public BuyPickDialog(bool isGift, COM_ITEM_TYPE type, uint id, RES_SHOPBUY_COINTYPE coinType, float discount, uint maxCount, BuyPickDialog.OnConfirmBuyDelegate onConfirm, CMallFactoryShopController.ShopProduct callContext, BuyPickDialog.OnConfirmBuyCommonDelegate onConfirmCommon = null, CUIEvent uieventPars = null, bool bfromFactoyShop = false) { this.m_bShowBigIcon = (callContext != null && callContext.GetSpecialIconPath() != null); CUIFormScript cUIFormScript; if (this.m_bShowBigIcon) { cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(BuyPickDialog.s_Gift_Big_Icon_Form_Path, false, true); } else { cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(BuyPickDialog.s_Gift_Form_Path, false, true); } if (null != cUIFormScript) { this._root = cUIFormScript.gameObject; this._usb = CUseableManager.CreateUseable(type, id, 0); this._count = 1u; this._bHeroSkinGift = false; this._bDynamicCorrectPrice = false; this._heroSkinGiftCost = 0u; this._maxCount = maxCount; if (this._maxCount == 0u) { this._maxCount = 999u; } this._onConfirm = onConfirm; this._callContext = callContext; this._onConfirmdCommon = onConfirmCommon; this._uieventPars = uieventPars; this._coinType = coinType; this._realDiscount = discount; if (this._usb != null) { this._countText = Utility.GetComponetInChild <Text>(this._root, "Panel/Count"); this._costText = Utility.GetComponetInChild <Text>(this._root, "Panel/Cost"); this._descText = Utility.GetComponetInChild <Text>(this._root, "Panel/lblDesc"); CItem cItem = new CItem(0uL, id, 0, 0); uint key = (uint)cItem.m_itemData.EftParam[0]; ResRandomRewardStore dataByKey = GameDataMgr.randomRewardDB.GetDataByKey(key); ListView <CUseable> listView = new ListView <CUseable>(); for (int i = 0; i < dataByKey.astRewardDetail.Length; i++) { if (dataByKey.astRewardDetail[i].bItemType != 0) { CUseable cUseable = CUseableManager.CreateUsableByRandowReward(dataByKey.astRewardDetail[i].bItemType, (int)dataByKey.astRewardDetail[i].dwLowCnt, dataByKey.astRewardDetail[i].dwItemID); if (cUseable != null) { listView.Add(cUseable); } } } if (this._descText != null) { this._descText.text = cItem.m_description; } uint num = 0u; int num2 = 0; if (this._usb.m_type == 2) { CItem cItem2 = (CItem)this._usb; if (cItem2 != null && cItem2.m_itemData != null && cItem2.m_itemData.bType == 4) { this._bDynamicCorrectPrice = (cItem2.m_itemData.EftParam[3] > 0f); } } CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(cUIFormScript.gameObject, "Panel/itemGroup"); componetInChild.SetElementAmount(listView.get_Count()); for (int j = 0; j < listView.get_Count(); j++) { CUIListElementScript elemenet = componetInChild.GetElemenet(j); this.UpdateElement(elemenet, listView.get_Item(j), this.m_bShowBigIcon); if (listView.get_Item(j).m_type == 4) { this._bHeroSkinGift = true; CHeroItem cHeroItem = listView.get_Item(j) as CHeroItem; CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo != null && masterRoleInfo.IsOwnHero(cHeroItem.m_heroData.dwCfgID)) { num += CHeroInfo.GetHeroCost(cHeroItem.m_heroData.dwCfgID, coinType); num2++; } } else if (listView.get_Item(j).m_type == 7) { this._bHeroSkinGift = true; CHeroSkin cHeroSkin = listView.get_Item(j) as CHeroSkin; CRoleInfo masterRoleInfo2 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo2 != null && masterRoleInfo2.IsHaveHeroSkin(cHeroSkin.m_heroId, cHeroSkin.m_skinId, false)) { num += CSkinInfo.GetHeroSkinCost(cHeroSkin.m_heroId, cHeroSkin.m_skinId, coinType); num2++; } } } this._coinUsb = CUseableManager.CreateCoinUseable(coinType, 0); if (this._coinUsb != null) { Utility.GetComponetInChild <Image>(this._root, "Panel/Cost/CoinType").SetSprite(CUIUtility.GetSpritePrefeb(this._coinUsb.GetIconPath(), false, false), false); } Text componetInChild2 = Utility.GetComponetInChild <Text>(this._root, "Panel/costDescText"); componetInChild2.text = string.Empty; if (this._bHeroSkinGift && this._bDynamicCorrectPrice) { uint buyPrice = this._usb.GetBuyPrice(coinType); Button componetInChild3 = Utility.GetComponetInChild <Button>(this._root, "Panel/Button_Sale"); if (num2 >= listView.get_Count()) { CUICommonSystem.SetButtonEnableWithShader(componetInChild3, false, true); componetInChild2.text = Singleton <CTextManager> .GetInstance().GetText("Gift_Can_Not_Buy_Tip"); this._heroSkinGiftCost = 0u; } else { CUICommonSystem.SetButtonEnableWithShader(componetInChild3, true, true); componetInChild2.text = Singleton <CTextManager> .GetInstance().GetText("Gift_Own_Hero_Skin_Tip"); uint num3 = CMallFactoryShopController.ShopProduct.SConvertWithRealDiscount(buyPrice - num, this._realDiscount); if (buyPrice >= num && num3 >= buyPrice / 10u) { this._heroSkinGiftCost = num3; } else { this._heroSkinGiftCost = buyPrice / 10u; } } if (this._callContext != null) { this._callContext.m_bChangeGiftPrice = true; this._callContext.m_newGiftPrice = this._heroSkinGiftCost; } } } Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BuyPick_CloseForm, new CUIEventManager.OnUIEventHandler(this.OnCloseForm)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BuyPick_Add, new CUIEventManager.OnUIEventHandler(this.OnClickAdd)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BuyPick_Dec, new CUIEventManager.OnUIEventHandler(this.OnClickDec)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BuyPick_Max, new CUIEventManager.OnUIEventHandler(this.OnClickMax)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BuyPick_Confirm, new CUIEventManager.OnUIEventHandler(this.OnClickConfirm)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BuyPick_Cancel, new CUIEventManager.OnUIEventHandler(this.OnClickCancel)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BuyPick_ConfirmFactoryShopBuy, new CUIEventManager.OnUIEventHandler(this.OnConfirmFactoryShopBuy)); this.ValidateDynamic(); } }
public uint SetItemPriceInfo(CMallItemWidget itemWidget, ref stPayInfoSet payInfoSet) { uint result = 0u; if (itemWidget.m_priceContainer == null) { return(result); } itemWidget.m_priceContainer.SetActive(true); CMallItem.OldPriceType oldPriceType = this.GetOldPriceType(); CUIListScript component = itemWidget.m_priceContainer.GetComponent <CUIListScript>(); component.SetElementAmount(1); itemWidget.m_orTextContainer.CustomSetActive(false); CUIListElementScript elemenet = component.GetElemenet(0); if (elemenet == null) { return(result); } GameObject widget = elemenet.GetWidget(0); GameObject widget2 = elemenet.GetWidget(1); GameObject widget3 = elemenet.GetWidget(2); GameObject widget4 = elemenet.GetWidget(4); GameObject widget5 = elemenet.GetWidget(3); GameObject widget6 = elemenet.GetWidget(5); if (widget == null || widget2 == null || widget3 == null || widget4 == null || widget5 == null || widget6 == null) { return(result); } for (int i = 0; i < payInfoSet.m_payInfoCount; i++) { if (payInfoSet.m_payInfos[i].m_payType == enPayType.Diamond || payInfoSet.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan) { payInfoSet.m_payInfos[i].m_payType = enPayType.DianQuan; } } for (int j = 0; j < payInfoSet.m_payInfoCount; j++) { if (payInfoSet.m_payInfos[j].m_payType == enPayType.DianQuan || payInfoSet.m_payInfos[j].m_payType == enPayType.Diamond || payInfoSet.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan) { result = payInfoSet.m_payInfos[j].m_payValue; switch (oldPriceType) { case CMallItem.OldPriceType.None: { itemWidget.m_middleOrText.CustomSetActive(true); itemWidget.m_bottomOrText.CustomSetActive(false); widget.SetActive(false); widget2.SetActive(false); widget3.SetActive(false); widget5.SetActive(true); Text component2 = widget5.GetComponent <Text>(); component2.text = payInfoSet.m_payInfos[j].m_payValue.ToString(); Image component3 = widget6.GetComponent <Image>(); component3.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); break; } case CMallItem.OldPriceType.FirstOne: itemWidget.m_middleOrText.CustomSetActive(false); itemWidget.m_bottomOrText.CustomSetActive(true); if (j == 0) { widget2.SetActive(false); widget5.SetActive(false); widget.SetActive(true); widget3.SetActive(true); Text component4 = widget.GetComponent <Text>(); component4.text = payInfoSet.m_payInfos[j].m_oriValue.ToString(); Text component5 = widget3.GetComponent <Text>(); component5.text = payInfoSet.m_payInfos[j].m_payValue.ToString(); Image component6 = widget4.GetComponent <Image>(); component6.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); } else { widget2.SetActive(false); widget.SetActive(false); widget5.SetActive(false); widget3.SetActive(true); Text component7 = widget3.GetComponent <Text>(); component7.text = payInfoSet.m_payInfos[j].m_payValue.ToString(); Image component8 = widget4.GetComponent <Image>(); component8.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); } break; case CMallItem.OldPriceType.SecondOne: itemWidget.m_middleOrText.CustomSetActive(false); itemWidget.m_bottomOrText.CustomSetActive(true); if (j == 1) { widget2.SetActive(false); widget5.SetActive(false); widget.SetActive(true); widget3.SetActive(true); Text component9 = widget.GetComponent <Text>(); component9.text = payInfoSet.m_payInfos[j].m_oriValue.ToString(); Text component10 = widget3.GetComponent <Text>(); component10.text = payInfoSet.m_payInfos[j].m_payValue.ToString(); Image component11 = widget4.GetComponent <Image>(); component11.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); } else { widget2.SetActive(false); widget.SetActive(false); widget5.SetActive(false); widget3.SetActive(true); Text component12 = widget3.GetComponent <Text>(); component12.text = payInfoSet.m_payInfos[j].m_payValue.ToString(); Image component13 = widget4.GetComponent <Image>(); component13.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); } break; case CMallItem.OldPriceType.Both: { itemWidget.m_middleOrText.CustomSetActive(true); itemWidget.m_bottomOrText.CustomSetActive(false); widget2.SetActive(false); widget5.SetActive(false); widget.SetActive(true); widget3.SetActive(true); Text component14 = widget.GetComponent <Text>(); component14.text = payInfoSet.m_payInfos[j].m_oriValue.ToString(); Text component15 = widget3.GetComponent <Text>(); component15.text = payInfoSet.m_payInfos[j].m_payValue.ToString(); Image component16 = widget4.GetComponent <Image>(); component16.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); break; } } break; } } return(result); }
public void OpenForm() { this.chat_cd_timer = Singleton <CTimerManager> .get_instance().AddTimer(3000, -1, new CTimer.OnTimeUpHandler(this.On_Input_Timer_End)); Singleton <CTimerManager> .get_instance().PauseTimer(this.chat_cd_timer); string text = string.Empty; if (Singleton <CHeroSelectBaseSystem> .get_instance().uiType == enUIType.enNormal) { text = CChatController.ChatSelectHeroPath_Normal; } else if (Singleton <CHeroSelectBaseSystem> .get_instance().uiType == enUIType.enBanPick) { text = CChatController.ChatSelectHeroPath_BanPick; } if (string.IsNullOrEmpty(text)) { return; } this.formScript = Singleton <CUIManager> .GetInstance().OpenForm(text, false, true); this.backgroundObject = this.formScript.transform.Find("Background").gameObject; this.show_listScript = this.formScript.transform.Find("chatTools/node/ListView/chatList").gameObject.GetComponent <CUIListScript>(); GameObject gameObject = this.formScript.transform.Find("chatTools/node/Tab/List").gameObject; this.tablistScript = gameObject.GetComponent <CUIListScript>(); this.tablistScript.SetElementAmount(2); CUIListElementScript elemenet = this.tablistScript.GetElemenet(0); this.ShowTemplate(elemenet, true); elemenet = this.tablistScript.GetElemenet(1); this.ShowTemplate(elemenet, false); this.tablistScript.m_alwaysDispatchSelectedChangeEvent = true; this.tablistScript.SelectElement(0, true); this.tablistScript.m_alwaysDispatchSelectedChangeEvent = false; this.formScript.transform.Find("bubble_node").gameObject.CustomSetActive(true); this.bubbleObj0 = this.formScript.transform.Find("bubble_node/bubble0").gameObject; this.bubbleText0 = this.bubbleObj0.transform.Find("text_bubble0").GetComponent <Text>(); this.bubbleObj1 = this.formScript.transform.Find("bubble_node/bubble1").gameObject; this.bubbleText1 = this.bubbleObj1.transform.Find("text_bubble0").GetComponent <Text>(); this.bubbleObj2 = this.formScript.transform.Find("bubble_node/bubble2").gameObject; this.bubbleText2 = this.bubbleObj2.transform.Find("text_bubble0").GetComponent <Text>(); this.bubbleObj3 = this.formScript.transform.Find("bubble_node/bubble3").gameObject; this.bubbleText3 = this.bubbleObj3.transform.Find("text_bubble0").GetComponent <Text>(); this.bubbleObj4 = this.formScript.transform.Find("bubble_node/bubble4").gameObject; this.bubbleText4 = this.bubbleObj4.transform.Find("text_bubble0").GetComponent <Text>(); this.bubbleObj0.CustomSetActive(false); this.bubbleObj1.CustomSetActive(false); this.bubbleObj2.CustomSetActive(false); this.bubbleObj3.CustomSetActive(false); this.bubbleObj4.CustomSetActive(false); this.bottomVoiceBtn = this.formScript.transform.Find("chatTools/ChatVoiceBtn").gameObject; this.inputField = this.formScript.transform.Find("chatTools/InputField").GetComponent <InputField>(); this.bottomSendVoiceBtn = this.formScript.transform.Find("chatTools/voice_Btn").gameObject; this.textSendBtn = this.formScript.transform.Find("chatTools/TextSendBtn").gameObject; this.voiceBtnNode = this.formScript.transform.Find("VoiceBtn").gameObject; this.chatEntryNode = this.formScript.transform.Find("entry_node").gameObject; this.chatDetailNode = this.formScript.transform.Find("chatTools").gameObject; this.m_OpenSpeakeObj = this.formScript.transform.Find("VoiceBtn/Voice_OpenSpeaker"); this.m_OpenMicObj = this.formScript.transform.Find("VoiceBtn/Voice_OpenMic"); this.m_OpenSpeakerTipObj = this.formScript.transform.Find("VoiceBtn/Voice_OpenSpeaker/info"); if (this.m_OpenSpeakerTipObj && this.m_OpenSpeakerTipObj.transform.Find("Text")) { this.m_OpenSpeakerTipText = this.m_OpenSpeakerTipObj.transform.Find("Text").GetComponent <Text>(); } this.m_OpenMicTipObj = this.formScript.transform.Find("VoiceBtn/Voice_OpenMic/info"); if (this.m_OpenMicTipObj && this.m_OpenMicTipObj.transform.Find("Text")) { this.m_OpenMicTipText = this.m_OpenMicTipObj.transform.Find("Text").GetComponent <Text>(); } this.m_Vocetimer = Singleton <CTimerManager> .get_instance().AddTimer(2000, -1, new CTimer.OnTimeUpHandler(this.OnVoiceTimeEnd)); Singleton <CTimerManager> .get_instance().PauseTimer(this.m_Vocetimer); Singleton <CTimerManager> .get_instance().ResetTimer(this.m_Vocetimer); this.m_VoiceMictime = Singleton <CTimerManager> .get_instance().AddTimer(2000, -1, new CTimer.OnTimeUpHandler(this.OnVoiceMicTimeEnd)); Singleton <CTimerManager> .get_instance().PauseTimer(this.m_VoiceMictime); Singleton <CTimerManager> .get_instance().ResetTimer(this.m_VoiceMictime); MonoSingleton <VoiceSys> .GetInstance().UseMicOnUser = false; if (MonoSingleton <VoiceSys> .GetInstance().IsUseVoiceSysSetting) { this.OnChatHeroSelectOpenSpeaker(true); } this.Show_SelectChat_MidNode(false); this._tab = CHeroSelectChatView.Tab.None; this.CurTab = CHeroSelectChatView.Tab.Template; this.curChatType = CHeroSelectChatView.enChatType.Text; this.OnUpdateBottomButtons(); this.Refresh_BottomChat(); MonoSingleton <VoiceSys> .GetInstance().ShowVoiceBtn_HeroSelect(this.formScript); }
private void SetAchievementListItemAward(CUIListElementScript listElement, CAchieveItem achieveItem) { Transform transform = listElement.transform; GameObject gameObject = transform.Find("pnlAward/pnlPoint").gameObject; GameObject obj3 = transform.Find("pnlAward/pnlCoin").gameObject; GameObject obj4 = transform.Find("pnlAward/pnlDiamond").gameObject; GameObject obj5 = transform.Find("pnlAward/pnlItem").gameObject; GameObject obj6 = transform.Find("pnlAward/pnlSkin").gameObject; uint dwPoint = achieveItem.m_cfgInfo.dwPoint; uint achievementAwardCnt = achieveItem.GetAchievementAwardCnt(RES_REWARDS_TYPE.RES_REWARDS_TYPE_HONOUR); uint num3 = achieveItem.GetAchievementAwardCnt(RES_REWARDS_TYPE.RES_REWARDS_TYPE_DIAMOND); uint num4 = achieveItem.GetAchievementAwardCnt(RES_REWARDS_TYPE.RES_REWARDS_TYPE_ITEM); uint num5 = achieveItem.GetAchievementAwardCnt(RES_REWARDS_TYPE.RES_REWARDS_TYPE_SKIN); gameObject.transform.Find("txtNum").GetComponent <Text>().text = dwPoint.ToString(); CUIEventScript component = gameObject.GetComponent <CUIEventScript>(); CUseable useable = CUseableManager.CreateVirtualUseable(enVirtualItemType.enAchievementPoint, (int)dwPoint); this.SetAchievementAwardTipsEvent(component, useable); if (achievementAwardCnt > 0) { obj3.CustomSetActive(true); obj3.GetComponent <LayoutElement>().ignoreLayout = false; obj3.transform.Find("txtNum").GetComponent <Text>().text = achievementAwardCnt.ToString(); CUIEventScript eventScript = obj3.GetComponent <CUIEventScript>(); CUseable useable2 = CUseableManager.CreateVirtualUseable(enVirtualItemType.enGoldCoin, (int)achievementAwardCnt); this.SetAchievementAwardTipsEvent(eventScript, useable2); } else { obj3.CustomSetActive(false); obj3.GetComponent <LayoutElement>().ignoreLayout = true; } if (num3 > 0) { obj4.CustomSetActive(true); obj4.GetComponent <LayoutElement>().ignoreLayout = false; obj4.transform.Find("txtNum").GetComponent <Text>().text = num3.ToString(); CUIEventScript script3 = obj4.GetComponent <CUIEventScript>(); CUseable useable3 = CUseableManager.CreateVirtualUseable(enVirtualItemType.enDiamond, (int)num3); this.SetAchievementAwardTipsEvent(script3, useable3); } else { obj4.CustomSetActive(false); obj4.GetComponent <LayoutElement>().ignoreLayout = true; } if (num4 > 0) { obj5.CustomSetActive(true); obj5.GetComponent <LayoutElement>().ignoreLayout = false; obj5.transform.Find("txtNum").GetComponent <Text>().text = num4.ToString(); string prefabPath = CUIUtility.s_Sprite_Dynamic_Icon_Dir + achieveItem.GetAchievementAwardId(RES_REWARDS_TYPE.RES_REWARDS_TYPE_ITEM); obj5.transform.Find("imgIcon").GetComponent <Image>().SetSprite(prefabPath, listElement.m_belongedFormScript, true, false, false); } else { obj5.CustomSetActive(false); obj5.GetComponent <LayoutElement>().ignoreLayout = true; } if (num5 > 0) { obj6.CustomSetActive(true); obj6.GetComponent <LayoutElement>().ignoreLayout = false; obj6.transform.Find("txtNum").GetComponent <Text>().text = num5.ToString(); string str2 = CUIUtility.s_Sprite_Dynamic_Icon_Dir + achieveItem.GetAchievementAwardId(RES_REWARDS_TYPE.RES_REWARDS_TYPE_SKIN); obj6.transform.Find("imgIcon").GetComponent <Image>().SetSprite(str2, listElement.m_belongedFormScript, true, false, false); } else { obj6.CustomSetActive(false); obj6.GetComponent <LayoutElement>().ignoreLayout = true; } }
public void Init(GameObject heroInfoPanelObj) { if (null == heroInfoPanelObj) { return; } this.heroInfoList = heroInfoPanelObj.GetComponent <CUIListScript>(); if (null == this.heroInfoList) { return; } this.heroInfoList.SetElementAmount(10); this.InitTextImageCacheList(); Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer(); if (hostPlayer == null) { DebugHelper.Assert(false, "HeroInfoPanel Init hostPlayer is null"); return; } this.m_HeroToIndexDic.Clear(); this.m_enemyHeroList.Clear(); this.m_teamHeroList.Clear(); int num = 10; for (int i = 0; i < num; i++) { bool flag = i >= 5; CUIListElementScript elemenet = this.heroInfoList.GetElemenet(i); if (elemenet != null) { elemenet.gameObject.CustomSetActive(false); GameObject widget = elemenet.GetWidget(1); GameObject widget2 = elemenet.GetWidget(2); widget.CustomSetActive(!flag); widget2.CustomSetActive(flag); GameObject widget3 = elemenet.GetWidget(6); GameObject widget4 = elemenet.GetWidget(7); widget3.CustomSetActive(false); widget4.CustomSetActive(!flag); } } List <Player> allPlayers = Singleton <GamePlayerCenter> .instance.GetAllPlayers(); int num2 = 0; for (int j = 0; j < allPlayers.get_Count(); j++) { if (allPlayers.get_Item(j).PlayerCamp == hostPlayer.PlayerCamp && allPlayers.get_Item(j) != hostPlayer) { int listIndex = num2; CUIListElementScript elemenet2 = this.heroInfoList.GetElemenet(num2); if (elemenet2 != null && allPlayers.get_Item(j).Captain) { elemenet2.gameObject.CustomSetActive(true); this.InitHeroItemData(elemenet2, allPlayers.get_Item(j).Captain); this.AddHeroToDic(allPlayers.get_Item(j).Captain, listIndex); this.m_teamHeroList.Add(allPlayers.get_Item(j).Captain); } num2++; } } this.InitEventListener(); }
public static void OpenForm(GameObject form) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo(); int num = GameDataMgr.addedSkiilDatabin.Count(); CUIToggleListScript component = form.transform.Find("Panel_Grid/ToggleList").GetComponent <CUIToggleListScript>(); component.SetElementAmount(num); form.transform.Find("Panel_TopBg/LevelText").GetComponent <Text>().text = ((masterRoleInfo == null) ? Singleton <CTextManager> .get_instance().GetText("Added_Skill_Common_Tips_2", new string[] { "1" }) : Singleton <CTextManager> .get_instance().GetText("Added_Skill_Common_Tips_2", new string[] { masterRoleInfo.PvpLevel.ToString() })); ResSkillUnlock dataByIndex; for (int i = 0; i < num; i++) { CUIListElementScript elemenet = component.GetElemenet(i); CUIEventScript component2 = elemenet.GetComponent <CUIEventScript>(); dataByIndex = GameDataMgr.addedSkiilDatabin.GetDataByIndex(i); uint dwUnlockSkillID = dataByIndex.dwUnlockSkillID; ResSkillCfgInfo dataByKey = GameDataMgr.skillDatabin.GetDataByKey(dwUnlockSkillID); bool flag = masterRoleInfo == null || masterRoleInfo.PvpLevel < (uint)dataByIndex.wAcntLevel; if (dataByKey != null) { string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(dataByKey.szIconPath)); Image component3 = elemenet.transform.Find("Icon").GetComponent <Image>(); component3.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false, false); component2.m_onClickEventID = enUIEventID.AddedSkill_GetDetail; component2.m_onClickEventParams.tag = (int)dataByIndex.wAcntLevel; elemenet.transform.Find("SkillNameTxt").GetComponent <Text>().text = Utility.UTF8Convert(dataByKey.szSkillName); elemenet.transform.Find("Lock").gameObject.CustomSetActive(flag); component3.color = ((!flag) ? Color.white : CUIUtility.s_Color_GrayShader); if (flag) { Utility.GetComponetInChild <Text>(elemenet.gameObject, "Lock/Text").text = Singleton <CTextManager> .get_instance().GetText("Added_Skill_Common_Tips_3", new string[] { dataByIndex.wAcntLevel.ToString() }); } } else { DebugHelper.Assert(false, string.Format("ResSkillCfgInfo[{0}] can not be found!", dwUnlockSkillID)); } } dataByIndex = GameDataMgr.addedSkiilDatabin.GetDataByIndex(0); if (dataByIndex != null) { component.SelectElement(0, true); CAddSkillView.OnRefresh(form, dataByIndex.wAcntLevel); } if (CSysDynamicBlock.bLobbyEntryBlocked) { CUIToggleListScript component4 = form.transform.FindChild("Panel_Grid/ToggleList").GetComponent <CUIToggleListScript>(); CUIListElementScript elemenet2 = component4.GetElemenet(10); if (elemenet2) { elemenet2.gameObject.CustomSetActive(false); } Transform transform = form.transform.FindChild("Skill-Send-Test"); if (transform != null) { transform.gameObject.CustomSetActive(false); } } }
public static void InitLevelList(CUIFormScript form, int currentChapter, int levelNo, int difficulty) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo == null) { return; } ResChapterInfo dataByKey = GameDataMgr.chapterInfoDatabin.GetDataByKey((long)currentChapter); DebugHelper.Assert(dataByKey != null); bool flag = Singleton <CFunctionUnlockSys> .instance.ChapterIsUnlock(dataByKey.dwChapterId); PVE_ADV_COMPLETE_INFO pVE_ADV_COMPLETE_INFO = masterRoleInfo.pveLevelDetail[difficulty - 1]; PVE_CHAPTER_COMPLETE_INFO pVE_CHAPTER_COMPLETE_INFO = pVE_ADV_COMPLETE_INFO.ChapterDetailList[currentChapter - 1]; PVE_LEVEL_COMPLETE_INFO[] levelDetailList = pVE_CHAPTER_COMPLETE_INFO.LevelDetailList; CUIListScript component = form.transform.FindChild("LevelList").GetComponent <CUIListScript>(); component.SetElementAmount(levelDetailList.Length); Sprite sprite = CUIUtility.GetSpritePrefeb(CAdventureView.GetLevelFramePath(difficulty), false, false).GetComponent <SpriteRenderer>().sprite; GameObject spritePrefeb = CUIUtility.GetSpritePrefeb(CAdventureView.GetLevelSelectFramePath(difficulty), false, false); for (int i = 0; i < levelDetailList.Length; i++) { CUIListElementScript elemenet = component.GetElemenet(i); ResLevelCfgInfo dataByKey2 = GameDataMgr.levelDatabin.GetDataByKey((long)levelDetailList[i].iLevelID); DebugHelper.Assert(dataByKey2 != null, "Can't find LevelConfig = {0}", new object[] { levelDetailList[i].iLevelID }); bool flag2 = levelDetailList[i].levelStatus == 0 || !flag; bool bActive = levelDetailList[i].levelStatus == 1 && flag; int starNum = CAdventureSys.GetStarNum(levelDetailList[i].bStarBits); elemenet.transform.FindChild("Unlock/star1").GetComponent <Image>().set_color((starNum >= 1) ? Color.white : CUIUtility.s_Color_GrayShader); elemenet.transform.FindChild("Unlock/star2").GetComponent <Image>().set_color((starNum >= 2) ? Color.white : CUIUtility.s_Color_GrayShader); elemenet.transform.FindChild("Unlock/star3").GetComponent <Image>().set_color((starNum >= 3) ? Color.white : CUIUtility.s_Color_GrayShader); elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().set_text(Utility.UTF8Convert(dataByKey2.szName)); if (levelNo == i + 1 && !flag2) { elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().set_color(CAdventureView.s_Adv_Level_Colors[0]); } else if (!flag2) { elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().set_color(CAdventureView.s_Adv_Level_Colors[1]); } else { elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().set_color(CAdventureView.s_Adv_Level_Colors[2]); } elemenet.transform.FindChild("SelectedFrame").GetComponent <Image>().set_color(CAdventureView.s_Adv_Difficult_Color[difficulty - 1]); elemenet.transform.FindChild("SelectedFrame/Image1").GetComponent <Image>().set_color(CAdventureView.s_Adv_Difficult_Color[CAdventureView.s_Adv_Difficult_Color.Length / 2 + difficulty - 1]); elemenet.transform.FindChild("SelectedFrame/Image2").GetComponent <Image>().set_color(CAdventureView.s_Adv_Difficult_Color[CAdventureView.s_Adv_Difficult_Color.Length / 2 + difficulty - 1]); elemenet.transform.FindChild("SelectedFrame/SelectedFrame").GetComponent <Image>().SetSprite(spritePrefeb, false); elemenet.transform.FindChild("New").gameObject.CustomSetActive(bActive); elemenet.GetComponent <CUIEventScript>().m_onClickEventID = enUIEventID.Adv_SelectLevel; elemenet.GetComponent <CUIEventScript>().m_onClickEventParams.tag = i + 1; elemenet.transform.FindChild("Unlock").gameObject.CustomSetActive(!flag2); elemenet.transform.FindChild("Lock").gameObject.CustomSetActive(flag2); elemenet.m_selectedSprite = sprite; elemenet.GetComponent <Image>().SetSprite((levelNo - 1 == i) ? sprite : elemenet.m_defaultSprite, elemenet.m_selectedLayout); } component.SelectElement(levelNo - 1, true); }
private void RefreshRankList() { if (this._rankingBtn != null) { CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(this._rankingBtn, "RankingList"); int amount = 0; if (this.m_rankingType == RankingSystem.RankingSubView.Friend) { this.myRankingNo = Singleton <RankingSystem> .instance.GetMyFriendRankNo(); if (this.myRankingNo != -1) { this.rankFriendList = Singleton <CFriendContoller> .instance.model.GetSortedRankingFriendList(COM_APOLLO_TRANK_SCORE_TYPE.COM_APOLLO_TRANK_SCORE_TYPE_LADDER_POINT); if (this.rankFriendList != null) { amount = this.rankFriendList.Count + 1; componetInChild.SetElementAmount(amount); CUIListElementScript elemenet = null; GameObject go = null; for (int i = 0; i < amount; i++) { elemenet = componetInChild.GetElemenet(i); if (elemenet != null) { go = elemenet.gameObject; if (go != null) { this.OnUpdateRankingFriendElement(go, i); } } } } } } else if (this.m_rankingType == RankingSystem.RankingSubView.All) { CSDT_RANKING_LIST_SUCC rankList = Singleton <RankingSystem> .instance.GetRankList(RankingSystem.RankingType.Ladder); if (rankList != null) { amount = (int)rankList.dwItemNum; componetInChild.SetElementAmount(amount); CUIListElementScript script3 = null; GameObject gameObject = null; for (int j = 0; j < amount; j++) { script3 = componetInChild.GetElemenet(j); if (script3 != null) { gameObject = script3.gameObject; if (gameObject != null) { this.OnUpdateRankingAllElement(gameObject, j); } } } } } } }
public static void InitExloreList(CUIFormScript form) { if (form == null) { return; } int num = CExploreView.s_eventIDs.Length; CUIStepListScript component = form.transform.Find("ExploreList").gameObject.GetComponent <CUIStepListScript>(); component.SetElementAmount(num); for (int i = 0; i < num; i++) { CUIListElementScript elemenet = component.GetElemenet(i); CUIEventScript component2 = elemenet.GetComponent <CUIEventScript>(); component2.m_onClickEventID = CExploreView.s_eventIDs[i]; Text component3 = elemenet.gameObject.transform.Find("TitleBg/ExlporeNameText").GetComponent <Text>(); component3.text = Singleton <CTextManager> .get_instance().GetText(CExploreView.s_exploreTypes[i]); Image component4 = elemenet.gameObject.transform.Find("TitleBg/Image").GetComponent <Image>(); component4.color = CExploreView.s_exploreColors[i]; Image component5 = elemenet.gameObject.transform.Find("Icon").gameObject.GetComponent <Image>(); GameObject spritePrefeb = CUIUtility.GetSpritePrefeb(CUIUtility.s_Sprite_Dynamic_Adventure_Dir + (i + 1), false, false); if (spritePrefeb != null) { component5.SetSprite(spritePrefeb, false); } GameObject gameObject = elemenet.transform.FindChild("Lock").gameObject; GameObject gameObject2 = elemenet.transform.FindChild("Unlock").gameObject; RES_SPECIALFUNCUNLOCK_TYPE rES_SPECIALFUNCUNLOCK_TYPE = CExploreView.s_unlockTypes[i]; if (Singleton <CFunctionUnlockSys> .get_instance().FucIsUnlock(rES_SPECIALFUNCUNLOCK_TYPE)) { component5.color = CUIUtility.s_Color_White; gameObject.CustomSetActive(false); } else { component5.color = CUIUtility.s_Color_GrayShader; gameObject.CustomSetActive(true); ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey(rES_SPECIALFUNCUNLOCK_TYPE); if (dataByKey != null) { gameObject.GetComponentInChildren <Text>().text = Utility.UTF8Convert(dataByKey.szLockedTip); } } if (CExploreView.s_unlockTypes[i] == null) { int lastChapter = CAdventureSys.GetLastChapter(1); ResChapterInfo dataByKey2 = GameDataMgr.chapterInfoDatabin.GetDataByKey((long)lastChapter); if (dataByKey2 != null) { gameObject2.CustomSetActive(true); gameObject2.GetComponentInChildren <Text>().text = string.Format(Singleton <CTextManager> .get_instance().GetText("Adventure_Chapter_Max_Tips"), Utility.UTF8Convert(dataByKey2.szChapterName)); } } else if (CExploreView.s_unlockTypes[i] == 9) { if (Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList == null || Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList.stArenaInfo.dwSelfRank == 0u) { gameObject2.CustomSetActive(false); } else { string text = string.Empty; text = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreArenaRankText"), Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList.stArenaInfo.dwSelfRank); gameObject2.gameObject.transform.FindChild("Text").gameObject.GetComponent <Text>().text = text; gameObject2.CustomSetActive(true); } } else if (CExploreView.s_unlockTypes[i] == 4) { BurnExpeditionModel model = Singleton <BurnExpeditionController> .GetInstance().model; if (model._data == null) { gameObject2.CustomSetActive(false); } else { string text2 = string.Empty; if (model.IsAllCompelte()) { text2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreBurnFinishText"), new object[0]); } else { text2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreBurnText"), Math.Max(1, model.Get_LastUnlockLevelIndex(model.curDifficultyType) + 1)); } gameObject2.gameObject.transform.FindChild("Text").gameObject.GetComponent <Text>().text = text2; gameObject2.CustomSetActive(true); } } } component.SelectElementImmediately(1); Text component6 = form.gameObject.transform.FindChild("AwardGroup/Name1").gameObject.GetComponent <Text>(); Text component7 = form.gameObject.transform.FindChild("AwardGroup/Name2").gameObject.GetComponent <Text>(); Image component8 = form.gameObject.transform.FindChild("AwardGroup/Icon1").gameObject.GetComponent <Image>(); Image component9 = form.gameObject.transform.FindChild("AwardGroup/Icon2").gameObject.GetComponent <Image>(); component6.gameObject.CustomSetActive(false); component7.gameObject.CustomSetActive(false); component8.gameObject.CustomSetActive(false); component9.gameObject.CustomSetActive(false); uint num2 = 0u; string empty = string.Empty; try { num2 = uint.Parse(Singleton <CTextManager> .GetInstance().GetText("ArenaAwardHeroId")); } catch (Exception) { } if (num2 != 0u) { ResHeroCfgInfo dataByKey3 = GameDataMgr.heroDatabin.GetDataByKey(num2); if (!Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsHaveHero(num2, false) && dataByKey3 != null) { component6.gameObject.CustomSetActive(true); component6.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("ArenaAwardHero"), dataByKey3.szName); component8.gameObject.CustomSetActive(true); component8.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic(num2, 0u)), form, true, false, false, false); } } num2 = 0u; try { num2 = uint.Parse(Singleton <CTextManager> .GetInstance().GetText("BurningAwardHeroId")); } catch (Exception) { } if (num2 != 0u) { ResHeroCfgInfo dataByKey4 = GameDataMgr.heroDatabin.GetDataByKey(num2); if (!Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsHaveHero(num2, false) && dataByKey4 != null) { component7.gameObject.CustomSetActive(true); component7.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("BurningAwardHero"), dataByKey4.szName); component9.gameObject.CustomSetActive(true); component9.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic(num2, 0u)), form, true, false, false, false); } } if (CSysDynamicBlock.bLobbyEntryBlocked) { Transform transform = form.transform.FindChild("AwardGroup"); if (transform) { transform.gameObject.CustomSetActive(false); } } }
private void OnTrophyRewardInfoEnable(CUIEvent uiEvent) { int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList; int num = (this.m_TrophyRewardInfoWithRewardList != null) ? this.m_TrophyRewardInfoWithRewardList.get_Count() : 0; if (srcWidgetIndexInBelongedList < 0 || srcWidgetIndexInBelongedList >= num) { return; } CTrophyRewardInfo cTrophyRewardInfo = this.m_TrophyRewardInfoWithRewardList.get_Item(srcWidgetIndexInBelongedList); CUIListElementScript cUIListElementScript = uiEvent.m_srcWidgetScript as CUIListElementScript; if (cUIListElementScript == null) { DebugHelper.Assert(false, "achievement reward enable elementscript is null"); return; } GameObject widget = cUIListElementScript.GetWidget(0); GameObject widget2 = cUIListElementScript.GetWidget(1); GameObject widget3 = cUIListElementScript.GetWidget(2); GameObject widget4 = cUIListElementScript.GetWidget(3); GameObject widget5 = cUIListElementScript.GetWidget(4); GameObject widget6 = cUIListElementScript.GetWidget(5); GameObject widget7 = cUIListElementScript.GetWidget(6); GameObject widget8 = cUIListElementScript.GetWidget(7); GameObject widget9 = cUIListElementScript.GetWidget(8); GameObject widget10 = cUIListElementScript.GetWidget(9); GameObject widget11 = cUIListElementScript.GetWidget(10); if (cTrophyRewardInfo.HasGotAward()) { widget.CustomSetActive(false); widget2.CustomSetActive(true); widget5.CustomSetActive(false); widget8.CustomSetActive(false); widget6.CustomSetActive(true); Text component = widget6.GetComponent <Text>(); component.text = Singleton <CTextManager> .GetInstance().GetText("Achievement_Trophy_Reward_Status_Got"); widget9.CustomSetActive(false); } else if (cTrophyRewardInfo.IsFinish()) { uint num2 = 0u; for (int i = 0; i < 3; i++) { if (cTrophyRewardInfo.Cfg.astReqReward[i].dwRewardNum != 0u) { num2 += 1u; } } if (num2 == 0u) { widget.CustomSetActive(false); widget2.CustomSetActive(true); widget5.CustomSetActive(false); widget8.CustomSetActive(false); widget6.CustomSetActive(true); Text component2 = widget6.GetComponent <Text>(); component2.text = Singleton <CTextManager> .GetInstance().GetText("Achievement_Trophy_Reward_Status_Done"); } else { widget.CustomSetActive(true); widget2.CustomSetActive(false); widget5.CustomSetActive(false); widget8.CustomSetActive(true); widget6.CustomSetActive(false); CUIEventScript component3 = widget8.GetComponent <CUIEventScript>(); if (component3 != null) { component3.SetUIEvent(enUIEventType.Click, enUIEventID.Achievement_Get_Trophy_Reward, new stUIEventParams { tag = cTrophyRewardInfo.Index }); } } widget9.CustomSetActive(false); } else { widget.CustomSetActive(true); widget2.CustomSetActive(false); widget5.CustomSetActive(false); widget8.CustomSetActive(false); widget6.CustomSetActive(true); Text component4 = widget6.GetComponent <Text>(); if (component4 != null) { component4.text = ((cTrophyRewardInfo.State != TrophyState.OnGoing) ? Singleton <CTextManager> .GetInstance().GetText("Achievement_Trophy_Reward_Status_Not_Done") : Singleton <CTextManager> .GetInstance().GetText("Achievement_Trophy_Reward_Status_OnGoing")); } widget9.CustomSetActive(false); } Image component5 = widget3.GetComponent <Image>(); component5.SetSprite(cTrophyRewardInfo.GetTrophyImagePath(), cUIListElementScript.m_belongedFormScript, true, false, false, false); Text component6 = widget4.GetComponent <Text>(); if (component6 != null) { component6.text = cTrophyRewardInfo.Cfg.szTrophyDesc; } CUIListScript component7 = widget7.GetComponent <CUIListScript>(); if (component7 != null) { CUseable[] trophyRewards = cTrophyRewardInfo.GetTrophyRewards(); component7.SetElementAmount(trophyRewards.Length); for (int j = 0; j < trophyRewards.Length; j++) { CUIListElementScript elemenet = component7.GetElemenet(j); GameObject widget12 = elemenet.GetWidget(0); if (widget12 != null) { CUseable cUseable = trophyRewards[j]; if (cUseable == null) { component7.SetElementAmount(0); return; } if (trophyRewards.Length >= 5) { CUICommonSystem.SetItemCell(component7.m_belongedFormScript, widget12, cUseable, false, false, false, false); } else { CUICommonSystem.SetItemCell(component7.m_belongedFormScript, widget12, cUseable, true, false, false, false); } if (cUseable.m_stackCount == 1) { Utility.FindChild(widget12, "cntBg").CustomSetActive(false); Utility.FindChild(widget12, "lblIconCount").CustomSetActive(false); } else { Utility.FindChild(widget12, "cntBg").CustomSetActive(true); Utility.FindChild(widget12, "lblIconCount").CustomSetActive(true); } } } } }
private void RefreshOverviewForm(CUIFormScript overviewForm = null) { if (overviewForm == null) { overviewForm = Singleton <CUIManager> .GetInstance().GetForm("UGUI/Form/System/Achieve/Form_Trophy_Overview.prefab"); } if (overviewForm == null) { return; } CUIListScript component = overviewForm.GetWidget(1).GetComponent <CUIListScript>(); if (component != null) { component.SetElementAmount(this.m_CurAchieveSeries.get_Count()); } GameObject widget = overviewForm.GetWidget(2); GameObject widget2 = overviewForm.GetWidget(3); GameObject widget3 = overviewForm.GetWidget(7); GameObject widget4 = overviewForm.GetWidget(8); GameObject widget5 = overviewForm.GetWidget(9); GameObject widget6 = overviewForm.GetWidget(10); GameObject widget7 = overviewForm.GetWidget(4); GameObject widget8 = overviewForm.GetWidget(5); GameObject widget9 = overviewForm.GetWidget(6); if (widget == null || widget2 == null || widget3 == null || widget4 == null || widget7 == null || widget8 == null || widget9 == null || widget5 == null || widget6 == null) { DebugHelper.Assert(false, "Some of Trophy overview form widgets is null"); return; } Text component2 = widget.GetComponent <Text>(); Text component3 = widget2.GetComponent <Text>(); Image component4 = widget6.GetComponent <Image>(); Image component5 = widget3.GetComponent <Image>(); Text component6 = widget4.GetComponent <Text>(); CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo(); if (masterAchieveInfo.LastDoneTrophyRewardInfo != null) { component4.SetSprite(masterAchieveInfo.LastDoneTrophyRewardInfo.GetTrophyImagePath(), overviewForm, true, false, false, false); } component2.text = ((masterAchieveInfo.LastDoneTrophyRewardInfo != null) ? string.Format("{0}", masterAchieveInfo.LastDoneTrophyRewardInfo.Cfg.dwTrophyLvl) : "0"); if (masterAchieveInfo.GetWorldRank() == 0u) { widget5.CustomSetActive(true); widget2.CustomSetActive(false); } else { widget5.CustomSetActive(false); widget2.CustomSetActive(true); component3.text = masterAchieveInfo.GetWorldRank().ToString(); } uint num = 0u; uint num2 = 0u; masterAchieveInfo.GetTrophyProgress(ref num, ref num2); CTrophyRewardInfo trophyRewardInfoByPoint = masterAchieveInfo.GetTrophyRewardInfoByPoint(num); CTrophyRewardInfo trophyRewardInfoByIndex = masterAchieveInfo.GetTrophyRewardInfoByIndex(trophyRewardInfoByPoint.Index + 1); component5.fillAmount = Utility.Divide(num - trophyRewardInfoByIndex.MinPoint, trophyRewardInfoByIndex.MaxPoint - trophyRewardInfoByIndex.MinPoint); component6.text = string.Format("{0}/{1}", num - trophyRewardInfoByIndex.MinPoint, trophyRewardInfoByIndex.MaxPoint - trophyRewardInfoByIndex.MinPoint); Text component7 = widget7.GetComponent <Text>(); CUIListScript component8 = widget8.GetComponent <CUIListScript>(); CUIEventScript component9 = widget9.GetComponent <CUIEventScript>(); CTrophyRewardInfo firstTrophyRewardInfoAwardNotGot = masterAchieveInfo.GetFirstTrophyRewardInfoAwardNotGot(); if (firstTrophyRewardInfoAwardNotGot == null) { widget7.CustomSetActive(false); widget9.CustomSetActive(false); component8.SetElementAmount(0); } else { bool flag = false; CUseable[] trophyRewards = firstTrophyRewardInfoAwardNotGot.GetTrophyRewards(); if (!firstTrophyRewardInfoAwardNotGot.HasGotAward() && firstTrophyRewardInfoAwardNotGot.IsFinish()) { flag = true; } widget7.CustomSetActive(true); component7.text = string.Format("{0}级奖励:", firstTrophyRewardInfoAwardNotGot.Cfg.dwTrophyLvl); component8.SetElementAmount(trophyRewards.Length); for (int i = 0; i < trophyRewards.Length; i++) { CUIListElementScript elemenet = component8.GetElemenet(i); CUICommonSystem.SetItemCell(overviewForm, elemenet.GetWidget(0), trophyRewards[i], false, false, false, false); } widget9.CustomSetActive(true); if (flag) { CUICommonSystem.SetButtonEnable(widget9.GetComponent <Button>(), true, true, true); component9.SetUIEvent(enUIEventType.Click, enUIEventID.Achievement_Get_Trophy_Reward, new stUIEventParams { tag = firstTrophyRewardInfoAwardNotGot.Index }); } else { CUICommonSystem.SetButtonEnable(widget9.GetComponent <Button>(), false, false, true); } } }
private void OnAchievementEnable(CUIEvent uiEvent) { if (this.m_CurAchieveItem == null) { Singleton <CUIManager> .GetInstance().CloseForm("UGUI/Form/System/Achieve/Form_Trophy_Detail.prefab"); return; } int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList; int achievementCnt = this.m_CurAchieveItem.GetAchievementCnt(); CAchieveItem2 cAchieveItem = this.m_CurAchieveItem; bool bActive = srcWidgetIndexInBelongedList != achievementCnt - 1; for (int i = 0; i < srcWidgetIndexInBelongedList; i++) { cAchieveItem = cAchieveItem.Next; } CUIListElementScript cUIListElementScript = uiEvent.m_srcWidgetScript as CUIListElementScript; GameObject widget = cUIListElementScript.GetWidget(0); GameObject widget2 = cUIListElementScript.GetWidget(1); GameObject widget3 = cUIListElementScript.GetWidget(2); GameObject widget4 = cUIListElementScript.GetWidget(3); GameObject widget5 = cUIListElementScript.GetWidget(4); GameObject widget6 = cUIListElementScript.GetWidget(5); GameObject widget7 = cUIListElementScript.GetWidget(6); GameObject widget8 = cUIListElementScript.GetWidget(7); GameObject widget9 = cUIListElementScript.GetWidget(8); GameObject widget10 = cUIListElementScript.GetWidget(9); widget4.CustomSetActive(bActive); Image component = widget.GetComponent <Image>(); Image component2 = widget9.GetComponent <Image>(); Text component3 = widget2.GetComponent <Text>(); Text component4 = widget3.GetComponent <Text>(); Text component5 = widget10.GetComponent <Text>(); Text component6 = widget5.GetComponent <Text>(); Text component7 = widget6.GetComponent <Text>(); if (component == null || component3 == null || component4 == null || component6 == null || component7 == null || component2 == null || component5 == null) { return; } component.SetSprite(CUIUtility.GetSpritePrefeb(cAchieveItem.GetAchieveImagePath(), false, false), false); CAchievementSystem.SetAchieveBaseIcon(widget9.transform, cAchieveItem, null); component3.text = cAchieveItem.Cfg.szName; component4.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Achievement_Score"), cAchieveItem.Cfg.dwPoint); if (cAchieveItem.IsFinish()) { if (cAchieveItem.DoneTime == 0u) { widget10.CustomSetActive(false); } else { widget10.CustomSetActive(true); component5.text = string.Format("{0:yyyy.M.d}", Utility.ToUtcTime2Local((long)((ulong)cAchieveItem.DoneTime))); } component6.text = cAchieveItem.GetAchievementDesc(); component7.text = Singleton <CTextManager> .GetInstance().GetText("Achievement_Status_Done"); widget7.CustomSetActive(true); widget8.CustomSetActive(false); } else { widget10.CustomSetActive(false); component6.text = cAchieveItem.GetAchievementDesc(); widget6.CustomSetActive(false); widget7.CustomSetActive(false); widget8.CustomSetActive(true); } }
private void OnTrophyEnable(CUIEvent uiEvent) { int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList; if (srcWidgetIndexInBelongedList < 0 || srcWidgetIndexInBelongedList >= this.m_CurAchieveSeries.get_Count()) { return; } CUIListElementScript cUIListElementScript = uiEvent.m_srcWidgetScript as CUIListElementScript; if (cUIListElementScript == null) { DebugHelper.Assert(false, "achievement sery enable elementscript is null"); return; } CAchieveItem2 cAchieveItem = this.m_CurAchieveSeries.get_Item(srcWidgetIndexInBelongedList); CUIEventScript component = cUIListElementScript.GetComponent <CUIEventScript>(); component.SetUIEvent(enUIEventType.Click, enUIEventID.Achievement_Trophy_Click, new stUIEventParams { commonUInt32Param1 = cAchieveItem.Cfg.dwID }); GameObject widget = cUIListElementScript.GetWidget(0); GameObject widget2 = cUIListElementScript.GetWidget(1); GameObject widget3 = cUIListElementScript.GetWidget(2); GameObject widget4 = cUIListElementScript.GetWidget(3); GameObject widget5 = cUIListElementScript.GetWidget(4); GameObject widget6 = cUIListElementScript.GetWidget(5); widget2.CustomSetActive(false); Image component2 = widget.GetComponent <Image>(); Image component3 = widget5.GetComponent <Image>(); Text component4 = widget3.GetComponent <Text>(); Text component5 = widget4.GetComponent <Text>(); if (component2 == null || component3 == null || component4 == null || component5 == null) { return; } CAchieveItem2 cAchieveItem2 = cAchieveItem.TryToGetMostRecentlyDoneItem(); if (cAchieveItem2 == null) { component2.SetSprite(CUIUtility.GetSpritePrefeb(cAchieveItem.GetAchieveImagePath(), false, false), false); CAchievementSystem.SetAchieveBaseIcon(widget5.transform, cAchieveItem, null); component4.text = cAchieveItem.Cfg.szName; component5.text = cAchieveItem.GetGotTimeText(false, false); widget6.CustomSetActive(true); } else { component2.SetSprite(CUIUtility.GetSpritePrefeb(cAchieveItem2.GetAchieveImagePath(), false, false), false); CAchievementSystem.SetAchieveBaseIcon(widget5.transform, cAchieveItem2, null); component4.text = cAchieveItem2.Cfg.szName; if (cAchieveItem == cAchieveItem2) { component5.text = cAchieveItem.GetGotTimeText(false, false); } else { component5.text = cAchieveItem2.GetGotTimeText(false, true); } widget6.CustomSetActive(false); } }
public void OpenForm(CUIEvent uiEvent) { this.friendform = Singleton <CUIManager> .GetInstance().OpenForm(CFriendContoller.FriendFormPath, false, true); GameObject gameObject = this.friendform.gameObject; this.friendListNode = gameObject.transform.Find("node/Image/FriendList").gameObject; this.friendListNode.CustomSetActive(true); this.friendListCom = this.friendListNode.GetComponent <CUIListScript>(); this.addFriendBtnGameObject = Utility.FindChild(gameObject, "node/Buttons/Add"); this.info_node = gameObject.transform.Find("node/Image/info_node").gameObject; this.info_node.CustomSetActive(false); this.ifnoText = Utility.GetComponetInChild <Text>(gameObject, "node/Image/info_node/Text"); this.ifnoText.text = Singleton <CTextManager> .instance.GetText("Friend_NoFriend_Tip"); string text = Singleton <CTextManager> .instance.GetText("FriendAdd_Tab_QQ"); if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.Wechat) { text = Singleton <CTextManager> .instance.GetText("FriendAdd_Tab_Weixin"); } this.tablistScript = gameObject.transform.Find("TopCommon/Panel_Menu/List").gameObject.GetComponent <CUIListScript>(); string[] strArray = new string[] { text, UT.GetText("Friend_Title_List"), UT.GetText("Friend_Title_Requests"), "黑名单", "附近的人" }; string[] strArray2 = new string[] { UT.GetText("Friend_Title_List"), UT.GetText("Friend_Title_Requests") }; string[] strArray3 = !CSysDynamicBlock.bSocialBlocked ? strArray : strArray2; Tab tab = !CSysDynamicBlock.bSocialBlocked ? Tab.Friend_SNS : Tab.Friend; this.tablistScript.SetElementAmount(strArray3.Length); for (int i = 0; i < this.tablistScript.m_elementAmount; i++) { this.tablistScript.GetElemenet(i).gameObject.transform.Find("Text").GetComponent <Text>().text = strArray3[i]; } this.btnText = Utility.GetComponetInChild <Text>(gameObject, "node/Buttons/Invite/Text"); this.sns_invite_btn = gameObject.transform.Find("node/Buttons/Invite").gameObject; string str2 = Singleton <CTextManager> .instance.GetText("FriendAdd_Invite_Btn_QQ"); if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.Wechat) { str2 = Singleton <CTextManager> .instance.GetText("FriendAdd_Invite_Btn_Weixin"); } this.btnText.text = str2; this.sns_invite_btn.CustomSetActive(false); this.rule_btn_node = gameObject.transform.Find("btnRule").gameObject; this.lbs_node = gameObject.transform.Find("node/LBSNode").gameObject; this.m_QQboxBtn = Utility.FindChild(gameObject, "node/Buttons/QQBoxBtn"); this.sns_share_switch = Utility.FindChild(gameObject, "node/SnsNtfNode/SnsToggle"); this.sns_add_switch = Utility.FindChild(gameObject, "node/SnsNtfNode/AddToggle"); this.sns_share_switch.CustomSetActive(false); this.localtionToggle = Utility.FindChild(gameObject, "node/LBSNode/location").GetComponent <Toggle>(); this.nanToggle = Utility.FindChild(gameObject, "node/LBSNode/nan").GetComponent <Toggle>(); this.nvToggle = Utility.FindChild(gameObject, "node/LBSNode/nv").GetComponent <Toggle>(); this.lbsRefreshBtn = Utility.FindChild(gameObject, "node/LBSNode/Add").GetComponent <Button>(); if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.QQ) { Utility.GetComponetInChild <Text>(this.sns_share_switch, "Label").text = Singleton <CTextManager> .instance.GetText("Friend_SNS_NTF_Switch_Tips_1"); } else { Utility.GetComponetInChild <Text>(this.sns_share_switch, "Label").text = Singleton <CTextManager> .instance.GetText("Friend_SNS_NTF_Switch_Tips_2"); } this.sns_add_switch.CustomSetActive(false); this.tablistScript.m_alwaysDispatchSelectedChangeEvent = true; this.tablistScript.SelectElement(0, true); this.tablistScript.m_alwaysDispatchSelectedChangeEvent = false; this._tab = Tab.None; this.Refresh_Tab(); this.CurTab = tab; CUIListElementScript elemenet = this.tablistScript.GetElemenet(4); if (elemenet != null) { Singleton <CMiShuSystem> .GetInstance().ShowNewFlag(elemenet.gameObject, enNewFlagKey.New_PeopleNearby_V1); } }
public void OpenForm(CUIEvent uiEvent) { this.m_CUIForm = Singleton <CUIManager> .GetInstance().OpenForm(CTaskSys.TASK_FORM_PATH, true, true); this.tablistScript = this.m_CUIForm.GetWidget(1).GetComponent <CUIListScript>(); this.tasklistScript_usual = this.m_CUIForm.GetWidget(3).GetComponent <CUIListScript>(); this.tasklistScript_mishu = this.m_CUIForm.GetWidget(4).GetComponent <CUIListScript>(); this.tasklistScript_iwantgold = this.m_CUIForm.GetWidget(18).GetComponent <CUIListScript>(); this.m_mainTaskNode = this.m_CUIForm.transform.Find("node/list_node_main").gameObject; this.m_unlockNode = this.m_CUIForm.transform.Find("node/list_node_main/unlock_node").gameObject; this.m_levelRewardNode = this.m_CUIForm.transform.Find("node/list_node_main/reward_node").gameObject; this.m_levelRewardList = this.m_CUIForm.transform.Find("node/list_node_main/levelList").GetComponent <CUIListScript>(); this.m_unlockInfoTxt = this.m_CUIForm.transform.Find("node/list_node_main/unlock_node/Text").GetComponent <Text>(); this.m_levelRewardText = this.m_CUIForm.transform.Find("node/list_node_main/reward_node/Text").GetComponent <Text>(); this.m_normalTaskNode = this.m_CUIForm.transform.Find("node/list_node_main/task_node/normal").gameObject; this.m_emptyTaskNode = this.m_CUIForm.transform.Find("node/list_node_main/task_node/noTask").gameObject; this.m_taskNode0 = this.m_CUIForm.transform.Find("node/list_node_main/task_node/normal/task_0").gameObject; this.m_taskNode1 = this.m_CUIForm.transform.Find("node/list_node_main/task_node/normal/task_1").gameObject; this.jumpRewardGameObject = this.m_CUIForm.transform.Find("node/list_node_main/levelList/goto_btn").gameObject; DebugHelper.Assert(this.m_mainTaskNode != null, "ctaskview m_mainTaskNode == null"); DebugHelper.Assert(this.m_unlockNode != null, "ctaskview m_unlockNode == null"); DebugHelper.Assert(this.m_levelRewardNode != null, "ctaskview m_levelRewardNode == null"); DebugHelper.Assert(this.m_levelRewardList != null, "ctaskview m_levelRewardList == null"); DebugHelper.Assert(this.m_unlockInfoTxt != null, "ctaskview m_unlockInfoTxt == null"); DebugHelper.Assert(this.m_levelRewardText != null, "ctaskview m_levelRewardText == null"); DebugHelper.Assert(this.m_normalTaskNode != null, "ctaskview m_normalTaskNode == null"); DebugHelper.Assert(this.m_emptyTaskNode != null, "ctaskview m_emptyTaskNode == null"); DebugHelper.Assert(this.m_taskNode0 != null, "ctaskview m_taskNode0 == null"); DebugHelper.Assert(this.m_taskNode1 != null, "ctaskview m_taskNode1 == null"); DebugHelper.Assert(this.m_taskNode1 != null, "ctaskview jumpRewardGameObject == null"); CTaskModel model = Singleton <CTaskSys> .get_instance().model; string[] array = new string[] { model.Daily_Quest_Career, model.Daily_Quest_NeedGrowing, model.Daily_Quest_NeedMoney, model.Daily_Quest_NeedSeal, model.Daily_Quest_NeedHero }; this.tablistScript.SetElementAmount(array.Length); for (int i = 0; i < this.tablistScript.m_elementAmount; i++) { CUIListElementScript elemenet = this.tablistScript.GetElemenet(i); Text component = elemenet.gameObject.transform.FindChild("Text").GetComponent <Text>(); component.text = array[i]; } this.tablistScript.m_alwaysDispatchSelectedChangeEvent = true; this.tablistScript.SelectElement(uiEvent.m_eventParams.tag, true); this.tablistScript.m_alwaysDispatchSelectedChangeEvent = false; this.week_huoyue_text = this.m_CUIForm.GetWidget(5).GetComponent <Text>(); this.week_node1 = this.m_CUIForm.GetWidget(6); this.week_node2 = this.m_CUIForm.GetWidget(7); this.m_container = this.m_CUIForm.GetWidget(8).GetComponent <CUIContainerScript>(); this.day_progress_bg = this.m_CUIForm.GetWidget(9).GetComponent <Image>(); this.day_progress = this.m_CUIForm.GetWidget(10).GetComponent <Image>(); this.day_huoyue_txt = this.m_CUIForm.GetWidget(11).GetComponent <Text>(); this.Refresh_Tab_RedPoint(); this._init_day_huoyue(); this.Refresh_Huoyue(); CTaskModel model2 = Singleton <CTaskSys> .get_instance().model; if (model2.curLevelRewardData == null) { uint pvpLevel = Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo().PvpLevel; model2.curLevelRewardData = model2.GetLevelRewardData((int)pvpLevel); } }
protected override void Update() { if (base.isInitialize) { base.Update(); } else { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CHeroSelectNormalSystem.s_heroSelectFormPath); if (form != null) { int index = base.currentConf.Param[0]; bool flag = base.currentConf.Param[1] > 0; if (base.currentConf.Param[2] > 0) { uint heroID = base.currentConf.Param[0]; index = Singleton <CHeroSelectBaseSystem> .instance.GetCanUseHeroIndex(heroID); } string name = "PanelLeft/ListHostHeroInfo"; if (flag) { name = "PanelLeft/ListHostHeroInfoFull"; } Transform transform = form.transform.FindChild(name); if (transform != null) { CUIListScript component = transform.gameObject.GetComponent <CUIListScript>(); if (component != null) { CUIListElementScript elemenet = component.GetElemenet(index); if (elemenet != null) { Transform transform2 = elemenet.transform.Find("heroItemCell"); if (transform2 != null) { GameObject gameObject = transform2.gameObject; if (gameObject.activeInHierarchy) { CUIEventScript script4 = gameObject.GetComponent <CUIEventScript>(); if ((script4 != null) && !script4.enabled) { this.CompleteHandler(); } else { base.AddHighLightGameObject(gameObject, true, form, true); base.Initialize(); } } } } else { this.CompleteHandler(); } } } } } }