Example #1
0
        public static LeaderInfo CreateLeaderInfo_Preset(int leaderID)
        {
            LeaderInfo info = new LeaderInfo();
            var        meta = LeaderModule.GetLeaderPresetDataByKey(leaderID);

            if (meta == null)
            {
                DebugPlus.LogError("CreateLeaderInfo_Preset Fail! leaderID=" + leaderID);
                return(null);
            }
            info.leaderID   = meta.LeaderID;
            info.leaderName = MultiLanguage.Instance.GetTextValue(meta.LeaderName);
            info.leaderDesc = MultiLanguage.Instance.GetTextValue(meta.LeaderDesc);
            info.currentAge = meta.Age;
            info.Gender     = (byte)meta.Gender;

            info.speciesInfo       = LeaderSpeciesInfo.InitSpeciesInfo(meta.SpeciesID);
            info.creedInfo         = LeaderCreedInfo.InitCreedInfo(meta.CreedID);
            info.skillInfoList     = LeaderModule.GetLeaderSkillInfoDefault(leaderID);
            info.attributeInfoList = LeaderModule.GetLeaderAttributePreset(leaderID);
            info.birthlandInfo     = LeaderBirthlandInfo.InitBirthlandInfo(meta.BirthlandID);
            info.storyInfoList     = LeaderModule.GetLeaderPresetStory(leaderID);

            info.portraitInfo = LeaderPortraitInfo.Generate_PresetInfo(meta.Portrait_BG, meta.Portrait_Cloth, meta.Portrait_Ear, meta.Portrait_Hair, meta.Portrait_Eyes, meta.Portrait_Face, meta.Portrait_Mouth, meta.Portrait_Nose);

            return(info);
        }
Example #2
0
 void OnNextBtnClick()
 {
     if (currentSelectIndex < itemList.Count)
     {
         currentSelectIndex++;
         SelectContentName.text = LeaderModule.GetPortraitName(portraitType) + "_" + currentSelectIndex + 1;
         UpdateBtnState();
     }
 }
Example #3
0
 void OnPreBtnClick()
 {
     if (currentSelectIndex > 0)
     {
         currentSelectIndex--;
         SelectContentName.text = LeaderModule.GetPortraitName(portraitType) + "_" + currentSelectIndex + 1;
         UpdateBtnState();
         UIManager.Instance.SendMessageToWnd(UIPath.WindowPath.Leader_Custom_Page, new UIMessage(UIMsgType.LeaderCustom_Refresh_Portrait, new List <object>()
         {
             portraitType, currentSelectIndex
         }));
     }
 }
Example #4
0
 public void SetUpItem(LeaderPortraitType type, int speciesID, int sexID)
 {
     itemList = LeaderModule.GetLeagalPortraitImte(type, speciesID, sexID);
     if (itemList == null || itemList.Count == 0)
     {
         return;
     }
     ///Select Default
     portraitType = type;
     transform.FindTransfrom("Name").SafeGetComponent <Text>().text = LeaderModule.GetPortraitName(type);
     SelectContentName.text = LeaderModule.GetPortraitName(portraitType) + "_" + currentSelectIndex + 1;
     UpdateBtnState();
 }
Example #5
0
        public Config.LeaderPortraitItemConfig portrait_nose;    //ιΌ»

        public static LeaderPortraitInfo GenerateRandomInfo(int speciesID, int sexID)
        {
            LeaderPortraitInfo info = new LeaderPortraitInfo();

            info.portrait_bg    = LeaderModule.GetRandomPortraitItem(LeaderPortraitType.BG, speciesID, sexID);
            info.portrait_cloth = LeaderModule.GetRandomPortraitItem(LeaderPortraitType.Cloth, speciesID, sexID);
            info.portrait_ear   = LeaderModule.GetRandomPortraitItem(LeaderPortraitType.Ear, speciesID, sexID);
            info.portrait_hair  = LeaderModule.GetRandomPortraitItem(LeaderPortraitType.Hair, speciesID, sexID);
            info.portrait_eyes  = LeaderModule.GetRandomPortraitItem(LeaderPortraitType.Eyes, speciesID, sexID);
            info.portrait_face  = LeaderModule.GetRandomPortraitItem(LeaderPortraitType.Face, speciesID, sexID);
            info.portrait_mouth = LeaderModule.GetRandomPortraitItem(LeaderPortraitType.Mouth, speciesID, sexID);
            info.portrait_nose  = LeaderModule.GetRandomPortraitItem(LeaderPortraitType.Nose, speciesID, sexID);
            return(info);
        }
Example #6
0
        public static LeaderCreedInfo InitCreedInfo(int creedID)
        {
            LeaderCreedInfo info = new LeaderCreedInfo();
            var             meta = LeaderModule.GetLeaderCreedDataByKey(creedID);

            if (meta == null)
            {
                DebugPlus.LogError("Init LeaderCreedInfo Error! creedID=" + creedID);
                return(null);
            }
            info.creedID       = meta.CreedID;
            info.creedName     = MultiLanguage.Instance.GetTextValue(meta.CreedName);
            info.creedDesc     = MultiLanguage.Instance.GetTextValue(meta.CreedDesc);
            info.creedIconPath = meta.IconPath;
            return(info);
        }
Example #7
0
        public static LeaderStoryInfo InitStoryInfo(int storyID)
        {
            LeaderStoryInfo info = new LeaderStoryInfo();
            var             meta = LeaderModule.GetLeaderStoryDataByKey(storyID);

            if (meta == null)
            {
                DebugPlus.LogError("Init LeaderStoryInfo Error! storyID=" + storyID);
                return(null);
            }
            info.storyID      = meta.StoryID;
            info.storyContent = MultiLanguage.Instance.GetTextValue(meta.Content);
            info.year         = meta.StoryYearStart;
            info.poolLevel    = meta.PoolLevel;

            return(info);
        }
Example #8
0
        public static LeaderAttributeInfo InitAttributeInfo(int attributeID)
        {
            LeaderAttributeInfo info = new LeaderAttributeInfo();
            var meta = LeaderModule.GetLeaderAttributeDataByKey(attributeID);

            if (meta == null)
            {
                DebugPlus.LogError("Init LeaderAttribute Error! attributeID=" + attributeID);
                return(null);
            }
            info.attributeID       = meta.AttributeID;
            info.attributeName     = MultiLanguage.Instance.GetTextValue(meta.Name);
            info.attributeDesc     = MultiLanguage.Instance.GetTextValue(meta.Desc);
            info.attributeIconPath = meta.IconPath;

            return(info);
        }
Example #9
0
        public static LeaderSpeciesInfo InitSpeciesInfo(int speciesID)
        {
            LeaderSpeciesInfo info = new LeaderSpeciesInfo();
            var meta = LeaderModule.GetLeaderSpeciesDataByKey(speciesID);

            if (meta == null)
            {
                DebugPlus.LogError("Init LeaderSpeciesInfo Fail! speciesID=" + speciesID);
                return(null);
            }
            info.speciesID            = speciesID;
            info.speciesName          = MultiLanguage.Instance.GetTextValue(meta.SpeciesName);
            info.speciesDesc          = MultiLanguage.Instance.GetTextValue(meta.SpeciesDesc);
            info.Portrait_MaleGroup   = meta.Portrait_MaleGroup;
            info.Portrait_FemaleGroup = meta.Portrait_FemaleGroup;
            return(info);
        }
Example #10
0
        public static LeaderBirthlandInfo InitBirthlandInfo(int landID)
        {
            LeaderBirthlandInfo info = new LeaderBirthlandInfo();
            var meta = LeaderModule.GetLeaderBirthlandDataByKey(landID);

            if (meta == null)
            {
                DebugPlus.LogError("Init LeaderBirthlandInfo Fail ! landID=" + landID);
                return(null);
            }
            info.birthlandID  = meta.LandID;
            info.landName     = MultiLanguage.Instance.GetTextValue(meta.LandName);
            info.landDesc     = MultiLanguage.Instance.GetTextValue(meta.LandDesc);
            info.landIconPath = meta.LandIconPath;
            info.landBGPath   = meta.LandBGPath;

            return(info);
        }
Example #11
0
        public static LeaderSkillInfo InitSkillInfo(int skillID, int defaultLevel)
        {
            LeaderSkillInfo info = new LeaderSkillInfo();
            var             meta = LeaderModule.GetLeaderSkillDataByKey(skillID);

            if (meta == null)
            {
                DebugPlus.LogError("Init LeaderSkill Info Error! skillID=" + skillID);
                return(null);
            }
            info.skillID       = meta.SkillID;
            info.skillName     = MultiLanguage.Instance.GetTextValue(meta.SkillName);
            info.skillDesc     = MultiLanguage.Instance.GetTextValue(meta.SkillDesc);
            info.skillIconPath = meta.SkillIcon;
            info.currentLevel  = defaultLevel;
            info.maxLevel      = meta.MaxLevel;

            if (info.currentLevel > meta.MaxLevel)
            {
                DebugPlus.Log("LeaderSkill Info SkillLevelDefault larger than MaxLevel, skillID=" + skillID);
                info.currentLevel = meta.MaxLevel;
            }
            return(info);
        }