Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 3
0
 public MctMod()
     : base()
 {
     instance = this;
 }