Example #1
0
 void SetButtonStatus(UI.MainUI.ItemFielInfo ItemFileInfo, BattleButton Button)
 {
     if (Button == null)
     {
         return;
     }
     Button.RecoveSprite.fillAmount = 0;
     if (ItemFileInfo == null)
     {
         Button.SetCallBackFuntion(null, null);
         Button.SetButtonIcon(null);
         Button.SetButtonText("");
     }
     else
     {
         Button.SetCallBackFuntion(OnButtonClick, ItemFileInfo);
         Button.SetButtonIcon(ItemFileInfo.LocalItemData._picPrefab);
         int ItemNumber = UI.MainUI.ContainerInfomanager.Instance.GetItemNumber(ItemFileInfo.LocalItemData._goodID);
         if (ItemNumber > 99)
         {
             ItemNumber = 99;
         }
         Button.SetButtonText(ItemNumber.ToString());
     }
 }
Example #2
0
        void SetButtonStatus(UI.MainUI.ItemFielInfo ItemFileInfo, BattleButton Button)
        {
            if (Button == null)
            {
                return;
            }
            Button.RecoveSprite.fillAmount = 0;
//            if (ItemFileInfo == null)
//            {
//                Button.SetCallBackFuntion(null,null);
//                Button.SetButtonIcon(null);
//                Button.SetButtonText("");
//                Button.gameObject.SetActive(false);
//            }else
//            {
//                if (Button.gameObject.active == false)
//                {
//                    Button.gameObject.SetActive(true);
//                }
//                Button.SetCallBackFuntion(OnButtonClick, ItemFileInfo);
//                Button.SetButtonIcon(GameManager.Instance.UseJoyStick ? ItemFileInfo.LocalItemData.lDisplayIdRound : ItemFileInfo.LocalItemData._picPrefab);
//                //int ItemNumber = UI.MainUI.ContainerInfomanager.Instance.GetItemNumber(ItemFileInfo.LocalItemData._goodID);
//                int ItemNumber = ItemFileInfo.sSyncContainerGoods_SC.byNum;
//                if (ItemNumber > 99) { ItemNumber = 99; }
//                Button.SetButtonText(ItemNumber.ToString());
//            }

            //new
            if (Button.gameObject.active == false)
            {
                Button.gameObject.SetActive(true);
            }
            Button.SetCallBackFuntion(OnButtonClick, ItemFileInfo);

            UpdateUseMedicamentHandle(null);
            int vipLevel = PlayerManager.Instance.FindHeroDataModel().GetCommonValue().PLAYER_FIELD_VISIBLE_VIP;
            SMSGEctypeInitialize_SC sMSGEctypeInitialize_SC = (SMSGEctypeInitialize_SC)GameDataManager.Instance.PeekData(DataType.InitializeEctype);
            EctypeContainerData     ectypeData = EctypeConfigManager.Instance.EctypeContainerConfigList[sMSGEctypeInitialize_SC.dwEctypeContainerId];
            int goodsID  = ectypeData.MedicamentIDs.SingleOrDefault(p => p.VipLevel == vipLevel).GoodsID;
            var itemData = ItemDataManager.Instance.GetItemData(goodsID);

            Button.SetButtonIcon(GameManager.Instance.UseJoyStick ? itemData.lDisplayIdRound : itemData._picPrefab);
//			int ItemNumber = ectypeData.FreeMedicaments.SingleOrDefault(p=>p.VipLevel == vipLevel).Num - sMSGEctypeInitialize_SC.dwMedicamentTimes;
//			Button.SetButtonText(ItemNumber.ToString());
        }