Exemplo n.º 1
0
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }
            ResxLanguage language = obj as ResxLanguage;

            return(Language == language.Language);
        }
Exemplo n.º 2
0
        private void SettingsForm_Load(object sender, EventArgs e)
        {
            this.PendingRestart               = false;
            this.TextBoxGameDirectory.Text    = UserSettings.GamePath;// = this.GameClientDirectory = UserSettings.GamePath;
            this.TextBoxPatcherDirectory.Text = this.PatcherWorkingDirectory = UserSettings.PatcherPath;
            this.CheckBoxPatchExe.Checked     = this.WantToPatchSoulworkerExe = UserSettings.WantToPatchExe;
            this.TextBoxId.Text               = this.GameUserId = UserSettings.GameId;
            this.TextBoxId.Enabled            = this.TextBoxPassword.Enabled = this.CheckBoxWantToLogin.Checked = this.WantToLogin = UserSettings.WantToLogin;

            string maskedEmptyString = SHA256String(String.Empty);
            string maskedGamePw      = MaskPassword(UserSettings.GamePw);

            if (maskedEmptyString == maskedGamePw)
            {
                this.TextBoxPassword.Text = this.GameUserPassword = String.Empty;
            }
            else
            {
                this.TextBoxPassword.Text = this.GameUserPassword = maskedGamePw;
            }

            var def = new ResxLanguage(StringLoader.GetText("match_windows"), "default");
            var en  = new ResxLanguage("English", "en");
            var ko  = new ResxLanguage("한국어", "ko");
            var vi  = new ResxLanguage("Tiếng Việt", "vi");
            var ru  = new ResxLanguage("Русский", "ru");

            this.ComboBoxUILanguage.DataSource = new ResxLanguage[] { def, en, ko, vi, ru };
            string savedCode = this.UILanguage = UserSettings.UILanguageCode;

            if (en.Code == savedCode)
            {
                this.ComboBoxUILanguage.SelectedItem = en;
            }
            else if (ko.Code == savedCode)
            {
                this.ComboBoxUILanguage.SelectedItem = ko;
            }
            else if (vi.Code == savedCode)
            {
                this.ComboBoxUILanguage.SelectedItem = vi;
            }
            else if (ru.Code == savedCode)
            {
                this.ComboBoxUILanguage.SelectedItem = ru;
            }
            else
            {
                this.ComboBoxUILanguage.SelectedItem = def;
            }

            if ((this.Owner as MainForm).CurrentState == MainForm.State.Idle)
            {
                this.TextBoxPatcherDirectory.TextChanged += this.EnableApplyButton;
                this.CheckBoxPatchExe.CheckedChanged     += this.EnableApplyButton;
                this.TextBoxId.TextChanged                   += this.EnableApplyButton;
                this.TextBoxPassword.TextChanged             += this.EnableApplyButton;
                this.CheckBoxWantToLogin.CheckedChanged      += this.EnableApplyButton;
                this.ComboBoxUILanguage.SelectedIndexChanged += this.EnableApplyButton;
            }
            else if ((this.Owner as MainForm).CurrentState == MainForm.State.RegionNotInstalled)
            {
                this.ButtonOpenGameDirectory.Enabled = false;
                this.ButtonOpenGameOptions.Enabled   = false;
            }
            else
            {
                this.ButtonChangePatcherDirectory.Enabled = false;
                this.CheckBoxPatchExe.Enabled             = false;
                this.TextBoxId.ReadOnly          = true;
                this.TextBoxPassword.ReadOnly    = true;
                this.CheckBoxWantToLogin.Enabled = false;
                this.ComboBoxUILanguage.Enabled  = false;
            }
        }
Exemplo n.º 3
0
        private void SettingsForm_Load(object sender, EventArgs e)
        {
            this.PendingRestart                    = false;
            this.TextBoxGameDirectory.Text         = UserSettings.GamePath;// = this.GameClientDirectory = UserSettings.GamePath;
            this.ServerIpTextBox.Text              = UserSettings.CustomGameIp;
            this.ServerPortTextBox.Text            = UserSettings.CustomGamePort;
            this.CustomGamePathTextBox.Text        = UserSettings.CustomGamePath;
            this.TextBoxPatcherDirectory.Text      = this.PatcherWorkingDirectory = UserSettings.PatcherPath;
            this.CheckBoxPatchExe.Checked          = this.WantToPatchSoulworkerExe = UserSettings.WantToPatchExe;
            this.TextBoxId.Text                    = this.GameUserId = UserSettings.GameId;
            this.TextBoxId.Enabled                 = this.TextBoxPassword.Enabled = this.CheckBoxWantToLogin.Checked = this.WantToLogin = UserSettings.WantToLogin;
            this.TranslationSourceTextBox.Text     = UserSettings.CustomTranslationServer;
            this.TranslationSourceCheckBox.Checked = UserSettings.UseCustomTranslationServer;

            string maskedEmptyString = SHA256String(String.Empty);
            string maskedGamePw      = MaskPassword(UserSettings.GamePw);

            if (maskedEmptyString == maskedGamePw)
            {
                this.TextBoxPassword.Text = this.GameUserPassword = String.Empty;
            }
            else
            {
                this.TextBoxPassword.Text = this.GameUserPassword = maskedGamePw;
            }

            var def = new ResxLanguage(StringLoader.GetText("match_windows"), "default");
            var en  = new ResxLanguage("English", "en");
            var ko  = new ResxLanguage("한국어", "ko");
            var vi  = new ResxLanguage("Tiếng Việt", "vi");
            var ru  = new ResxLanguage("Русский", "ru");

            this.ComboBoxUILanguage.DataSource = new ResxLanguage[] { def, en, ko, vi, ru };
            string savedCode = this.UILanguage = UserSettings.UILanguageCode;

            if (en.Code == savedCode)
            {
                this.ComboBoxUILanguage.SelectedItem = en;
            }
            else if (ko.Code == savedCode)
            {
                this.ComboBoxUILanguage.SelectedItem = ko;
            }
            else if (vi.Code == savedCode)
            {
                this.ComboBoxUILanguage.SelectedItem = vi;
            }
            else if (ru.Code == savedCode)
            {
                this.ComboBoxUILanguage.SelectedItem = ru;
            }
            else
            {
                this.ComboBoxUILanguage.SelectedItem = def;
            }

            this.TextBoxPatcherDirectory.TextChanged += this.EnableApplyButton;
            this.CheckBoxPatchExe.CheckedChanged     += this.EnableApplyButton;
            this.TextBoxId.TextChanged                    += this.EnableApplyButton;
            this.TextBoxPassword.TextChanged              += this.EnableApplyButton;
            this.CheckBoxWantToLogin.CheckedChanged       += this.EnableApplyButton;
            this.ComboBoxUILanguage.SelectedIndexChanged  += this.EnableApplyButton;
            this.CustomGamePathTextBox.TextChanged        += this.EnableApplyButton;
            this.ServerIpTextBox.TextChanged              += this.EnableApplyButton;
            this.ServerPortTextBox.TextChanged            += this.EnableApplyButton;
            this.TranslationSourceCheckBox.CheckedChanged += this.EnableApplyButton;
            this.TranslationSourceTextBox.TextChanged     += this.EnableApplyButton;
        }