protected OptionsHeadType InitializeHumanHeadTypes()
        {
            MethodInfo headGraphicsMethod = typeof(GraphicDatabaseHeadRecords).GetMethod("BuildDatabaseIfNecessary", BindingFlags.Static | BindingFlags.NonPublic);

            headGraphicsMethod.Invoke(null, null);
            string[] headsFolderPaths = new string[] {
                "Things/Pawn/Humanlike/Heads/Male",
                "Things/Pawn/Humanlike/Heads/Female"
            };
            OptionsHeadType result = new OptionsHeadType();

            for (int i = 0; i < headsFolderPaths.Length; i++)
            {
                string text = headsFolderPaths[i];
                IEnumerable <string> graphicsInFolder = GraphicDatabaseUtility.GraphicNamesInFolder(text);
                foreach (string current in GraphicDatabaseUtility.GraphicNamesInFolder(text))
                {
                    string         fullPath = text + "/" + current;
                    CustomHeadType headType = CreateHeadTypeFromGenderedGraphicPath(fullPath);
                    result.AddHeadType(headType);
                    pathDictionary.Add(fullPath, headType);
                }
            }
            return(result);
        }
 private static void BuildDatabaseIfNecessary()
 {
     if (heads.Count <= 0 || skull == null || stump == null)
     {
         heads.Clear();
         string[] headsFolderPaths = HeadsFolderPaths;
         foreach (string text in headsFolderPaths)
         {
             foreach (string item in GraphicDatabaseUtility.GraphicNamesInFolder(text))
             {
                 var head = new HeadGraphicRecord(text + "/" + item);
                 if (head.gender == Gender.Female)
                 {
                     femaleHeads.Add(head);
                 }
                 else if (head.gender == Gender.Male)
                 {
                     maleHeads.Add(head);
                 }
                 heads.Add(head);
             }
         }
         skull = new HeadGraphicRecord(SkullPath);
         stump = new HeadGraphicRecord(StumpPath);
     }
 }
 private static void AddHeadTypesToList(string source, List <string> list)
 {
     foreach (string current in GraphicDatabaseUtility.GraphicNamesInFolder(source))
     {
         string item = source + "/" + current;
         list.Add(item);
     }
 }
Exemple #4
0
 private void AddHeadTypesToList(string source, List <string> list)
 {
     foreach (string current in GraphicDatabaseUtility.GraphicNamesInFolder(source))
     {
         string item = current;
         if (item.IndexOf("/") == -1)
         {
             item = source + item;
         }
         list.Add(item);
     }
 }
 // Token: 0x060051D0 RID: 20944 RVA: 0x0025EC0C File Offset: 0x0025D00C
 private static void BuildDatabaseIfNecessary()
 {
     if (GraphicDatabaseHeadRecords_Zombiefied.heads.Count > 0 && GraphicDatabaseHeadRecords_Zombiefied.skull != null && GraphicDatabaseHeadRecords_Zombiefied.stump != null)
     {
         return;
     }
     GraphicDatabaseHeadRecords_Zombiefied.heads.Clear();
     foreach (string text in GraphicDatabaseHeadRecords_Zombiefied.HeadsFolderPaths)
     {
         foreach (string str in GraphicDatabaseUtility.GraphicNamesInFolder(text))
         {
             GraphicDatabaseHeadRecords_Zombiefied.heads.Add(new GraphicDatabaseHeadRecords_Zombiefied.HeadGraphicRecord(text + "/" + str));
         }
     }
     GraphicDatabaseHeadRecords_Zombiefied.skull = new GraphicDatabaseHeadRecords_Zombiefied.HeadGraphicRecord(GraphicDatabaseHeadRecords_Zombiefied.SkullPath);
     GraphicDatabaseHeadRecords_Zombiefied.stump = new GraphicDatabaseHeadRecords_Zombiefied.HeadGraphicRecord(GraphicDatabaseHeadRecords_Zombiefied.StumpPath);
 }
Exemple #6
0
        protected void InitializeHeads()
        {
            MethodInfo headGraphicsMethod = typeof(GraphicDatabaseHeadRecords).GetMethod("BuildDatabaseIfNecessary", BindingFlags.Static | BindingFlags.NonPublic);

            headGraphicsMethod.Invoke(null, null);

            string[] headsFolderPaths = new string[] {
                "Things/Pawn/Humanlike/Heads/Male",
                "Things/Pawn/Humanlike/Heads/Female"
            };
            for (int i = 0; i < headsFolderPaths.Length; i++)
            {
                string text = headsFolderPaths[i];
                foreach (string current in GraphicDatabaseUtility.GraphicNamesInFolder(text))
                {
                    string headPath = text + "/" + current;
                    headPaths.Add(headPath);
                }
            }
        }
        public static List <HeadType> LoadHeads()
        {
            typeof(GraphicDatabaseHeadRecords).GetMethod("BuildDatabaseIfNecessary", BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, null);
            string[] arr = new string[]
            {
                "Things/Pawn/Humanlike/Heads/Male",
                "Things/Pawn/Humanlike/Heads/Female",
                "Things/Pawn/Humanlike/Heads/Female"
            };
            var heads = new List <HeadType>();

            foreach (string text in arr)
            {
                GraphicDatabaseUtility.GraphicNamesInFolder(text);
                foreach (string str in GraphicDatabaseUtility.GraphicNamesInFolder(text))
                {
                    string   text2   = text + "/" + str;
                    HeadType newHead = CreateHeadFromFilePath(text2);
                    heads.Add(newHead);
                }
            }
            return(heads);
        }
Exemple #8
0
        protected OptionsHeadType InitializeHumanHeadTypes()
        {
            Reflection.GraphicDatabaseHeadRecords.BuildDatabaseIfNecessary();
            string[] headsFolderPaths = new string[] {
                "Things/Pawn/Humanlike/Heads/Male",
                "Things/Pawn/Humanlike/Heads/Female"
            };
            OptionsHeadType result = new OptionsHeadType();

            for (int i = 0; i < headsFolderPaths.Length; i++)
            {
                string text = headsFolderPaths[i];
                IEnumerable <string> graphicsInFolder = GraphicDatabaseUtility.GraphicNamesInFolder(text);
                foreach (string current in GraphicDatabaseUtility.GraphicNamesInFolder(text))
                {
                    string         fullPath = text + "/" + current;
                    CustomHeadType headType = CreateHumanHeadTypeFromGenderedGraphicPath(fullPath);
                    result.AddHeadType(headType);
                    pathDictionary.Add(fullPath, headType);
                }
            }
            return(result);
        }