From adec40e7f8774712eadb0c3845e18d5a16dbc792 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期一, 03 九月 2018 15:26:32 +0800
Subject: [PATCH] 3032【前端】宗门试练兑换界面优化
---
System/Dungeon/TrialExchangeBehaviour.cs | 34 +++++++++++++++++++++++++---------
1 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/System/Dungeon/TrialExchangeBehaviour.cs b/System/Dungeon/TrialExchangeBehaviour.cs
index eb79356..2ddae7e 100644
--- a/System/Dungeon/TrialExchangeBehaviour.cs
+++ b/System/Dungeon/TrialExchangeBehaviour.cs
@@ -15,6 +15,7 @@
[SerializeField] ItemCell m_Item;
[SerializeField] Text m_Description;
[SerializeField] Text m_SpecialDescription;
+ [SerializeField] Text m_ChestDescription;
[SerializeField] ItemBehaviour m_Token;
[SerializeField] LongPressButton m_Exchange;
[SerializeField] Image m_Redpoint;
@@ -37,16 +38,27 @@
if (trialExchangeId != 0)
{
int error = 0;
- if (!model.TrialSendExchange(trialExchangeId, out error))
+ var config = Config.Instance.Get<TrialExchangeConfig>(trialExchangeId);
+ if (config != null)
{
- if (error == 1)
- {
- var config = Config.Instance.Get<TrialExchangeConfig>(trialExchangeId);
- if (config != null)
- {
- ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(config.tokenId);
- }
- }
+ var itemConfig = Config.Instance.Get<ItemConfig>(model.GetExchangeItemByJob(config));
+ ItemAttrData itemAttrData = new ItemAttrData(itemConfig.ID, true, (ulong)config.exchangeItemCount, -1, config.exchangeItemIsBind);
+ ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData, false);
+ ModelCenter.Instance.GetModel<ItemTipsModel>().curAttrData.SetTipsFuncBtn(ItemWinBtnType.exchange,
+ (ItemWinBtnType btnType, string value) =>
+ {
+ if (btnType == ItemWinBtnType.exchange)
+ {
+ if (!model.TrialSendExchange(trialExchangeId, out error))
+ {
+ if (error == 1)
+ {
+ ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(config.tokenId);
+ }
+ }
+ }
+ });
+ ModelCenter.Instance.GetModel<ItemTipsModel>().ShowUICtrl();
}
}
}
@@ -95,6 +107,10 @@
{
m_SpecialDescription.text = config.description;
}
+ if (m_ChestDescription != null)
+ {
+ m_ChestDescription.text = config.chestDesc;
+ }
m_Token.SetItem(config.tokenId, config.tokenCount);
var count = model.GetTrialTokenCount(config.tokenId);
m_Token.count.text = StringUtility.Contact(count >= config.tokenCount ? "<color=#35e112>" : string.Empty, count,
--
Gitblit v1.8.0