private void RefreshTimer() { if (!this.IsShopAvailable()) { return; } CUIFormScript mallForm = Singleton <CMallSystem> .GetInstance().m_MallForm; if (mallForm == null || !Singleton <CMallSystem> .GetInstance().m_IsMallFormOpen) { return; } CUITimerScript componetInChild = Utility.GetComponetInChild <CUITimerScript>(mallForm.gameObject, "pnlBodyBg/pnlMystery/Content/Banner/TimeLeft/Timer"); int timeToClose = this.GetTimeToClose(); if (timeToClose > 86400) { componetInChild.m_timerDisplayType = enTimerDisplayType.D_H_M_S; } else { componetInChild.m_timerDisplayType = enTimerDisplayType.H_M_S; } componetInChild.SetTotalTime((float)timeToClose); componetInChild.StartTimer(); }
private void OnInvite_TabChange(CUIEvent uiEvent) { CUIFormScript srcFormScript = uiEvent.m_srcFormScript; CUIListScript component = uiEvent.m_srcWidget.GetComponent <CUIListScript>(); GameObject widget = srcFormScript.GetWidget(0); GameObject obj3 = srcFormScript.GetWidget(1); if (component.GetSelectedIndex() == 0) { widget.CustomSetActive(true); obj3.CustomSetActive(false); } else { obj3.CustomSetActive(true); widget.CustomSetActive(false); if (this.m_isFirstlySelectGuildMemberTab) { this.InitAllGuildMemberList(); this.SendGetGuildMemberGameStateReq(); CUITimerScript script3 = srcFormScript.GetWidget(8).GetComponent <CUITimerScript>(); script3.SetTotalTime(1000f); script3.SetOnChangedIntervalTime(10f); script3.StartTimer(); this.m_isFirstlySelectGuildMemberTab = false; } } }
private void PlayItemUseAnimation(CUseable item, int itemCount) { if (item != null) { CItem item2 = (CItem)item; if (item2 != null) { if ((item2.m_itemData.bType == 4) && (item2.m_itemData.EftParam[2] != 0f)) { CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(s_openAwardpFormPath, false, true); if (script != null) { CUITimerScript component = script.transform.Find("Timer").GetComponent <CUITimerScript>(); component.m_eventParams[1].iconUseable = item; component.m_eventParams[1].tag = itemCount; component.EndTimer(); component.StartTimer(); } } else if (!this.CheckNameChangeCard(item2)) { SendItemUseMsgToServer(item.m_objID, 0, itemCount); } } } }
private void OnSettle_ShowStatistics(CUIEvent uiEvent) { CSettlementView.DoCoinTweenEnd(); CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(PATH_PVP_SETTLE_PVP); if (form != null) { if ((form != null) && (form.gameObject != null)) { CSettlementView.SetTab(1, form.gameObject); } Transform transform = form.gameObject.transform.Find("PanelB/ButtonGrid"); if (transform != null) { transform.gameObject.CustomSetActive(false); } Transform transform2 = form.gameObject.transform.Find("PanelB/StateChangeTimer"); if (transform2 != null) { CUITimerScript component = transform2.GetComponent <CUITimerScript>(); if (component != null) { component.StartTimer(); } } Transform transform3 = form.gameObject.transform.Find("PanelB/lblWait"); if (transform3 != null) { transform3.gameObject.CustomSetActive(true); } } }
private void SetPrepareGuildListItem(CUIListElementScript listElementScript, PrepareGuildInfo info) { Transform transform = listElementScript.transform; Image component = transform.Find("imgIcon").GetComponent <Image>(); Text component2 = transform.Find("txtName").GetComponent <Text>(); Text component3 = transform.Find("txtCreator").GetComponent <Text>(); Text component4 = transform.Find("txtMemCnt").GetComponent <Text>(); CUITimerScript component5 = transform.Find("timeoutTimer").GetComponent <CUITimerScript>(); GameObject gameObject = transform.Find("imgOnlyFriend").gameObject; string prefabPath = CUIUtility.s_Sprite_Dynamic_GuildHead_Dir + info.stBriefInfo.dwHeadId; component.SetSprite(prefabPath, this.m_form, true, false, false, false); component2.text = info.stBriefInfo.sName; component3.text = info.stBriefInfo.stCreatePlayer.sName; component4.text = (int)(info.stBriefInfo.bMemCnt - 1) + "/" + GameDataMgr.guildMiscDatabin.GetDataByKey(1u).dwConfValue; uint num = info.stBriefInfo.dwRequestTime + GameDataMgr.guildMiscDatabin.GetDataByKey(2u).dwConfValue; int num2 = (int)((ulong)num - (ulong)((long)CRoleInfo.GetCurrentUTCTime())); if (num2 < 0) { num2 = 0; } TimeSpan timeSpan = new TimeSpan(0, 0, 0, num2); component5.SetTotalTime((float)timeSpan.get_TotalSeconds()); component5.StartTimer(); gameObject.CustomSetActive(info.stBriefInfo.IsOnlyFriend); }
private void ShowCountDownTime(GameObject Btn, bool bMapOpened) { if (Btn != null) { Transform transform = Btn.transform; uint tagUInt = Btn.GetComponent <CUIMiniEventScript>().m_onClickEventParams.tagUInt; Transform transform2 = transform.FindChild("Desc"); if (transform2 != null) { GameObject gameObject = transform2.FindChild("Text").gameObject; GameObject obj3 = transform2.FindChild("Timer").gameObject; if (!bMapOpened) { obj3.CustomSetActive(false); gameObject.CustomSetActive(false); } else { int utilOpenDay = 0; uint utilOpenSec = 0; CUICommonSystem.GetTimeUtilOpen(RES_BATTLE_MAP_TYPE.RES_BATTLE_MAP_TYPE_REWARDMATCH, tagUInt, out utilOpenSec, out utilOpenDay); if ((utilOpenDay == 0) && (utilOpenSec == 0)) { obj3.CustomSetActive(false); gameObject.CustomSetActive(true); gameObject.GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Union_Battle_Tips6"); } else if (utilOpenSec < SECOND_ONE_DAY) { gameObject.CustomSetActive(false); obj3.CustomSetActive(true); CUITimerScript component = obj3.transform.FindChild("Text").GetComponent <CUITimerScript>(); component.SetTotalTime((float)utilOpenSec); component.StartTimer(); } else { int num4 = utilOpenDay; gameObject.CustomSetActive(true); obj3.CustomSetActive(false); string text = Singleton <CTextManager> .GetInstance().GetText("Union_Battle_Tips7"); gameObject.GetComponent <Text>().text = string.Format(text, num4); } } } } }
public void OnCheckFirstWin(CUIEvent uiEvent) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo(); CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(CLobbySystem.LOBBY_FORM_PATH); if (form == null || masterRoleInfo == null) { return; } Transform transform = form.transform.Find("Award"); Text component = transform.Find("lblFirstWin").GetComponent <Text>(); Image component2 = transform.Find("Icon").GetComponent <Image>(); CUITimerScript component3 = transform.Find("Timer").GetComponent <CUITimerScript>(); if (!masterRoleInfo.IsFirstWinOpen()) { transform.gameObject.CustomSetActive(false); return; } transform.gameObject.CustomSetActive(true); float num = (float)masterRoleInfo.GetCurFirstWinRemainingTimeSec(); if (num <= 0f) { component.text = Singleton <CTextManager> .GetInstance().GetText("Daily_Quest_FirstVictory"); component2.color = CUIUtility.s_Color_White; component3.gameObject.CustomSetActive(false); } else { component.text = Singleton <CTextManager> .GetInstance().GetText("Daily_Quest_FirstVictoryCD"); component2.color = CUIUtility.s_Color_GrayShader; component3.gameObject.CustomSetActive(true); component3.SetTotalTime(num); component3.StartTimer(); } }
public void OnCheckFirstWin(CUIEvent uiEvent) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo(); CUIFormScript form = Singleton <CUIManager> .instance.GetForm(CLobbySystem.LOBBY_FORM_PATH); if ((form != null) && (masterRoleInfo != null)) { Transform transform = form.transform.Find("Award"); Text component = transform.Find("lblFirstWin").GetComponent <Text>(); Image image = transform.Find("Icon").GetComponent <Image>(); CUITimerScript script2 = transform.Find("Timer").GetComponent <CUITimerScript>(); if (!masterRoleInfo.IsFirstWinOpen()) { transform.gameObject.CustomSetActive(false); } else { transform.gameObject.CustomSetActive(true); float curFirstWinRemainingTimeSec = masterRoleInfo.GetCurFirstWinRemainingTimeSec(); if (curFirstWinRemainingTimeSec <= 0f) { component.text = Singleton <CTextManager> .GetInstance().GetText("Daily_Quest_FirstVictory"); image.color = CUIUtility.s_Color_White; script2.gameObject.CustomSetActive(false); } else { component.text = Singleton <CTextManager> .GetInstance().GetText("Daily_Quest_FirstVictoryCD"); image.color = CUIUtility.s_Color_GrayShader; script2.gameObject.CustomSetActive(true); script2.SetTotalTime(curFirstWinRemainingTimeSec); script2.StartTimer(); } } } }
private void AddBubbleText(NewbieGuideWeakConf conf, NewbieWeakGuideControl inControl) { GameObject gameObject = this.m_formWeakGuide.transform.FindChild("GuideText").gameObject; gameObject.CustomSetActive(true); NewbieGuideSpecialTipConf specialTipConfig = Singleton <NewbieGuideDataManager> .GetInstance().GetSpecialTipConfig((uint)conf.wSpecialTip); CUICommonSystem.SetTextContent(gameObject.transform.FindChild("RightSpecial/Text"), specialTipConfig.szTipText); RectTransform rectTransform = gameObject.transform as RectTransform; rectTransform.anchoredPosition = new Vector2 { x = (float)specialTipConfig.iOffsetX, y = (float)specialTipConfig.iOffsetY }; CUITimerScript componetInChild = Utility.GetComponetInChild <CUITimerScript>(gameObject, "Timer"); if (conf.Param[0] != 0u) { componetInChild.SetTotalTime(conf.Param[0]); } componetInChild.StartTimer(); }
private GameObject AddBubbleEffectInternal(GameObject effectParent, NewbieGuideWeakConf conf, NewbieWeakGuideControl inControl, CUIFormScript inOriginalForm) { if (effectParent == null) { return(null); } if (effectParent.transform.FindChild("WeakGuideBubble(Clone)") != null) { return(null); } GameObject original = Singleton <CResourceManager> .GetInstance().GetResource(NewbieWeakGuideImpl.WEAK_BUBBLE_PATH, typeof(GameObject), 4, false, false).m_content as GameObject; GameObject gameObject = Object.Instantiate(original) as GameObject; gameObject.transform.SetParent(effectParent.transform); RectTransform rectTransform = gameObject.transform.FindChild("Image") as RectTransform; RectTransform rectTransform2 = gameObject.transform as RectTransform; NewbieGuideSpecialTipConf specialTipConfig = Singleton <NewbieGuideDataManager> .GetInstance().GetSpecialTipConfig((uint)conf.wSpecialTip); if (specialTipConfig != null) { CUICommonSystem.SetTextContent(rectTransform2.FindChild("Text"), specialTipConfig.szTipText); } Vector2 anchorMin = default(Vector2); Vector2 anchorMax = default(Vector2); Vector2 pivot = default(Vector2); Vector3 one = Vector3.one; Vector2 anchoredPosition = default(Vector2); switch (specialTipConfig.bSpecialTipPos) { case 0: anchorMin.x = 0f; anchorMin.y = 1f; anchorMax.x = 0f; anchorMax.y = 1f; one.y = -1f; pivot.x = 0f; pivot.y = 0f; anchoredPosition.x = 10f; anchoredPosition.y = 15f; break; case 1: anchorMin.x = 0f; anchorMin.y = 0f; anchorMax.x = 0f; anchorMax.y = 0f; pivot.x = 0f; pivot.y = 0f; anchoredPosition.x = 10f; anchoredPosition.y = -15f; break; case 2: anchorMin.x = 1f; anchorMin.y = 1f; anchorMax.x = 1f; anchorMax.y = 1f; one.y = -1f; pivot.x = 1f; pivot.y = 0f; anchoredPosition.x = -10f; anchoredPosition.y = 15f; break; case 3: anchorMin.x = 1f; anchorMin.y = 0f; anchorMax.x = 1f; anchorMax.y = 0f; pivot.x = 1f; pivot.y = 0f; anchoredPosition.x = -10f; anchoredPosition.y = -15f; break; } rectTransform2.position = effectParent.transform.position; rectTransform2.anchoredPosition = Vector2.zero; Vector2 anchoredPosition2 = rectTransform2.anchoredPosition; anchoredPosition2.x += (float)specialTipConfig.iOffsetX; anchoredPosition2.y += (float)specialTipConfig.iOffsetY; rectTransform2.anchoredPosition = anchoredPosition2; rectTransform2.localScale = Vector3.one; rectTransform.localScale = one; rectTransform.anchorMin = anchorMin; rectTransform.anchorMax = anchorMax; rectTransform.pivot = pivot; rectTransform.anchoredPosition = anchoredPosition; CUITimerScript componetInChild = Utility.GetComponetInChild <CUITimerScript>(gameObject, "Timer"); if (componetInChild != null) { if (conf.Param[0] != 0u) { componetInChild.SetTotalTime(conf.Param[0]); } componetInChild.StartTimer(); } return(gameObject); }
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 RefreshPrepareGuildPanelMemberList() { GameObject widget = this.m_form.GetWidget(12); GameObject widget2 = this.m_form.GetWidget(13); GameObject widget3 = this.m_form.GetWidget(23); GameObject widget4 = this.m_form.GetWidget(25); GameObject widget5 = this.m_form.GetWidget(26); GameObject widget6 = this.m_form.GetWidget(24); widget2.CustomSetActive(true); widget3.CustomSetActive(true); widget6.CustomSetActive(true); widget.CustomSetActive(false); widget4.CustomSetActive(false); widget5.CustomSetActive(false); CUIListScript component = this.m_form.GetWidget(28).GetComponent <CUIListScript>(); ListView <GuildMemInfo> memList = this.m_Model.CurrentPrepareGuildInfo.m_MemList; int num = (int)(this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.bMemCnt - 1); component.SetElementAmount(num); if (num > 0) { component.SelectElement(0, true); } int num2 = 0; for (int i = 0; i < (int)this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.bMemCnt; i++) { if (memList.get_Item(i).stBriefInfo.uulUid != this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.uulUid) { CUIListElementScript elemenet = component.GetElemenet(num2); if (elemenet != null) { this.SetPrepareGuildMemListItem(elemenet, memList.get_Item(i)); } num2++; } } CUIHttpImageScript component2 = this.m_form.GetWidget(35).GetComponent <CUIHttpImageScript>(); Image component3 = this.m_form.GetWidget(45).GetComponent <Image>(); Image component4 = this.m_form.GetWidget(44).GetComponent <Image>(); Text component5 = this.m_form.GetWidget(14).GetComponent <Text>(); Text component6 = this.m_form.GetWidget(15).GetComponent <Text>(); Text component7 = this.m_form.GetWidget(16).GetComponent <Text>(); component2.SetImageUrl(CGuildHelper.GetHeadUrl(this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.szHeadUrl)); component5.text = this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.sName; component6.text = Singleton <CTextManager> .GetInstance().GetText("Common_Level_Format", new string[] { this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.dwLevel.ToString() }); component7.text = this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.dwAbility.ToString(); MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component3, CGuildHelper.GetNobeLevel(this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.uulUid, this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.stVip.level), false); MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(component4, CGuildHelper.GetNobeHeadIconId(this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.uulUid, this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.stVip.headIconId)); Text component8 = this.m_form.GetWidget(18).GetComponent <Text>(); Text component9 = this.m_form.GetWidget(19).GetComponent <Text>(); Image component10 = this.m_form.GetWidget(17).GetComponent <Image>(); uint num3 = GameDataMgr.guildMiscDatabin.GetDataByKey(1u).dwConfValue; num3 = ((num3 >= 0u) ? num3 : 0u); CUITimerScript component11 = this.m_form.GetWidget(20).GetComponent <CUITimerScript>(); uint num4 = this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.dwRequestTime + GameDataMgr.guildMiscDatabin.GetDataByKey(2u).dwConfValue; int num5 = (int)((ulong)num4 - (ulong)((long)CRoleInfo.GetCurrentUTCTime())); if (num5 < 0) { num5 = 0; } TimeSpan timeSpan = new TimeSpan(0, 0, 0, num5); component11.SetTotalTime((float)timeSpan.get_TotalSeconds()); component11.StartTimer(); component8.text = this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.sName; string prefabPath = CUIUtility.s_Sprite_Dynamic_GuildHead_Dir + this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.dwHeadId; component10.SetSprite(prefabPath, this.m_form, true, false, false, false); component9.text = num.ToString() + "/" + num3.ToString(); }
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 static void UpdateConfirmBox(GameObject root, ulong confirmPlayerUid) { RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo; DebugHelper.Assert(roomInfo != null, "Room Info is NULL!!!"); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "RoleInfo is NULL!!!"); int currentMapPlayerNum = Singleton <CMatchingSystem> .GetInstance().currentMapPlayerNum; int confirmPlayerNum = Singleton <CMatchingSystem> .GetInstance().confirmPlayerNum; Transform transform = root.transform.Find("Panel/Panel/stateGroup"); if (transform) { if ((roomInfo.roomAttrib.bMapType == 3 && masterRoleInfo != null && (int)CLadderSystem.GetGradeDataByShowGrade((int)masterRoleInfo.m_rankGrade).bLogicGrade >= CMatchingView.ShowDefaultHeadImgStartLogicLadderLevel && !roomInfo.roomAttrib.bWarmBattle) || roomInfo.roomAttrib.bMapType == 5) { if (masterRoleInfo.playerUllUID == confirmPlayerUid) { CUICommonSystem.SetObjActive(transform.Find(string.Format("icon{0}/ready", confirmPlayerNum)), true); CUICommonSystem.SetObjActive(transform.Find(string.Format("icon{0}/unready", confirmPlayerNum)), false); } else { CUITimerScript uITimerScript = CUICommonSystem.GetUITimerScript(transform.Find(string.Format("icon{0}", confirmPlayerNum))); if (uITimerScript != null) { uITimerScript.SetTotalTime((float)Random.Range(1, 4)); uITimerScript.SetTimerEventId(enTimerEventType.TimeUp, enUIEventID.Matchingt_ShowConfirmHead); uITimerScript.enabled = true; uITimerScript.StartTimer(); } } } else { int num = 1; for (COM_PLAYERCAMP cOM_PLAYERCAMP = COM_PLAYERCAMP.COM_PLAYERCAMP_1; cOM_PLAYERCAMP < COM_PLAYERCAMP.COM_PLAYERCAMP_COUNT; cOM_PLAYERCAMP++) { ListView <MemberInfo> listView = roomInfo[cOM_PLAYERCAMP]; for (int i = 0; i < listView.Count; i++) { MemberInfo memberInfo = listView[i]; if (memberInfo.ullUid == confirmPlayerUid) { Transform transform2 = transform.Find(string.Format("icon{0}/ready", num)); if (transform2) { transform2.gameObject.CustomSetActive(true); } Transform transform3 = transform.Find(string.Format("icon{0}/unready", num)); if (transform3) { transform3.gameObject.CustomSetActive(false); } break; } num++; } } } } bool flag = roomInfo.roomAttrib.bPkAI == 2; int num2 = (!roomInfo.roomAttrib.bWarmBattle && flag) ? (currentMapPlayerNum / 2) : currentMapPlayerNum; Transform transform4 = root.transform.Find("Panel/Panel/TxtReadyNum"); if (transform4) { Text component = transform4.GetComponent <Text>(); if (component) { component.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("Matching_Confirm_PlayerNum"), confirmPlayerNum, num2)); } } if (confirmPlayerUid == roomInfo.selfInfo.ullUid) { Transform transform5 = root.transform.Find("Panel/Panel/btnGroup/Button_Confirm"); if (transform5 != null) { Button component2 = transform5.GetComponent <Button>(); if (component2) { component2.set_interactable(false); } } } }
public static void InitConfirmBox(GameObject root, int PlayerNum, ref RoomInfo roomInfo, CUIFormScript form) { if (root.transform.Find("Panel/Timer") != null) { CUITimerScript component = root.transform.Find("Panel/Timer").GetComponent <CUITimerScript>(); if (component != null) { component.EndTimer(); component.StartTimer(); } } if (root.transform.Find("Panel/Panel/Timer") != null) { CUITimerScript component2 = root.transform.Find("Panel/Panel/Timer").GetComponent <CUITimerScript>(); if (component2 != null) { component2.EndTimer(); component2.StartTimer(); } } Transform transform = root.transform.Find("Panel/Panel/stateGroup"); GridLayoutGroup component3 = transform.GetComponent <GridLayoutGroup>(); if (component3) { component3.set_constraintCount((PlayerNum == 6) ? 3 : 5); } bool flag = roomInfo.roomAttrib.bPkAI == 2; int num = (!roomInfo.roomAttrib.bWarmBattle && flag) ? (PlayerNum / 2) : PlayerNum; for (int i = 1; i <= 10; i++) { GameObject gameObject = transform.Find(string.Format("icon{0}", i)).gameObject; gameObject.CustomSetActive(num >= i); } int num2 = 1; for (COM_PLAYERCAMP cOM_PLAYERCAMP = COM_PLAYERCAMP.COM_PLAYERCAMP_1; cOM_PLAYERCAMP < COM_PLAYERCAMP.COM_PLAYERCAMP_COUNT; cOM_PLAYERCAMP++) { ListView <MemberInfo> listView = roomInfo[cOM_PLAYERCAMP]; for (int j = 0; j < listView.Count; j++) { MemberInfo memberInfo = listView[j]; Transform transform2 = transform.Find(string.Format("icon{0}", num2)); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (!CSysDynamicBlock.bSocialBlocked) { if ((roomInfo.roomAttrib.bMapType == 3 && masterRoleInfo != null && (int)CLadderSystem.GetGradeDataByShowGrade((int)masterRoleInfo.m_rankGrade).bLogicGrade >= CMatchingView.ShowDefaultHeadImgStartLogicLadderLevel) || roomInfo.roomAttrib.bMapType == 5) { Image component4 = transform2.Find("HttpImage").GetComponent <Image>(); if (component4) { component4.SetSprite(CUIUtility.s_Sprite_Dynamic_BustPlayer_Dir + "Common_PlayerImg", form, true, false, false, false); } } else { CUIHttpImageScript component5 = transform2.Find("HttpImage").GetComponent <CUIHttpImageScript>(); if (component5) { component5.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(memberInfo.MemberHeadUrl)); } } } Transform transform3 = transform.Find(string.Format("icon{0}/ready", num2)); if (transform3) { transform3.gameObject.CustomSetActive(false); } Transform transform4 = transform.Find(string.Format("icon{0}/unready", num2)); if (transform4) { transform4.gameObject.CustomSetActive(true); } num2++; } } Transform transform5 = root.transform.Find("Panel/Panel/TxtReadyNum"); if (transform5) { Text component6 = transform5.GetComponent <Text>(); if (component6) { component6.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("Matching_Confirm_PlayerNum"), 0, num)); } } Transform transform6 = root.transform.Find("Panel/Panel/btnGroup/Button_Confirm"); if (transform6) { Button component7 = transform6.GetComponent <Button>(); component7.set_interactable(true); } }
public static void InitConfirmBox(GameObject root, int PlayerNum, ref RoomInfo roomInfo, CUIFormScript form) { if (root.transform.Find("Panel/Timer") != null) { CUITimerScript script = root.transform.Find("Panel/Timer").GetComponent <CUITimerScript>(); if (script != null) { script.EndTimer(); script.StartTimer(); } } if (root.transform.Find("Panel/Panel/Timer") != null) { CUITimerScript script2 = root.transform.Find("Panel/Panel/Timer").GetComponent <CUITimerScript>(); if (script2 != null) { script2.EndTimer(); script2.StartTimer(); } } Transform transform = root.transform.Find("Panel/Panel/stateGroup"); GridLayoutGroup component = transform.GetComponent <GridLayoutGroup>(); if (component != null) { component.constraintCount = (PlayerNum != 6) ? 5 : 3; } bool flag = roomInfo.roomAttrib.bPkAI == 2; int num = !(!roomInfo.roomAttrib.bWarmBattle ? flag : false) ? PlayerNum : (PlayerNum / 2); for (int i = 1; i <= 10; i++) { transform.Find(string.Format("icon{0}", i)).gameObject.CustomSetActive(num >= i); } int num3 = 1; for (COM_PLAYERCAMP com_playercamp = COM_PLAYERCAMP.COM_PLAYERCAMP_1; com_playercamp < COM_PLAYERCAMP.COM_PLAYERCAMP_COUNT; com_playercamp += 1) { ListView <MemberInfo> view = roomInfo[com_playercamp]; for (int j = 0; j < view.Count; j++) { MemberInfo info = view[j]; Transform transform2 = transform.Find(string.Format("icon{0}", num3)); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (!CSysDynamicBlock.bSocialBlocked) { if ((((roomInfo.roomAttrib.bMapType == 3) && (masterRoleInfo != null)) && (masterRoleInfo.m_rankGrade >= 7)) || (roomInfo.roomAttrib.bMapType == 5)) { Image image = transform2.Find("HttpImage").GetComponent <Image>(); if (image != null) { image.SetSprite(CUIUtility.s_Sprite_Dynamic_BustPlayer_Dir + "Common_PlayerImg", form, true, false, false); } } else { CUIHttpImageScript script3 = transform2.Find("HttpImage").GetComponent <CUIHttpImageScript>(); if (script3 != null) { script3.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(info.MemberHeadUrl)); } } } Transform transform3 = transform.Find(string.Format("icon{0}/ready", num3)); if (transform3 != null) { transform3.gameObject.CustomSetActive(false); } Transform transform4 = transform.Find(string.Format("icon{0}/unready", num3)); if (transform4 != null) { transform4.gameObject.CustomSetActive(true); } num3++; } } Transform transform5 = root.transform.Find("Panel/Panel/TxtReadyNum"); if (transform5 != null) { Text text = transform5.GetComponent <Text>(); if (text != null) { text.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Matching_Confirm_PlayerNum"), 0, num); } } Transform transform6 = root.transform.Find("Panel/Panel/btnGroup/Button_Confirm"); if (transform6 != null) { transform6.GetComponent <Button>().interactable = true; } }