Exemple #1
0
        public override void OnLoad()
        {
            base.OnLoad();

            if (!Main.dedServ)
            {
                (MctUI.WhitePixel = new Texture2D(API.main.GraphicsDevice, 1, 1)).SetData(new Color[1] { new Color(255, 255, 255, 0) });
                (MctUI.InversedWhitePixel = new Texture2D(API.main.GraphicsDevice, 1, 1)).SetData(new Color[1] { new Color(255, 255, 255, 255) });
            }

            instance = this;

            FileStream fs = null;
            try
            {
                fs = new FileStream(MCTDataFile, FileMode.Open);
                ReadSettings(fs);
            }
            catch (IOException)
            {
                if (fs != null)
                    fs.Close();

                fs = new FileStream(MCTDataFile, FileMode.Create);

                WriteSettings(fs);
            }
            finally
            {
                if (fs != null)
                    fs.Close();
            }
        }
Exemple #2
0
        public override void OnUnload()
        {
            Mct.Uninit();

            FileStream fs = new FileStream(MCTDataFile, FileMode.Create);
            WriteSettings(fs);
            fs.Close();

            instance = null;
            SettingsPage.PageInstance = null;

            base.OnUnload();
        }
Exemple #3
0
 public MctMod()
     : base()
 {
     instance = this;
 }