protected override void Update()
    {
        if (base.isInitialize)
        {
            base.Update();
        }
        else
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CHeroSelectNormalSystem.s_heroSelectFormPath);

            if (form != null)
            {
                int       index     = base.currentConf.Param[0];
                Transform transform = form.transform.FindChild("PanelAddSkill/ToggleList");
                if (transform != null)
                {
                    CUIToggleListScript component = transform.gameObject.GetComponent <CUIToggleListScript>();
                    if (component != null)
                    {
                        component.MoveElementInScrollArea(index, true);
                        CUIToggleListElementScript elemenet = component.GetElemenet(index) as CUIToggleListElementScript;
                        if (elemenet != null)
                        {
                            GameObject gameObject = elemenet.transform.gameObject;
                            if (gameObject.activeInHierarchy)
                            {
                                base.AddHighLightGameObject(gameObject, true, form, true);
                                base.Initialize();
                            }
                        }
                    }
                }
            }
        }
    }
Esempio n. 2
0
        private void OnTagSelectChanged(CUIEvent evt)
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CPlayerSocialInfoController.s_socialTagEditFormPath);

            if (form == null)
            {
                return;
            }
            GameObject widget = form.GetWidget(0);

            if (widget == null)
            {
                return;
            }
            CUIToggleListScript component = widget.GetComponent <CUIToggleListScript>();
            string text = Singleton <CTextManager> .GetInstance().GetText("Social_TagTips", new string[]
            {
                component.GetMultiSelectCount().ToString(),
                4.ToString()
            });

            GameObject widget2 = form.GetWidget(1);

            widget2.GetComponent <Text>().set_text(text);
        }
Esempio n. 3
0
    public static void OnRefresh(GameObject form, ushort addedSkillLevel)
    {
        CUIToggleListScript component = form.transform.Find("Panel_Grid/ToggleList").GetComponent <CUIToggleListScript>();
        int selected = component.GetSelected();

        for (int i = 0; i < component.GetElementAmount(); i++)
        {
            CUIListElementScript elemenet = component.GetElemenet(i);
            if (i == selected)
            {
                elemenet.transform.Find("SkillNameTxt").GetComponent <Text>().color = CAddSkillView.SELECTED_COLOR;
            }
            else
            {
                elemenet.transform.Find("SkillNameTxt").GetComponent <Text>().color = CAddSkillView.UN_SELECTED_COLOR;
            }
        }
        ResSkillUnlock  dataByKey       = GameDataMgr.addedSkiilDatabin.GetDataByKey((uint)addedSkillLevel);
        uint            dwUnlockSkillID = dataByKey.dwUnlockSkillID;
        ResSkillCfgInfo dataByKey2      = GameDataMgr.skillDatabin.GetDataByKey(dwUnlockSkillID);

        if (dataByKey2 == null)
        {
            DebugHelper.Assert(false, string.Format("ResSkillCfgInfo[{0}] can not be found!", dwUnlockSkillID));
            return;
        }
        CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo();

        bool   flag       = masterRoleInfo == null || masterRoleInfo.PvpLevel < (uint)dataByKey.wAcntLevel;
        Image  component2 = form.transform.Find("Panel_SkillDesc/IconImg").GetComponent <Image>();
        Image  component3 = form.transform.Find("Panel_SkillDesc/ContentImg").GetComponent <Image>();
        Text   component4 = form.transform.Find("Panel_SkillDesc/SkillNameTxt").GetComponent <Text>();
        Text   component5 = form.transform.Find("Panel_SkillDesc/SkillNameTxt2").GetComponent <Text>();
        Text   component6 = form.transform.Find("Panel_SkillDesc/SkillUnlockTxt").GetComponent <Text>();
        Text   component7 = form.transform.Find("Panel_SkillDesc/SkillDescTxt").GetComponent <Text>();
        string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(dataByKey2.szIconPath));

        component2.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false, false);
        prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_AddedSkill_Dir, dwUnlockSkillID);
        component3.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false, false);
        Text   arg_1F6_0 = component4;
        string text      = Utility.UTF8Convert(dataByKey2.szSkillName);

        component5.text = text;
        arg_1F6_0.text  = text;
        component6.text = string.Format("Lv.{0}", dataByKey.wAcntLevel);
        component7.text = CUICommonSystem.GetSkillDescLobby(dataByKey2.szSkillDesc, CAddSkillView.HeroID);
        if (flag)
        {
            component6.text = Singleton <CTextManager> .get_instance().GetText("Added_Skill_Common_Tips_3", new string[]
            {
                dataByKey.wAcntLevel.ToString()
            });
        }
        else
        {
            component6.text = Singleton <CTextManager> .get_instance().GetText("Added_Skill_Common_Tips_4");
        }
    }
Esempio n. 4
0
    public static void OnRefresh(GameObject form, ushort addedSkillLevel)
    {
        CUIToggleListScript  component = form.transform.Find("Panel_Grid/ToggleList").GetComponent <CUIToggleListScript>();
        CUIListElementScript elemenet  = null;
        int selected = component.GetSelected();

        for (int i = 0; i < component.GetElementAmount(); i++)
        {
            elemenet = component.GetElemenet(i);
            if (i == selected)
            {
                elemenet.transform.Find("SkillNameTxt").GetComponent <Text>().color = SELECTED_COLOR;
            }
            else
            {
                elemenet.transform.Find("SkillNameTxt").GetComponent <Text>().color = UN_SELECTED_COLOR;
            }
        }
        ResSkillUnlock  dataByKey       = GameDataMgr.addedSkiilDatabin.GetDataByKey((int)addedSkillLevel);
        uint            dwUnlockSkillID = dataByKey.dwUnlockSkillID;
        ResSkillCfgInfo info            = GameDataMgr.skillDatabin.GetDataByKey(dwUnlockSkillID);

        if (info == null)
        {
            DebugHelper.Assert(false, string.Format("ResSkillCfgInfo[{0}] can not be found!", dwUnlockSkillID));
        }
        else
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            bool   flag       = (masterRoleInfo == null) || (masterRoleInfo.PvpLevel < dataByKey.wAcntLevel);
            Image  image      = form.transform.Find("Panel_SkillDesc/IconImg").GetComponent <Image>();
            Image  image2     = form.transform.Find("Panel_SkillDesc/ContentImg").GetComponent <Image>();
            Text   text       = form.transform.Find("Panel_SkillDesc/SkillNameTxt").GetComponent <Text>();
            Text   text2      = form.transform.Find("Panel_SkillDesc/SkillNameTxt2").GetComponent <Text>();
            Text   text3      = form.transform.Find("Panel_SkillDesc/SkillUnlockTxt").GetComponent <Text>();
            Text   text4      = form.transform.Find("Panel_SkillDesc/SkillDescTxt").GetComponent <Text>();
            string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(info.szIconPath));
            image.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false);
            prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_AddedSkill_Dir, dwUnlockSkillID);
            image2.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false);
            string str2 = Utility.UTF8Convert(info.szSkillName);
            text2.text = str2;
            text.text  = str2;
            text3.text = string.Format("Lv.{0}", dataByKey.wAcntLevel);
            text4.text = Utility.UTF8Convert(info.szSkillDesc);
            if (flag)
            {
                string[] args = new string[] { dataByKey.wAcntLevel.ToString() };
                text3.text = Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_3", args);
            }
            else
            {
                text3.text = Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_4");
            }
        }
    }
        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;
        }
Esempio n. 6
0
    public static void OpenForm(GameObject form)
    {
        CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

        int amount = GameDataMgr.addedSkiilDatabin.Count();
        CUIToggleListScript component = form.transform.Find("Panel_Grid/ToggleList").GetComponent <CUIToggleListScript>();

        component.SetElementAmount(amount);
        CUIListElementScript elemenet    = null;
        CUIEventScript       script3     = null;
        ResSkillUnlock       dataByIndex = null;
        ResSkillCfgInfo      dataByKey   = null;
        uint key     = 0;
        bool bActive = true;

        form.transform.Find("Panel_TopBg/LevelText").GetComponent <Text>().text = (masterRoleInfo == null) ? Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_2", new string[] { "1" }) : Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_2", new string[] { masterRoleInfo.PvpLevel.ToString() });

        for (int i = 0; i < amount; i++)
        {
            elemenet    = component.GetElemenet(i);
            script3     = elemenet.GetComponent <CUIEventScript>();
            dataByIndex = GameDataMgr.addedSkiilDatabin.GetDataByIndex(i);
            key         = dataByIndex.dwUnlockSkillID;
            dataByKey   = GameDataMgr.skillDatabin.GetDataByKey(key);
            bActive     = (masterRoleInfo == null) || (masterRoleInfo.PvpLevel < dataByIndex.wAcntLevel);
            if (dataByKey != null)
            {
                string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(dataByKey.szIconPath));
                Image  image      = elemenet.transform.Find("Icon").GetComponent <Image>();
                image.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false);
                script3.m_onClickEventID         = enUIEventID.AddedSkill_GetDetail;
                script3.m_onClickEventParams.tag = dataByIndex.wAcntLevel;
                elemenet.transform.Find("SkillNameTxt").GetComponent <Text>().text = Utility.UTF8Convert(dataByKey.szSkillName);
                elemenet.transform.Find("Lock").gameObject.CustomSetActive(bActive);
                image.color = !bActive ? Color.white : CUIUtility.s_Color_GrayShader;
                if (bActive)
                {
                    string[] args = new string[] { dataByIndex.wAcntLevel.ToString() };
                    Utility.GetComponetInChild <Text>(elemenet.gameObject, "Lock/Text").text = Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_3", args);
                }
            }
            else
            {
                DebugHelper.Assert(false, string.Format("ResSkillCfgInfo[{0}] can not be found!", key));
            }
        }
        dataByIndex = GameDataMgr.addedSkiilDatabin.GetDataByIndex(0);
        if (dataByIndex != null)
        {
            component.SelectElement(0, true);
            OnRefresh(form, dataByIndex.wAcntLevel);
        }
    }
Esempio n. 7
0
        public void OnEditTag(CUIEvent evt)
        {
            CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CPlayerSocialInfoController.s_socialTagEditFormPath, false, true);

            if (!cUIFormScript)
            {
                return;
            }
            GameObject widget = cUIFormScript.GetWidget(0);

            if (widget != null)
            {
                CUIToggleListScript component = widget.transform.GetComponent <CUIToggleListScript>();
                int num = GameDataMgr.socialTagsDataBin.Count();
                component.SetElementAmount(num);
                for (int i = 0; i < num; i++)
                {
                    CUIToggleListElementScript cUIToggleListElementScript = (CUIToggleListElementScript)component.GetElemenet(i);
                    ResSocialTags dataByIndex = GameDataMgr.socialTagsDataBin.GetDataByIndex(i);
                    if (cUIToggleListElementScript != null)
                    {
                        Transform transform  = cUIToggleListElementScript.gameObject.transform;
                        Transform transform2 = transform.Find("Text");
                        CUICommonSystem.SetTextContent(transform2.gameObject, dataByIndex.szText);
                        Text component2 = transform2.transform.GetComponent <Text>();
                        byte bType      = dataByIndex.bType;
                        if (bType != 1)
                        {
                            if (bType == 2)
                            {
                                component2.set_color(this.m_colorTagKawaii);
                            }
                        }
                        else
                        {
                            component2.set_color(this.m_colorTagCool);
                        }
                    }
                }
                component.SetSelectLimitCount(4);
                for (int j = 0; j < this.m_tags.get_Count(); j++)
                {
                    component.SetMultiSelected(Convert.ToInt32(this.m_tags.get_Item(j)), true);
                }
            }
            this.OnTagSelectChanged(null);
        }
Esempio n. 8
0
        private void OnTagEditEnd(CUIEvent evt)
        {
            CUIFormScript srcFormScript = evt.m_srcFormScript;

            if (srcFormScript == null)
            {
                return;
            }
            this.m_tags.Clear();
            GameObject          widget    = srcFormScript.GetWidget(0);
            CUIToggleListScript component = widget.GetComponent <CUIToggleListScript>();

            bool[] multiSelected = component.GetMultiSelected();
            for (int i = 0; i < component.GetElementAmount(); i++)
            {
                if (multiSelected[i])
                {
                    this.m_tags.Add(i);
                }
            }
            this.UpdateTags();
            srcFormScript.Close();
        }
Esempio n. 9
0
        private void OpenCheatForm()
        {
            CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(s_cheatFormPath, false, false);

            if (script != null)
            {
                this.m_enabled = true;
                GameObject widget = script.GetWidget(0);
                if (widget != null)
                {
                    CUIToggleListScript component = widget.GetComponent <CUIToggleListScript>();
                    if (component != null)
                    {
                        component.SetElementAmount(s_tversionServerTypeName.Length);
                        for (int i = 0; i < s_tversionServerTypeName.Length; i++)
                        {
                            Transform transform = component.GetElemenet(i).gameObject.transform.Find("Label");
                            if (transform != null)
                            {
                                Text text = transform.gameObject.GetComponent <Text>();
                                if (text != null)
                                {
                                    text.text = s_tversionServerTypeName[i];
                                    if (i == 8)
                                    {
                                        text.color = new Color(1f, 0f, 0f, 1f);
                                    }
                                }
                            }
                        }
                        component.SetSelected((int)CVersionUpdateSystem.GetIIPSServerType());
                    }
                }
                GameObject obj3 = script.GetWidget(1);
                if (obj3 != null)
                {
                    CUIToggleListScript script4 = obj3.GetComponent <CUIToggleListScript>();
                    if (script4 != null)
                    {
                        script4.SetElementAmount(s_TDirServerTypeName.Length);
                        for (int j = 0; j < s_TDirServerTypeName.Length; j++)
                        {
                            Transform transform2 = script4.GetElemenet(j).gameObject.transform.Find("Label");
                            if (transform2 != null)
                            {
                                Text text2 = transform2.gameObject.GetComponent <Text>();
                                if (text2 != null)
                                {
                                    text2.text = s_TDirServerTypeName[j];
                                    if (j == 0)
                                    {
                                        text2.color = new Color(1f, 0f, 0f, 1f);
                                    }
                                }
                            }
                        }
                        script4.SetSelected((int)TdirConfig.cheatServerType);
                    }
                }
                GameObject obj4 = script.GetWidget(2);
                if (obj4 != null)
                {
                    CUIToggleListScript script6 = obj4.GetComponent <CUIToggleListScript>();
                    if (script6 != null)
                    {
                        script6.SetElementAmount(s_errorLogFlagName.Length);
                        for (int k = 0; k < s_errorLogFlagName.Length; k++)
                        {
                            Transform transform3 = script6.GetElemenet(k).gameObject.transform.Find("Label");
                            if (transform3 != null)
                            {
                                Text text3 = transform3.gameObject.GetComponent <Text>();
                                if (text3 != null)
                                {
                                    text3.text = s_errorLogFlagName[k];
                                }
                            }
                        }
                        for (int m = 0; m < s_errorLogFlags.Length; m++)
                        {
                            script6.SetMultiSelected(m, s_errorLogFlags[m]);
                        }
                    }
                }
                GameObject obj5 = script.GetWidget(3);
                if (obj5 != null)
                {
                    CUIToggleListScript script8 = obj5.GetComponent <CUIToggleListScript>();
                    if (script8 != null)
                    {
                        script8.SetElementAmount(s_ignoreMaintainName.Length);
                        for (int n = 0; n < s_ignoreMaintainName.Length; n++)
                        {
                            Transform transform4 = script8.GetElemenet(n).gameObject.transform.Find("Label");
                            if (transform4 != null)
                            {
                                Text text4 = transform4.gameObject.GetComponent <Text>();
                                if (text4 != null)
                                {
                                    text4.text = s_ignoreMaintainName[n];
                                }
                            }
                        }
                        script8.SetMultiSelected(0, TdirMgr.s_maintainBlock);
                    }
                }
                GameObject obj6 = script.GetWidget(4);
                if (obj6 != null)
                {
                    CUIToggleListScript script10 = obj6.GetComponent <CUIToggleListScript>();
                    if (script10 != null)
                    {
                        script10.SetElementAmount(s_joystickConfigNames.Length);
                        for (int num6 = 0; num6 < s_joystickConfigNames.Length; num6++)
                        {
                            Transform transform5 = script10.GetElemenet(num6).gameObject.transform.Find("Label");
                            if (transform5 != null)
                            {
                                Text text5 = transform5.gameObject.GetComponent <Text>();
                                if (text5 != null)
                                {
                                    text5.text = s_joystickConfigNames[num6];
                                }
                            }
                            if (num6 == 0)
                            {
                                script10.SetMultiSelected(num6, s_joystickConfigs[num6]);
                            }
                        }
                    }
                }
            }
        }
    public static void OnRefresh(GameObject form, ushort addedSkillLevel)
    {
        CUIToggleListScript  component            = form.transform.Find("Panel_Grid/ToggleList").GetComponent <CUIToggleListScript>();
        CUIListElementScript cUIListElementScript = null;
        int selected = component.GetSelected();

        for (int i = 0; i < component.GetElementAmount(); i++)
        {
            cUIListElementScript = component.GetElemenet(i);
            if (i == selected)
            {
                cUIListElementScript.transform.Find("SkillNameTxt").GetComponent <Text>().set_color(CAddSkillView.SELECTED_COLOR);
            }
            else
            {
                cUIListElementScript.transform.Find("SkillNameTxt").GetComponent <Text>().set_color(CAddSkillView.UN_SELECTED_COLOR);
            }
        }
        ResSkillUnlock  dataByKey       = GameDataMgr.addedSkiilDatabin.GetDataByKey((uint)addedSkillLevel);
        uint            dwUnlockSkillID = dataByKey.dwUnlockSkillID;
        ResSkillCfgInfo dataByKey2      = GameDataMgr.skillDatabin.GetDataByKey(dwUnlockSkillID);

        if (dataByKey2 == null)
        {
            DebugHelper.Assert(false, string.Format("ResSkillCfgInfo[{0}] can not be found!", dwUnlockSkillID));
            return;
        }
        CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

        bool   flag       = masterRoleInfo == null || masterRoleInfo.PvpLevel < (uint)dataByKey.wAcntLevel;
        Image  component2 = form.transform.Find("Panel_SkillDesc/IconImg").GetComponent <Image>();
        Image  component3 = form.transform.Find("Panel_SkillDesc/ContentImg").GetComponent <Image>();
        Text   component4 = form.transform.Find("Panel_SkillDesc/SkillNameTxt").GetComponent <Text>();
        Text   component5 = form.transform.Find("Panel_SkillDesc/SkillNameTxt2").GetComponent <Text>();
        Text   component6 = form.transform.Find("Panel_SkillDesc/SkillUnlockTxt").GetComponent <Text>();
        Text   component7 = form.transform.Find("Panel_SkillDesc/SkillDescTxt").GetComponent <Text>();
        string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(dataByKey2.szIconPath));

        component2.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false, false);
        prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_AddedSkill_Dir, dwUnlockSkillID);
        component3.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false, false);
        Text   text  = component4;
        string text2 = Utility.UTF8Convert(dataByKey2.szSkillName);

        component5.set_text(text2);
        text.set_text(text2);
        component6.set_text(string.Format("Lv.{0}", dataByKey.wAcntLevel));
        component7.set_text(CUICommonSystem.GetSkillDescLobby(dataByKey2.szSkillDesc, CAddSkillView.HeroID));
        if (flag)
        {
            component6.set_text(Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_3", new string[]
            {
                dataByKey.wAcntLevel.ToString()
            }));
        }
        else
        {
            component6.set_text(Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_4"));
        }
        if ((ulong)dwUnlockSkillID == (ulong)((long)CAddSkillSys.SendSkillId) && masterRoleInfo.PvpLevel >= (uint)addedSkillLevel)
        {
            Singleton <CBattleGuideManager> .GetInstance().OpenBannerDlgByBannerGuideId(21u, null, false);

            Singleton <CUINewFlagSystem> .GetInstance().AddNewFlag(cUIListElementScript.gameObject, enNewFlagKey.New_SendSkill_V14, enNewFlagPos.enTopRight, 1f, 0f, 0f, enNewFlagType.enNewFlag);
        }
    }
    public static void OpenForm(GameObject form)
    {
        CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

        int num = GameDataMgr.addedSkiilDatabin.Count();
        CUIToggleListScript component = form.transform.Find("Panel_Grid/ToggleList").GetComponent <CUIToggleListScript>();

        component.SetElementAmount(num);
        form.transform.Find("Panel_TopBg/LevelText").GetComponent <Text>().set_text((masterRoleInfo != null) ? Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_2", new string[]
        {
            masterRoleInfo.PvpLevel.ToString()
        }) : Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_2", new string[]
        {
            "1"
        }));
        ResSkillUnlock dataByIndex;

        for (int i = 0; i < num; i++)
        {
            CUIListElementScript elemenet   = component.GetElemenet(i);
            CUIEventScript       component2 = elemenet.GetComponent <CUIEventScript>();
            dataByIndex = GameDataMgr.addedSkiilDatabin.GetDataByIndex(i);
            uint            dwUnlockSkillID = dataByIndex.dwUnlockSkillID;
            ResSkillCfgInfo dataByKey       = GameDataMgr.skillDatabin.GetDataByKey(dwUnlockSkillID);
            bool            flag            = masterRoleInfo == null || masterRoleInfo.PvpLevel < (uint)dataByIndex.wAcntLevel;
            if (dataByKey != null)
            {
                string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(dataByKey.szIconPath));
                Image  component3 = elemenet.transform.Find("Icon").GetComponent <Image>();
                component3.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false, false);
                component2.m_onClickEventID         = enUIEventID.AddedSkill_GetDetail;
                component2.m_onClickEventParams.tag = (int)dataByIndex.wAcntLevel;
                elemenet.transform.Find("SkillNameTxt").GetComponent <Text>().set_text(Utility.UTF8Convert(dataByKey.szSkillName));
                elemenet.transform.Find("Lock").gameObject.CustomSetActive(flag);
                component3.set_color(flag ? CUIUtility.s_Color_GrayShader : Color.white);
                if (flag)
                {
                    Utility.GetComponetInChild <Text>(elemenet.gameObject, "Lock/Text").set_text(Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_3", new string[]
                    {
                        dataByIndex.wAcntLevel.ToString()
                    }));
                }
                if ((ulong)dwUnlockSkillID == (ulong)((long)CAddSkillSys.SendSkillId))
                {
                    CUICommonSystem.SetObjActive(elemenet.transform.FindChild("HelpBtn"), true);
                    if (masterRoleInfo.PvpLevel >= (uint)dataByIndex.wAcntLevel)
                    {
                        Singleton <CUINewFlagSystem> .GetInstance().AddNewFlag(elemenet.gameObject, enNewFlagKey.New_SendSkill_V14, enNewFlagPos.enTopRight, 1f, 0f, 0f, enNewFlagType.enNewFlag);
                    }
                }
            }
            else
            {
                DebugHelper.Assert(false, string.Format("ResSkillCfgInfo[{0}] can not be found!", dwUnlockSkillID));
            }
        }
        dataByIndex = GameDataMgr.addedSkiilDatabin.GetDataByIndex(0);
        if (dataByIndex != null)
        {
            component.SelectElement(0, true);
            CAddSkillView.OnRefresh(form, dataByIndex.wAcntLevel);
        }
        if (CSysDynamicBlock.bLobbyEntryBlocked)
        {
            CUIToggleListScript  component4 = form.transform.FindChild("Panel_Grid/ToggleList").GetComponent <CUIToggleListScript>();
            CUIListElementScript elemenet2  = component4.GetElemenet(10);
            if (elemenet2)
            {
                elemenet2.gameObject.CustomSetActive(false);
            }
            Transform transform = form.transform.FindChild("Skill-Send-Test");
            if (transform != null)
            {
                transform.gameObject.CustomSetActive(false);
            }
        }
    }
Esempio n. 12
0
        private void OpenCheatForm()
        {
            CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CCheatSystem.s_cheatFormPath, false, false);

            if (cUIFormScript == null)
            {
                return;
            }
            this.m_enabled = true;
            GameObject widget = cUIFormScript.GetWidget(0);

            if (widget != null)
            {
                CUIToggleListScript component = widget.GetComponent <CUIToggleListScript>();
                if (component != null)
                {
                    component.SetElementAmount(CCheatSystem.s_tversionServerTypeName.Length);
                    for (int i = 0; i < CCheatSystem.s_tversionServerTypeName.Length; i++)
                    {
                        CUIListElementScript elemenet  = component.GetElemenet(i);
                        Transform            transform = elemenet.gameObject.transform.Find("Label");
                        if (transform != null)
                        {
                            Text component2 = transform.gameObject.GetComponent <Text>();
                            if (component2 != null)
                            {
                                component2.set_text(CCheatSystem.s_tversionServerTypeName[i]);
                                if (i == 8)
                                {
                                    component2.set_color(new Color(1f, 0f, 0f, 1f));
                                }
                            }
                        }
                    }
                    component.SetSelected((int)CVersionUpdateSystem.GetIIPSServerType());
                }
            }
            GameObject widget2 = cUIFormScript.GetWidget(1);

            if (widget2 != null)
            {
                CUIToggleListScript component3 = widget2.GetComponent <CUIToggleListScript>();
                if (component3 != null)
                {
                    component3.SetElementAmount(CCheatSystem.s_TDirServerTypeName.Length);
                    for (int j = 0; j < CCheatSystem.s_TDirServerTypeName.Length; j++)
                    {
                        CUIListElementScript elemenet2  = component3.GetElemenet(j);
                        Transform            transform2 = elemenet2.gameObject.transform.Find("Label");
                        if (transform2 != null)
                        {
                            Text component4 = transform2.gameObject.GetComponent <Text>();
                            if (component4 != null)
                            {
                                component4.set_text(CCheatSystem.s_TDirServerTypeName[j]);
                                if (j == 0)
                                {
                                    component4.set_color(new Color(1f, 0f, 0f, 1f));
                                }
                            }
                        }
                    }
                    component3.SetSelected((int)TdirConfig.cheatServerType);
                }
            }
            GameObject widget3 = cUIFormScript.GetWidget(2);

            if (widget3 != null)
            {
                CUIToggleListScript component5 = widget3.GetComponent <CUIToggleListScript>();
                if (component5 != null)
                {
                    component5.SetElementAmount(CCheatSystem.s_errorLogFlagName.Length);
                    for (int k = 0; k < CCheatSystem.s_errorLogFlagName.Length; k++)
                    {
                        CUIListElementScript elemenet3  = component5.GetElemenet(k);
                        Transform            transform3 = elemenet3.gameObject.transform.Find("Label");
                        if (transform3 != null)
                        {
                            Text component6 = transform3.gameObject.GetComponent <Text>();
                            if (component6 != null)
                            {
                                component6.set_text(CCheatSystem.s_errorLogFlagName[k]);
                            }
                        }
                    }
                    CCheatSystem.s_errorLogFlags[1] = CVersionUpdateSystem.IsEnableLogDebug();
                    for (int l = 0; l < CCheatSystem.s_errorLogFlags.Length; l++)
                    {
                        component5.SetMultiSelected(l, CCheatSystem.s_errorLogFlags[l]);
                    }
                }
            }
            GameObject widget4 = cUIFormScript.GetWidget(3);

            if (widget4 != null)
            {
                CUIToggleListScript component7 = widget4.GetComponent <CUIToggleListScript>();
                if (component7 != null)
                {
                    component7.SetElementAmount(CCheatSystem.s_ignoreMaintainName.Length);
                    for (int m = 0; m < CCheatSystem.s_ignoreMaintainName.Length; m++)
                    {
                        CUIListElementScript elemenet4  = component7.GetElemenet(m);
                        Transform            transform4 = elemenet4.gameObject.transform.Find("Label");
                        if (transform4 != null)
                        {
                            Text component8 = transform4.gameObject.GetComponent <Text>();
                            if (component8 != null)
                            {
                                component8.set_text(CCheatSystem.s_ignoreMaintainName[m]);
                            }
                        }
                    }
                    component7.SetMultiSelected(0, TdirMgr.s_maintainBlock);
                }
            }
            GameObject widget5 = cUIFormScript.GetWidget(4);

            if (widget5 != null)
            {
                CUIToggleListScript component9 = widget5.GetComponent <CUIToggleListScript>();
                if (component9 != null)
                {
                    component9.SetElementAmount(CCheatSystem.s_joystickConfigNames.Length);
                    for (int n = 0; n < CCheatSystem.s_joystickConfigNames.Length; n++)
                    {
                        CUIListElementScript elemenet5  = component9.GetElemenet(n);
                        Transform            transform5 = elemenet5.gameObject.transform.Find("Label");
                        if (transform5 != null)
                        {
                            Text component10 = transform5.gameObject.GetComponent <Text>();
                            if (component10 != null)
                            {
                                component10.set_text(CCheatSystem.s_joystickConfigNames[n]);
                            }
                        }
                        component9.SetMultiSelected(n, CCheatSystem.s_joystickConfigs[n]);
                    }
                }
            }
        }