コード例 #1
0
    public static ListView <ResSkillUnlock> GetSelSkillAvailable(ResDT_UnUseSkill unUseSkillInfo)
    {
        ListView <ResSkillUnlock> listView = new ListView <ResSkillUnlock>();
        CRoleInfo masterRoleInfo           = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

        if (unUseSkillInfo == null)
        {
            return(listView);
        }
        for (int i = 0; i < GameDataMgr.addedSkiilDatabin.count; i++)
        {
            ResSkillUnlock dataByIndex = GameDataMgr.addedSkiilDatabin.GetDataByIndex(i);
            if (masterRoleInfo != null && masterRoleInfo.PvpLevel >= (uint)dataByIndex.wAcntLevel)
            {
                bool flag = true;
                if (unUseSkillInfo != null)
                {
                    for (int j = 0; j < unUseSkillInfo.UnUseSkillList.Length; j++)
                    {
                        if (unUseSkillInfo.UnUseSkillList[j] == dataByIndex.dwUnlockSkillID)
                        {
                            flag = false;
                            break;
                        }
                    }
                }
                if (flag)
                {
                    listView.Add(dataByIndex);
                }
            }
        }
        return(listView);
    }
コード例 #2
0
    public static bool IsSelSkillAvailable(ResDT_UnUseSkill unUseSkillInfo, uint selSkillId)
    {
        CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

        ResSkillUnlock resSkillUnlock = null;

        if (unUseSkillInfo == null)
        {
            return(false);
        }
        for (int i = 0; i < GameDataMgr.addedSkiilDatabin.count; i++)
        {
            ResSkillUnlock dataByIndex = GameDataMgr.addedSkiilDatabin.GetDataByIndex(i);
            if (dataByIndex.dwUnlockSkillID == selSkillId)
            {
                resSkillUnlock = dataByIndex;
                break;
            }
        }
        if (resSkillUnlock != null && masterRoleInfo != null && masterRoleInfo.PvpLevel >= (uint)resSkillUnlock.wAcntLevel)
        {
            if (unUseSkillInfo != null)
            {
                for (int j = 0; j < unUseSkillInfo.UnUseSkillList.Length; j++)
                {
                    if (unUseSkillInfo.UnUseSkillList[j] == resSkillUnlock.dwUnlockSkillID)
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
        return(false);
    }
コード例 #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");
        }
    }
コード例 #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");
            }
        }
    }
コード例 #5
0
ファイル: CAddSkillView.cs プロジェクト: isoundy000/wzry-1
    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);
        }
    }
コード例 #6
0
    public static bool NewPlayerLevelUnlockAddSkill(int inNewLevel, int inOldLevel, out uint outSkillId)
    {
        outSkillId = 0;
        int num = GameDataMgr.addedSkiilDatabin.Count();

        for (int i = 0; i < num; i++)
        {
            ResSkillUnlock dataByIndex = GameDataMgr.addedSkiilDatabin.GetDataByIndex(i);
            if (dataByIndex != null)
            {
                int wAcntLevel = dataByIndex.wAcntLevel;
                if ((inNewLevel >= wAcntLevel) && (inOldLevel < wAcntLevel))
                {
                    outSkillId = dataByIndex.dwUnlockSkillID;
                    return(true);
                }
            }
        }
        return(false);
    }
コード例 #7
0
    public static bool NewPlayerLevelUnlockAddSkill(int inNewLevel, int inOldLevel, out uint outSkillId)
    {
        bool result = false;

        outSkillId = 0u;
        int num = GameDataMgr.addedSkiilDatabin.Count();

        for (int i = 0; i < num; i++)
        {
            ResSkillUnlock dataByIndex = GameDataMgr.addedSkiilDatabin.GetDataByIndex(i);
            if (dataByIndex != null)
            {
                int wAcntLevel = (int)dataByIndex.wAcntLevel;
                if (inNewLevel >= wAcntLevel && inOldLevel < wAcntLevel)
                {
                    outSkillId = dataByIndex.dwUnlockSkillID;
                    result     = true;
                    break;
                }
            }
        }
        return(result);
    }
コード例 #8
0
    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);
        }
    }