| | |
| | | [SerializeField] Image m_Bottom;
|
| | | [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;
|
| | |
| | | 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();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | public void Display(int id, bool equipBetter = true, bool first = false)
|
| | | {
|
| | | m_Bottom.SetSprite(first ? "SpecialExchangeBottom" : "Title_PopupWindow");
|
| | | m_Bottom.SetSprite(first ? "XT_VIP_63" : "XT_VIP_63");
|
| | | m_ContainerSpecial.gameObject.SetActive(first);
|
| | | m_ContainerNormal.gameObject.SetActive(!first);
|
| | | trialExchangeId = id;
|
| | |
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
|
| | | });
|
| | | m_Description.text = config.description;
|
| | | if (m_SpecialDescription != null)
|
| | | {
|
| | | 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>" : "<color=#ff0303>", count,
|
| | | "</color>/", config.tokenCount);
|
| | | m_Token.count.text = StringUtility.Contact(count >= config.tokenCount ? "<color=#109d06>" : string.Empty, count,
|
| | | count >= config.tokenCount ? "</color>" : string.Empty, "/", config.tokenCount);
|
| | | var equipCompare = model.EquipCompare(model.GetExchangeItemByJob(config));
|
| | | m_Up.gameObject.SetActive(equipCompare == 1);
|
| | | m_Down.gameObject.SetActive(equipCompare == -1);
|