Esempio n. 1
0
        public static Hud ParseHud(string path)
        {
            Hud hud = new Hud();
            HudResourceFile tempRes;
            tempRes = ParseHudResource(path);
            if(!tempRes.IsNull)
            {
                hud.Resource = tempRes;
                hud.ApplyResource();
            }                   

            var Hud_Subfolders = Directory.GetDirectories(path);
            for(int i = 0; i < Hud_Subfolders.Length; i++)
            {
                HudFolder folder = new HudFolder();
                folder.FullName = Hud_Subfolders[i];

                if(folder.Name.ToLower() == "resource" || folder.Name.ToLower() == "scripts")
                    folder = ParseHudFolder(folder.FullName);
                else
                    folder.CopyNoParse = true;
                hud.Add(folder);                                                  
            }            
            return hud;
        }
Esempio n. 2
0
 public void Add(HudFolder folder)
 {
     m_FolderList.Add(folder);
 }
Esempio n. 3
0
 public void Add(HudFolder folder)
 {
     if(folder.FullName == null)
     {
         if(folder.FullName.ToLower() == "new folder")
         {
             for(int i = 1; folder.FullName == "new folder" + i; i++)
                 folder.FullName = "New Folder " + i;
         }
         else folder.FullName = "New Folder";
     }
     m_SubFolderList.Add(folder);
 }
Esempio n. 4
0
        static HudFolder ParseHudFolder(string path)
        {            
            HudFolder folder = new HudFolder();
            folder.FullName = path;
            var hudFiles = Directory.GetFiles(path, "*.res");
            var folders = Directory.GetDirectories(path);

            for(int i = 0; i < folders.Length; i++)
            {
                HudFolder subFolder = new HudFolder();                
                subFolder.FullName = folders[i];
                if(!subFolder.CopyNoParse)
                    subFolder = ParseHudFolder(subFolder.FullName);
                folder.Add(subFolder);
            }
            if(hudFiles.Length > 0)
            {
                for(int i = 0; i < hudFiles.Length; i++)
                {
                    HudFile file = new HudFile();
                    file.FullName = hudFiles[i];

                    file = ParseHudFile(file.FullName);
                    if(!file.IsNull)
                        folder.Add(file);
                }
            }            
            return folder;
        }