Esempio n. 1
0
        public void Init(object gameInstance)
        {
            if (HaEConstants.versionNumber < MinBasePluginVersion)
            {
                throw new Exception("HaE Plugincore, BasePlugin out of date! please update!");
            }

            config = new HaETweakConfiguration();
            DeSerialize();

            uiTweaks     = new HaEUITweaks();
            uxTweaks     = new HaEUXTweaks();
            renderTweaks = new HaERenderTweaks();
            pbProfiling  = new PBProfiling();

            textureManager = new TexturePackManager();
        }
Esempio n. 2
0
 public static void DeSerialize()
 {
     if (Directory.Exists($"{HaEConstants.pluginFolder}\\{HaEConstants.StorageFolder}"))
     {
         try
         {
             using (var writer = new StreamReader($"{HaEConstants.pluginFolder}\\{HaEConstants.StorageFolder}\\{config.fileName}"))
             {
                 var x = new XmlSerializer(typeof(HaETweakConfiguration));
                 config = (HaETweakConfiguration)x.Deserialize(writer);
                 writer.Close();
             }
         }
         catch (FileNotFoundException e)
         {
             //nom
         }
     }
 }