Example #1
0
        public static void SetSwapTimer(int totalSec, COM_PLAYERCAMP camp = COM_PLAYERCAMP.COM_PLAYERCAMP_1, int pos = 0)
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CRoomSystem.PATH_ROOM);

            if (form == null || form.gameObject == null)
            {
                return;
            }
            int num  = 1;
            int num2 = 2;

            for (int i = num; i <= num2; i++)
            {
                COM_PLAYERCAMP cOM_PLAYERCAMP = (COM_PLAYERCAMP)i;
                for (int j = 0; j < 5; j++)
                {
                    string     path       = string.Format("Panel_Main/{0}{1}/Occupied/TimerSwap", (cOM_PLAYERCAMP == COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? "LeftPlayers/Left_Player" : "RightPlayers/Right_Player", j + 1);
                    GameObject gameObject = Utility.FindChild(form.gameObject, path);
                    if (camp == cOM_PLAYERCAMP && pos == j && totalSec > 0)
                    {
                        gameObject.CustomSetActive(true);
                        CUITimerScript component = gameObject.GetComponent <CUITimerScript>();
                        component.SetTotalTime((float)totalSec);
                        component.m_eventIDs[1] = enUIEventID.Room_ChangePos_TimeUp;
                        component.ReStartTimer();
                    }
                    else
                    {
                        gameObject.CustomSetActive(false);
                    }
                }
            }
        }
Example #2
0
        public static void SetSwapTimer(int totalSec, COM_PLAYERCAMP camp = 1, int pos = 0)
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CRoomSystem.PATH_ROOM);

            if ((form != null) && (form.gameObject != null))
            {
                GameObject obj2 = null;
                int        num  = 1;
                int        num2 = 2;
                for (int i = num; i <= num2; i++)
                {
                    COM_PLAYERCAMP com_playercamp = (COM_PLAYERCAMP)i;
                    for (int j = 0; j < 5; j++)
                    {
                        string path = string.Format("Panel_Main/{0}{1}/Occupied/TimerSwap", (com_playercamp != COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? "Right_Player" : "Left_Player", j + 1);
                        obj2 = Utility.FindChild(form.gameObject, path);
                        if (((camp == com_playercamp) && (pos == j)) && (totalSec > 0))
                        {
                            obj2.CustomSetActive(true);
                            CUITimerScript component = obj2.GetComponent <CUITimerScript>();
                            component.SetTotalTime((float)totalSec);
                            component.m_eventIDs[1] = enUIEventID.Room_ChangePos_TimeUp;
                            component.ReStartTimer();
                        }
                        else
                        {
                            obj2.CustomSetActive(false);
                        }
                    }
                }
            }
        }
Example #3
0
        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;
                }
            }
        }
Example #4
0
        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);
        }
Example #5
0
        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();
        }
Example #6
0
        public static void ShowSwapMsg(int totalSec, COM_PLAYERCAMP camp = COM_PLAYERCAMP.COM_PLAYERCAMP_1, int pos = 0)
        {
            if (totalSec > 0)
            {
                CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CRoomSystem.PATH_ROOM_SWAP, false, true);

                if (cUIFormScript == null || cUIFormScript.gameObject == null)
                {
                    return;
                }
                GameObject    gameObject = Utility.FindChild(cUIFormScript.gameObject, "SwapMessageBox");
                CUIFormScript form       = Singleton <CUIManager> .GetInstance().GetForm(CRoomSystem.PATH_ROOM);

                if (form == null || form.gameObject == null)
                {
                    return;
                }
                GameObject gameObject2;
                if (camp == COM_PLAYERCAMP.COM_PLAYERCAMP_1)
                {
                    gameObject2 = Utility.FindChild(form.gameObject, string.Format("Panel_Main/LeftPlayers/Left_Player{0}", pos + 1));
                }
                else if (camp == COM_PLAYERCAMP.COM_PLAYERCAMP_2)
                {
                    gameObject2 = Utility.FindChild(form.gameObject, string.Format("Panel_Main/RightPlayers/Right_Player{0}", pos + 1));
                }
                else
                {
                    gameObject2 = Utility.FindChild(form.gameObject, "Panel_Main/Observers");
                }
                if (gameObject2 == null)
                {
                    return;
                }
                gameObject.CustomSetActive(true);
                Vector2 vector   = CUIUtility.WorldToScreenPoint(form.GetCamera(), gameObject2.transform.position);
                Vector3 position = CUIUtility.ScreenToWorldPoint(cUIFormScript.GetCamera(), vector, gameObject.transform.position.z);
                gameObject.transform.position = position;
                vector    = default(Vector2);
                vector    = (gameObject.transform as RectTransform).anchoredPosition;
                vector.y += (float)((camp == COM_PLAYERCAMP.COM_PLAYERCAMP_MID) ? -20 : 28);
                (gameObject.transform as RectTransform).anchoredPosition = vector;
                CUITimerScript component = gameObject.GetComponent <CUITimerScript>();
                component.SetTotalTime((float)totalSec);
                component.m_eventIDs[0]         = enUIEventID.Room_ChangePos_Box_TimerChange;
                component.m_eventIDs[2]         = enUIEventID.Room_ChangePos_Box_TimerChange;
                component.m_eventIDs[1]         = enUIEventID.Room_ChangePos_TimeUp;
                component.m_eventParams[0].tag  = pos;
                component.m_eventParams[0].tag2 = (int)camp;
                component.m_eventParams[2].tag  = pos;
                component.m_eventParams[2].tag2 = (int)camp;
                component.ReStartTimer();
            }
            else
            {
                Singleton <CUIManager> .GetInstance().CloseForm(CRoomSystem.PATH_ROOM_SWAP);
            }
        }
Example #7
0
        private void InitFromView(CUIFormScript formScript)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            this.InitBuffItem(formScript, curLvelContext);
            this.m_relivePayType  = CMallSystem.ResBuyTypeToPayType((int)curLvelContext.m_reviveInfo[curLvelContext.m_levelDifficulty].astReviveCost[3 - PVEReviveHeros.m_iRemainReviveNum].bCostType);
            this.m_relivePayValue = curLvelContext.m_reviveInfo[curLvelContext.m_levelDifficulty].astReviveCost[3 - PVEReviveHeros.m_iRemainReviveNum].dwCostPrice;
            string     text   = string.Format(Singleton <CTextManager> .GetInstance().GetText("ReliveMessage"), Singleton <CTextManager> .GetInstance().GetText(CMallSystem.s_payTypeNameKeys[(int)this.m_relivePayType]));
            GameObject widget = formScript.GetWidget(0);

            if (widget != null)
            {
                Text component = widget.GetComponent <Text>();
                if (component != null)
                {
                    component.text = text;
                }
            }
            GameObject widget2 = formScript.GetWidget(1);

            if (widget2 != null)
            {
                Image component2 = widget2.GetComponent <Image>();
                if (component2 != null)
                {
                    component2.SetSprite(CMallSystem.GetPayTypeIconPath(this.m_relivePayType), formScript, true, false, false, false);
                }
            }
            GameObject widget3 = formScript.GetWidget(2);

            if (widget3 != null)
            {
                Text component3 = widget3.GetComponent <Text>();
                if (component3 != null)
                {
                    component3.text = this.m_relivePayValue.ToString();
                }
            }
            GameObject gameObject = this.m_form.transform.Find("buffInfoPanel").gameObject;

            if (gameObject == null)
            {
                return;
            }
            GameObject gameObject2 = gameObject.transform.Find("ReviveText/NumText").gameObject;

            if (gameObject2 == null)
            {
                return;
            }
            gameObject2.GetComponent <Text>().text = PVEReviveHeros.m_iRemainReviveNum.ToString();
            CUITimerScript component4    = gameObject.transform.Find("Timer").GetComponent <CUITimerScript>();
            byte           reviveTimeMax = curLvelContext.m_reviveTimeMax;

            component4.SetTotalTime((float)reviveTimeMax);
        }
Example #8
0
        private void InitFromView(CUIFormScript formScript)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            ResLevelCfgInfo dataByKey = GameDataMgr.levelDatabin.GetDataByKey(curLvelContext.iLevelID);

            this.InitBuffItem(formScript, curLvelContext, dataByKey);
            this.m_relivePayType  = CMallSystem.ResBuyTypeToPayType(dataByKey.astReviveInfo[curLvelContext.difficulty].astReviveCost[3 - m_iRemainReviveNum].bCostType);
            this.m_relivePayValue = dataByKey.astReviveInfo[curLvelContext.difficulty].astReviveCost[3 - m_iRemainReviveNum].dwCostPrice;
            string     str    = string.Format(Singleton <CTextManager> .GetInstance().GetText("ReliveMessage"), Singleton <CTextManager> .GetInstance().GetText(CMallSystem.s_payTypeNameKeys[(int)this.m_relivePayType]));
            GameObject widget = formScript.GetWidget(0);

            if (widget != null)
            {
                Text component = widget.GetComponent <Text>();
                if (component != null)
                {
                    component.text = str;
                }
            }
            GameObject obj3 = formScript.GetWidget(1);

            if (obj3 != null)
            {
                Image image = obj3.GetComponent <Image>();
                if (image != null)
                {
                    image.SetSprite(CMallSystem.GetPayTypeIconPath(this.m_relivePayType), formScript, true, false, false);
                }
            }
            GameObject obj4 = formScript.GetWidget(2);

            if (obj4 != null)
            {
                Text text2 = obj4.GetComponent <Text>();
                if (text2 != null)
                {
                    text2.text = this.m_relivePayValue.ToString();
                }
            }
            GameObject gameObject = this.m_form.transform.Find("buffInfoPanel").gameObject;

            if (gameObject != null)
            {
                GameObject obj6 = gameObject.transform.Find("ReviveText/NumText").gameObject;
                if (obj6 != null)
                {
                    obj6.GetComponent <Text>().text = m_iRemainReviveNum.ToString();
                    CUITimerScript script         = gameObject.transform.Find("Timer").GetComponent <CUITimerScript>();
                    byte           bReviveTimeMax = dataByKey.bReviveTimeMax;
                    script.SetTotalTime((float)bReviveTimeMax);
                }
            }
        }
Example #9
0
        public void OpenSurrenderForm(int maxNum, int totalNum, byte data)
        {
            bool flag = Singleton <CUIManager> .GetInstance().GetForm(s_surrenderForm) == null;

            CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(s_surrenderForm, false, true);

            GameObject gameObject = null;
            GameObject obj3       = null;
            GameObject obj4       = null;
            bool       flag2      = false;
            bool       bActive    = false;

            if (script != null)
            {
                gameObject = script.transform.GetChild(0).gameObject;
                obj3       = gameObject.transform.Find("SurrenderElement").gameObject;
                for (int i = 0; i < 5; i++)
                {
                    obj4  = obj3.transform.GetChild(i).gameObject;
                    flag2 = i < maxNum;
                    obj4.SetActive(flag2);
                    if (flag2)
                    {
                        if (i < totalNum)
                        {
                            bActive = (data & (((int)1) << i)) > 0;
                            obj4.transform.GetChild(0).gameObject.CustomSetActive(bActive);
                            obj4.transform.GetChild(1).gameObject.CustomSetActive(!bActive);
                        }
                        else
                        {
                            obj4.transform.GetChild(0).gameObject.CustomSetActive(false);
                            obj4.transform.GetChild(1).gameObject.CustomSetActive(false);
                        }
                    }
                }
                gameObject.transform.Find("ButtonGroup/Button_Surrender").gameObject.SetActive(this.m_haveRights);
                gameObject.transform.Find("ButtonGroup/Button_Reject").gameObject.SetActive(this.m_haveRights);
                gameObject.transform.Find("ButtonGroup/SurrenderResult_Txt").gameObject.SetActive(!this.m_haveRights);
                if (flag)
                {
                    CUITimerScript component = gameObject.GetComponent <CUITimerScript>();
                    component.SetTotalTime((float)this.GetSurrenderVaildTime());
                    component.ReStartTimer();
                }
                if (maxNum == totalNum)
                {
                    this.DelayCloseSurrenderForm(5);
                }
            }
        }
        public void DelayCloseSurrenderForm(int delay)
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CSurrenderSystem.s_surrenderForm);

            if (form != null)
            {
                CUITimerScript component = form.transform.GetChild(0).GetComponent <CUITimerScript>();
                if (component != null && component.GetCurrentTime() > (float)delay)
                {
                    component.SetTotalTime((float)delay);
                    component.ReStartTimer();
                }
            }
        }
        public void OpenSurrenderForm(int maxNum, int totalNum, byte data)
        {
            bool flag = Singleton <CUIManager> .GetInstance().GetForm(CSurrenderSystem.s_surrenderForm) == null;

            CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CSurrenderSystem.s_surrenderForm, false, true);

            if (cUIFormScript)
            {
                GameObject gameObject  = cUIFormScript.transform.GetChild(0).gameObject;
                GameObject gameObject2 = gameObject.transform.Find("SurrenderElement").gameObject;
                for (int i = 0; i < 5; i++)
                {
                    GameObject gameObject3 = gameObject2.transform.GetChild(i).gameObject;
                    bool       flag2       = i < maxNum;
                    gameObject3.SetActive(flag2);
                    if (flag2)
                    {
                        if (i < totalNum)
                        {
                            bool flag3 = ((int)data & 1 << i) > 0;
                            gameObject3.transform.GetChild(0).gameObject.CustomSetActive(flag3);
                            gameObject3.transform.GetChild(1).gameObject.CustomSetActive(!flag3);
                        }
                        else
                        {
                            gameObject3.transform.GetChild(0).gameObject.CustomSetActive(false);
                            gameObject3.transform.GetChild(1).gameObject.CustomSetActive(false);
                        }
                    }
                }
                gameObject.transform.Find("ButtonGroup/Button_Surrender").gameObject.SetActive(this.m_haveRights);
                gameObject.transform.Find("ButtonGroup/Button_Reject").gameObject.SetActive(this.m_haveRights);
                if (flag)
                {
                    CUITimerScript component = gameObject.GetComponent <CUITimerScript>();
                    component.SetTotalTime((float)this.GetSurrenderVaildTime());
                    component.ReStartTimer();
                    if (!this.m_haveRights)
                    {
                        this.SimplifySurrenderForm();
                    }
                }
                if (maxNum == totalNum)
                {
                    this.DelayCloseSurrenderForm(5);
                }
            }
        }
        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);
                        }
                    }
                }
            }
        }
Example #13
0
        public static void ShowSwapMsg(int totalSec, COM_PLAYERCAMP camp = 1, int pos = 0)
        {
            if (totalSec > 0)
            {
                CUIFormScript form = Singleton <CUIManager> .GetInstance().OpenForm(CRoomSystem.PATH_ROOM_SWAP, false, true);

                if ((form != null) && (form.gameObject != null))
                {
                    GameObject obj2 = Utility.FindChild(form.gameObject, "SwapMessageBox");
                    form = Singleton <CUIManager> .GetInstance().GetForm(CRoomSystem.PATH_ROOM);

                    if ((form != null) && (form.gameObject != null))
                    {
                        GameObject obj3 = null;
                        if (camp == COM_PLAYERCAMP.COM_PLAYERCAMP_1)
                        {
                            obj3 = Utility.FindChild(form.gameObject, string.Format("Panel_Main/Left_Player{0}", pos + 1));
                        }
                        else if (camp == COM_PLAYERCAMP.COM_PLAYERCAMP_2)
                        {
                            obj3 = Utility.FindChild(form.gameObject, string.Format("Panel_Main/Right_Player{0}", pos + 1));
                        }
                        if (obj3 != null)
                        {
                            obj2.CustomSetActive(true);
                            obj2.GetComponent <RectTransform>().anchoredPosition = obj3.GetComponent <RectTransform>().anchoredPosition;
                            CUITimerScript component = obj2.GetComponent <CUITimerScript>();
                            component.SetTotalTime((float)totalSec);
                            component.m_eventIDs[0]        = enUIEventID.Room_ChangePos_Box_TimerChange;
                            component.m_eventIDs[2]        = enUIEventID.Room_ChangePos_Box_TimerChange;
                            component.m_eventIDs[1]        = enUIEventID.Room_ChangePos_TimeUp;
                            component.m_eventParams[0].tag = pos;
                            component.m_eventParams[2].tag = pos;
                            component.ReStartTimer();
                        }
                    }
                }
            }
            else
            {
                Singleton <CUIManager> .GetInstance().CloseForm(CRoomSystem.PATH_ROOM_SWAP);
            }
        }
Example #14
0
        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();
            }
        }
Example #15
0
        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();
                    }
                }
            }
        }
Example #16
0
    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();
    }
Example #17
0
    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);
    }
Example #18
0
        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]);
            }
        }
Example #19
0
        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);
                    }
                }
            }
        }
Example #20
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);
                    }
                }
            }
        }
Example #21
0
        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();
        }
Example #22
0
        private void OpenApplyClosePwdForm(CUIEvent uiEvent)
        {
            if (this.EnableStatus == PwdStatus.Disable)
            {
                return;
            }
            CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CSecurePwdSystem.sApplyClosePwdFormPath, false, true);

            if (cUIFormScript == null)
            {
                DebugHelper.Assert(false, "Apply Close Pwd Form Is Null");
                return;
            }
            Transform transform  = cUIFormScript.transform.Find("pnlBg/Panel_Main/LeftTime");
            Transform transform2 = cUIFormScript.transform.Find("pnlBg/Panel_Main/Button");
            Transform transform3 = cUIFormScript.transform.Find("pnlBg/Panel_Main/Desc");

            if (transform == null)
            {
                DebugHelper.Assert(false, "SecurePwdSys left time trans is null");
                return;
            }
            if (transform2 == null)
            {
                DebugHelper.Assert(false, "SecurePwdSys op btn trans is null");
                return;
            }
            if (transform3 == null)
            {
                DebugHelper.Assert(false, "SecurePwdSys desc trans is null");
                return;
            }
            Text component = transform3.GetComponent <Text>();

            if (component != null && GameDataMgr.svr2CltCfgDict.ContainsKey(13u))
            {
                ResGlobalInfo resGlobalInfo = new ResGlobalInfo();
                if (GameDataMgr.svr2CltCfgDict.TryGetValue(13u, ref resGlobalInfo))
                {
                    float num  = resGlobalInfo.dwConfValue;
                    float num2 = num / 86000f;
                    component.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("SecurePwd_Force_Close_Desc"), num2.ToString("F0"));
                }
            }
            PwdCloseStatus closeStatus = this.CloseStatus;

            if (closeStatus != PwdCloseStatus.Open)
            {
                if (closeStatus == PwdCloseStatus.Close)
                {
                    transform.gameObject.CustomSetActive(false);
                    CUIEventScript component2 = transform2.GetComponent <CUIEventScript>();
                    if (component2 != null)
                    {
                        component2.SetUIEvent(enUIEventType.Up, enUIEventID.SecurePwd_OnApplyClose);
                    }
                    Text componetInChild = Utility.GetComponetInChild <Text>(transform2.gameObject, "Text");
                    if (componetInChild != null)
                    {
                        componetInChild.text = Singleton <CTextManager> .GetInstance().GetText("SecurePwd_Force_Close_Btn");
                    }
                }
            }
            else
            {
                transform.gameObject.CustomSetActive(true);
                CUITimerScript component3 = transform.Find("Timer").GetComponent <CUITimerScript>();
                if (component3 == null)
                {
                    DebugHelper.Assert(false, "SecurePwdSys left timer is null");
                    return;
                }
                DateTime dateTime = Utility.ToUtcTime2Local((long)CRoleInfo.GetCurrentUTCTime());
                TimeSpan timeSpan = Utility.ToUtcTime2Local((long)((ulong)this.m_CloseTime)) - dateTime;
                if (timeSpan.get_TotalSeconds() > 0.0)
                {
                    component3.SetTotalTime((float)timeSpan.get_TotalSeconds());
                    component3.ReStartTimer();
                    CUIEventScript component4 = transform2.GetComponent <CUIEventScript>();
                    if (component4 != null)
                    {
                        component4.SetUIEvent(enUIEventType.Up, enUIEventID.SecurePwd_OnCancelApplyClose);
                    }
                    Text componetInChild2 = Utility.GetComponetInChild <Text>(transform2.gameObject, "Text");
                    if (componetInChild2 != null)
                    {
                        componetInChild2.text = Singleton <CTextManager> .GetInstance().GetText("SecurePwd_Cancel_Force_Close_Btn");
                    }
                }
                else
                {
                    this.EnableStatus = PwdStatus.Disable;
                    this.CloseStatus  = PwdCloseStatus.Close;
                    this.CloseTime    = 0u;
                    Singleton <CUIManager> .GetInstance().CloseForm(CSecurePwdSystem.sApplyClosePwdFormPath);

                    Singleton <EventRouter> .GetInstance().BroadCastEvent(EventID.SECURE_PWD_STATUS_CHANGE);
                }
            }
        }