Exemple #1
0
 public override void Load()
 {
     using (var file = new AnarchyStorage(FullPath, '`', false))
     {
         file.Load();
         file.AutoSave = false;
         data[0]       = file.GetString("ground", string.Empty);
         for (int i = 1; i < data.Length - Leaves.Length; i++)
         {
             data[i] = file.GetString("tree" + (i - 1).ToString(), string.Empty);
         }
         for (int i = data.Length - Leaves.Length; i < data.Length; i++)
         {
             data[i] = file.GetString("leaves" + (i - 1).ToString(), string.Empty);
         }
         LinkedSkybox = file.GetString("skybox", Anarchy.Configuration.StringSetting.NotDefine);
         if (LinkedSkybox != Anarchy.Configuration.StringSetting.NotDefine)
         {
             SkyboxPreset set = new SkyboxPreset(LinkedSkybox);
             if (!set.Exists())
             {
                 LinkedSkybox = Anarchy.Configuration.StringSetting.NotDefine;
             }
         }
         RandomizePairs = file.GetBool("randomizePairs", false);
     }
 }
Exemple #2
0
        public static SkinPreset[] GetAllPresets()
        {
            DirectoryInfo info = new DirectoryInfo(SkyboxPath);

            FileInfo[] files = info.GetFiles();
            if (files.Length == 0)
            {
                return(null);
            }
            SkinPreset[] result = new SkinPreset[files.Length];
            for (int i = 0; i < files.Length; i++)
            {
                result[i] = new SkyboxPreset(files[i].Name.Replace(Extension, string.Empty));
                result[i].Load();
            }
            return(result);
        }
Exemple #3
0
 public override void Load()
 {
     using (var file = new AnarchyStorage(FullPath, '`', false))
     {
         file.Load();
         file.AutoSave = false;
         data[0]       = file.GetString("ground", string.Empty);
         data[1]       = file.GetString("wall", string.Empty);
         data[2]       = file.GetString("gate", string.Empty);
         for (int i = 3; i < Length; i++)
         {
             data[i] = file.GetString("house" + (i - 3).ToString(), string.Empty);
         }
         LinkedSkybox = file.GetString("skybox", Anarchy.Configuration.StringSetting.NotDefine);
         if (LinkedSkybox != Anarchy.Configuration.StringSetting.NotDefine)
         {
             SkyboxPreset set = new SkyboxPreset(LinkedSkybox);
             if (!set.Exists())
             {
                 LinkedSkybox = Anarchy.Configuration.StringSetting.NotDefine;
             }
         }
     }
 }