private void OnSellGoods(short state, SystemRecoveryRes down = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } if (down == null) { return; } List <ItemBriefInfo> itemInfo = down.itemInfo; List <int> list = new List <int>(); List <long> list2 = new List <long>(); List <long> list3 = new List <long>(); for (int i = 0; i < itemInfo.get_Count(); i++) { ItemBriefInfo itemBriefInfo = itemInfo.get_Item(i); list.Add(itemBriefInfo.cfgId); list2.Add(itemBriefInfo.count); list3.Add(itemBriefInfo.uId); } RewardUI rewardUI = LinkNavigationManager.OpenRewardUI(UINodesManager.NormalUIRoot); rewardUI.SetRewardItem("获得物品", list, list2, true, false, null, list3); }
private void OnClickSelectBagItem(GameObject go) { if (!this.isDecomposeNow) { if (GuildStorageManager.Instance.GuildStorageInfo != null && GuildStorageManager.Instance.GuildStorageInfo.baseInfo != null && GuildStorageManager.Instance.GuildStorageInfo.baseInfo.exchanges <= GuildStorageManager.Instance.GuildStoragePersonalInfo.exchanges) { DialogBoxUIViewModel.Instance.ShowAsConfirm(GameDataUtils.GetChineseContent(621264, false), GameDataUtils.GetChineseContent(621601, false), null, GameDataUtils.GetChineseContent(505114, false), "button_orange_1", null); return; } GuildStorageBagItem bagItem = go.GetComponent <GuildStorageBagItem>(); if (bagItem != null && bagItem.m_SpecialItemInfo != null && bagItem.isSpecialItem) { int specialItemChangePoint = GuildStorageManager.Instance.GetSpecialItemChangePoint(); UIManagerControl.Instance.OpenUI("BuyUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush); BuyUIViewModel.Instance.BuyNumberAdjustOn = true; BuyUIViewModel.Instance.BuyCallback = delegate(int count) { ItemBriefInfo itemBriefInfo = new ItemBriefInfo(); itemBriefInfo.cfgId = bagItem.m_SpecialItemInfo.cfgId; itemBriefInfo.uId = bagItem.m_SpecialItemInfo.uId; itemBriefInfo.count = (long)count; GuildStorageManager.Instance.SendGuildStorageExchangeReq(null, itemBriefInfo); }; BuyUIViewModel.Instance.RefreshInfo(bagItem.m_SpecialItemInfo.cfgId, (int)bagItem.m_SpecialItemInfo.count, specialItemChangePoint, 19, "兑换", "兑换物品"); } else if (bagItem != null && bagItem.m_EquipSimpleInfo != null) { EquipItemChangeUI equipItemChangeUI = UIManagerControl.Instance.OpenUI("EquipItemChangeUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush) as EquipItemChangeUI; int points = GuildStorageManager.Instance.GuildStoragePersonalInfo.points; equipItemChangeUI.SetEquipItemData(bagItem.m_EquipSimpleInfo, points); equipItemChangeUI.ActionClickBtnCB = delegate { EquipBriefInfo equipBriefInfo = new EquipBriefInfo(); equipBriefInfo.equipId = bagItem.m_EquipSimpleInfo.equipId; if (DataReader <zZhuangBeiPeiZhiBiao> .Contains(bagItem.m_EquipSimpleInfo.cfgId)) { equipBriefInfo.position = DataReader <zZhuangBeiPeiZhiBiao> .Get(bagItem.m_EquipSimpleInfo.cfgId).position; } GuildStorageManager.Instance.SendGuildStorageExchangeReq(equipBriefInfo, null); }; } } else { GuildStorageBagItem bagItem = go.GetComponent <GuildStorageBagItem>(); if (bagItem != null && !bagItem.isSpecialItem && bagItem.m_EquipSimpleInfo != null) { bagItem.Selected = !bagItem.Selected; int num = this.selectDecomposeEquips.FindIndex((EquipSimpleInfo a) => a.equipId == bagItem.m_EquipSimpleInfo.equipId && a.cfgId == bagItem.m_EquipSimpleInfo.cfgId); if (num >= 0 && !bagItem.Selected) { this.selectDecomposeEquips.RemoveAt(num); } else if (num < 0 && bagItem.Selected) { this.selectDecomposeEquips.Add(bagItem.m_EquipSimpleInfo); } } } }
public void UpdateSCWinUI(SecretAreaChallengeResultNty result) { base.FindTransform("BtnStatisticsNode").get_gameObject().SetActive(true); this.lastBatchText.set_text(string.Format(GameDataUtils.GetChineseContent(512053, false), result.startStage)); this.currBatchText.set_text(string.Format(GameDataUtils.GetChineseContent(512054, false), result.endStage)); for (int i = 0; i < this.ItemConten.get_childCount(); i++) { Object.Destroy(this.ItemConten.GetChild(i).get_gameObject()); } for (int j = 0; j < result.copyRewards.get_Count(); j++) { ItemBriefInfo itemBriefInfo = result.copyRewards.get_Item(j); if (itemBriefInfo.cfgId == 1) { this.expText.set_text(itemBriefInfo.count.ToString()); } else if (itemBriefInfo.cfgId == 2) { this.goldText.set_text(itemBriefInfo.count.ToString()); } else { ItemShow.ShowItem(this.ItemConten, itemBriefInfo.cfgId, itemBriefInfo.count, false, null, 2001); } } }
public void UpdateItemData(ItemBriefInfo itemInfo) { if (!this.isInit) { this.InitUI(); } if (itemInfo != null && DataReader <Items> .Contains(itemInfo.cfgId)) { this.m_SpecialItemInfo = itemInfo; this.isSpecialItem = true; if (this.itemRootNullObj.get_activeSelf()) { this.itemRootNullObj.SetActive(false); } if (!this.itemRootObj.get_activeSelf()) { this.itemRootObj.SetActive(true); } if (this.itemStepObj.get_activeSelf()) { this.itemRootObj.SetActive(false); } ResourceManager.SetSprite(this.itemIconImg, GameDataUtils.GetItemIcon(itemInfo.cfgId)); ResourceManager.SetSprite(this.itemFrameImg, GameDataUtils.GetItemFrame(itemInfo.cfgId)); this.itemNumText.set_text(itemInfo.count + string.Empty); } this.Selected = false; }
public void UpdateData(DefendFightBtlResultNty result) { if ((DefendFightManager.Instance.SelectDetailMode == DefendFightMode.DFMD.Hold || DefendFightManager.Instance.SelectDetailMode == DefendFightMode.DFMD.Save || DefendFightManager.Instance.SelectDetailMode == DefendFightMode.DFMD.Protect) && result.result.winnerId != EntityWorld.Instance.EntSelf.ID) { ResourceManager.SetSprite(this.ResultImage, ResourceManager.GetIconSprite("failure_bg_zi01")); ResourceManager.SetSprite(this.ResultImageFx, ResourceManager.GetIconSprite("win_Light_02")); } else { ResourceManager.SetSprite(this.ResultImage, ResourceManager.GetIconSprite("win_01")); ResourceManager.SetSprite(this.ResultImageFx, ResourceManager.GetIconSprite("win_Light_01")); } Debug.LogError(result.normalDropItems.get_Count() + "===========" + result.extendDropItems.get_Count()); for (int i = 0; i < this.rewardItems.get_childCount(); i++) { Object.Destroy(this.rewardItems.GetChild(i).get_gameObject()); } using (List <ItemBriefInfo> .Enumerator enumerator = result.normalDropItems.GetEnumerator()) { while (enumerator.MoveNext()) { ItemBriefInfo current = enumerator.get_Current(); if (current.cfgId == 1) { this.exp.set_text(current.count.ToString()); } else if (current.cfgId == 2) { this.gold.set_text(current.count.ToString()); } else { ItemShow.ShowItem(this.rewardItems, current.cfgId, current.count, false, null, 2001); } } } base.FindTransform("RewardBgsBoss").get_gameObject().SetActive(result.extendDropItems.get_Count() > 0); Transform transform = base.FindTransform("BossRewardItems"); for (int j = 0; j < transform.get_childCount(); j++) { Object.Destroy(transform.GetChild(j).get_gameObject()); } for (int k = 0; k < result.extendDropItems.get_Count(); k++) { ItemBriefInfo itemBriefInfo = result.extendDropItems.get_Item(k); ItemShow.ShowItem(transform, itemBriefInfo.cfgId, itemBriefInfo.count, false, null, 2001); } this.time.set_text(GameDataUtils.GetChineseContent(501004, false) + " " + TimeConverter.GetTime(result.result.killTargetUsedTime, TimeFormat.HHMMSS)); int id = (DefendFightManager.Instance.SelectDetailMode != DefendFightMode.DFMD.Protect) ? 513536 : 513537; this.num.set_text(string.Format(GameDataUtils.GetChineseContent(id, false), result.maxWave.ToString())); this.exitButton.onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickDefendExit); }
public void SendGuildStorageExchangeReq(EquipBriefInfo m_equip, ItemBriefInfo m_item) { GuildStorageExchangeReq guildStorageExchangeReq = new GuildStorageExchangeReq(); if (m_equip != null) { guildStorageExchangeReq.equip = m_equip; } if (m_item != null) { guildStorageExchangeReq.item = m_item; } NetworkManager.Send(guildStorageExchangeReq, ServerType.Data); }
public void UpdateItemNull() { if (!this.isInit) { this.InitUI(); } this.m_EquipSimpleInfo = null; this.m_SpecialItemInfo = null; if (!this.itemRootNullObj.get_activeSelf()) { this.itemRootNullObj.SetActive(true); } if (this.itemRootObj.get_activeSelf()) { this.itemRootObj.SetActive(false); } this.Selected = false; }
public override void GetInstanceResult(ChallengeResult result) { if (InstanceManager.CurrentInstanceType != base.Type) { return; } this.instanceResult = result; InstanceManager.StopAllClientAI(true); List <KeyValuePair <int, long> > list = new List <KeyValuePair <int, long> >(); if (base.InstanceResult.items != null && base.InstanceResult.items.get_Count() > 0) { for (int i = 0; i < base.InstanceResult.items.get_Count(); i++) { ItemBriefInfo itemBriefInfo = base.InstanceResult.items.get_Item(i); KeyValuePair <int, long> keyValuePair = new KeyValuePair <int, long>(itemBriefInfo.cfgId, itemBriefInfo.count); list.Add(keyValuePair); } } InstanceManager.SetInstanceDrop(list); if (EntityWorld.Instance.EntSelf.IsInBattle) { if (base.InstanceResult.winnerId == EntityWorld.Instance.EntSelf.ID) { InstanceManager.InstanceWin(); Debug.Log("任务完成!"); } else { InstanceManager.InstanceLose(); Debug.Log("任务失败!"); } } if (this.mProgressUI != null && this.mProgressUI.ProgressPanel != null) { this.mProgressUI.ProgressPanel.get_gameObject().SetActive(false); } if (DialogBoxUIViewModel.Instance != null) { DialogBoxUIViewModel.Instance.Close(); } }
private void ShowGetItems(List <ItemBriefInfo> items) { if (items == null || items.get_Count() < 1) { return; } List <int> list = new List <int>(); List <long> list2 = new List <long>(); List <long> list3 = new List <long>(); for (int i = 0; i < items.get_Count(); i++) { ItemBriefInfo itemBriefInfo = items.get_Item(i); list.Add(itemBriefInfo.cfgId); list2.Add(itemBriefInfo.count); list3.Add(itemBriefInfo.uId); } if (list != null && list.get_Count() > 0) { RewardUI rewardUI = LinkNavigationManager.OpenRewardUI(UINodesManager.TopUIRoot); rewardUI.SetRewardItem("获得物品", list, list2, true, false, null, list3); } }
public void OnGetFirstPrizeRes(short state, GetFirstPrizeRes down = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } if (down != null) { List <ItemBriefInfo> items = down.items; List <int> list = new List <int>(); List <long> list2 = new List <long>(); List <long> list3 = new List <long>(); for (int i = 0; i < items.get_Count(); i++) { ItemBriefInfo itemBriefInfo = items.get_Item(i); list.Add(itemBriefInfo.cfgId); list2.Add(itemBriefInfo.count); list3.Add(itemBriefInfo.uId); } RewardUI rewardUI = LinkNavigationManager.OpenRewardUI(UINodesManager.TopUIRoot); rewardUI.SetRewardItem("获得物品", list, list2, true, false, null, list3); } }
public void SetDropLog(List <BossDropLog> logList) { this.m_TextTitle.set_text(GameDataUtils.GetChineseContent(517512, false)); this.m_ScrollLayout.set_anchoredPosition(new Vector2(0f, 0f)); this.HideCells(); for (int i = 0; i < logList.get_Count(); i++) { BossDropLog bossDropLog = logList.get_Item(i); Transform transform; if (i < this.m_ScrollLayout.get_childCount()) { transform = this.m_ScrollLayout.GetChild(i); transform.get_gameObject().SetActive(true); } else { GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("BBDropRecordCell"); instantiate2Prefab.SetActive(true); transform = instantiate2Prefab.get_transform(); transform.SetParent(this.m_ScrollLayout, false); } transform.get_gameObject().SetActive(true); BossBiaoQian bossBiaoQian = DataReader <BossBiaoQian> .Get(bossDropLog.labelId); ZhuChengPeiZhi zhuChengPeiZhi = DataReader <ZhuChengPeiZhi> .Get(bossBiaoQian.scene); Text component = transform.Find("TextRecord").GetComponent <Text>(); Text component2 = transform.Find("TextDrop").GetComponent <Text>(); DateTime dateTime = BossBookManager.StampToDateTime(bossDropLog.dateTimeSec.ToString()); string time = TimeConverter.GetTime(dateTime, TimeFormat.MDHHMM); string text = string.Format(GameDataUtils.GetChineseContent(517514, false), new object[] { time, bossDropLog.roleName, GameDataUtils.GetChineseContent(zhuChengPeiZhi.name, false), GameDataUtils.GetChineseContent(bossBiaoQian.nameId, false) }); component.set_text(text); if (bossDropLog.items.get_Count() > 0) { int num = this.GetBestQualityItem(bossDropLog.items); if (num < 0 && num >= bossDropLog.items.get_Count()) { num = 0; } ItemBriefInfo itemBriefInfo = bossDropLog.items.get_Item(num); Items items = DataReader <Items> .Get(itemBriefInfo.cfgId); if (items != null) { component2.set_text(GameDataUtils.GetChineseContent(items.name, false)); Dictionary <string, Color> textColorByQuality = GameDataUtils.GetTextColorByQuality(items.color); component2.set_color(textColorByQuality.get_Item("TextColor")); component2.GetComponent <Outline>().set_effectColor(textColorByQuality.get_Item("TextOutlineColor")); component2.GetComponent <RectTransform>().set_anchoredPosition(new Vector2(component.get_preferredWidth() + 50f, 0f)); } else { component2.set_text(string.Empty); } } else { component2.set_text(string.Empty); } } }
public void RefreshUI(string blockID) { base.GetComponent <BaseTweenAlphaBaseTime>().TweenAlpha(0f, 1f, 0f, 0.5f); BlockInfo blockInfo = ElementInstanceManager.Instance.GetBlockInfo(blockID); switch (blockInfo.incidentType) { case RandomIncidentType.IncidentType.TOOL: { this.ContentProperty.get_gameObject().SetActive(false); this.ContentItems.get_gameObject().SetActive(true); YDaoJuKu yDaoJuKu = DataReader <YDaoJuKu> .Get(blockInfo.incidentTypeId); string text = GameDataUtils.GetChineseContent(502320, false); text = text.Replace("{s1}", yDaoJuKu.holdName); this.TextTitle.set_text(text); for (int i = 0; i < this.listRewards.get_Count(); i++) { Object.Destroy(this.listRewards.get_Item(i)); } this.listRewards.Clear(); for (int j = 0; j < GlobalManager.Instance.DropGoods.get_Count(); j++) { ItemBriefInfo itemBriefInfo = GlobalManager.Instance.DropGoods.get_Item(j); GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("InstanceRewardItem"); instantiate2Prefab.get_transform().set_parent(this.GridItems.get_transform()); instantiate2Prefab.GetComponent <RectTransform>().set_localScale(Vector3.get_one()); Vector3 localPosition = instantiate2Prefab.GetComponent <RectTransform>().get_localPosition(); localPosition.z = 0f; instantiate2Prefab.GetComponent <RectTransform>().set_localPosition(localPosition); instantiate2Prefab.AddComponent <ElementInstanceSettleItem>(); instantiate2Prefab.GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickSettleItem); instantiate2Prefab.GetComponent <ElementInstanceSettleItem>().itemID = itemBriefInfo.cfgId; ResourceManager.SetSprite(instantiate2Prefab.get_transform().FindChild("ImageIcon").GetComponent <Image>(), GameDataUtils.GetItemIcon(itemBriefInfo.cfgId)); ResourceManager.SetSprite(instantiate2Prefab.get_transform().FindChild("ImageFrame").GetComponent <Image>(), GameDataUtils.GetItemFrame(itemBriefInfo.cfgId)); instantiate2Prefab.get_transform().FindChild("Text").GetComponent <Text>().set_text(itemBriefInfo.count.ToString()); this.listRewards.Add(instantiate2Prefab); } break; } case RandomIncidentType.IncidentType.PETPROPERTY: { this.ContentProperty.get_gameObject().SetActive(true); this.ContentItems.get_gameObject().SetActive(false); YChongWuJiaChengKu yChongWuJiaChengKu = DataReader <YChongWuJiaChengKu> .Get(blockInfo.incidentTypeId); string text2 = yChongWuJiaChengKu.depict; text2 = text2.Replace("{s1}", yChongWuJiaChengKu.addNum.ToString()); this.TextContent.set_text(text2); text2 = GameDataUtils.GetChineseContent(502320, false); text2 = text2.Replace("{s1}", yChongWuJiaChengKu.eventName); this.TextTitle.set_text(text2); break; } case RandomIncidentType.IncidentType.PLAYERPROPERTY: { this.ContentProperty.get_gameObject().SetActive(true); this.ContentItems.get_gameObject().SetActive(false); YJiaoSeJiaChengKu yJiaoSeJiaChengKu = DataReader <YJiaoSeJiaChengKu> .Get(blockInfo.incidentTypeId); string text3 = yJiaoSeJiaChengKu.depict; text3 = text3.Replace("{s1}", yJiaoSeJiaChengKu.addNum.ToString()); this.TextContent.set_text(text3); text3 = GameDataUtils.GetChineseContent(502320, false); text3 = text3.Replace("{s1}", yJiaoSeJiaChengKu.eventName); this.TextTitle.set_text(text3); break; } case RandomIncidentType.IncidentType.RECOVRYENERGY: { this.ContentProperty.get_gameObject().SetActive(true); this.ContentItems.get_gameObject().SetActive(false); YNengLiangHuiFu yNengLiangHuiFu = DataReader <YNengLiangHuiFu> .Get(blockInfo.incidentTypeId); string text4 = yNengLiangHuiFu.powerName; text4 = text4.Replace("{s1}", yNengLiangHuiFu.powerPoint.ToString()); this.TextContent.set_text(text4); text4 = GameDataUtils.GetChineseContent(502320, false); text4 = text4.Replace("{s1}", yNengLiangHuiFu.eventName); this.TextTitle.set_text(text4); break; } } }