public void ShowInviteButton(bool isShow, bool isEnable) { if (this.reCallButton != null) { if (CSysDynamicBlock.bFriendBlocked) { this.reCallButton.gameObject.CustomSetActive(false); } else if (!isShow) { this.reCallButton.gameObject.CustomSetActive(false); } else { if (this.reCallText != null) { if (isEnable) { this.reCallText.text = Singleton <CTextManager> .instance.GetText("Friend_ReCall_Tips_1"); } else { this.reCallText.text = Singleton <CTextManager> .instance.GetText("Friend_ReCall_Tips_2"); } } this.reCallButton.gameObject.CustomSetActive(true); if (this.reCallBtn_eventScript != null) { this.reCallBtn_eventScript.SetUIEvent(enUIEventType.Click, enUIEventID.Friend_SNS_ReCall); } CUICommonSystem.SetButtonEnable(this.reCallButton, isEnable, isEnable, true); } } }
private void ValidateTimerState() { this._passedTimeTxt.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("PauseTimeFormate"), this._passedSecond / 60, this._passedSecond % 60); bool flag = this._waitResumeSecond >= 0; if (flag) { string text = Singleton <CTextManager> .GetInstance().GetText("ResumeGame"); if (this._waitResumeSecond > 0) { this._resumeTimerTxt.text = string.Concat(new object[] { text, "(", this._waitResumeSecond, ")" }); } else { this._resumeTimerTxt.text = text; } bool flag2 = this._waitResumeSecond == 0; CUICommonSystem.SetButtonEnable(this._resumeButton, flag2, flag2, true); this._resumeButton.gameObject.CustomSetActive(true); } else { this._resumeButton.gameObject.CustomSetActive(false); } }
private static void SetStartBtnEnable(GameObject Start, List <uint> heros) { Button component = Start.GetComponent <Button>(); bool flag = heros != null && heros.get_Count() > 0; CUICommonSystem.SetButtonEnable(component, flag, flag, true); component.interactable = flag; }
private static void SetStartBtnEnable(GameObject Start, List <uint> heros) { Button component = Start.GetComponent <Button>(); bool isEnable = (heros != null) && (heros.Count > 0); CUICommonSystem.SetButtonEnable(component, isEnable, isEnable, true); component.interactable = isEnable; }
public void ShowSendButton(bool bEnable) { if ((this.sendHeartButton != null) && (this.sendHeartButton.gameObject != null)) { CUICommonSystem.SetButtonEnable(this.sendHeartButton, bEnable, bEnable, true); this.sendHeartButton.gameObject.CustomSetActive(true); this.sendHeartButton.transform.Find("Text").GetComponent <Text>().text = Singleton <CTextManager> .instance.GetText(!bEnable? "Have_Send" : "Send_Coin"); } }
public static void ShowLBSUserData(CSDT_LBS_USER_INFO info, FriendShower com) { if (com == null) { return; } com.ullUid = info.stLbsUserInfo.stUin.ullUid; com.dwLogicWorldID = info.stLbsUserInfo.stUin.dwLogicWorldId; if (info.stLbsUserInfo.szHeadUrl != null) { string url = UT.Bytes2String(info.stLbsUserInfo.szHeadUrl); com.HttpImage.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url)); } if (com.nobeIcon) { MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(com.nobeIcon.GetComponent <Image>(), (int)info.stLbsUserInfo.stGameVip.dwCurLevel, false); } if (com.HeadIconBack) { MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(com.HeadIconBack.GetComponent <Image>(), (int)info.stLbsUserInfo.stGameVip.dwHeadIconId); } if (com.QQVipImage) { MonoSingleton <NobeSys> .GetInstance().SetOtherQQVipHead(com.QQVipImage.GetComponent <Image>(), (int)info.stLbsUserInfo.dwQQVIPMask); } com.intimacyNode.CustomSetActive(false); com.SetFriendItemType(FriendShower.ItemType.LBS, true); com.ShowName(UT.Bytes2String(info.stLbsUserInfo.szUserName)); com.ShowLevel(info.stLbsUserInfo.dwPvpLvl); com.ShowLastTime(true, UT.GetTimeString(info.stLbsUserInfo.dwLastLoginTime)); com.ShowGenderType(info.stLbsUserInfo.bGender); com.ShowDistance(UT.GetDistance(info.dwDistance)); com.SetBGray(info.stLbsUserInfo.bIsOnline != 1); if (com.platChannelIcon != null) { com.platChannelIcon.CustomSetActive(false); } if (com.lbsAddFriendBtn != null) { CFriendModel model = Singleton <CFriendContoller> .get_instance().model; if (model.IsSnsFriend(com.ullUid, com.dwLogicWorldID) || model.IsGameFriend(com.ullUid, com.dwLogicWorldID)) { CUICommonSystem.SetButtonEnable(com.lbsAddFriendBtn, false, false, true); } else { CUICommonSystem.SetButtonEnable(com.lbsAddFriendBtn, true, true, true); } } GameObject gameObject = com.gameObject.transform.Find("body/LBS/Rank").gameObject; GameObject gameObject2 = com.gameObject.transform.Find("body/LBS/HisRank").gameObject; UT.ShowRank(com.formScript, gameObject, info.bGradeOfRank, info.stLbsUserInfo.dwRankClass); UT.ShowRank(com.formScript, gameObject2, info.bMaxGradeOfRank, info.stLbsUserInfo.dwRankClass); }
private void UpdateCheckView() { if (this._curActivity != null) { ListView <ActivityPhase> phaseList = this._curActivity.PhaseList; Transform transform = this._form.gameObject.transform.FindChild("Panel/ItemContainer"); bool flag = false; for (int i = 0; i < phaseList.get_Count(); i++) { CheckInPhase checkInPhase = phaseList.get_Item(i) as CheckInPhase; bool marked = checkInPhase.Marked; bool readyForGet = checkInPhase.ReadyForGet; if (readyForGet) { this._availablePhase = checkInPhase; } uint gameVipDoubleLv = checkInPhase.GetGameVipDoubleLv(); CUseable useable = checkInPhase.GetUseable(0); if (useable != null) { GameObject gameObject = transform.FindChild(string.Format("itemCell{0}", i + 1)).gameObject; if (gameObject != null) { this.SetItem(useable, gameObject, marked, readyForGet, gameVipDoubleLv); } } if (!flag && readyForGet) { flag = true; } } Transform transform2 = this._form.gameObject.transform.FindChild("Panel/BtnCheck"); CUICommonSystem.SetButtonEnable(transform2.GetComponent <Button>(), flag, flag, true); Transform transform3 = this._form.gameObject.transform.FindChild("Panel/MeinvPic"); MonoSingleton <BannerImageSys> .GetInstance().TrySetCheckInImage(transform3.gameObject.GetComponent <Image>()); Transform transform4 = this._form.gameObject.transform.FindChild("Panel/Title/Text"); transform4.gameObject.GetComponent <Text>().text = Singleton <CTextManager> .get_instance().GetText("SevenCheckIn_Title"); Text component = this._form.gameObject.transform.FindChild("Panel/Desc").gameObject.GetComponent <Text>(); component.text = Singleton <CTextManager> .get_instance().GetText("SevenCheckIn_Desc"); DateTime dateTime = Utility.ToUtcTime2Local(this._curActivity.StartTime); DateTime dateTime2 = Utility.ToUtcTime2Local(this._curActivity.CloseTime); string text = string.Format("{0}.{1}.{2}", dateTime.get_Year(), dateTime.get_Month(), dateTime.get_Day()); string text2 = string.Format("{0}.{1}.{2}", dateTime2.get_Year(), dateTime2.get_Month(), dateTime2.get_Day()); string text3 = Singleton <CTextManager> .get_instance().GetText("SevenCheckIn_Date", new string[] { text, text2 }); Text component2 = this._form.gameObject.transform.FindChild("Panel/Date").gameObject.GetComponent <Text>(); component2.text = text3; } }
public void Validate() { if ((this.phase != null) && (this.uiItem != null)) { this.uiItem.CustomSetActive(true); ResDT_PointExchange config = this.phase.Config; PointsExchangeActivity owner = this.phase.Owner as PointsExchangeActivity; if ((owner != null) && (owner.PointsConfig != null)) { ResWealPointExchange pointsConfig = owner.PointsConfig; GameObject gameObject = this.uiItem.transform.FindChild("DuihuanBtn").gameObject; gameObject.GetComponent <CUIEventScript>().m_onClickEventParams.commonUInt32Param1 = (uint)this.index; uint maxExchangeCount = owner.GetMaxExchangeCount(this.index); uint exchangeCount = owner.GetExchangeCount(this.index); uint dwPointCnt = config.dwPointCnt; uint jiFen = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().JiFen; bool isEnable = (jiFen >= dwPointCnt) && ((maxExchangeCount == 0) || (exchangeCount < maxExchangeCount)); if (this.owner.view.activity.timeState != Activity.TimeState.Going) { CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), false, false, true); } else { CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), isEnable, isEnable, true); } CUseable itemUseable = CUseableManager.CreateVirtualUseable(enVirtualItemType.enDianJuanJiFen, 1); GameObject itemCell = this.uiItem.transform.FindChild("Panel/PointsCell").gameObject; CUICommonSystem.SetItemCell(this.owner.view.form.formScript, itemCell, itemUseable, true, false); CUseable useable2 = CUseableManager.CreateUseable((COM_ITEM_TYPE)config.wResItemType, config.dwResItemID, config.wResItemCnt); GameObject obj4 = this.uiItem.transform.FindChild("Panel/GetItemCell").gameObject; CUICommonSystem.SetItemCell(this.owner.view.form.formScript, obj4, useable2, true, false); Text component = this.uiItem.transform.FindChild("Panel/PointsCell/ItemCount").gameObject.GetComponent <Text>(); if (jiFen < config.dwPointCnt) { component.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemNotEnoughCount"), jiFen, dwPointCnt); CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), false, false, true); } else { component.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemCount"), jiFen, dwPointCnt); } GameObject obj5 = this.uiItem.transform.FindChild("ExchangeCount").gameObject; if (maxExchangeCount > 0) { obj5.CustomSetActive(true); obj5.GetComponent <Text>().text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_TimeLimit"), exchangeCount, maxExchangeCount); } else { obj5.CustomSetActive(false); } } } }
public static void SetComEnable(bool enable) { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CRoomSystem.PATH_ROOM); if ((form != null) && (form.gameObject != null)) { Button componetInChild = Utility.GetComponetInChild <Button>(form.gameObject, "Panel_Main/bg1/LeftRobot"); Button btn = Utility.GetComponetInChild <Button>(form.gameObject, "Panel_Main/bg2/RightRobot"); CUICommonSystem.SetButtonEnable(componetInChild, enable, enable, true); CUICommonSystem.SetButtonEnable(btn, enable, enable, true); } }
public void ShowSendButton(bool bEnable) { if (this.SendCoin != null) { Button component = this.SendCoin.GetComponent <Button>(); if (component != null) { component.gameObject.CustomSetActive(true); CUICommonSystem.SetButtonEnable(component, bEnable, bEnable, true); component.transform.Find("Text").GetComponent <Text>().text = Singleton <CTextManager> .instance.GetText(!bEnable? "Have_Send" : "Send_Coin"); } } }
public void SyncLBSShareBtnState() { bool enableShareLocation = Singleton <CFriendContoller> .instance.model.EnableShareLocation; if (this.lbsRefreshBtn != null) { CUICommonSystem.SetButtonEnable(this.lbsRefreshBtn, enableShareLocation, enableShareLocation, true); } if (this.localtionToggle != null) { this.localtionToggle.isOn = enableShareLocation; } }
public void OnLoginOpen(CUIEvent uiEvent) { this.m_SelectIDx = 0; if (uiEvent == null) { this.m_bOpenLink = false; } else { this.m_bOpenLink = true; } if (this._form == null) { bool flag = false; ListView <Activity> activityList = Singleton <ActivitySys> .GetInstance().GetActivityList((Activity actv) => actv.Entrance == RES_WEAL_ENTRANCE_TYPE.RES_WEAL_ENTRANCE_TYPE_14CHECK); if (activityList != null && activityList.Count > 0) { this._curActivity = (CheckInActivity)activityList[0]; ListView <ActivityPhase> phaseList = this._curActivity.PhaseList; for (int i = 0; i < phaseList.Count; i++) { if (phaseList[i].ReadyForGet) { this.m_SelectIDx = i; flag = true; break; } } if (flag || this.m_bOpenLink) { this._curActivity.OnMaskStateChange += new Activity.ActivityEvent(this.ActivityEvent); this._curActivity.OnTimeStateChange += new Activity.ActivityEvent(this.ActivityEvent); this._form = Singleton <CUIManager> .GetInstance().OpenForm(this.FormName, false, true); this.InitUI(); this.InitLeftUI(); if (this._form != null) { Transform transform = this._form.gameObject.transform.FindChild("Panel/BtnCheck"); CUICommonSystem.SetButtonEnable(transform.GetComponent <Button>(), flag, flag, true); } } else { this._curActivity = null; } } } }
private static void SetMopupTenEnable(GameObject Mopup, byte StarBitsMask, RES_LEVEL_DIFFICULTY_TYPE difficulty, int LeftPlayNum) { Button component = Mopup.GetComponent <Button>(); CUIEventScript component2 = component.gameObject.GetComponent <CUIEventScript>(); stUIEventParams onClickEventParams = default(stUIEventParams); bool isEnable; if (difficulty == 1) { Text componetInChild = Utility.GetComponetInChild <Text>(Mopup, "Text"); componetInChild.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", new string[] { "10" }); isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL && CAdventureView.isVip()); onClickEventParams.tag = 10; component2.m_onClickEventParams = onClickEventParams; } else { if (difficulty != 2) { DebugHelper.Assert(false, "Invalid difficulty -- {0}", new object[] { difficulty }); return; } Text componetInChild2 = Utility.GetComponetInChild <Text>(Mopup, "Text"); if (LeftPlayNum > 0) { componetInChild2.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", new string[] { LeftPlayNum.ToString() }); } else { componetInChild2.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Can_Not_Sweep"); } isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL && CAdventureView.isVip() && LeftPlayNum > 0); onClickEventParams.tag = LeftPlayNum; component2.m_onClickEventParams = onClickEventParams; } CUICommonSystem.SetButtonEnable(component, isEnable, true, true); }
public void OnTalent_ItemClick(CUIEvent uiEvent) { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(s_TalentFormPath); if (form != null) { CUIListScript[] scriptArray = new CUIListScript[] { form.gameObject.transform.Find("Panel/PanelLeft/List1").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List2").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List3").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List4").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List5").GetComponent <CUIListScript>() }; CUIListScript srcWidgetBelongedListScript = uiEvent.m_srcWidgetBelongedListScript; stTalentEventParams talentParams = uiEvent.m_eventParams.talentParams; if ((uiEvent.m_srcWidgetIndexInBelongedList != -1) && (talentParams.talentInfo != null)) { for (int i = 0; i < scriptArray.Length; i++) { if (scriptArray[i] != srcWidgetBelongedListScript) { CUIListElementScript lastSelectedElement = scriptArray[i].GetLastSelectedElement(); if (lastSelectedElement != null) { lastSelectedElement.ChangeDisplay(false); } scriptArray[i].SelectElement(-1, true); } } GameObject gameObject = form.gameObject.transform.Find("Panel/PanelRight").gameObject; Image component = form.gameObject.transform.Find("Panel/PanelRight/talentCell/imgIcon").GetComponent <Image>(); Text text = form.gameObject.transform.Find("Panel/PanelRight/lblDesc").GetComponent <Text>(); Button btn = form.gameObject.transform.Find("Panel/PanelRight/btnLearn").GetComponent <Button>(); component.SetSprite(CUIUtility.s_Sprite_Dynamic_Talent_Dir + talentParams.talentInfo.dwIcon, form, true, false, false); text.text = StringHelper.UTF8BytesToString(ref talentParams.talentInfo.szDesc); if (!talentParams.isCanLearn && !talentParams.isHaveTalent) { text.text = Singleton <CTextManager> .instance.GetText("Talent_Buy_1"); } btn.gameObject.CustomSetActive(true); if (talentParams.isCanLearn) { CUICommonSystem.SetButtonEnable(btn, true, true, true); btn.gameObject.transform.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Talent_BtnLearnClick, uiEvent.m_eventParams); } else { CUICommonSystem.SetButtonEnable(btn, false, false, true); } gameObject.CustomSetActive(true); } } }
public void ShowRecommendGuild(bool isShow, bool isEnabled) { if (this.inviteGuildButton != null) { if (CSysDynamicBlock.bFriendBlocked && this.inviteGuildButton.gameObject.activeSelf) { this.inviteGuildButton.gameObject.SetActive(false); } else if (!isShow) { if (this.inviteGuildButton.gameObject.activeSelf) { this.inviteGuildButton.gameObject.CustomSetActive(false); } } else { if (!this.inviteGuildButton.gameObject.activeSelf) { this.inviteGuildButton.gameObject.CustomSetActive(true); } if (this.inviteGuildBtn_eventScript != null) { this.inviteGuildBtn_eventScript.SetUIEvent(enUIEventType.Click, enUIEventID.Friend_RecommendGuild); } if (isEnabled) { CUICommonSystem.SetButtonEnable(this.inviteGuildButton, true, true, true); if (this.inviteGuildBtnText != null) { this.inviteGuildBtnText.text = Singleton <CFriendContoller> .instance.model.Guild_Recommend_txt; } } else { CUICommonSystem.SetButtonEnable(this.inviteGuildButton, false, false, true); if (this.inviteGuildBtnText != null) { this.inviteGuildBtnText.text = Singleton <CFriendContoller> .instance.model.Guild_Has_Recommended_txt; } } } } }
private static void SetMopupEnable(GameObject Mopup, byte StarBitsMask, RES_LEVEL_DIFFICULTY_TYPE difficulty, int LeftPlayNum) { Button component = Mopup.GetComponent <Button>(); bool isEnable = false; if (difficulty == RES_LEVEL_DIFFICULTY_TYPE.RES_LEVEL_DIFFICULTY_TYPE_NORMAL) { isEnable = CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL; } else if (difficulty == RES_LEVEL_DIFFICULTY_TYPE.RES_LEVEL_DIFFICULTY_TYPE_NIGHTMARE) { isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL) && (LeftPlayNum > 0); } else { object[] inParameters = new object[] { difficulty }; DebugHelper.Assert(false, "Invalid difficulty -- {0}", inParameters); return; } CUICommonSystem.SetButtonEnable(component, isEnable, true, true); }
private static void SetMopupTenEnable(GameObject Mopup, byte StarBitsMask, RES_LEVEL_DIFFICULTY_TYPE difficulty, int LeftPlayNum) { Button component = Mopup.GetComponent <Button>(); bool isEnable = false; CUIEventScript script = component.gameObject.GetComponent <CUIEventScript>(); stUIEventParams @params = new stUIEventParams(); if (difficulty == RES_LEVEL_DIFFICULTY_TYPE.RES_LEVEL_DIFFICULTY_TYPE_NORMAL) { string[] args = new string[] { "10" }; Utility.GetComponetInChild <Text>(Mopup, "Text").text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", args); isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL) && isVip(); @params.tag = 10; script.m_onClickEventParams = @params; } else if (difficulty == RES_LEVEL_DIFFICULTY_TYPE.RES_LEVEL_DIFFICULTY_TYPE_NIGHTMARE) { Text componetInChild = Utility.GetComponetInChild <Text>(Mopup, "Text"); if (LeftPlayNum > 0) { string[] textArray2 = new string[] { LeftPlayNum.ToString() }; componetInChild.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", textArray2); } else { componetInChild.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Can_Not_Sweep"); } isEnable = ((CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL) && isVip()) && (LeftPlayNum > 0); @params.tag = LeftPlayNum; script.m_onClickEventParams = @params; } else { object[] inParameters = new object[] { difficulty }; DebugHelper.Assert(false, "Invalid difficulty -- {0}", inParameters); return; } CUICommonSystem.SetButtonEnable(component, isEnable, true, true); }
private static void SetMopupEnable(GameObject Mopup, byte StarBitsMask, RES_LEVEL_DIFFICULTY_TYPE difficulty, int LeftPlayNum) { Button component = Mopup.GetComponent <Button>(); bool isEnable; if (difficulty == 1) { isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL); } else { if (difficulty != 2) { DebugHelper.Assert(false, "Invalid difficulty -- {0}", new object[] { difficulty }); return; } isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL && LeftPlayNum > 0); } CUICommonSystem.SetButtonEnable(component, isEnable, true, true); }
private void OnSurrenderCDReady(CUIEvent uiEvent) { if (Singleton <BattleLogic> .instance.isRuning && (this._form != null)) { GameObject widget = this._form.GetWidget(0x1a); if (widget != null) { GameObject p = Utility.FindChild(widget, "Button_Surrender"); if (p != null) { Button component = p.GetComponent <Button>(); if (component != null) { GameObject obj4 = Utility.FindChild(p, "CountDown"); if (obj4 != null) { obj4.CustomSetActive(false); CUICommonSystem.SetButtonEnable(component, true, true, true); } } } } } }
public void Validate() { if ((this.phase != null) && (this.uiItem != null)) { this.uiItem.CustomSetActive(true); ResDT_Item_Info info = null; ResDT_Item_Info info2 = null; ResDT_Item_Info stResItemInfo = null; stResItemInfo = this.phase.Config.stResItemInfo; if (this.phase.Config.bColItemCnt > 0) { info = this.phase.Config.astColItemInfo[0]; } if (this.phase.Config.bColItemCnt > 1) { info2 = this.phase.Config.astColItemInfo[1]; } CUseableContainer useableContainer = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().GetUseableContainer(enCONTAINER_TYPE.ITEM); if (useableContainer != null) { int num = (info != null) ? useableContainer.GetUseableStackCount((COM_ITEM_TYPE)info.wItemType, info.dwItemID) : 0; int num2 = (info2 != null) ? useableContainer.GetUseableStackCount((COM_ITEM_TYPE)info2.wItemType, info2.dwItemID) : 0; if (stResItemInfo != null) { GameObject gameObject = this.uiItem.transform.FindChild("DuihuanBtn").gameObject; gameObject.GetComponent <CUIEventScript>().m_onClickEventParams.commonUInt32Param1 = (uint)this.index; bool isEnable = this.owner.view.activity.timeState == Activity.TimeState.Going; CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), isEnable, isEnable, true); if (info != null) { CUseable useable2 = CUseableManager.CreateUseable((COM_ITEM_TYPE)info.wItemType, info.dwItemID, 1); GameObject obj3 = this.uiItem.transform.FindChild("Panel/ItemCell1").gameObject; CUICommonSystem.SetItemCell(this.owner.view.form.formScript, obj3, useable2, true, false); int useableStackCount = useableContainer.GetUseableStackCount((COM_ITEM_TYPE)info.wItemType, info.dwItemID); ushort wItemCnt = info.wItemCnt; Text component = this.uiItem.transform.FindChild("Panel/ItemCell1/ItemCount").gameObject.GetComponent <Text>(); if (useableStackCount < wItemCnt) { component.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemNotEnoughCount"), useableStackCount, wItemCnt); CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), false, false, true); } else { component.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemCount"), useableStackCount, wItemCnt); } } if (info2 != null) { CUseable useable3 = CUseableManager.CreateUseable((COM_ITEM_TYPE)info2.wItemType, info2.dwItemID, 1); GameObject obj4 = this.uiItem.transform.FindChild("Panel/ItemCell2").gameObject; obj4.CustomSetActive(true); CUICommonSystem.SetItemCell(this.owner.view.form.formScript, obj4, useable3, true, false); int num5 = useableContainer.GetUseableStackCount((COM_ITEM_TYPE)info2.wItemType, info2.dwItemID); ushort num6 = info2.wItemCnt; Text text2 = this.uiItem.transform.FindChild("Panel/ItemCell2/ItemCount").gameObject.GetComponent <Text>(); if (num5 < num6) { text2.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemNotEnoughCount"), num5, num6); CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), false, false, true); } else { text2.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemCount"), num5, num6); } } else { this.uiItem.transform.FindChild("Panel/ItemCell2").gameObject.CustomSetActive(false); this.uiItem.transform.FindChild("Panel/Add").gameObject.CustomSetActive(false); } CUseable itemUseable = CUseableManager.CreateUseable((COM_ITEM_TYPE)stResItemInfo.wItemType, stResItemInfo.dwItemID, stResItemInfo.wItemCnt); GameObject itemCell = this.uiItem.transform.FindChild("Panel/GetItemCell").gameObject; CUICommonSystem.SetItemCell(this.owner.view.form.formScript, itemCell, itemUseable, true, false); ExchangeActivity activity = this.owner.view.activity as ExchangeActivity; if (activity != null) { GameObject obj8 = this.uiItem.transform.FindChild("ExchangeCount").gameObject; uint maxExchangeCount = activity.GetMaxExchangeCount(this.phase.Config.bIdx); uint exchangeCount = activity.GetExchangeCount(this.phase.Config.bIdx); if (maxExchangeCount > 0) { obj8.CustomSetActive(true); obj8.GetComponent <Text>().text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_TimeLimit"), exchangeCount, maxExchangeCount); if (exchangeCount >= maxExchangeCount) { CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), false, false, true); } } else { obj8.CustomSetActive(false); } } } } } }
private void UpdateOneElement(int index) { ListView <ActivityPhase> phaseList = base.view.activity.PhaseList; if ((index < phaseList.Count) && (this._elementsGo != null)) { ExchangePhase phase = phaseList[index] as ExchangePhase; GameObject obj2 = null; bool flag = this._elementsGo.TryGetValue(index, out obj2); if ((phase != null) && (obj2 != null)) { obj2.CustomSetActive(true); ResDT_Item_Info info = null; ResDT_Item_Info info2 = null; ResDT_Item_Info stResItemInfo = null; stResItemInfo = phase.Config.stResItemInfo; if (phase.Config.bColItemCnt > 0) { info = phase.Config.astColItemInfo[0]; } if (phase.Config.bColItemCnt > 1) { info2 = phase.Config.astColItemInfo[1]; } CUseableContainer useableContainer = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().GetUseableContainer(enCONTAINER_TYPE.ITEM); if (useableContainer != null) { int num = (info != null) ? useableContainer.GetUseableStackCount((COM_ITEM_TYPE)info.wItemType, info.dwItemID) : 0; int num2 = (info2 != null) ? useableContainer.GetUseableStackCount((COM_ITEM_TYPE)info2.wItemType, info2.dwItemID) : 0; if (stResItemInfo != null) { GameObject gameObject = obj2.transform.FindChild("DuihuanBtn").gameObject; gameObject.GetComponent <CUIEventScript>().m_onClickEventParams.commonUInt64Param1 = phase.Config.bIdx; if (base.view.activity.timeState == Activity.TimeState.Close) { CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), false, false, true); } if (info != null) { CUseable useable2 = CUseableManager.CreateUseable((COM_ITEM_TYPE)info.wItemType, info.dwItemID, 1); GameObject obj4 = obj2.transform.FindChild("Panel/ItemCell1").gameObject; CUICommonSystem.SetItemCell(base.view.form.formScript, obj4, useable2, true, false); int useableStackCount = useableContainer.GetUseableStackCount((COM_ITEM_TYPE)info.wItemType, info.dwItemID); ushort wItemCnt = info.wItemCnt; Text component = obj2.transform.FindChild("Panel/ItemCell1/ItemCount").gameObject.GetComponent <Text>(); if (useableStackCount < wItemCnt) { component.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemNotEnoughCount"), useableStackCount, wItemCnt); CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), false, false, true); } else { component.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemCount"), useableStackCount, wItemCnt); } } if (info2 != null) { CUseable useable3 = CUseableManager.CreateUseable((COM_ITEM_TYPE)info2.wItemType, info2.dwItemID, 1); GameObject obj5 = obj2.transform.FindChild("Panel/ItemCell2").gameObject; obj5.CustomSetActive(true); CUICommonSystem.SetItemCell(base.view.form.formScript, obj5, useable3, true, false); int num5 = useableContainer.GetUseableStackCount((COM_ITEM_TYPE)info2.wItemType, info2.dwItemID); ushort num6 = info2.wItemCnt; Text text2 = obj2.transform.FindChild("Panel/ItemCell2/ItemCount").gameObject.GetComponent <Text>(); if (num5 < num6) { text2.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemNotEnoughCount"), num5, num6); CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), false, false, true); } else { text2.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemCount"), num5, num6); } } else { obj2.transform.FindChild("Panel/ItemCell2").gameObject.CustomSetActive(false); obj2.transform.FindChild("Panel/Add").gameObject.CustomSetActive(false); } CUseable itemUseable = CUseableManager.CreateUseable((COM_ITEM_TYPE)stResItemInfo.wItemType, stResItemInfo.dwItemID, 1); GameObject itemCell = obj2.transform.FindChild("Panel/GetItemCell").gameObject; CUICommonSystem.SetItemCell(base.view.form.formScript, itemCell, itemUseable, true, false); ExchangeActivity activity = base.view.activity as ExchangeActivity; if (activity != null) { GameObject obj9 = obj2.transform.FindChild("ExchangeCount").gameObject; uint maxExchangeCount = activity.GetMaxExchangeCount(phase.Config.bIdx); uint exchangeCount = activity.GetExchangeCount(phase.Config.bIdx); if (maxExchangeCount > 0) { obj9.CustomSetActive(true); obj9.GetComponent <Text>().text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_TimeLimit"), exchangeCount, maxExchangeCount); if (exchangeCount >= maxExchangeCount) { CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), false, false, true); } } else { obj9.CustomSetActive(false); } } } } } } }
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); } } }
public void UpdateSelectedHonor(CUIFormScript form, COMDT_HONORINFO honorInfo) { CTextManager instance = Singleton <CTextManager> .GetInstance(); string text = instance.GetText("Player_Info_Honor_Btn_Using"); string text2 = instance.GetText("Player_Info_Honor_Btn_Use"); string text3 = instance.GetText("Player_Info_Honor_Btn_Browse"); GameObject widget = form.GetWidget(9); if (widget == null) { return; } Transform transform = form.transform.Find("pnlBg/pnlBody/pnlHonorInfo/pnlContainer/SelectedHonor/Button"); Button button = (!(transform == null)) ? transform.GetComponent <Button>() : null; GameObject gameObject = Utility.FindChild(widget, "pnlHonorInfo/pnlContainer/SelectedHonor/CurrentHonor/normal"); GameObject gameObject2 = Utility.FindChild(widget, "pnlHonorInfo/pnlContainer/SelectedHonor/CurrentHonor/label"); GameObject gameObject3 = Utility.FindChild(widget, "pnlHonorInfo/pnlContainer/SelectedHonor/CurrentHonor/cnt"); GameObject gameObject4 = Utility.FindChild(widget, "pnlHonorInfo/pnlContainer/SelectedHonor/Text"); CPlayerProfile profile = Singleton <CPlayerInfoSystem> .GetInstance().GetProfile(); int selectedHonorId = profile.GetSelectedHonorId(); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); bool flag = true; if (masterRoleInfo != null && masterRoleInfo.playerUllUID != profile.m_uuid) { flag = false; } if (honorInfo == null) { honorInfo = new COMDT_HONORINFO(); if (button != null) { CUICommonSystem.SetButtonEnable(button, false, false, true); CUICommonSystem.SetButtonName(transform.gameObject, text2); } if (gameObject != null) { this.SetHonorImage(gameObject.transform, honorInfo); } if (gameObject2 != null) { this.SetHonorName(gameObject2.transform, honorInfo); } if (gameObject3 != null) { this.SetHonorPoint(gameObject3.transform, honorInfo); } if (gameObject4 != null) { this.SetHonorDesc(gameObject4.transform, honorInfo); } if (!flag && button != null) { CUICommonSystem.SetButtonEnable(button, false, false, true); CUICommonSystem.SetButtonName(transform.gameObject, text3); return; } return; } else { if (gameObject != null) { this.SetHonorImage(gameObject.transform, honorInfo); } if (gameObject2 != null) { this.SetHonorName(gameObject2.transform, honorInfo); } if (gameObject3 != null) { this.SetHonorPoint(gameObject3.transform, honorInfo); } if (gameObject4 != null) { this.SetHonorDesc(gameObject4.transform, honorInfo); } if (!flag && button != null) { CUICommonSystem.SetButtonEnable(button, false, false, true); CUICommonSystem.SetButtonName(transform.gameObject, text3); return; } if (honorInfo.iHonorID == selectedHonorId && honorInfo.iHonorID != 0) { if (button != null) { CUICommonSystem.SetButtonEnable(button, false, false, true); CUICommonSystem.SetButtonName(transform.gameObject, text); } } else if (honorInfo.iHonorLevel <= 0) { if (button != null) { CUICommonSystem.SetButtonEnable(button, false, false, true); CUICommonSystem.SetButtonName(transform.gameObject, text2); } } else if (button != null) { CUICommonSystem.SetButtonEnable(button, true, true, true); CUICommonSystem.SetButtonName(transform.gameObject, text2); } return; } }
public void Validate() { if (this.phase == null || this.uiItem == null) { return; } this.uiItem.CustomSetActive(true); ResDT_PointExchange config = this.phase.Config; PointsExchangeActivity pointsExchangeActivity = this.phase.Owner as PointsExchangeActivity; if (pointsExchangeActivity == null || pointsExchangeActivity.PointsConfig == null) { return; } ResWealPointExchange pointsConfig = pointsExchangeActivity.PointsConfig; GameObject gameObject = this.uiItem.transform.FindChild("DuihuanBtn").gameObject; gameObject.GetComponent <CUIEventScript>().m_onClickEventParams.commonUInt32Param1 = (uint)this.index; uint maxExchangeCount = pointsExchangeActivity.GetMaxExchangeCount(this.index); uint exchangeCount = pointsExchangeActivity.GetExchangeCount(this.index); uint dwPointCnt = config.dwPointCnt; CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); uint jiFen = masterRoleInfo.JiFen; bool flag = jiFen >= dwPointCnt && (maxExchangeCount == 0u || exchangeCount < maxExchangeCount); if (this.owner.view.activity.timeState != Activity.TimeState.Going) { CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), false, false, true); } else { CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), flag, flag, true); } CUseable itemUseable = CUseableManager.CreateVirtualUseable(enVirtualItemType.enDianJuanJiFen, 1); GameObject gameObject2 = this.uiItem.transform.FindChild("Panel/PointsCell").gameObject; CUICommonSystem.SetItemCell(this.owner.view.form.formScript, gameObject2, itemUseable, true, false, false, false); CUseable cUseable = CUseableManager.CreateUseable(config.wResItemType, config.dwResItemID, (int)config.wResItemCnt); GameObject gameObject3 = this.uiItem.transform.FindChild("Panel/GetItemCell").gameObject; if (cUseable.m_type == 2) { CItem cItem = cUseable as CItem; if (cItem != null && cItem.m_itemData.bIsView > 0) { CUICommonSystem.SetItemCell(this.owner.view.form.formScript, gameObject3, cUseable, true, false, false, true); } else { CUICommonSystem.SetItemCell(this.owner.view.form.formScript, gameObject3, cUseable, true, false, false, false); if (gameObject3 != null) { CUIEventScript component = gameObject3.GetComponent <CUIEventScript>(); if (component != null) { component.SetUIEvent(enUIEventType.Click, enUIEventID.None); } } } } else { CUICommonSystem.SetItemCell(this.owner.view.form.formScript, gameObject3, cUseable, true, false, false, false); if (gameObject3 != null) { CUIEventScript component2 = gameObject3.GetComponent <CUIEventScript>(); if (component2 != null) { component2.SetUIEvent(enUIEventType.Click, enUIEventID.None); } } } bool bActive = false; if (cUseable.m_type == 4) { CHeroItem cHeroItem = (CHeroItem)cUseable; if (cHeroItem != null) { CRoleInfo masterRoleInfo2 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo2 != null) { bActive = masterRoleInfo2.IsHaveHero(cHeroItem.m_baseID, true); } } } else if (cUseable.m_type == 7) { CHeroSkin cHeroSkin = (CHeroSkin)cUseable; if (cHeroSkin != null) { CRoleInfo masterRoleInfo3 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo3 != null) { bActive = masterRoleInfo3.IsHaveHeroSkin(cHeroSkin.m_heroId, cHeroSkin.m_skinId, false); } } } Transform transform = this.uiItem.transform.FindChild("Panel/GetItemCell/HaveItemFlag"); if (transform != null && transform.gameObject != null) { transform.gameObject.CustomSetActive(bActive); } Text component3 = this.uiItem.transform.FindChild("Panel/PointsCell/ItemCount").gameObject.GetComponent <Text>(); if (jiFen < config.dwPointCnt) { component3.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemNotEnoughCount"), jiFen, dwPointCnt); CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), false, false, true); } else { component3.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemCount"), jiFen, dwPointCnt); } GameObject gameObject4 = this.uiItem.transform.FindChild("ExchangeCount").gameObject; if (maxExchangeCount > 0u) { gameObject4.CustomSetActive(true); gameObject4.GetComponent <Text>().text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_TimeLimit"), exchangeCount, maxExchangeCount); } else { gameObject4.CustomSetActive(false); } }
public void Validate() { if (this.phase == null || this.uiItem == null) { return; } this.uiItem.CustomSetActive(true); ResDT_Item_Info resDT_Item_Info = null; ResDT_Item_Info resDT_Item_Info2 = null; ResDT_Item_Info stResItemInfo = this.phase.Config.stResItemInfo; if (this.phase.Config.bColItemCnt > 0) { resDT_Item_Info = this.phase.Config.astColItemInfo[0]; } if (this.phase.Config.bColItemCnt > 1) { resDT_Item_Info2 = this.phase.Config.astColItemInfo[1]; } CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo(); CUseableContainer useableContainer = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM); if (useableContainer == null) { return; } int arg_CD_0 = (resDT_Item_Info != null) ? useableContainer.GetUseableStackCount(resDT_Item_Info.wItemType, resDT_Item_Info.dwItemID) : 0; int arg_EE_0 = (resDT_Item_Info2 != null) ? useableContainer.GetUseableStackCount(resDT_Item_Info2.wItemType, resDT_Item_Info2.dwItemID) : 0; if (stResItemInfo != null) { GameObject gameObject = this.uiItem.transform.FindChild("DuihuanBtn").gameObject; gameObject.GetComponent <CUIEventScript>().m_onClickEventParams.commonUInt32Param1 = (uint)this.index; bool flag = this.owner.view.activity.timeState == Activity.TimeState.Going; CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), flag, flag, true); if (resDT_Item_Info != null) { CUseable itemUseable = CUseableManager.CreateUseable(resDT_Item_Info.wItemType, resDT_Item_Info.dwItemID, 1); GameObject gameObject2 = this.uiItem.transform.FindChild("Panel/ItemCell1").gameObject; CUICommonSystem.SetItemCell(this.owner.view.form.formScript, gameObject2, itemUseable, true, false, false, false); int useableStackCount = useableContainer.GetUseableStackCount(resDT_Item_Info.wItemType, resDT_Item_Info.dwItemID); ushort wItemCnt = resDT_Item_Info.wItemCnt; Text component = this.uiItem.transform.FindChild("Panel/ItemCell1/ItemCount").gameObject.GetComponent <Text>(); if (useableStackCount < (int)wItemCnt) { component.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemNotEnoughCount"), useableStackCount, wItemCnt); CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), false, false, true); } else { component.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemCount"), useableStackCount, wItemCnt); } } if (resDT_Item_Info2 != null) { CUseable itemUseable2 = CUseableManager.CreateUseable(resDT_Item_Info2.wItemType, resDT_Item_Info2.dwItemID, 1); GameObject gameObject3 = this.uiItem.transform.FindChild("Panel/ItemCell2").gameObject; gameObject3.CustomSetActive(true); CUICommonSystem.SetItemCell(this.owner.view.form.formScript, gameObject3, itemUseable2, true, false, false, false); int useableStackCount2 = useableContainer.GetUseableStackCount(resDT_Item_Info2.wItemType, resDT_Item_Info2.dwItemID); ushort wItemCnt2 = resDT_Item_Info2.wItemCnt; Text component2 = this.uiItem.transform.FindChild("Panel/ItemCell2/ItemCount").gameObject.GetComponent <Text>(); if (useableStackCount2 < (int)wItemCnt2) { component2.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemNotEnoughCount"), useableStackCount2, wItemCnt2); CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), false, false, true); } else { component2.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemCount"), useableStackCount2, wItemCnt2); } } else { GameObject gameObject4 = this.uiItem.transform.FindChild("Panel/ItemCell2").gameObject; gameObject4.CustomSetActive(false); GameObject gameObject5 = this.uiItem.transform.FindChild("Panel/Add").gameObject; gameObject5.CustomSetActive(false); } CUseable cUseable = CUseableManager.CreateUseable(stResItemInfo.wItemType, stResItemInfo.dwItemID, (int)stResItemInfo.wItemCnt); GameObject gameObject6 = this.uiItem.transform.FindChild("Panel/GetItemCell").gameObject; bool bActive = false; if (cUseable.m_type == 4) { CHeroItem cHeroItem = (CHeroItem)cUseable; if (cHeroItem != null) { CRoleInfo masterRoleInfo2 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo2 != null) { bActive = masterRoleInfo2.IsHaveHero(cHeroItem.m_baseID, true); } } } else if (cUseable.m_type == 7) { CHeroSkin cHeroSkin = (CHeroSkin)cUseable; if (cHeroSkin != null) { CRoleInfo masterRoleInfo3 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo3 != null) { bActive = masterRoleInfo3.IsHaveHeroSkin(cHeroSkin.m_heroId, cHeroSkin.m_skinId, false); } } } Transform transform = this.uiItem.transform.FindChild("Panel/GetItemCell/HaveItemFlag"); if (transform != null && transform.gameObject != null) { transform.gameObject.CustomSetActive(bActive); } if (cUseable.m_type == 2) { CItem cItem = cUseable as CItem; if (cItem != null && cItem.m_itemData.bIsView > 0) { CUICommonSystem.SetItemCell(this.owner.view.form.formScript, gameObject6, cUseable, true, false, false, true); } else { CUICommonSystem.SetItemCell(this.owner.view.form.formScript, gameObject6, cUseable, true, false, false, false); if (gameObject6 != null) { CUIEventScript component3 = gameObject6.GetComponent <CUIEventScript>(); if (component3 != null) { component3.SetUIEvent(enUIEventType.Click, enUIEventID.None); } } } } else { CUICommonSystem.SetItemCell(this.owner.view.form.formScript, gameObject6, cUseable, true, false, false, false); if (gameObject6 != null) { CUIEventScript component4 = gameObject6.GetComponent <CUIEventScript>(); if (component4 != null) { component4.SetUIEvent(enUIEventType.Click, enUIEventID.None); } } } ExchangeActivity exchangeActivity = this.owner.view.activity as ExchangeActivity; if (exchangeActivity != null) { GameObject gameObject7 = this.uiItem.transform.FindChild("ExchangeCount").gameObject; uint maxExchangeCount = exchangeActivity.GetMaxExchangeCount((int)this.phase.Config.bIdx); uint exchangeCount = exchangeActivity.GetExchangeCount((int)this.phase.Config.bIdx); if (maxExchangeCount > 0u) { gameObject7.CustomSetActive(true); gameObject7.GetComponent <Text>().text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_TimeLimit"), exchangeCount, maxExchangeCount); if (exchangeCount >= maxExchangeCount) { CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), false, false, true); } } else { gameObject7.CustomSetActive(false); } } } }
private void initPanel(CUIFormScript form) { this.m_SliderMusic.initPanel(this._form.m_formWidgets[4], enSliderKind.Slider_Music); this.m_SliderSoundEffect.initPanel(this._form.m_formWidgets[5], enSliderKind.Slider_SoundEffect); this.m_SliderModelLOD.initPanel(this._form.m_formWidgets[6], enSliderKind.Slider_ModelLOD); this.m_SliderParticleLOD.initPanel(this._form.m_formWidgets[7], enSliderKind.Slider_ParticleLOD); this.m_SliderSkillTip.initPanel(this._form.m_formWidgets[8], enSliderKind.Slider_SkillTip); this.m_SliderFps.initPanel(this._form.m_formWidgets[0x16], enSliderKind.Slider_Fps); if ((this._form.m_formWidgets.Length > 0x17) && (this._form.m_formWidgets[0x17] != null)) { this.m_SliderVoice.initPanel(this._form.m_formWidgets[0x17], enSliderKind.Slider_Voice); } Text component = this._form.m_formWidgets[9].transform.FindChild("Text").gameObject.GetComponent <Text>(); ApolloAccountInfo accountInfo = Singleton <ApolloHelper> .GetInstance().GetAccountInfo(false); if (accountInfo != null) { if (accountInfo.Platform == ApolloPlatform.QQ) { component.text = Singleton <CTextManager> .GetInstance().GetText("Common_Login_QQ"); } else if (accountInfo.Platform == ApolloPlatform.Wechat) { component.text = Singleton <CTextManager> .GetInstance().GetText("Common_Login_Weixin"); } else if (accountInfo.Platform == ApolloPlatform.WTLogin) { component.text = Singleton <CTextManager> .GetInstance().GetText("Common_Login_PC"); } else if (accountInfo.Platform == ApolloPlatform.Guest) { component.text = Singleton <CTextManager> .GetInstance().GetText("Common_Login_Guest"); } } else { this._form.m_formWidgets[9].CustomSetActive(false); } if (Singleton <BattleLogic> .instance.isRuning) { GameObject widget = this._form.GetWidget(0x1a); if (widget != null) { if (Singleton <CSurrenderSystem> .instance.CanSurrender()) { widget.CustomSetActive(true); GameObject p = Utility.FindChild(widget, "Button_Surrender"); if (p != null) { Button btn = p.GetComponent <Button>(); if (btn != null) { GameObject obj4 = Utility.FindChild(p, "CountDown"); if (obj4 != null) { CUITimerScript componetInChild = Utility.GetComponetInChild <CUITimerScript>(obj4, "timerSurrender"); if (componetInChild != null) { uint time = 0; if (Singleton <CSurrenderSystem> .instance.InSurrenderCD(out time)) { obj4.CustomSetActive(true); CUICommonSystem.SetButtonEnable(btn, false, false, true); componetInChild.SetTotalTime((float)time); componetInChild.StartTimer(); } else { obj4.CustomSetActive(false); CUICommonSystem.SetButtonEnable(btn, true, true, true); } } } } } } else { widget.CustomSetActive(false); } } } }
private void ConnectLimit(bool showTips = true, ApolloResult result = 0) { bool flag = false; float num = 0f; if (this.m_Form == null) { return; } GameObject widget = this.m_Form.GetWidget(8); GameObject obj3 = Utility.FindChild(widget, "CountDown"); if (widget == null) { return; } Button component = widget.GetComponent <Button>(); if (component == null) { return; } CUITimerScript componetInChild = Utility.GetComponetInChild <CUITimerScript>(widget, "CountDown/timerEnableStartBtn"); if (componetInChild == null) { return; } bool flag2 = false; bool flag3 = false; if (!this.m_ConnectLimitDeregulated && (this.m_ReConnectTimes >= 6)) { flag2 = true; num = 300f; } else if (!this.m_ConnectLimitDeregulated && (this.m_ReConnectTimes >= 3)) { flag2 = true; num = 10f; } DateTime time2 = new DateTime(0x7b2, 1, 1, 0, 0, 0, 0); int totalSeconds = (int)DateTime.Now.Subtract(time2.AddSeconds((double)this.m_ReConnectFailedTime)).TotalSeconds; num -= totalSeconds; if (num <= 0f) { flag2 = false; } string str = string.Empty; ApolloResult result2 = result; switch (result2) { case ApolloResult.PeerStopSession: case ApolloResult.TokenSvrError: case ApolloResult.Timeout: break; case ApolloResult.StayInQueue: flag3 = true; str = "当前服务器人数过多需要排队"; goto Label_01D0; case ApolloResult.SvrIsFull: flag3 = true; str = "当前服务器已满"; goto Label_01D0; case ApolloResult.Success: goto Label_01D0; case ApolloResult.NetworkException: flag3 = true; str = "网络异常"; goto Label_01D0; default: switch (result2) { case ApolloResult.TokenInvalid: flag = true; flag3 = true; str = "授权失败,请重新登录"; goto Label_01D0; case ApolloResult.ConnectFailed: break; default: flag3 = true; str = string.Format("未知错误({0})", result); goto Label_01D0; } break; } flag3 = true; str = "服务器未响应"; Label_01D0: if (flag2) { if (showTips) { str = string.Format("{0},{1}", str, string.Format("请等待{0}再尝试开始游戏", (num <= 60f) ? string.Format("{0}秒", num) : string.Format("{0}分钟", (int)(num / 60f)))); } obj3.CustomSetActive(true); CUICommonSystem.SetButtonEnable(component, false, false, true); componetInChild.SetTotalTime(num); componetInChild.StartTimer(); } else { obj3.CustomSetActive(false); CUICommonSystem.SetButtonEnable(component, true, true, true); } if (flag3) { PlayerPrefs.SetInt("SGAME_Reconnect_Times", this.m_ReConnectTimes); PlayerPrefs.SetInt("SGAME_Reconnect_Failed_Time", (int)DateTime.Now.Subtract(new DateTime(0x7b2, 1, 1, 0, 0, 0, 0)).TotalSeconds); } if (flag) { Singleton <LobbyLogic> .GetInstance().GotoAccLoginPage(); } if (showTips && (str != string.Empty)) { Singleton <CUIManager> .GetInstance().CloseSendMsgAlert(); Singleton <CUIManager> .GetInstance().OpenTips(str, false, 1f, null, new object[0]); } }
public void RefreshAwakeTaskForm() { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(s_heroAwakeTaskFormPath); if (form != null) { Image component = form.transform.Find("Panel/PanelLeft/HeroCell/Hero").GetComponent <Image>(); Text text = form.transform.Find("Panel/PanelLeft/lblTitle").GetComponent <Text>(); Transform transform = form.transform.Find("Panel/PanelLeft/lblState"); Text text2 = form.transform.Find("Panel/PanelLeft/lblContent").GetComponent <Text>(); Button btn = form.transform.Find("Panel/PanelLeft/btnReciveTask").GetComponent <Button>(); Transform transform2 = form.transform.Find("Panel/PanelLeft/panelType1"); Text text3 = transform2.Find("lblTaskDesc").GetComponent <Text>(); Transform transform3 = transform2.Find("itemInfo/itemCell"); Text text4 = transform2.Find("itemInfo/lblName").GetComponent <Text>(); Text text5 = transform2.Find("itemInfo/lblProce").GetComponent <Text>(); Button button2 = transform2.Find("itemInfo/btnReciveTask").GetComponent <Button>(); Button button3 = transform2.Find("getInfo/btnReciveTask").GetComponent <Button>(); Transform transform4 = form.transform.Find("Panel/PanelLeft/panelType2"); Text text6 = transform4.Find("taskInfo/lblTaskDesc").GetComponent <Text>(); Text text7 = transform4.Find("taskInfo/lblProce").GetComponent <Text>(); GameObject prefab = CUIUtility.GetSpritePrefeb(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + StringHelper.UTF8BytesToString(ref this.m_heroInfo.cfgInfo.szImagePath), true, true); component.SetSprite(prefab); ResHeroWakeInfo dataByKey = GameDataMgr.heroAwakDatabin.GetDataByKey(GameDataMgr.GetDoubleKey(this.m_heroInfo.cfgInfo.dwCfgID, this.m_heroInfo.m_awakeStepID)); if (dataByKey != null) { text.text = StringHelper.UTF8BytesToString(ref dataByKey.szWakeTitle); text2.text = StringHelper.UTF8BytesToString(ref dataByKey.szWakeDesc); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo != null) { if (dataByKey.bOptType == 1) { transform2.gameObject.CustomSetActive(true); transform4.gameObject.CustomSetActive(false); CUseable itemUseable = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, (uint)dataByKey.OptParam[1], 0); int useableStackCount = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM).GetUseableStackCount(itemUseable.m_type, itemUseable.m_baseID); stUIEventParams eventParams = new stUIEventParams { iconUseable = itemUseable }; itemUseable.m_stackCount = dataByKey.OptParam[2]; string[] args = new string[] { itemUseable.m_stackCount.ToString(), itemUseable.m_name }; text3.text = Singleton <CTextManager> .instance.GetText("HeroAwake_Tips4", args); text4.text = itemUseable.m_name; CUICommonSystem.SetItemCell(form, transform3.gameObject, itemUseable, true, false); if (useableStackCount >= itemUseable.m_stackCount) { button2.gameObject.CustomSetActive(false); transform.gameObject.CustomSetActive(true); CUICommonSystem.SetButtonEnable(btn, true, true, true); text5.text = string.Format("{0}/{1}", useableStackCount, itemUseable.m_stackCount); } else { button2.gameObject.CustomSetActive(true); transform.gameObject.CustomSetActive(false); CUICommonSystem.SetButtonEnable(btn, false, false, true); text5.text = string.Format("<color=red>{0}</color>/{1}", useableStackCount, itemUseable.m_stackCount); CUIEventScript script2 = button2.GetComponent <CUIEventScript>(); if (script2 != null) { script2.SetUIEvent(enUIEventType.Click, enUIEventID.HeroInfo_Material_Direct_Buy, eventParams); } } CUIEventScript script3 = button3.GetComponent <CUIEventScript>(); if (script3 != null) { script3.SetUIEvent(enUIEventType.Click, enUIEventID.Tips_ItemSourceInfoOpen, eventParams); } } else { transform2.gameObject.CustomSetActive(false); transform4.gameObject.CustomSetActive(true); int num2 = dataByKey.OptParam[0]; CTask task = Singleton <CTaskSys> .instance.model.GetTask((uint)num2); if (task == null) { task = TaskUT.Create_Task((uint)num2); if (task == null) { return; } task.SetState(CTask.State.None); } if (task != null) { text6.text = UT.Bytes2String(task.m_resTask.szTaskDesc); string str = " "; for (int i = 0; i < task.m_prerequisiteInfo.Length; i++) { if (task.m_prerequisiteInfo[i].m_valueTarget > 0) { string str2; if (!this.m_heroInfo.m_isStepFinish) { str2 = str; object[] objArray1 = new object[] { str2, task.m_prerequisiteInfo[i].m_value, "/", task.m_prerequisiteInfo[i].m_valueTarget, " " }; str = string.Concat(objArray1); } else { str2 = str; object[] objArray2 = new object[] { str2, task.m_prerequisiteInfo[i].m_valueTarget, "/", task.m_prerequisiteInfo[i].m_valueTarget, " " }; str = string.Concat(objArray2); } break; } } text7.text = str; } if (this.m_heroInfo.m_isStepFinish || (task.m_taskState == 3)) { transform.gameObject.CustomSetActive(true); CUICommonSystem.SetButtonEnable(btn, true, true, true); } else { transform.gameObject.CustomSetActive(false); CUICommonSystem.SetButtonEnable(btn, false, false, true); } } } } } }