Beispiel #1
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");
        }
    }
Beispiel #2
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((uint)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 = CUICommonSystem.GetSkillDescLobby(info.szSkillDesc, HeroID);
            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 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);
        }
    }