Beispiel #1
0
        //Load portrait data for 1 ID
        public static PortraitData LoadPortraitData(string customID)
        {
            PortraitData result = new PortraitData(customID);

            result.EnsureImages(false);
            return(result);
        }
Beispiel #2
0
        //Load all tags for all portraits in folder
        public static Dictionary <string, TagData> LoadAllPortraitsTags(Dictionary <string, TagData> customTags, Boolean skipDefault)
        {
            PortraitTagSelector.portraitIDsUI = new string[] { };
            string[] existingCustomPortraitIds = CustomPortraitsManager.Instance.GetExistingCustomPortraitIds();

            Dictionary <string, TagData> result = new Dictionary <string, TagData>();

            for (int i = 0; i < existingCustomPortraitIds.Length; i++)
            {
                PortraitData portraitData = new PortraitData(existingCustomPortraitIds[i]);
                portraitData.EnsureImages(false);
                portraitData.CheckIfDefaultPortraitData();
                if (portraitData.IsDefault && skipDefault)
                {
                    continue;
                }
                List <string> tagList;
                if (customTags.ContainsKey(portraitData.CustomId))
                {
                    tagList = new List <string>(customTags[portraitData.CustomId].tags);
                }
                else
                {
                    tagList = new List <string>();
                }
                TagData resultTag = new TagData(GetPseudoHash(portraitData.FullLengthPortrait.texture).ToString(),
                                                portraitData.CustomId, tagList);
                result[resultTag.CustomId] = resultTag;
                portraitData = null;
            }
            return(result);
        }
Beispiel #3
0
        //Modified LoadAllCustomPortraits from the game. Added skipping default portraits. Not in use now
        public static List <PortraitData> LoadAllCustomPortraits(Boolean skipDefault)
        {
            string[]            existingCustomPortraitIds = CustomPortraitsManager.Instance.GetExistingCustomPortraitIds();
            List <PortraitData> list = new List <PortraitData>();

            for (int i = 0; i < existingCustomPortraitIds.Length; i++)
            {
                PortraitData portraitData = new PortraitData(existingCustomPortraitIds[i]);
                portraitData.EnsureImages(false);
                portraitData.CheckIfDefaultPortraitData();
                if (portraitData.IsDefault && skipDefault)
                {
                    continue;
                }
                list.Add(portraitData);
            }
            return(list);
        }