예제 #1
0
        private void remoboToolStripMenuItem_Click(object sender, EventArgs e)
        {
            String remoboPath = VPN.searchRemobo();

            if (remoboPath != null)
            {
                try
                {
                    System.Diagnostics.Process.Start(remoboPath);
                }
                catch { }
            }
        }
예제 #2
0
        public fPrincipal()
        {
            this.Icon = Properties.Resources.age3x_arrow;

            // Cargamos la configuracion y si no existe la inicializamos
            this.config = new Configuration(_configuration_reg_path, Configuration.configLocation.APPDATA);
            if (!config.Load())
            {
                config.Set("game_wo_video", false);
                config.Set("game_wo_sound", false);
                config.Set("game_in_window", false);
                config.Set("selected_ip", "0.0.0.0");
                config.Set("selected_mod", 0);
                config.Set("mod_popmod_population", "320");
                config.Set("culture_language", "");
                config.Set("culture_country", "");
                if (!config.Save())
                {
                    MessageBox.Show("Critical Error.\nConfiguration couldn't be initializated.", "Critical Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            // Cargamos el idioma de la configuración, si no el del sistema y en ultima instancia el definido por defecto
            if (config.Get("culture_language").ToString() == String.Empty)
            {
                if (!languageManager.setCulture())
                {
                    if (!languageManager.setCulture(_av_languages_l[_av_languages_default], _av_languages_c[_av_languages_default]))
                    {
                        MessageBox.Show("Critical Error.\nLanguages can´t be loaded.\nProgram will close.", "Critical Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        Application.Exit();
                    }
                }
            }
            else
            {
                Boolean loaded = false;
                if (config.Get("culture_country").ToString() == String.Empty)
                {
                    loaded = languageManager.setCulture(config.Get("culture_language").ToString().ToUpper());
                }
                else
                {
                    loaded = languageManager.setCulture(config.Get("culture_language").ToString().ToUpper(), config.Get("culture_country").ToString().ToUpper());
                }
                if (!loaded)
                {
                    if (!languageManager.setCulture())
                    {
                        if (!languageManager.setCulture(_av_languages_l[_av_languages_default], _av_languages_c[_av_languages_default]))
                        {
                            MessageBox.Show("Critical Error.\nLanguages can´t be loaded.\nProgram will close.", "Critical Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            Application.Exit();
                        }
                    }
                }
            }

            // Le indicamos al programa que idioma es el actualmente cargado
            for (int i = 0; i < _av_languages.Length; i++)
            {
                if (_av_languages_l[i] == languageManager.Culture.Language && _av_languages_c[i] == languageManager.Culture.Country)
                {
                    _av_languages_actual = i;
                    break;
                }
            }

            InitializeComponent();

            // Cargamos la información de los juegos
            info.Load();

            // Cargamos las IP's de los adaptadores conectados
            LoadIPs();

            // Establecemos todos los textos
            setText();

            // Comprobamos la disponibilidad de los VPN
            if (VPN.searchRemobo() == null)
            {
                this.remoboToolStripMenuItem.Enabled = false;
            }

            // Cargamos el valor de los checks desde la configuración
            this.cbOpVideo.Checked   = (Boolean)config.Get("game_wo_video");
            this.cbOpSound.Checked   = (Boolean)config.Get("game_wo_sound");
            this.cbOpGWindow.Checked = (Boolean)config.Get("game_in_window");

            // Seleccionamos el mod por defecto
            if (0 > (Int32)config.Get("selected_mod") && (Int32)config.Get("selected_mod") < _av_mods.Length)
            {
                _auxiliary_modslist_index = (Int32)config.Get("selected_mod");
            }
            else
            {
                _auxiliary_modslist_index = 0;
            }

            // Seleccionamos el valor por defecto del popmod
            for (int i = 0; i < this.cbPopModPopulation.Items.Count; i++)
            {
                if (config.Get("mod_popmod_population").ToString() == this.cbPopModPopulation.Items[i].ToString())
                {
                    this.cbPopModPopulation.SelectedIndex = i;
                    break;
                }

                this.cbPopModPopulation.SelectedIndex = 0;
            }
        }