Skip to content

Commit

Permalink
Client Settings Revamp with Categories.
Browse files Browse the repository at this point in the history
* Renamed "Options" to "Settings" in order to keep consistency.
* Added Tabs in order to categorize the client settings.
* Game Settings has it's own tab for upcoming settings.
* Video Settings has it's own tab.
* Audio Settings has it's own tab.
* Keybinding Settings (AKA: "Controls") has it's own tab.
* Apply button behaves as it usually does, but now saves the Keybinding Settings as well.
* (Client Strings) Renamed the fields within the modified structs to comply with the 'Pascal Case' format.

(Cheshire92's Review changes)
* Added the Json property 'NullValueHandling.Ignore' to the fields within the modified structs.
  • Loading branch information
Arufonsu committed Oct 16, 2021
1 parent d39d457 commit 0920f1e
Show file tree
Hide file tree
Showing 6 changed files with 829 additions and 667 deletions.
20 changes: 10 additions & 10 deletions Intersect.Client/Interface/Game/EscapeMenu.cs
Expand Up @@ -25,9 +25,9 @@ public class EscapeMenu : ImagePanel

private readonly Button mLogout;

private readonly Button mOptions;
private readonly Button mSettings;

private readonly OptionsWindow mOptionsWindow;
private readonly SettingsWindow mSettingsWindow;

private readonly Label mTitle;

Expand All @@ -45,14 +45,14 @@ public EscapeMenu(Canvas gameCanvas) : base(gameCanvas, "EscapeMenu")
Text = Strings.EscapeMenu.Title,
};

mOptionsWindow = new OptionsWindow(gameCanvas, null, null);
mSettingsWindow = new SettingsWindow(gameCanvas, null);

mOptions = new Button(mContainer, "OptionsButton")
mSettings = new Button(mContainer, "SettingsButton")
{
Text = Strings.EscapeMenu.Options
Text = Strings.EscapeMenu.Settings
};

mOptions.Clicked += Options_Clicked;
mSettings.Clicked += Settings_Clicked;

mGoToCharacterSelect = new Button(mContainer, "CharacterSelectButton")
{
Expand Down Expand Up @@ -119,22 +119,22 @@ public void Update()
mGoToCharacterSelect.IsDisabled = Globals.Me?.CombatTimer > Timing.Global.Milliseconds;
}

private void Options_Clicked(Base sender, ClickedEventArgs arguments)
private void Settings_Clicked(Base sender, ClickedEventArgs arguments)
{
mOptionsWindow.Show();
mSettingsWindow.Show();
Interface.GameUi?.EscapeMenu?.Hide();
}

public void OpenSettings()
{
mOptionsWindow.Show();
mSettingsWindow.Show();
Interface.GameUi?.EscapeMenu?.Hide();
}

/// <inheritdoc />
public override void ToggleHidden()
{
if (mOptionsWindow.IsVisible())
if (mSettingsWindow.IsVisible())
{
return;
}
Expand Down
49 changes: 24 additions & 25 deletions Intersect.Client/Interface/Menu/MainMenu.cs
Expand Up @@ -2,7 +2,6 @@

using Intersect.Client.Core;
using Intersect.Client.Framework.File_Management;
using Intersect.Client.Framework.Graphics;
using Intersect.Client.Framework.Gwen;
using Intersect.Client.Framework.Gwen.Control;
using Intersect.Client.Framework.Gwen.Control.EventArguments;
Expand Down Expand Up @@ -45,9 +44,9 @@ public class MainMenu : MutableInterface

private readonly ImagePanel mMenuWindow;

private readonly Button mOptionsButton;
private readonly Button mSettingsButton;

private readonly OptionsWindow mOptionsWindow;
private readonly SettingsWindow mSettingsWindow;

private readonly Button mRegisterButton;

Expand Down Expand Up @@ -93,41 +92,41 @@ public MainMenu(Canvas menuCanvas) : base(menuCanvas)

//Menu Header
mMenuHeader = new Label(mMenuWindow, "Title");
mMenuHeader.SetText(Strings.MainMenu.title);
mMenuHeader.SetText(Strings.MainMenu.Title);

//Login Button
mLoginButton = new Button(mMenuWindow, "LoginButton");
mLoginButton.SetText(Strings.MainMenu.login);
mLoginButton.SetText(Strings.MainMenu.Login);
mLoginButton.Clicked += LoginButton_Clicked;

//Register Button
mRegisterButton = new Button(mMenuWindow, "RegisterButton");
mRegisterButton.SetText(Strings.MainMenu.register);
mRegisterButton.SetText(Strings.MainMenu.Register);
mRegisterButton.Clicked += RegisterButton_Clicked;

//Credits Button
mCreditsButton = new Button(mMenuWindow, "CreditsButton");
mCreditsButton.SetText(Strings.MainMenu.credits);
mCreditsButton.SetText(Strings.MainMenu.Credits);
mCreditsButton.Clicked += CreditsButton_Clicked;

//Exit Button
mExitButton = new Button(mMenuWindow, "ExitButton");
mExitButton.SetText(Strings.MainMenu.exit);
mExitButton.SetText(Strings.MainMenu.Exit);
mExitButton.Clicked += ExitButton_Clicked;

//Options Button
mOptionsButton = new Button(mMenuWindow, "OptionsButton");
mOptionsButton.Clicked += OptionsButton_Clicked;
mOptionsButton.SetText(Strings.MainMenu.options);
if (!string.IsNullOrEmpty(Strings.MainMenu.optionstooltip))
//Settings Button
mSettingsButton = new Button(mMenuWindow, "SettingsButton");
mSettingsButton.Clicked += SettingsButton_Clicked;
mSettingsButton.SetText(Strings.MainMenu.Settings);
if (!string.IsNullOrEmpty(Strings.MainMenu.SettingsTooltip))
{
mOptionsButton.SetToolTipText(Strings.MainMenu.optionstooltip);
mSettingsButton.SetToolTipText(Strings.MainMenu.SettingsTooltip);
}

mMenuWindow.LoadJsonUi(GameContentManager.UI.Menu, Graphics.Renderer.GetResolutionString());

//Options Controls
mOptionsWindow = new OptionsWindow(menuCanvas, this, mMenuWindow);
//Settings Controls
mSettingsWindow = new SettingsWindow(menuCanvas, this);

//Login Controls
mLoginWindow = new LoginWindow(menuCanvas, this, mMenuWindow);
Expand Down Expand Up @@ -192,14 +191,14 @@ public void Update()
mSelectCharacterWindow.Update();
}

mOptionsWindow.Update();
mSettingsWindow.Update();
}

public void Reset()
{
mLoginWindow.Hide();
mRegisterWindow.Hide();
mOptionsWindow.Hide();
mSettingsWindow.Hide();
mCreditsWindow.Hide();
mForgotPasswordWindow.Hide();
mResetPasswordWindow.Hide();
Expand All @@ -214,19 +213,19 @@ public void Reset()
}

mMenuWindow.Show();
mOptionsButton.Show();
mSettingsButton.Show();
}

public void Show()
{
mMenuWindow.IsHidden = false;
mOptionsButton.IsHidden = false;
mSettingsButton.IsHidden = false;
}

public void Hide()
{
mMenuWindow.IsHidden = true;
mOptionsButton.IsHidden = true;
mSettingsButton.IsHidden = true;
}

public void NotifyOpenCharacterSelection(List<Character> characters)
Expand Down Expand Up @@ -262,7 +261,7 @@ public void CreateCharacterSelection()
Hide();
mLoginWindow.Hide();
mRegisterWindow.Hide();
mOptionsWindow.Hide();
mSettingsWindow.Hide();
mCreateCharacterWindow.Hide();
mSelectCharacterWindow.Show();
mShouldOpenCharacterSelection = false;
Expand All @@ -278,7 +277,7 @@ public void CreateCharacterCreation()
Hide();
mLoginWindow.Hide();
mRegisterWindow.Hide();
mOptionsWindow.Hide();
mSettingsWindow.Hide();
mSelectCharacterWindow.Hide();
mCreateCharacterWindow.Show();
mCreateCharacterWindow.Init();
Expand All @@ -305,10 +304,10 @@ void CreditsButton_Clicked(Base sender, ClickedEventArgs arguments)
mCreditsWindow.Show();
}

void OptionsButton_Clicked(Base sender, ClickedEventArgs arguments)
void SettingsButton_Clicked(Base sender, ClickedEventArgs arguments)
{
Hide();
mOptionsWindow.Show();
mSettingsWindow.Show();
}

void ExitButton_Clicked(Base sender, ClickedEventArgs arguments)
Expand Down

0 comments on commit 0920f1e

Please sign in to comment.