public List <Drop_DropModel.DropData> GetGotList(CRespInAppPurchase data, List <Drop_DropModel.DropData> currencylist) { List <Drop_DropModel.DropData> list = new List <Drop_DropModel.DropData>(); if (currencylist != null) { int num = 0; int count = currencylist.Count; while (num < count) { Drop_DropModel.DropData item = currencylist[num]; if (item.is_base_currency) { list.Add(item); } num++; } } if ((data != null) && (data.m_arrEquipInfo != null)) { int index = 0; int length = data.m_arrEquipInfo.Length; while (index < length) { Drop_DropModel.DropData item = new Drop_DropModel.DropData { type = PropType.eEquip, id = (int)data.m_arrEquipInfo[index].m_nEquipID, count = (int)data.m_arrEquipInfo[index].m_nFragment }; list.Add(item); index++; } } return(list); }
private List <BattleDropData> GetDropList() { List <BattleDropData> list = new List <BattleDropData>(); this.equiplist = LocalSave.Instance.mFakeStageDrop.GetDropList(); if ((this.equiplist != null) && (this.equiplist.Count > 0)) { int num = 0; int count = this.equiplist.Count; while (num < count) { Drop_DropModel.DropData data = this.equiplist[num]; this.can_drop = true; LocalSave.EquipOne newEquipByID = LocalSave.Instance.GetNewEquipByID(data.id, data.count); if (!this.equipexp_talent_enable) { if (newEquipByID.Overlying) { this.can_drop = false; } } else if (newEquipByID.Overlying && !LocalSave.Instance.mEquip.Get_EquipExp_CanDrop(newEquipByID)) { this.can_drop = false; } if (this.can_drop) { list.Add(new BattleDropData(FoodType.eEquip, newEquipByID)); } num++; } } return(list); }
private void ExcuteEquips() { this.mEquipTransfer.Clear(); int num = 0; int count = this.mTransfer.list.Count; while (num < count) { if (this.mTransfer.list[num].type == PropType.eEquip) { Drop_DropModel.DropData item = new Drop_DropModel.DropData { type = this.mTransfer.list[num].type }; int haveCount = this.GetHaveCount(this.mTransfer.list[num].id); item.id = this.mTransfer.list[num].id; item.count = this.mTransfer.list[num].count; this.mEquipTransfer.Add(item); } else { this.mEquipTransfer.Add(this.mTransfer.list[num]); } num++; } }
private void InitUI() { int result = 0; int num2 = 0; if (int.TryParse(this.args[0], out result) && int.TryParse(this.args[1], out num2)) { Drop_DropModel.DropData[] equips = new Drop_DropModel.DropData[2]; List <Drop_DropModel.DropData> dropList = LocalModelManager.Instance.Drop_Drop.GetDropList(result); if (dropList.Count > 0) { equips[0] = dropList[0]; } List <Drop_DropModel.DropData> list2 = LocalModelManager.Instance.Drop_Drop.GetDropList(num2); if (list2.Count > 0) { equips[1] = list2[0]; } this.mTurnCtrl.InitGood(equips); } else { SdkManager.Bugly_Report("EventChest1UICtrl", "OnOpen proxy.Data is not all int."); } }
public void InitProp(Drop_DropModel.DropData data) { if (data.type == PropType.eCurrency) { this.InitCurrency(data.id, (long)data.count); } else if (data.type == PropType.eEquip) { this.InitEquip(data.id, data.count); } }
private void OnClickGet() { Drop_DropModel.DropData data; List <Drop_DropModel.DropData> list = new List <Drop_DropModel.DropData>(); if (this.mTranfer.data.m_nCoins > 0) { data = new Drop_DropModel.DropData { type = PropType.eCurrency, id = 1, count = this.mTranfer.data.m_nCoins }; list.Add(data); } if (this.mTranfer.data.m_nDiamond > 0) { data = new Drop_DropModel.DropData { type = PropType.eCurrency, id = 2, count = this.mTranfer.data.m_nDiamond }; list.Add(data); } CReqItemPacket itemPacket = NetManager.GetItemPacket(list, false); itemPacket.m_nPacketType = 6; itemPacket.m_nExtraInfo = this.mTranfer.data.m_nMailID; NetManager.SendInternal <CReqItemPacket>(itemPacket, SendType.eForceOnce, delegate(NetResponse response) { if (response.IsSuccess) { LocalSave.Instance.Mail.MailGot(this.mTranfer.data); if (this.mTranfer.data.m_nCoins > 0) { LocalSave.Instance.Modify_Gold((long)this.mTranfer.data.m_nCoins, false); CurrencyFlyCtrl.PlayGet(CurrencyType.Gold, (long)this.mTranfer.data.m_nCoins, this.mCoinPos, null, null, true); } if (this.mTranfer.data.m_nDiamond > 0) { LocalSave.Instance.Modify_Diamond((long)this.mTranfer.data.m_nDiamond, false); CurrencyFlyCtrl.PlayGet(CurrencyType.Diamond, (long)this.mTranfer.data.m_nDiamond, this.mDiamondPos, null, null, true); } if (this.mTranfer.ctrl != null) { this.mTranfer.ctrl.UpdateMail(); } this.OnClickClose(); } else if (response.error != null) { CInstance <TipsUIManager> .Instance.ShowCode(response.error.m_nStatusCode, 1); } }); }
public List <Drop_DropModel.DropData> GetList() { List <Drop_DropModel.DropData> list = new List <Drop_DropModel.DropData>(); if (this.IsValid) { if ((this.mInfoList == null) || (this.mInfoList.Length == 0)) { return(list); } int index = 0; int length = this.mInfoList.Length; while (index < length) { string str = this.mInfoList[index]; if (!string.IsNullOrEmpty(str)) { char[] separator = new char[] { ',' }; string[] strArray = str.Split(separator); if (strArray.Length == 3) { int result = 0; int.TryParse(strArray[0], out result); int num4 = 0; int.TryParse(strArray[1], out num4); int num5 = 0; int.TryParse(strArray[2], out num5); if (((result != 0) && (num4 != 0)) && (num5 != 0)) { Drop_DropModel.DropData item = new Drop_DropModel.DropData { type = (PropType)result, id = num4, count = num5 }; list.Add(item); } } } index++; } } return(list); }
public void Init(Drop_DropModel.DropData data) { this.mData = data; this.currencyparent.SetActive(false); this.equipparent.SetActive(false); this.Currency_Gift.SetActive(false); this.Text_Gift.text = GameLogic.Hold.Language.GetLanguageByTID("Box_Gift", Array.Empty <object>()); switch (data.type) { case PropType.eCurrency: { this.currencyparent.SetActive(true); this.Currency_ImageIcon.gameObject.SetActive(false); this.Text_Content.text = string.Empty; CurrencyType id = (CurrencyType)data.id; if (id == CurrencyType.Reborn) { this.Text_Content.text = GameLogic.Hold.Language.GetLanguageByTID("currency_reborn", Array.Empty <object>()); } else { this.Currency_ImageIcon.gameObject.SetActive(true); this.Currency_ImageIcon.set_sprite(SpriteManager.GetUICommonCurrency(id)); } object[] args = new object[] { this.mData.count }; this.Currency_TextCount.text = Utils.FormatString("x{0}", args); break; } case PropType.eEquip: { Equip_equip beanById = LocalModelManager.Instance.Equip_equip.GetBeanById(this.mData.id); this.equipparent.SetActive(true); this.Equip_ImageIcon.set_sprite(SpriteManager.GetEquip(beanById.EquipIcon)); object[] args = new object[] { beanById.Quality }; this.Equip_ImageBG.set_sprite(SpriteManager.GetCharUI(Utils.FormatString("CharUI_Quality{0}", args))); object[] objArray3 = new object[] { this.mData.count }; this.Text_Count.text = Utils.FormatString("x{0}", objArray3); break; } } }
public void Init(TurnTableData data) { this.mData = data; this.child.localScale = Vector3.one; this.Text_Value.text = string.Empty; this.Image_Icon.enabled = true; if ((data.type != TurnTableType.Get) && (this._equipone != null)) { this._equipone.gameObject.SetActive(false); } switch (data.type) { case TurnTableType.BigEquip: case TurnTableType.SmallEquip: { this.Image_Icon.enabled = false; Drop_DropModel.DropData data2 = data.value as Drop_DropModel.DropData; this.equipone.gameObject.SetActive(true); this.equipone.InitEquip(data2.id, data2.count); this.Image_Icon.set_sprite(SpriteManager.GetEquip(LocalModelManager.Instance.Equip_equip.GetBeanById(data2.id).EquipIcon)); break; } case TurnTableType.Boss: this.Image_Icon.set_sprite(SpriteManager.GetBattle("GameTurn_Monster")); break; case TurnTableType.Hitted: this.Image_Icon.set_sprite(SpriteManager.GetBattle("GameTurn_Hitted")); break; case TurnTableType.Get: { Sequence sequence = DOTween.Sequence(); TweenSettingsExtensions.SetUpdate <Sequence>(sequence, true); TweenSettingsExtensions.Append(sequence, ShortcutExtensions.DOScale(this.child, 1.3f, 0.18f)); TweenSettingsExtensions.Append(sequence, ShortcutExtensions.DOScale(this.child, 1f, 0.18f)); TweenSettingsExtensions.AppendCallback(sequence, new TweenCallback(this, this.< Init > m__0)); break; } } }
private void init_rewards() { this.mPool.Collect <GoldTextCtrl>(); if (!this.mData.isgot) { List <Drop_DropModel.DropData> rewards = this.mData.mData.GetRewards(); float x = 0f; for (int i = rewards.Count - 1; (i >= 0) && (i < rewards.Count); i--) { GoldTextCtrl ctrl = this.mPool.DeQueue <GoldTextCtrl>(); Drop_DropModel.DropData data = rewards[i]; ctrl.SetCurrencyType(data.id); ctrl.SetValue(data.count); ctrl.gameObject.SetParentNormal(this.rewardparent); RectTransform transform = ctrl.transform as RectTransform; transform.anchoredPosition = new Vector2(x, 0f); x -= ctrl.GetWidth(); } } }
public Sequence Init(Drop_DropModel.DropData data) { this.DeInit(); this.gift.SetActive(false); this.Text_Gift.text = GameLogic.Hold.Language.GetLanguageByTID("Box_Gift", Array.Empty <object>()); this.Text_Content.text = string.Empty; this.Image_Icon.gameObject.SetActive(false); object[] args = new object[] { data.count }; this.Text_Count.text = Utils.FormatString("x{0}", args); CurrencyType id = (CurrencyType)data.id; if (id == CurrencyType.Reborn) { this.Text_Content.text = GameLogic.Hold.Language.GetLanguageByTID("currency_reborn", Array.Empty <object>()); } else { this.Image_Icon.gameObject.SetActive(true); this.Image_Icon.set_sprite(SpriteManager.GetUICommonCurrency(id)); } this.fx_open.SetActive(true); return(TweenSettingsExtensions.Append(DOTween.Sequence(), ShortcutExtensions.DOScale(this.child, 1f, 0.3f))); }
public void Init(int index, Shop_MysticShop data) { if (this.mItem == null) { this.mItem = CInstance <UIResourceCreator> .Instance.GetPropOneEquip(this.equipparent.transform); this.mItem.SetButtonEnable(false); } Drop_DropModel.DropData data2 = new Drop_DropModel.DropData { type = PropType.eEquip, id = data.ProductId, count = data.ProductNum }; this.mEquipOne.Clear(); this.mEquipOne.EquipID = data.ProductId; this.mItem.InitProp(data2); this.mIndex = index; this.bBuy = false; this.mData = data; this.equipdata = LocalModelManager.Instance.Equip_equip.GetBeanById(this.mData.ProductId); if (this.equipdata == null) { object[] args = new object[] { data.ID }; SdkManager.Bugly_Report("BlackItemOneCtrl", Utils.FormatString("Init Equip_equip:{0} is null", args)); } else { this.SetBuy(this.bBuy); this.mGoldCtrl.UseTextRed(); this.mGoldCtrl.SetCurrencyType(data.PriceType); this.mGoldCtrl.SetValue(data.Price); this.Text_Sold.text = GameLogic.Hold.Language.GetLanguageByTID("blackshop_sold", Array.Empty <object>()); this.Image_Buy.transform.localScale = Vector3.one; this.Text_Name.text = this.mEquipOne.NameOnlyString; this.Text_Name.set_color(this.mEquipOne.qualityColor); } }
private void update_touch() { if (Input.GetKeyUp(KeyCode.P)) { this.bPause = !this.bPause; GameLogic.SetPause(this.bPause); } if (Input.GetKeyUp(KeyCode.F)) { CameraControlM.CameraFollow = !CameraControlM.CameraFollow; } if (Input.GetKeyUp(KeyCode.T)) { this.buy_gold(); } if (Input.GetKeyUp(KeyCode.V)) { List <Drop_DropModel.DropData> list = new List <Drop_DropModel.DropData>(); Drop_DropModel.DropData item = new Drop_DropModel.DropData { type = PropType.eCurrency, id = 1, count = 0x7d0 }; list.Add(item); item = new Drop_DropModel.DropData { type = PropType.eCurrency, id = 2, count = 100 }; list.Add(item); item = new Drop_DropModel.DropData { type = PropType.eCurrency, id = 3, count = 10 }; list.Add(item); item = new Drop_DropModel.DropData { type = PropType.eCurrency, id = 4, count = 3 }; list.Add(item); if (MathDxx.RandomBool()) { item = new Drop_DropModel.DropData { type = PropType.eEquip, id = 0xfdee5, count = 1 }; list.Add(item); item = new Drop_DropModel.DropData { type = PropType.eEquip, id = 0xfdee6, count = 1 }; list.Add(item); item = new Drop_DropModel.DropData { type = PropType.eEquip, id = 0x7595, count = 5 }; list.Add(item); item = new Drop_DropModel.DropData { type = PropType.eEquip, id = 0x7597, count = 10 }; list.Add(item); } WindowUI.ShowRewardSimple(list); } }