Esempio n. 1
0
 private void Reset()
 {
     this.m_enLastEventPriority = CRecordUseSDK.RECORD_EVENT_PRIORITY.RECORD_EVENT_TYPE_INVALID;
     this.m_lLastEventStartTime = 0L;
     this.m_lLastEventEndTime   = 0L;
     this.m_lGameStartTime      = 0L;
     this.m_lGameEndTime        = 0L;
     this.m_iContinuKillMaxNum  = -1;
     this.m_bIsStartRecordOk    = false;
     this.m_bIsMvp                   = false;
     this.m_iHostPlaterKillNum       = 0;
     this.m_iHostPlaterDeadNum       = 0;
     this.m_iHostPlaterAssistNum     = 0;
     this.m_bIsCallGameJoyGenerate   = false;
     this.m_bIsCallStopGameJoyRecord = false;
     this.m_lVideoTimeLen            = 0L;
     if (this.m_hostActor)
     {
         this.m_hostActor.Release();
     }
     if (this.m_stRecordInfo != null)
     {
         this.m_stRecordInfo.Clear();
     }
     this.m_uiEventStartTimeInterval            = GameDataMgr.GetGlobeValue(219) * 1000u;
     this.m_uiEventEndTimeInterval              = GameDataMgr.GetGlobeValue(249) * 1000u;
     this.m_uiEventNumMax                       = GameDataMgr.GetGlobeValue(220);
     this.m_ui543KillEventTotalTime             = GameDataMgr.GetGlobeValue(221) * 1000u;
     this.m_ui210KillEventTotalTime             = GameDataMgr.GetGlobeValue(256) * 1000u;
     this.m_uiMinSpaceLimit                     = GameDataMgr.GetGlobeValue(231);
     this.m_uiOnceDoubleEventTimeIntervalReduce = GameDataMgr.GetGlobeValue(248) * 1000u;
 }
Esempio n. 2
0
    public static uint GetGuideLevelHeroTypeBtMobaHeroType(int mobaHeroType)
    {
        uint globeValue  = GameDataMgr.GetGlobeValue(284);
        uint globeValue2 = GameDataMgr.GetGlobeValue(285);
        uint globeValue3 = GameDataMgr.GetGlobeValue(286);

        switch (mobaHeroType + 1)
        {
        case 0:
        case 1:
        case 2:
            return(globeValue);

        case 3:
            return(globeValue3);

        case 4:
        case 5:
            return(globeValue);

        case 6:
            return(globeValue2);

        case 7:
            return(globeValue3);

        default:
            return(globeValue);
        }
    }
Esempio n. 3
0
        public void Init(GameObject objPanelEnemyHeroAtk)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            if (curLvelContext != null && curLvelContext.IsMobaMode())
            {
                this.m_bIsMobaMode = true;
                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Battle_EnemyHeroAtkBtn_Down, new CUIEventManager.OnUIEventHandler(this.OnEnemyHeroAtkBtnDown));

                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Battle_EnemyHeroAtkBtn_Up, new CUIEventManager.OnUIEventHandler(this.OnEnemyHeroAtkBtnUp));

                Singleton <EventRouter> .GetInstance().AddEventHandler <uint, bool>("ActorVisibleToHostPlayerChnage", new Action <uint, bool>(this.OnActorVisibleToHostPlayerChance));

                Singleton <EventRouter> .GetInstance().AddEventHandler <PoolObjHandle <ActorRoot>, int, int>("HeroHpChange", new Action <PoolObjHandle <ActorRoot>, int, int>(this.OnHeroHpChange));

                Singleton <GameEventSys> .instance.AddEventHandler <DefaultGameEventParam>(GameEventDef.Event_ActorRevive, new RefAction <DefaultGameEventParam>(this.OnActorRevive));

                Singleton <GameEventSys> .instance.AddEventHandler <DefaultGameEventParam>(GameEventDef.Event_FightStart, new RefAction <DefaultGameEventParam>(this.OnFightStart));

                Singleton <GameEventSys> .instance.AddEventHandler <DefaultGameEventParam>(GameEventDef.Event_CaptainSwitch, new RefAction <DefaultGameEventParam>(this.OnCaptainSwitched));

                this.m_objPanelEnemyHeroAtk = objPanelEnemyHeroAtk;
                this.m_hostActor            = Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain;

                this.m_iEnemyDistanceMax = (int)GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_ENEMYATKBTN_ENEMYDISTANCEMAX);
                int globeValue = (int)GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_HORIZON_RADIUS);
                this.m_iEnemyDistanceMax             = ((this.m_iEnemyDistanceMax < globeValue) ? this.m_iEnemyDistanceMax : globeValue);
                this.m_iCurTargetEnemyBtnIndex       = -1;
                this.m_iLastTargetEnemyBtnIndex      = -1;
                this.m_iLastSkillTargetEnemyBtnIndex = -1;
                this.m_bLastSkillUsed = true;
            }
        }
        private uint GetTimeToCD(RES_CHANGE_NAME_TYPE changeType)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                DateTime dateTime = Utility.ToUtcTime2Local((long)CRoleInfo.GetCurrentUTCTime());
                DateTime dateTime2;
                uint     globeValue;
                if (changeType != RES_CHANGE_NAME_TYPE.RES_CHANGE_NAME_TYPE_PLAYER)
                {
                    if (changeType != RES_CHANGE_NAME_TYPE.RES_CHANGE_NAME_TYPE_GUILD)
                    {
                        return(0u);
                    }
                    dateTime2  = Utility.ToUtcTime2Local((long)((ulong)masterRoleInfo.chgNameCD.dwLastChgGuildNameTime));
                    globeValue = GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_CHG_GUILD_NAME_CD);
                }
                else
                {
                    dateTime2  = Utility.ToUtcTime2Local((long)((ulong)masterRoleInfo.chgNameCD.dwLastChgPlayerNameTime));
                    globeValue = GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_CHG_PLAYER_NAME_CD);
                }
                uint dwConfValue = GameDataMgr.globalInfoDatabin.GetDataByKey(10u).dwConfValue;
                int  num         = Utility.Hours2Second((int)(dwConfValue / 100u)) + Utility.Minutes2Seconds((int)(dwConfValue % 100u));
                dateTime  = dateTime.AddSeconds(-(double)num).get_Date();
                dateTime2 = dateTime2.AddSeconds(-(double)num).get_Date();
                int days = (dateTime - dateTime2).get_Days();
                return((uint)(((long)days >= (long)((ulong)globeValue)) ? 0uL : ((ulong)globeValue - (ulong)((long)days))));
            }
            return(0u);
        }
Esempio n. 5
0
    public static void RefreshRecommendTips()
    {
        CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(CRoleRegisterSys.s_heroTypeSelectFormPath);

        CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

        if (form != null && masterRoleInfo != null)
        {
            GameObject obj = null;
            if (masterRoleInfo.acntMobaInfo.bMobaUsedType == 1)
            {
                uint guideLevelHeroTypeBtMobaHeroType = CRoleRegisterView.GetGuideLevelHeroTypeBtMobaHeroType(masterRoleInfo.acntMobaInfo.iRecommendHeroType);
                if (guideLevelHeroTypeBtMobaHeroType == GameDataMgr.GetGlobeValue(284))
                {
                    obj = form.GetWidget(0).transform.FindChild("TuiJian").gameObject;
                }
                else if (guideLevelHeroTypeBtMobaHeroType == GameDataMgr.GetGlobeValue(285))
                {
                    obj = form.GetWidget(1).transform.FindChild("TuiJian").gameObject;
                }
                else if (guideLevelHeroTypeBtMobaHeroType == GameDataMgr.GetGlobeValue(286))
                {
                    obj = form.GetWidget(2).transform.FindChild("TuiJian").gameObject;
                }
            }
            else if (masterRoleInfo.acntMobaInfo.bMobaUsedType == 2)
            {
                obj = form.GetWidget(0).transform.FindChild("TuiJian").gameObject;
            }
            obj.CustomSetActive(true);
        }
    }
Esempio n. 6
0
    public static uint GetGuideLevelHeroTypeBtMobaHeroType(int mobaHeroType)
    {
        uint globeValue  = GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_NEWBIE_RECOMMEND_HEROTYPE1);
        uint globeValue2 = GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_NEWBIE_RECOMMEND_HEROTYPE2);
        uint globeValue3 = GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_NEWBIE_RECOMMEND_HEROTYPE3);

        switch (mobaHeroType + 1)
        {
        case 0:
        case 1:
        case 2:
            return(globeValue);

        case 3:
            return(globeValue3);

        case 4:
        case 5:
            return(globeValue);

        case 6:
            return(globeValue2);

        case 7:
            return(globeValue3);

        default:
            return(globeValue);
        }
    }
Esempio n. 7
0
        private void OnLoginSceneCompleted()
        {
            Singleton <CSoundManager> .GetInstance().PostEvent("Login_Play", null);

            Singleton <CLoginSystem> .GetInstance().Draw();

            if (GameDataMgr.GetGlobeValue(244) == 1u && !DeviceCheckSys.CheckAvailMemory() && DeviceCheckSys.GetRecordCurMemNotEnoughPopTimes() < 3)
            {
                Singleton <CUIManager> .GetInstance().OpenMessageBox(Singleton <CTextManager> .GetInstance().GetText("CheckDevice_QuitGame_CurMemNotEnough"), false);

                DeviceCheckSys.RecordCurMemNotEnoughPopTimes();
            }
        }
Esempio n. 8
0
        public uint GetBestPlayer()
        {
            DictionaryView <uint, PlayerKDA> .Enumerator enumerator = Singleton <BattleStatistic> .instance.m_playerKDAStat.GetEnumerator();

            float     num            = ((float)GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_HONOR_KILL_FACTOR)) / 10000f;
            float     num2           = ((float)GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_HONOR_ASSIST_FACTOR)) / 10000f;
            float     num3           = ((float)GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_HONOR_DEAD_FACTOR)) / 10000f;
            uint      lastBestPlayer = this.m_lastBestPlayer;
            float     b       = 0f;
            int       numKill = 0;
            PlayerKDA rkda    = null;

            while (enumerator.MoveNext())
            {
                KeyValuePair <uint, PlayerKDA> current = enumerator.Current;
                rkda = current.Value;
                float a = ((rkda.numKill * num) + (rkda.numAssist * num2)) - (rkda.numDead * num3);
                if (Mathf.Approximately(a, b))
                {
                    KeyValuePair <uint, PlayerKDA> pair2 = enumerator.Current;
                    if (pair2.Value.numKill >= numKill)
                    {
                        if (rkda.PlayerId != this.m_lastBestPlayer)
                        {
                            lastBestPlayer = rkda.PlayerId;
                        }
                        b = a;
                        KeyValuePair <uint, PlayerKDA> pair3 = enumerator.Current;
                        numKill = pair3.Value.numKill;
                    }
                }
                else if (a >= b)
                {
                    lastBestPlayer = rkda.PlayerId;
                    b = a;
                    KeyValuePair <uint, PlayerKDA> pair4 = enumerator.Current;
                    numKill = pair4.Value.numKill;
                }
            }
            if (Mathf.Approximately(b, 0f))
            {
                this.m_lastBestPlayer = 0;
                return(0);
            }
            this.m_lastBestPlayer = lastBestPlayer;
            return(lastBestPlayer);
        }
        public uint GetBestPlayer()
        {
            DictionaryView <uint, PlayerKDA> .Enumerator enumerator = Singleton <BattleStatistic> .instance.m_playerKDAStat.GetEnumerator();

            float num  = GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_HONOR_KILL_FACTOR) / 10000f;
            float num2 = GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_HONOR_ASSIST_FACTOR) / 10000f;
            float num3 = GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_HONOR_DEAD_FACTOR) / 10000f;
            uint  num4 = this.m_lastBestPlayer;
            float num5 = 0f;
            int   num6 = 0;

            while (enumerator.MoveNext())
            {
                KeyValuePair <uint, PlayerKDA> current = enumerator.Current;
                PlayerKDA value = current.get_Value();
                float     num7  = (float)value.numKill * num + (float)value.numAssist * num2 - (float)value.numDead * num3;
                if (Mathf.Approximately(num7, num5))
                {
                    KeyValuePair <uint, PlayerKDA> current2 = enumerator.Current;
                    if (current2.get_Value().numKill >= num6)
                    {
                        if (value.PlayerId != this.m_lastBestPlayer)
                        {
                            num4 = value.PlayerId;
                        }
                        num5 = num7;
                        KeyValuePair <uint, PlayerKDA> current3 = enumerator.Current;
                        num6 = current3.get_Value().numKill;
                    }
                }
                else if (num7 >= num5)
                {
                    num4 = value.PlayerId;
                    num5 = num7;
                    KeyValuePair <uint, PlayerKDA> current4 = enumerator.Current;
                    num6 = current4.get_Value().numKill;
                }
            }
            if (Mathf.Approximately(num5, 0f))
            {
                this.m_lastBestPlayer = 0u;
                return(0u);
            }
            this.m_lastBestPlayer = num4;
            return(num4);
        }
 public void Init(PoolObjHandle <ActorRoot> actorRoot)
 {
     this.m_actorHero = actorRoot;
     this.m_iDamageIntervalTimeMax   = (int)GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_DEADINFO_ATTACK_INTERVALTIME_MAX);
     this.m_iDamageStatisticsTimeMax = (int)GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_DEADINFO_STATTIME_MAX);
 }
Esempio n. 11
0
    public static void SetHeroType(uint heroType)
    {
        CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(CRoleRegisterSys.s_heroTypeSelectFormPath);

        if (form != null)
        {
            GameObject gameObject = Utility.FindChild(form.gameObject, "ConfirmBtn").gameObject;
            gameObject.CustomSetActive(true);
            GameObject widget  = form.GetWidget(0);
            GameObject widget2 = form.GetWidget(1);
            GameObject widget3 = form.GetWidget(2);
            gameObject.GetComponent <CUIEventScript>().m_onClickEventParams.tag = (int)heroType;
            if (heroType == GameDataMgr.GetGlobeValue(284))
            {
                gameObject.GetComponent <CUIEventScript>().enabled = true;
                gameObject.GetComponent <Button>().interactable    = true;
                gameObject.GetComponentInChildren <Text>().color   = Color.white;
                widget.transform.FindChild("Background/Checkmark").gameObject.CustomSetActive(true);
                widget2.transform.FindChild("Background/Checkmark").gameObject.CustomSetActive(false);
                widget3.transform.FindChild("Background/Checkmark").gameObject.CustomSetActive(false);
                widget.transform.FindChild("Mask").gameObject.CustomSetActive(false);
                widget2.transform.FindChild("Mask").gameObject.CustomSetActive(true);
                widget3.transform.FindChild("Mask").gameObject.CustomSetActive(true);
            }
            else if (heroType == GameDataMgr.GetGlobeValue(285))
            {
                gameObject.GetComponent <CUIEventScript>().enabled = true;
                gameObject.GetComponent <Button>().interactable    = true;
                gameObject.GetComponentInChildren <Text>().color   = Color.white;
                widget.transform.FindChild("Background/Checkmark").gameObject.CustomSetActive(false);
                widget2.transform.FindChild("Background/Checkmark").gameObject.CustomSetActive(true);
                widget3.transform.FindChild("Background/Checkmark").gameObject.CustomSetActive(false);
                widget.transform.FindChild("Mask").gameObject.CustomSetActive(true);
                widget2.transform.FindChild("Mask").gameObject.CustomSetActive(false);
                widget3.transform.FindChild("Mask").gameObject.CustomSetActive(true);
            }
            else if (heroType == GameDataMgr.GetGlobeValue(286))
            {
                gameObject.GetComponent <CUIEventScript>().enabled = true;
                gameObject.GetComponent <Button>().interactable    = true;
                gameObject.GetComponentInChildren <Text>().color   = Color.white;
                widget.transform.FindChild("Background/Checkmark").gameObject.CustomSetActive(false);
                widget2.transform.FindChild("Background/Checkmark").gameObject.CustomSetActive(false);
                widget3.transform.FindChild("Background/Checkmark").gameObject.CustomSetActive(true);
                widget.transform.FindChild("Mask").gameObject.CustomSetActive(true);
                widget2.transform.FindChild("Mask").gameObject.CustomSetActive(true);
                widget3.transform.FindChild("Mask").gameObject.CustomSetActive(false);
            }
            else
            {
                gameObject.GetComponent <CUIEventScript>().enabled = false;
                gameObject.GetComponent <Button>().interactable    = false;
                gameObject.GetComponentInChildren <Text>().color   = Color.gray;
                widget.transform.FindChild("Background/Checkmark").gameObject.CustomSetActive(false);
                widget2.transform.FindChild("Background/Checkmark").gameObject.CustomSetActive(false);
                widget3.transform.FindChild("Background/Checkmark").gameObject.CustomSetActive(false);
                widget.transform.FindChild("Mask").gameObject.CustomSetActive(false);
                widget2.transform.FindChild("Mask").gameObject.CustomSetActive(false);
                widget3.transform.FindChild("Mask").gameObject.CustomSetActive(false);
            }
            CUIEventScript component = gameObject.GetComponent <CUIEventScript>();
            component.m_onClickEventParams.tagUInt = heroType;
        }
    }
Esempio n. 12
0
    public static void OpenHeroTypeSelectForm()
    {
        CUIFormScript cUIFormScript = Singleton <CUIManager> .get_instance().OpenForm(CRoleRegisterSys.s_heroTypeSelectFormPath, false, true);

        if (cUIFormScript != null)
        {
            GameObject gameObject = Utility.FindChild(cUIFormScript.gameObject, "ToggleGroup/Toggle1");
            gameObject.GetComponent <CUIEventScript>().m_onClickEventParams.tagUInt = GameDataMgr.GetGlobeValue(286);
            gameObject = Utility.FindChild(cUIFormScript.gameObject, "ToggleGroup/Toggle2");
            gameObject.GetComponent <CUIEventScript>().m_onClickEventParams.tagUInt = GameDataMgr.GetGlobeValue(284);
            gameObject = Utility.FindChild(cUIFormScript.gameObject, "ToggleGroup/Toggle3");
            gameObject.GetComponent <CUIEventScript>().m_onClickEventParams.tagUInt = GameDataMgr.GetGlobeValue(285);
            CRoleRegisterView.SetHeroType(0u);
        }
    }
Esempio n. 13
0
 public void Init(PoolObjHandle <ActorRoot> actorRoot)
 {
     this.m_actorHero = actorRoot;
     this.m_iDamageIntervalTimeMax   = (int)GameDataMgr.GetGlobeValue(298);
     this.m_iDamageStatisticsTimeMax = (int)GameDataMgr.GetGlobeValue(299);
 }
Esempio n. 14
0
        public static void InitMatchingEntry(CUIFormScript form)
        {
            if (form == null)
            {
                return;
            }
            Transform transform = form.transform;

            uint[] array = new uint[23];
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_1V1"), ref array[0]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_3V3"), ref array[1]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_1V1_1"), ref array[2]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_1V1_1"), ref array[3]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_1V1_1"), ref array[4]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_3V3Team_1"), ref array[5]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_3V3Team_1"), ref array[6]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_3V3Team_1"), ref array[7]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5Team_1"), ref array[8]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5Team_1"), ref array[9]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5Team_1"), ref array[10]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_Melee_Team_1"), ref array[11]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_Melee_Team_1"), ref array[12]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_Melee_Team_1"), ref array[13]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5"), ref array[14]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_MELEE"), ref array[15]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_Fire"), ref array[16]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5Clone"), ref array[17]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5CD"), ref array[18]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5Miwu"), ref array[19]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5TeamMiwu_1"), ref array[20]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5TeamMiwu_1"), ref array[21]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5TeamMiwu_1"), ref array[22]);
            CUIMiniEventScript[] array2 = new CUIMiniEventScript[]
            {
                transform.Find("panelGroup2/btnGroup/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup2/btnGroup/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button1/btnGrp/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button1/btnGrp/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button1/btnGrp/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button2/btnGrp/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button2/btnGrp/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button2/btnGrp/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button4/btnGrp/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button4/btnGrp/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button4/btnGrp/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button3/btnGrp/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button3/btnGrp/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button3/btnGrp/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup2/btnGroup/Button4").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup2/btnGroup/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup5/btnGroup/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup5/btnGroup/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup5/btnGroup/Button4").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup2/btnGroup/Button5").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button5/btnGrp/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button5/btnGrp/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button5/btnGrp/Button3").GetComponent <CUIMiniEventScript>()
            };
            for (int i = 0; i < array.Length; i++)
            {
                array2[i].m_onClickEventParams.tagUInt = array[i];
                array2[i].m_onClickEventParams.tag     = (int)CMatchingView.mapDifficultyList[i];
            }
            transform.Find("panelGroup1/btnGroup/Button1").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 1;
            transform.Find("panelGroup1/btnGroup/Button2").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 2;
            transform.Find("panelGroup1/btnGroup/ButtonEntertain").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag = 3;
            transform.Find("panelGroup3/btnGroup/Button1").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 0;
            transform.Find("panelGroup3/btnGroup/Button2").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 1;
            transform.Find("panelGroup3/btnGroup/Button4").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 2;
            transform.Find("panelGroup3/btnGroup/Button3").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 3;
            transform.Find("panelGroup3/btnGroup/Button5").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 4;
            transform.FindChild("panelGroup5/btnGroup/Button1").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag    = 0;
            transform.FindChild("panelGroup5/btnGroup/Button3").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag    = 1;
            transform.FindChild("panelGroup5/btnGroup/Button4").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag    = 2;
            CMatchingView.ShowDefaultHeadImgStartLogicLadderLevel = (int)CLadderSystem.GetGradeDataByShowGrade((int)GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_SHOW_DEFAULT_HEADIMG_START_LADDERLEVEL)).bLogicGrade;
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return;
            }
            GameObject gameObject  = transform.FindChild("CoinAndExp/DoubleCoin").gameObject;
            GameObject gameObject2 = transform.FindChild("CoinAndExp/DoubleExp").gameObject;

            gameObject2.CustomSetActive(false);
            gameObject.CustomSetActive(false);
            masterRoleInfo.UpdateCoinAndExpValidTime();
            if (masterRoleInfo.HaveExtraCoin())
            {
                gameObject.CustomSetActive(true);
                string text  = string.Empty;
                string text2 = string.Empty;
                if (masterRoleInfo.GetCoinExpireHours() > 0)
                {
                    string text3 = Singleton <CTextManager> .GetInstance().GetText("DoubleCoinExpireTimeTips");

                    text = string.Format(text3, masterRoleInfo.GetCoinExpireHours() / 24, masterRoleInfo.GetCoinExpireHours() % 24);
                }
                if (masterRoleInfo.GetCoinWinCount() > 0u)
                {
                    string text4 = Singleton <CTextManager> .GetInstance().GetText("DoubleCoinCountWinTips");

                    text2 = string.Format(text4, masterRoleInfo.GetCoinWinCount());
                }
                if (string.IsNullOrEmpty(text))
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject, string.Format("{0}", text2), enUseableTipsPos.enBottom);
                }
                else if (string.IsNullOrEmpty(text2))
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject, string.Format("{0}", text), enUseableTipsPos.enBottom);
                }
                else
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject, string.Format("{0}\n{1}", text, text2), enUseableTipsPos.enBottom);
                }
            }
            if (masterRoleInfo.HaveExtraExp())
            {
                gameObject2.CustomSetActive(true);
                string text5 = string.Empty;
                string text6 = string.Empty;
                if (masterRoleInfo.GetExpExpireHours() > 0)
                {
                    text5 = string.Format(Singleton <CTextManager> .GetInstance().GetText("DoubleExpExpireTimeTips"), masterRoleInfo.GetExpExpireHours() / 24, masterRoleInfo.GetExpExpireHours() % 24);
                }
                if (masterRoleInfo.GetExpWinCount() > 0u)
                {
                    text6 = string.Format(Singleton <CTextManager> .GetInstance().GetText("DoubleExpCountWinTips"), masterRoleInfo.GetExpWinCount());
                }
                if (string.IsNullOrEmpty(text5))
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject2, string.Format("{0}", text6), enUseableTipsPos.enBottom);
                }
                else if (string.IsNullOrEmpty(text6))
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject2, string.Format("{0}", text5), enUseableTipsPos.enBottom);
                }
                else
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject2, string.Format("{0}\n{1}", text5, text6), enUseableTipsPos.enBottom);
                }
            }
            if (CSysDynamicBlock.bLobbyEntryBlocked)
            {
                Transform transform2 = form.transform.Find("panelBottom/btnShop");
                if (transform2)
                {
                    transform2.gameObject.CustomSetActive(false);
                }
                Transform transform3 = form.transform.Find("CoinAndExp");
                if (transform3)
                {
                    transform3.gameObject.CustomSetActive(false);
                }
            }
            GameObject gameObject3 = form.gameObject.transform.Find("Panel").gameObject;

            gameObject3.transform.Find("Name").gameObject.GetComponent <Text>().set_text(masterRoleInfo.Name);
            ResAcntPvpExpInfo dataByKey = GameDataMgr.acntPvpExpDatabin.GetDataByKey((uint)((byte)masterRoleInfo.PvpLevel));

            DebugHelper.Assert(dataByKey != null);
            DebugHelper.Assert(dataByKey.dwNeedExp > 0u);
            GameObject gameObject4 = gameObject3.transform.Find("DegreeBarBg/bar").gameObject;

            gameObject4.GetComponent <RectTransform>().sizeDelta = new Vector2(204f * Math.Min(1f, masterRoleInfo.PvpExp * 1f / dataByKey.dwNeedExp), 19f);
            gameObject3.transform.Find("DegreeTitle").gameObject.CustomSetActive(false);
            if ((ulong)masterRoleInfo.PvpLevel >= (ulong)((long)GameDataMgr.acntPvpExpDatabin.Count()))
            {
                gameObject3.transform.Find("DegreeNum").gameObject.GetComponent <Text>().set_text(Singleton <CTextManager> .GetInstance().GetText("PVP_Level_Max"));
            }
            else
            {
                gameObject3.transform.Find("DegreeNum").gameObject.GetComponent <Text>().set_text(string.Format("{0}/{1}", masterRoleInfo.PvpExp, dataByKey.dwNeedExp));
            }
            gameObject3.transform.Find("DegreeIcon").gameObject.CustomSetActive(false);
            MonoSingleton <NewbieGuideManager> .GetInstance().CheckTriggerTime(NewbieGuideTriggerTimeType.enterPvpEntry, new uint[0]);
        }
Esempio n. 15
0
    public static void OpenHeroTypeSelectForm()
    {
        CUIFormScript cUIFormScript = Singleton <CUIManager> .instance.OpenForm(CRoleRegisterSys.s_heroTypeSelectFormPath, false, true);

        if (cUIFormScript != null)
        {
            GameObject gameObject = Utility.FindChild(cUIFormScript.gameObject, "ToggleGroup/Toggle1");
            gameObject.GetComponent <CUIEventScript>().m_onClickEventParams.tagUInt = GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_NEWBIE_RECOMMEND_HEROTYPE3);
            gameObject = Utility.FindChild(cUIFormScript.gameObject, "ToggleGroup/Toggle2");
            gameObject.GetComponent <CUIEventScript>().m_onClickEventParams.tagUInt = GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_NEWBIE_RECOMMEND_HEROTYPE1);
            gameObject = Utility.FindChild(cUIFormScript.gameObject, "ToggleGroup/Toggle3");
            gameObject.GetComponent <CUIEventScript>().m_onClickEventParams.tagUInt = GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_NEWBIE_RECOMMEND_HEROTYPE2);
            CRoleRegisterView.SetHeroType(0u);
        }
    }