Пример #1
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);
                        }
                    }
                }
            }
        }
Пример #2
0
    public void Show_Bubble(int index, string content, int type = 0)
    {
        GameObject bubbleObj = this.getBubbleObj(index);

        if (bubbleObj != null)
        {
            CUITimerScript component = bubbleObj.GetComponent <CUITimerScript>();
            bubbleObj.CustomSetActive(true);
            component.ReStartTimer();
            this.setBubbleText(index, content);
            if (Singleton <CHeroSelectBaseSystem> .instance.m_isAllowShowBattleHistory)
            {
                if (type == 0)
                {
                    CUICommonSystem.SetObjActive(bubbleObj.transform.Find("Bg/Bg1"), true);
                    CUICommonSystem.SetObjActive(bubbleObj.transform.Find("Bg/Bg2"), false);
                }
                else if (type == 1)
                {
                    CUICommonSystem.SetObjActive(bubbleObj.transform.Find("Bg/Bg1"), false);
                    CUICommonSystem.SetObjActive(bubbleObj.transform.Find("Bg/Bg2"), true);
                }
            }
        }
    }
Пример #3
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);
                    }
                }
            }
        }
Пример #4
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);
            }
        }
Пример #5
0
        public void CheckMiShuTalk(bool isRestarTimer = true)
        {
            bool   flag = false;
            string text = null;

            if (Singleton <CTaskSys> .get_instance().model.IsShowMainTaskTab_RedDotCount())
            {
                flag = true;
                text = Singleton <CTextManager> .get_instance().GetText("Secretary_Reward_Tips");
            }
            else
            {
                CTask maxIndex_TaskID_InState = Singleton <CTaskSys> .get_instance().model.GetMaxIndex_TaskID_InState(enTaskTab.TAB_USUAL, CTask.State.Have_Done);

                if (maxIndex_TaskID_InState != null)
                {
                    flag = true;
                    text = Singleton <CTextManager> .get_instance().GetText("Secretary_Reward_Tips");
                }
                else
                {
                    maxIndex_TaskID_InState = Singleton <CTaskSys> .get_instance().model.GetMaxIndex_TaskID_InState(enTaskTab.TAB_USUAL, CTask.State.OnGoing);

                    if (maxIndex_TaskID_InState != null)
                    {
                        flag = true;
                        text = maxIndex_TaskID_InState.m_resTask.szMiShuDesc;
                    }
                }
            }
            CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(CLobbySystem.LOBBY_FORM_PATH);

            if (form == null)
            {
                return;
            }
            Transform      transform  = form.transform.Find("LobbyBottom/Newbie/TalkFrame");
            Text           component  = form.transform.Find("LobbyBottom/Newbie/TalkFrame/Text").GetComponent <Text>();
            CUITimerScript component2 = form.transform.Find("LobbyBottom/Newbie/TalkFrame/Timer").GetComponent <CUITimerScript>();

            if (flag)
            {
                transform.gameObject.CustomSetActive(true);
                component.text = text;
                component2.ReStartTimer();
            }
            else
            {
                transform.gameObject.CustomSetActive(false);
                component2.EndTimer();
            }
            if (isRestarTimer)
            {
                CUITimerScript component3 = form.transform.Find("LobbyBottom/Newbie/Timer").GetComponent <CUITimerScript>();
                component3.ReStartTimer();
            }
        }
Пример #6
0
    public void Show_Bubble(int index, string content)
    {
        GameObject obj2 = this.getBubbleObj(index);

        if (obj2 != null)
        {
            CUITimerScript component = obj2.GetComponent <CUITimerScript>();
            obj2.CustomSetActive(true);
            component.ReStartTimer();
            this.setBubbleText(index, content);
        }
    }
Пример #7
0
 private void On_Chat_EntryPanel_Click(CUIEvent uievent)
 {
     this.ShowPanel(true, true);
     if (((this.view != null) && (this.view.chatForm != null)) && (this.view.chatForm.gameObject != null))
     {
         this.DoChatOpenningAnim();
         CUITimerScript componetInChild = Utility.GetComponetInChild <CUITimerScript>(this.view.chatForm.gameObject, "Timer");
         if (componetInChild != null)
         {
             componetInChild.ReStartTimer();
         }
     }
 }
Пример #8
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();
                }
            }
        }
Пример #10
0
    private void onBattleEuipFormClose(CUIEvent uiEvent)
    {
        if (!this.IsBattleEquipGuideComplete())
        {
            CSkillButtonManager cSkillButtonManager = (Singleton <CBattleSystem> .GetInstance().FightForm != null) ? Singleton <CBattleSystem> .GetInstance().FightForm.m_skillButtonManager : null;

            if (cSkillButtonManager != null)
            {
                SkillButton button  = cSkillButtonManager.GetButton(SkillSlotType.SLOT_SKILL_9);
                PlayerKDA   hostKDA = Singleton <BattleStatistic> .GetInstance().m_playerKDAStat.GetHostKDA();

                if (hostKDA == null)
                {
                    return;
                }
                bool flag = false;
                ListView <HeroKDA> .Enumerator enumerator = hostKDA.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    if (enumerator.get_Current().Equips.Length > 0)
                    {
                        flag = true;
                        break;
                    }
                }
                if (button != null && button.m_button.activeSelf && flag)
                {
                    CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(FightForm.s_skillBtnFormPath);

                    if (form != null)
                    {
                        Transform transform = form.GetWidget(27).transform.FindChild("Panel_Guide");
                        if (transform != null)
                        {
                            transform.gameObject.CustomSetActive(true);
                            CUITimerScript component = transform.FindChild("Timer").GetComponent <CUITimerScript>();
                            component.ResetTime();
                            component.ReStartTimer();
                            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                            if (masterRoleInfo != null)
                            {
                                masterRoleInfo.SetClientBits(6, true, true);
                            }
                        }
                    }
                }
            }
        }
    }
Пример #11
0
        public void CheckMiShuTalk(bool isRestarTimer = true)
        {
            bool   flag        = false;
            string szMiShuDesc = null;

            if (Singleton <CTaskSys> .instance.model.IsShowMainTaskTab_RedDotCount())
            {
                flag        = true;
                szMiShuDesc = Singleton <CTextManager> .instance.GetText("Secretary_Reward_Tips");
            }
            else if (Singleton <CTaskSys> .instance.model.GetMaxIndex_TaskID_InState(RES_TASK_TYPE.RES_TASKTYPE_USUAL, CTask.State.Have_Done) != null)
            {
                flag        = true;
                szMiShuDesc = Singleton <CTextManager> .instance.GetText("Secretary_Reward_Tips");
            }
            else
            {
                CTask task = Singleton <CTaskSys> .instance.model.GetMaxIndex_TaskID_InState(RES_TASK_TYPE.RES_TASKTYPE_USUAL, CTask.State.OnGoing);

                if (task != null)
                {
                    flag        = true;
                    szMiShuDesc = task.m_resTask.szMiShuDesc;
                }
            }
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(CLobbySystem.LOBBY_FORM_PATH);

            if (form != null)
            {
                Transform      transform = form.transform.Find("LobbyBottom/Newbie/TalkFrame");
                Text           component = form.transform.Find("LobbyBottom/Newbie/TalkFrame/Text").GetComponent <Text>();
                CUITimerScript script2   = form.transform.Find("LobbyBottom/Newbie/TalkFrame/Timer").GetComponent <CUITimerScript>();
                if (flag)
                {
                    transform.gameObject.CustomSetActive(true);
                    component.text = szMiShuDesc;
                    script2.ReStartTimer();
                }
                else
                {
                    transform.gameObject.CustomSetActive(false);
                    script2.EndTimer();
                }
                if (isRestarTimer)
                {
                    form.transform.Find("LobbyBottom/Newbie/Timer").GetComponent <CUITimerScript>().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);
                }
            }
        }
Пример #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);
            }
        }
Пример #14
0
        public void OpenSpeakerForm(uint itemID)
        {
            if (itemID == 10041u || itemID == 10042u)
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                if (masterRoleInfo == null)
                {
                    return;
                }
                CUseableContainer useableContainer = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM);
                if (useableContainer == null)
                {
                    return;
                }
                if (useableContainer.GetUseableStackCount(2, itemID) == 0)
                {
                    CMallFactoryShopController.ShopProduct product;
                    if (itemID == 10041u)
                    {
                        product = Singleton <CMallFactoryShopController> .GetInstance().GetProduct(GameDataMgr.globalInfoDatabin.GetDataByKey(212u).dwConfValue);
                    }
                    else
                    {
                        product = Singleton <CMallFactoryShopController> .GetInstance().GetProduct(GameDataMgr.globalInfoDatabin.GetDataByKey(211u).dwConfValue);
                    }
                    if (product != null)
                    {
                        CUIEvent uIEvent = Singleton <CUIEventManager> .GetInstance().GetUIEvent();

                        uIEvent.m_eventID = enUIEventID.Mall_Buy_Product_Confirm;
                        uIEvent.m_eventParams.commonUInt64Param1 = (ulong)product.Key;
                        uIEvent.m_eventParams.commonUInt32Param1 = 1u;
                        Singleton <CMallFactoryShopController> .GetInstance().BuyShopProduct(product, 1u, true, uIEvent);
                    }
                    return;
                }
                ResHornInfo dataByKey = GameDataMgr.speakerDatabin.GetDataByKey(itemID);
                this.m_itemID         = itemID;
                this.m_characterLimit = dataByKey.dwWordLimit;
                if (dataByKey == null)
                {
                    return;
                }
                CUIFormScript cUIFormScript = Singleton <CUIManager> .get_instance().OpenForm(CLoudSpeakerSys.SPEAKER_FORM_PATH, false, false);

                if (cUIFormScript == null || cUIFormScript.gameObject == null)
                {
                    return;
                }
                GameObject     obj              = Utility.FindChild(cUIFormScript.gameObject, "pnlBg/Title/speakerText");
                GameObject     obj2             = Utility.FindChild(cUIFormScript.gameObject, "pnlBg/Title/loudSpeakerText");
                GameObject     obj3             = Utility.FindChild(cUIFormScript.gameObject, "pnlBg/Model/speaker");
                GameObject     obj4             = Utility.FindChild(cUIFormScript.gameObject, "pnlBg/Model/loudspeaker");
                InputField     componetInChild  = Utility.GetComponetInChild <InputField>(cUIFormScript.gameObject, "pnlBg/Panel_Main/InputField");
                CUITimerScript componetInChild2 = Utility.GetComponetInChild <CUITimerScript>(cUIFormScript.gameObject, "Timer");
                componetInChild2.ReStartTimer();
                if (itemID == 10041u)
                {
                    obj.CustomSetActive(true);
                    obj2.CustomSetActive(false);
                    obj3.CustomSetActive(true);
                    obj4.CustomSetActive(false);
                    componetInChild.characterLimit = (int)this.m_characterLimit;
                }
                else
                {
                    obj.CustomSetActive(false);
                    obj2.CustomSetActive(true);
                    obj3.CustomSetActive(false);
                    obj4.CustomSetActive(true);
                    componetInChild.characterLimit = (int)this.m_characterLimit;
                }
            }
        }
Пример #15
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);
                }
            }
        }
Пример #16
0
        public void LoadSubModule(CUIFormScript form, CUIEvent uiEvent = null)
        {
            bool flag = false;

            form.GetWidget(5).CustomSetActive(false);
            form.GetWidget(4).CustomSetActive(false);
            form.GetWidget(3).CustomSetActive(false);
            switch (this.m_selectMenuType)
            {
            case enSymbolMenuType.SymbolEquip:
                flag = this.m_symbolWearCtrl.Loaded(form);
                if (!flag)
                {
                    form.GetWidget(8).CustomSetActive(true);
                    this.m_symbolWearCtrl.Load(form);
                }
                break;

            case enSymbolMenuType.SymbolRecommend:
                flag = this.m_symbolRcmdCtrl.Loaded(form);
                if (!flag)
                {
                    form.GetWidget(8).CustomSetActive(true);
                    this.m_symbolRcmdCtrl.Load(form);
                }
                break;

            case enSymbolMenuType.SymbolMake:
                Singleton <CSymbolMakeController> .GetInstance().Source = enSymbolMakeSource.SymbolManage;

                flag = Singleton <CSymbolMakeController> .GetInstance().Loaded(form);

                if (!flag)
                {
                    form.GetWidget(8).CustomSetActive(true);
                    Singleton <CSymbolMakeController> .GetInstance().Load(form);
                }
                break;
            }
            uiEvent.m_srcFormScript.GetWidget(1).CustomSetActive(this.m_selectMenuType == enSymbolMenuType.SymbolEquip);
            uiEvent.m_srcFormScript.GetWidget(6).CustomSetActive(false);
            if (!flag)
            {
                GameObject widget = form.GetWidget(7);
                if (widget != null)
                {
                    CUITimerScript component = widget.GetComponent <CUITimerScript>();
                    if (component != null)
                    {
                        component.ReStartTimer();
                    }
                }
            }
            else
            {
                CUIEvent cUIEvent = new CUIEvent();
                cUIEvent.m_eventID       = enUIEventID.Symbol_Update_Sub_Module;
                cUIEvent.m_srcFormScript = form;
                Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(cUIEvent);
            }
        }