Exemplo n.º 1
0
        public void Dispose()
        {
            #region Save Config XML
            using (XmlTextWriter writer = new XmlTextWriter("config.xml", System.Text.Encoding.UTF8))
            {
                var configration = new Config();
                var serializer = new XmlSerializer(typeof(Config));

                configration.write_packetlog
                    = m_SharedData.write_packetlog;
                configration.freemouse
                    = m_SharedData.freemouse;
                configration.m2e
                    = m_SharedData.m2e;
                configration.fix_windowmode_vsyncwait
                    = m_SharedData.fix_windowmode_vsyncwait;
                configration.show_framerate
                    = m_SharedData.show_framerate;
                configration.objectinformation
                    = m_SharedData.objectinformation;
                configration._44khz_audiomode
                    = m_SharedData._44khz_audiomode;
                configration.cpucoolerlevel
                    = m_SharedData.cpucoolerlevel;

                writer.Formatting = Formatting.Indented;
                serializer.Serialize(writer, configration);
            }
            #endregion

            m_SharedData.Dispose();
            Dispose(true);
        }
Exemplo n.º 2
0
        private void Window_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (m_npcLogger.WindowState == FormWindowState.Normal )
                Properties.Settings.Default.LoggerWinBounds = m_npcLogger.Bounds;
            else
                Properties.Settings.Default.LoggerWinBounds = m_npcLogger.RestoreBounds;
            Properties.Settings.Default.LoggerWinState = m_npcLogger.WindowState;

            Properties.Settings.Default.LoggerWinVisible = m_npcLogger.Visible;

            Properties.Settings.Default.Save();

            m_npcLogger.Hide();

            #region Save Config XML
            using (XmlTextWriter writer = new XmlTextWriter("config.xml", System.Text.Encoding.UTF8))
            {
                var configration = new Config();
                var serializer = new XmlSerializer(typeof(Config));

                configration.write_packetlog
                    = m_SharedData.write_packetlog;
                configration.freemouse
                    = m_SharedData.freemouse;
                configration.ground_zbias
                    = m_SharedData.ground_zbias;
                configration.alphalevel
                    = m_SharedData.alphalevel;
                configration.m2e
                    = m_SharedData.m2e;
                configration.bbe
                    = m_SharedData.bbe;
                configration.deadcell
                    = m_SharedData.deadcell;
                configration.chatscope
                    = m_SharedData.chatscope;
                configration.fix_windowmode_vsyncwait
                    = m_SharedData.fix_windowmode_vsyncwait;
                configration.show_framerate
                    = m_SharedData.show_framerate;
                configration.objectinformation
                    = m_SharedData.objectinformation;
                configration._44khz_audiomode
                    = m_SharedData._44khz_audiomode;
                configration.cpucoolerlevel
                    = m_SharedData.cpucoolerlevel;

                writer.Formatting = Formatting.Indented;
                serializer.Serialize(writer, configration);
            }
            #endregion


        }
Exemplo n.º 3
0
        public MainForm()
        {
            InitializeComponent();

            m_SharedData = new SRHSharedData();

            string curentdirstr = System.IO.Directory.GetCurrentDirectory() + "\\config.ini";
            m_SharedData.configfilepath = curentdirstr;

            if (File.Exists("config.xml"))
            {
                #region Load Config XML
                using (XmlReader reader = XmlReader.Create("config.xml"))
                {
                    var configration = new Config();
                    var serializer = new XmlSerializer(typeof(Config));

                    configration = (Config)serializer.Deserialize(reader);

                    m_SharedData.write_packetlog
                        = configration.write_packetlog;
                    m_SharedData.freemouse
                        = configration.freemouse;
                    m_SharedData.m2e
                        = configration.m2e;
                    m_SharedData.fix_windowmode_vsyncwait
                        = configration.fix_windowmode_vsyncwait;
                    m_SharedData.show_framerate
                        = configration.show_framerate;
                    m_SharedData.objectinformation
                        = configration.objectinformation;
                    m_SharedData._44khz_audiomode
                        = configration._44khz_audiomode;
                    m_SharedData.cpucoolerlevel
                        = configration.cpucoolerlevel;
                }
                #endregion
            }
        }
Exemplo n.º 4
0
        private void Window_Load(object sender, EventArgs e)
        {
            InitTaskTrayMenu();

            string curentdirstr = System.IO.Directory.GetCurrentDirectory() + "\\config.ini";
            m_SharedData.configfilepath = curentdirstr;
            if (!File.Exists("config.ini"))
            {
                using( StreamWriter w = new StreamWriter(@"config.ini") )
                {
                    w.WriteLine("[M2E]");
                    w.WriteLine("; MiniMiniEffect Color Setting");
                    w.WriteLine("; 0xAARRGGBB");
                    w.WriteLine("; AA:alpha  00-FF (00:0%---7F:50%---FF:100%)");
                    w.WriteLine("; RR:red    00-FF (0-255)");
                    w.WriteLine("; GG:green  00-FF (0-255)");
                    w.WriteLine("; BB:blue   00-FF (0-255)");
                    w.WriteLine("; ");
                    w.WriteLine(";SW");
                    w.WriteLine("Skill007E=0x7F008888");
                    w.WriteLine(";FW");
                    w.WriteLine("Skill007F=0x7F880000");
                    w.WriteLine(";");
                    w.WriteLine(";warp portal");
                    w.WriteLine("Skill0080=0x7FFFFFFF");
                    w.WriteLine("Skill0081=0x7FFFFFFF");
                    w.WriteLine(";b.s. sacramentl");
                    w.WriteLine("Skill0082=0x7F888888");
                    w.WriteLine(";sanctuary");
                    w.WriteLine("Skill0083=0x7F00FFFF");
                    w.WriteLine(";ME");
                    w.WriteLine("Skill0084=0x7F00FFFF");
                    w.WriteLine(";pneuma");
                    w.WriteLine("Skill0085=0x7F00FFFF");
                    w.WriteLine(";SG LOV etc.");
                    w.WriteLine("Skill0086=0x7F880088");
                    w.WriteLine(";FP");
                    w.WriteLine("Skill0087=0x7F888800");
                    w.WriteLine("Skill0088=0x7F888800");
                    w.WriteLine(";");
                    w.WriteLine("Skill0089=0x7F888888");
                    w.WriteLine("Skill008A=0x7F888888");
                    w.WriteLine("Skill008B=0x7F888888");
                    w.WriteLine("Skill008C=0x7F888888");
                    w.WriteLine(";IW");
                    w.WriteLine("Skill008D=0x7F880088");
                    w.WriteLine(";QM");
                    w.WriteLine("Skill008E=0x7F448844");
                    w.WriteLine(";");
                    w.WriteLine("Skill008F=0x7F888888");
                    w.WriteLine(";");
                    for (int ii = 0x90; ii < 0x100; ii++)
                    {
                        w.WriteLine("Skill{0}=0x7F888888", ii.ToString("X4"));
                    }
                }
            }

            if (File.Exists("config.xml"))
            {
                #region Load Config XML
                using (XmlReader reader = XmlReader.Create("config.xml"))
                {
                    var configration = new Config();
                    var serializer = new XmlSerializer(typeof(Config));

                    configration = (Config)serializer.Deserialize(reader);

                    m_SharedData.write_packetlog
                        = configration.write_packetlog;
                    m_SharedData.freemouse
                        = configration.freemouse;
                    m_SharedData.ground_zbias
                        = configration.ground_zbias;
                    m_SharedData.alphalevel
                        = configration.alphalevel;
                    m_SharedData.m2e
                        = configration.m2e;
                    m_SharedData.bbe
                        = configration.bbe;
                    m_SharedData.deadcell
                        = configration.deadcell;
                    m_SharedData.chatscope
                        = configration.chatscope;
                    m_SharedData.fix_windowmode_vsyncwait
                        = configration.fix_windowmode_vsyncwait;
                    m_SharedData.show_framerate
                        = configration.show_framerate;
                    m_SharedData.objectinformation
                        = configration.objectinformation;
                    m_SharedData._44khz_audiomode
                        = configration._44khz_audiomode;
                    m_SharedData.cpucoolerlevel
                        = configration.cpucoolerlevel;
                }
                #endregion
            }

            m_npcLogger = new NPCLogger();
            m_npcLogger.StartPosition = FormStartPosition.Manual;
            m_npcLogger.Bounds = Properties.Settings.Default.LoggerWinBounds;
            m_npcLogger.WindowState = Properties.Settings.Default.LoggerWinState;

            if ( Properties.Settings.Default.LoggerWinVisible)
                m_npcLogger.Show();

        }