Exemple #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);
                    }
                }
            }
        }
Exemple #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);
                        }
                    }
                }
            }
        }
        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 InitForm()
 {
     if (this.m_form != null)
     {
         Text component = this.m_form.GetWidget(0).GetComponent <Text>();
         Text text2     = this.m_form.GetWidget(1).transform.FindChild("Text").GetComponent <Text>();
         this.m_stepList   = this.m_form.GetWidget(2).GetComponent <CUIStepListScript>();
         this.m_BottomBtn  = this.m_form.GetWidget(1).gameObject;
         this.m_PickObject = this.m_form.GetWidget(3).gameObject;
         this.m_BtnLeft    = this.m_form.GetWidget(4).gameObject;
         this.m_BtnRight   = this.m_form.GetWidget(5).gameObject;
         this.m_timer      = this.m_form.GetWidget(6).GetComponent <CUITimerScript>();
         if (this.m_title != null)
         {
             component.text = this.m_title;
         }
         if (this.m_btnName != null)
         {
             text2.text = this.m_btnName;
         }
         this.m_stepList.SetElementAmount(this.m_totalImgNum);
         for (int i = 0; i < this.m_totalImgNum; i++)
         {
             if (this.m_stepList.GetElemenet(i) != null)
             {
                 this.m_stepList.GetElemenet(i).transform.FindChild("Image").GetComponent <Image>().SetSprite(this.m_imgPath[i], this.m_form, true, false, false);
             }
         }
         this.m_BottomBtn.CustomSetActive(false);
         this.m_stepList.SetDontUpdate(true);
     }
 }
        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;
                }
            }
        }
Exemple #6
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);
                }
            }
        }
    }
Exemple #7
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();
        }
Exemple #8
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);
        }
Exemple #9
0
        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);
                    }
                }
            }
        }
Exemple #10
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);
            }
        }
Exemple #11
0
 public void Clear()
 {
     this.listNode     = null;
     this.form         = null;
     this.listScript   = null;
     this.m_inputFiled = null;
     this.timerScript  = null;
     this.m_sendBtn    = null;
 }
Exemple #12
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();
            }
        }
        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);
        }
Exemple #14
0
        private void OnSurrenderTimeStart(CUIEvent cuiEvent)
        {
            GameObject     srcWidget       = cuiEvent.m_srcWidget;
            CUITimerScript srcWidgetScript = cuiEvent.m_srcWidgetScript as CUITimerScript;

            if ((srcWidget != null) && (srcWidgetScript != null))
            {
                float num = srcWidgetScript.GetCurrentTime() / ((float)this.GetSurrenderVaildTime());
                Utility.GetComponetInChild <Slider>(srcWidget, "CountDownBar/Bar").value = num;
            }
        }
Exemple #15
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);
                }
            }
        }
        private void OnSurrenderTimeStart(CUIEvent cuiEvent)
        {
            GameObject     srcWidget      = cuiEvent.m_srcWidget;
            CUITimerScript cUITimerScript = cuiEvent.m_srcWidgetScript as CUITimerScript;

            if (srcWidget != null && cUITimerScript != null)
            {
                float value = cUITimerScript.GetCurrentTime() / (float)this.GetSurrenderVaildTime();
                Utility.GetComponetInChild <Slider>(srcWidget, "CountDownBar/Bar").set_value(value);
            }
        }
Exemple #17
0
        public void OnCloseTalk(CUIEvent uiEvent)
        {
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(CLobbySystem.LOBBY_FORM_PATH);

            if (form != null)
            {
                Transform      transform = form.transform.Find("LobbyBottom/Newbie/TalkFrame");
                CUITimerScript component = form.transform.Find("LobbyBottom/Newbie/TalkFrame/Timer").GetComponent <CUITimerScript>();
                transform.gameObject.CustomSetActive(false);
                component.EndTimer();
            }
        }
    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);
        }
    }
        public void OpenForm()
        {
            this.m_form = Singleton <CUIManager> .GetInstance().GetForm(CBattleStatCompetitionSystem.s_equipFormPath);

            if (this.m_form == null)
            {
                this.m_form = Singleton <CUIManager> .GetInstance().OpenForm(CBattleStatCompetitionSystem.s_equipFormPath, true, true);
            }
            this.m_form.gameObject.CustomSetActive(true);
            this.tabList           = this.m_form.GetWidget(0).GetComponent <CUIListScript>();
            this.heatmapView       = this.m_form.GetWidget(3);
            this.teamFightListGo   = this.m_form.GetWidget(8);
            this.teamFightDataView = this.m_form.GetWidget(7);
            this.heatmapView.CustomSetActive(false);
            this.teamFightDataView.CustomSetActive(false);
            this.timeStartGo = this.m_form.GetWidget(9);
            this.timeEndGo   = this.m_form.GetWidget(10);
            this.startInput  = this.timeStartGo.transform.Find("InputField").GetComponent <InputField>();
            this.endInput    = this.timeEndGo.transform.Find("InputField").GetComponent <InputField>();
            this.startInput.set_text("0000");
            this.endInput.set_text("0000");
            this.startTimeText = this.timeStartGo.transform.Find("TimeDisp").GetComponent <Text>();
            this.endTimeText   = this.timeEndGo.transform.Find("TimeDisp").GetComponent <Text>();
            this.startTimeText.set_text("00:00");
            this.startTimeText.set_text("00:00");
            this.updateTimer             = this.m_form.GetWidget(2).GetComponent <CUITimerScript>();
            this.IRViewScprit            = this.m_form.GetWidget(1).GetComponent <CUIGraphIRViewScript>();
            this.imgMapBg                = this.m_form.GetWidget(4).GetComponent <Image>();
            this.m_IRListLeft            = this.m_form.GetWidget(5).GetComponent <CUIListScript>();
            this.m_IRListRight           = this.m_form.GetWidget(6).GetComponent <CUIListScript>();
            this.teamFightTypeToggleList = this.m_form.GetWidget(11).GetComponent <CUIToggleListScript>();
            this.m_curIRViewIdx          = 12;
            string[] array = new string[]
            {
                Singleton <CTextManager> .GetInstance().GetText("BattleStatCompetition_IRView_Title"),
                Singleton <CTextManager> .GetInstance().GetText("BattleStatCompetition_GroDPSView_Title")
            };
            this.tabList.SetElementAmount(array.Length);
            for (int i = 0; i < array.Length; i++)
            {
                Text component = this.tabList.GetElemenet(i).transform.Find("Text").GetComponent <Text>();
                component.set_text(array[i]);
            }
            this.SetHeroList();
            this.ResetIRView();
            this.ResetTeamFightView();
            this.tabList.SelectElement(0, true);
            this.OnTabSelect(null);
            this.m_IRListLeft.SelectElement(-1, true);
            this.m_IRListRight.SelectElement(-1, true);
            this.m_teamFightDataStart = -1;
            this.m_teamFightDataEnd   = -1;
        }
Exemple #20
0
        public static void UpdateSwapBox(int pos)
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CRoomSystem.PATH_ROOM_SWAP);

            if ((form != null) && (form.gameObject != null))
            {
                GameObject     p         = Utility.FindChild(form.gameObject, "SwapMessageBox");
                CUITimerScript component = p.GetComponent <CUITimerScript>();
                string[]       args      = new string[] { (pos + 1).ToString(), ((int)component.GetCurrentTime()).ToString() };
                Utility.GetComponetInChild <Text>(p, "Content").text = Singleton <CTextManager> .instance.GetText("Room_Change_Pos_Tip_3", args);
            }
        }
 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();
         }
     }
 }
Exemple #22
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);
                }
            }
        }
Exemple #23
0
 public void Clear()
 {
     this.m_imgPath     = null;
     this.m_title       = null;
     this.m_btnName     = null;
     this.m_PickIdxList = null;
     this.m_BottomBtn   = null;
     this.m_stepList    = null;
     this.m_form        = null;
     this.m_timer       = null;
     this.m_PickObject  = null;
     this.m_BtnLeft     = null;
     this.m_BtnRight    = null;
 }
    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);
                            }
                        }
                    }
                }
            }
        }
    }
        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();
                }
            }
        }
Exemple #26
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();
                }
            }
        }
        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 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);
                }
            }
        }
Exemple #29
0
    private void InitForm()
    {
        if (this.m_form == null)
        {
            return;
        }
        Text component  = this.m_form.GetWidget(0).GetComponent <Text>();
        Text component2 = this.m_form.GetWidget(1).transform.FindChild("Text").GetComponent <Text>();

        this.m_stepList   = this.m_form.GetWidget(2).GetComponent <CUIStepListScript>();
        this.m_BottomBtn  = this.m_form.GetWidget(1).gameObject;
        this.m_PickObject = this.m_form.GetWidget(3).gameObject;
        this.m_BtnLeft    = this.m_form.GetWidget(4).gameObject;
        this.m_BtnRight   = this.m_form.GetWidget(5).gameObject;
        this.m_timer      = this.m_form.GetWidget(6).GetComponent <CUITimerScript>();
        if (this.m_title != null)
        {
            component.set_text(this.m_title);
        }
        if (this.m_btnName != null)
        {
            component2.set_text(this.m_btnName);
        }
        this.m_stepList.SetElementAmount(this.m_totalImgNum);
        for (int i = 0; i < this.m_totalImgNum; i++)
        {
            if (this.m_stepList.GetElemenet(i) != null)
            {
                Image         component3    = this.m_stepList.GetElemenet(i).transform.FindChild("Image").GetComponent <Image>();
                CBinaryObject cBinaryObject = Singleton <CResourceManager> .GetInstance().GetResource(this.m_imgPath[i] + ".bytes", typeof(TextAsset), enResourceType.UISprite, false, false).m_content as CBinaryObject;

                if (cBinaryObject != null)
                {
                    byte[]    data      = cBinaryObject.m_data;
                    Texture2D texture2D = new Texture2D(0, 0, TextureFormat.RGB24, false);
                    texture2D.LoadImage(data);
                    Sprite sprite = Sprite.Create(texture2D, new Rect(0f, 0f, (float)texture2D.width, (float)texture2D.height), new Vector2(0.5f, 0.5f));
                    component3.set_sprite(sprite);
                }
                else
                {
                    component3.SetSprite(this.m_imgPath[i], this.m_form, true, false, false, false);
                }
            }
        }
        this.m_stepList.SetDontUpdate(true);
    }
Exemple #30
0
        public static void UpdateSwapBox(COM_PLAYERCAMP camp, int pos)
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CRoomSystem.PATH_ROOM_SWAP);

            if (form == null || form.gameObject == null)
            {
                return;
            }
            GameObject     gameObject      = Utility.FindChild(form.gameObject, "SwapMessageBox");
            CUITimerScript component       = gameObject.GetComponent <CUITimerScript>();
            Text           componetInChild = Utility.GetComponetInChild <Text>(gameObject, "Content");

            componetInChild.set_text(Singleton <CTextManager> .instance.GetText("Room_Change_Pos_Tip_3", new string[]
            {
                Singleton <CTextManager> .instance.GetText("RoomCamp_" + (int)camp),
                (pos + 1).ToString(),
                ((int)component.GetCurrentTime()).ToString()
            }));
        }