Skip to content

Commit

Permalink
Default to Separated UI Layout (#433)
Browse files Browse the repository at this point in the history
# Description

<sub>~~Change from Nyano~~</sub>
Uses space a lot better. The old layout still exists if people want it
for whatever reason.
I also renamed "Default" to "Overlay", which should stay anyway if the
default change is denied.

---

<details><summary><h1>Media</h1></summary>
<p>

## Separated


![image](https://github.com/Simple-Station/Einstein-Engines/assets/77995199/b97c4373-99ac-4ac5-80a5-149122238551)

## Overlay


![image](https://github.com/Simple-Station/Einstein-Engines/assets/77995199/3891756f-91f0-4336-b075-6c461ee1b8e6)

</p>
</details>

---

# Changelog

:cl:
- tweak: UI layout now defaults to separated, the old one is still
available in settings
  • Loading branch information
DEATHB4DEFEAT authored Jun 16, 2024
1 parent b032f9f commit 544fd13
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions Content.Client/Gameplay/GameplayState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,17 @@ private void LoadMainScreen()
var screenTypeString = _configurationManager.GetCVar(CCVars.UILayout);
if (!Enum.TryParse(screenTypeString, out ScreenType screenType))
{
screenType = default;
screenType = ScreenType.Separated;
}

switch (screenType)
{
case ScreenType.Default:
_uiManager.LoadScreen<DefaultGameScreen>();
break;
case ScreenType.Separated:
_uiManager.LoadScreen<SeparatedChatGameScreen>();
break;
case ScreenType.Overlay:
_uiManager.LoadScreen<OverlayChatGameScreen>();
break;
}

_loadController.LoadScreen();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<screens:DefaultGameScreen
<screens:OverlayChatGameScreen
xmlns="https://spacestation14.io"
xmlns:screens="clr-namespace:Content.Client.UserInterface.Screens"
xmlns:menuBar="clr-namespace:Content.Client.UserInterface.Systems.MenuBar.Widgets"
Expand Down Expand Up @@ -30,4 +30,4 @@
<hotbar:HotbarGui Name="Hotbar" Access="Protected" />
<chat:ResizableChatBox Name="Chat" Access="Protected" />
<alerts:AlertsUI Name="Alerts" Access="Protected" />
</screens:DefaultGameScreen>
</screens:OverlayChatGameScreen>
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
namespace Content.Client.UserInterface.Screens;

[GenerateTypedNameReferences]
public sealed partial class DefaultGameScreen : InGameScreen
public sealed partial class OverlayChatGameScreen : InGameScreen
{
public DefaultGameScreen()
public OverlayChatGameScreen()
{
RobustXamlLoader.Load(this);

Expand Down
8 changes: 4 additions & 4 deletions Content.Client/UserInterface/Screens/ScreenType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ namespace Content.Client.UserInterface.Screens;
public enum ScreenType
{
/// <summary>
/// The modern SS14 user interface.
/// The classic SS13 user interface.
/// </summary>
Default,
Separated,
/// <summary>
/// The classic SS13 user interface.
/// The temporary SS14 user interface.
/// </summary>
Separated
Overlay,
}
16 changes: 8 additions & 8 deletions Content.Client/UserInterface/Systems/Chat/ChatUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,16 @@ public void SetMainChat(bool setting)

switch (UIManager.ActiveScreen)
{
case DefaultGameScreen defaultScreen:
chatBox = defaultScreen.ChatBox;
chatSizeRaw = _config.GetCVar(CCVars.DefaultScreenChatSize);
SetChatSizing(chatSizeRaw, defaultScreen, setting);
break;
case SeparatedChatGameScreen separatedScreen:
chatBox = separatedScreen.ChatBox;
chatSizeRaw = _config.GetCVar(CCVars.SeparatedScreenChatSize);
SetChatSizing(chatSizeRaw, separatedScreen, setting);
break;
case OverlayChatGameScreen overlayScreen:
chatBox = overlayScreen.ChatBox;
chatSizeRaw = _config.GetCVar(CCVars.OverlayScreenChatSize);
SetChatSizing(chatSizeRaw, overlayScreen, setting);
break;
default:
// this could be better?
var maybeChat = UIManager.ActiveScreen.GetWidget<ChatBox>();
Expand Down Expand Up @@ -322,12 +322,12 @@ private void StoreChatSize(Vector2 size)
$"{size.X.ToString(CultureInfo.InvariantCulture)},{size.Y.ToString(CultureInfo.InvariantCulture)}";
switch (UIManager.ActiveScreen)
{
case DefaultGameScreen _:
_config.SetCVar(CCVars.DefaultScreenChatSize, stringSize);
break;
case SeparatedChatGameScreen _:
_config.SetCVar(CCVars.SeparatedScreenChatSize, stringSize);
break;
case OverlayChatGameScreen _:
_config.SetCVar(CCVars.OverlayScreenChatSize, stringSize);
break;
default:
// do nothing
return;
Expand Down
6 changes: 3 additions & 3 deletions Content.Client/UserInterface/Systems/Vote/VoteUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ private void OnScreenLoad()
{
switch (UIManager.ActiveScreen)
{
case DefaultGameScreen game:
_votes.SetPopupContainer(game.VoteMenu);
break;
case SeparatedChatGameScreen separated:
_votes.SetPopupContainer(separated.VoteMenu);
break;
case OverlayChatGameScreen overlay:
_votes.SetPopupContainer(overlay.VoteMenu);
break;
}
}

Expand Down
6 changes: 3 additions & 3 deletions Content.Shared/CCVar/CCVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1596,10 +1596,10 @@ public static readonly CVarDef<int>
*/

public static readonly CVarDef<string> UILayout =
CVarDef.Create("ui.layout", "Default", CVar.CLIENTONLY | CVar.ARCHIVE);
CVarDef.Create("ui.layout", "Separated", CVar.CLIENTONLY | CVar.ARCHIVE);

public static readonly CVarDef<string> DefaultScreenChatSize =
CVarDef.Create("ui.default_chat_size", "", CVar.CLIENTONLY | CVar.ARCHIVE);
public static readonly CVarDef<string> OverlayScreenChatSize =
CVarDef.Create("ui.overlay_chat_size", "", CVar.CLIENTONLY | CVar.ARCHIVE);

public static readonly CVarDef<string> SeparatedScreenChatSize =
CVarDef.Create("ui.separated_chat_size", "0.6,0", CVar.CLIENTONLY | CVar.ARCHIVE);
Expand Down

0 comments on commit 544fd13

Please sign in to comment.