Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Account Security and Password Recovery, part of #41 #57

Merged
merged 11 commits into from
Dec 2, 2020
34 changes: 17 additions & 17 deletions src/Client/ConfigWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@
*/
package Client;

import Client.KeybindSet.KeyModifier;
import Game.Camera;
import Game.Client;
import Game.Game;
import Game.KeyboardHandler;
import Game.Replay;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
Expand Down Expand Up @@ -82,6 +76,12 @@
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.plaf.nimbus.NimbusLookAndFeel;
import Client.KeybindSet.KeyModifier;
import Game.Camera;
import Game.Client;
import Game.Game;
import Game.KeyboardHandler;
import Game.Replay;

/**
* GUI designed for the RSCPlus client that manages configuration options and keybind values from
Expand Down Expand Up @@ -138,6 +138,7 @@ public class ConfigWindow {
private JSpinner generalPanelClientSizeXSpinner;
private JSpinner generalPanelClientSizeYSpinner;
private JCheckBox generalPanelCheckUpdates;
private JCheckBox generalPanelAccountSecurityCheckbox;
private JCheckBox generalPanelWelcomeEnabled;
// private JCheckBox generalPanelChatHistoryCheckbox;
private JCheckBox generalPanelCombatXPMenuCheckbox;
Expand Down Expand Up @@ -226,7 +227,6 @@ public class ConfigWindow {
private JCheckBox streamingPanelIPAtLoginCheckbox;
private JCheckBox streamingPanelSaveLoginCheckbox;
private JCheckBox streamingPanelStartLoginCheckbox;
private JCheckBox streamingPanelAccountSecurityCheckbox;
private JCheckBox streamingPanelSpeedrunnerCheckbox;
// private JTextField streamingPanelSpeedrunnerUsernameTextField;

Expand Down Expand Up @@ -557,6 +557,12 @@ public void actionPerformed(ActionEvent e) {
addCheckbox("Check for rscplus updates from GitHub at launch", generalPanel);
generalPanelCheckUpdates.setToolTipText(
"When enabled, rscplus will check for client updates before launching the game and install them when prompted");

generalPanelAccountSecurityCheckbox =
addCheckbox(
"Show Account Creation and Security Settings (Requires restart for Account Creation and Recovery)", generalPanel);
generalPanelAccountSecurityCheckbox.setToolTipText(
"Makes old RSC account creation, password recovery and in-game security settings");

generalPanelWelcomeEnabled =
addCheckbox("Remind you how to open the Settings every time you log in", generalPanel);
Expand Down Expand Up @@ -1304,12 +1310,6 @@ public void stateChanged(ChangeEvent e) {
streamingPanelStartLoginCheckbox.setToolTipText(
"Starts the game at the login screen and return to it on logout");

streamingPanelAccountSecurityCheckbox =
addCheckbox(
"Show Account Creation and Security Settings (Requires restart)", streamingPanel);
streamingPanelAccountSecurityCheckbox.setToolTipText(
"Makes old RSC account creation, password recovery and in-game security settings");

JLabel spacerLabel =
new JLabel("<html><head><style>p{font-size:10px;}</style></head><p>&nbsp;</p>");
streamingPanel.add(spacerLabel);
Expand Down Expand Up @@ -2182,6 +2182,8 @@ public void synchronizeGuiValues() {
generalPanelClientSizeYSpinner.setValue(
Settings.CUSTOM_CLIENT_SIZE_Y.get(Settings.currentProfile));
generalPanelCheckUpdates.setSelected(Settings.CHECK_UPDATES.get(Settings.currentProfile));
generalPanelAccountSecurityCheckbox.setSelected(
Settings.SHOW_ACCOUNT_SECURITY_SETTINGS.get(Settings.currentProfile));
generalPanelWelcomeEnabled.setSelected(
Settings.REMIND_HOW_TO_OPEN_SETTINGS.get(Settings.currentProfile));
// generalPanelChatHistoryCheckbox.setSelected(Settings.LOAD_CHAT_HISTORY.get(Settings.currentProfile)); // TODO: Implement this feature
Expand Down Expand Up @@ -2358,8 +2360,6 @@ public void synchronizeGuiValues() {
Settings.SAVE_LOGININFO.get(Settings.currentProfile));
streamingPanelStartLoginCheckbox.setSelected(
Settings.START_LOGINSCREEN.get(Settings.currentProfile));
streamingPanelAccountSecurityCheckbox.setSelected(
Settings.SHOW_ACCOUNT_SECURITY_SETTINGS.get(Settings.currentProfile));
streamingPanelSpeedrunnerCheckbox.setSelected(
Settings.SPEEDRUNNER_MODE_ACTIVE.get(Settings.currentProfile));
// streamingPanelSpeedrunnerUsernameTextField.setText(Settings.SPEEDRUNNER_USERNAME.get(Settings.currentProfile));
Expand Down Expand Up @@ -2409,6 +2409,8 @@ public void saveSettings() {
Settings.currentProfile,
((SpinnerNumberModel) (generalPanelClientSizeYSpinner.getModel())).getNumber().intValue());
Settings.CHECK_UPDATES.put(Settings.currentProfile, generalPanelCheckUpdates.isSelected());
Settings.SHOW_ACCOUNT_SECURITY_SETTINGS.put(
Settings.currentProfile, generalPanelAccountSecurityCheckbox.isSelected());
Settings.REMIND_HOW_TO_OPEN_SETTINGS.put(
Settings.currentProfile, generalPanelWelcomeEnabled.isSelected());
// Settings.LOAD_CHAT_HISTORY.put(Settings.currentProfile,
Expand Down Expand Up @@ -2568,8 +2570,6 @@ public void saveSettings() {
Settings.currentProfile, streamingPanelSaveLoginCheckbox.isSelected());
Settings.START_LOGINSCREEN.put(
Settings.currentProfile, streamingPanelStartLoginCheckbox.isSelected());
Settings.SHOW_ACCOUNT_SECURITY_SETTINGS.put(
Settings.currentProfile, streamingPanelAccountSecurityCheckbox.isSelected());
Settings.SPEEDRUNNER_MODE_ACTIVE.put(
Settings.currentProfile, streamingPanelSpeedrunnerCheckbox.isSelected());
// Settings.SPEEDRUNNER_USERNAME.put(
Expand Down
Loading