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

Added CP14 options menu #454

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Content.Client/Options/UI/OptionsMenu.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<DefaultWindow xmlns="https://spacestation14.io"
xmlns:tabs="clr-namespace:Content.Client.Options.UI.Tabs"
xmlns:options="clr-namespace:Content.Client._CP14.Options"
Title="{Loc 'ui-options-title'}"
MinSize="800 450">
<TabContainer Name="Tabs" Access="Public">
Expand All @@ -8,5 +9,8 @@
<tabs:KeyRebindTab Name="KeyRebindTab" />
<tabs:AudioTab Name="AudioTab" />
<tabs:AccessibilityTab Name="AccessibilityTab" />
<!-- CP14-options-menu-start -->
<options:CP14OptionsMenuMainTab Name="CP14OptionsMenuTab"/>
<!-- CP14-options-menu-end -->
</TabContainer>
</DefaultWindow>
4 changes: 4 additions & 0 deletions Content.Client/Options/UI/OptionsMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ public OptionsMenu()
Tabs.SetTabTitle(3, Loc.GetString("ui-options-tab-audio"));
Tabs.SetTabTitle(4, Loc.GetString("ui-options-tab-accessibility"));

// CP14-options-menu-start
Tabs.SetTabTitle(5, Loc.GetString("cp14-ui-options-tab-main"));
// CP14-options-menu-end

UpdateTabs();
}

Expand Down
35 changes: 35 additions & 0 deletions Content.Client/_CP14/Options/CP14OptionsMenuMainTab.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<options:CP14OptionsMenuMainTab
xmlns="https://spacestation14.io"
xmlns:ui="clr-namespace:Content.Client.Options.UI"
xmlns:options="clr-namespace:Content.Client._CP14.Options">

<!--
Place for all custom settings of CP14
-->
<BoxContainer Orientation="Vertical">

<!-- Main options container -->
<ScrollContainer VerticalExpand="True" HorizontalExpand="True">
<BoxContainer Orientation="Vertical" Margin="8 8 8 8" VerticalExpand="True">

<!-- Graphics group -->
<Label Text="{Loc 'cp14-ui-options-main-graphics-label'}"
StyleClasses="LabelKeyText"/>

<!-- CP14 Wave shader settings -->
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'cp14-ui-options-main-graphics-wave-shader'}" Margin="0 0 4 0"/>
<CheckBox Name="WaveShaderEnabled"/>
</BoxContainer>

</BoxContainer>
</ScrollContainer>

<!--
Utilitarian element to simplify configuration work,
ust don't touch that, okay?
-->
<ui:OptionsTabControlRow Name="Control" />

</BoxContainer>
</options:CP14OptionsMenuMainTab>
19 changes: 19 additions & 0 deletions Content.Client/_CP14/Options/CP14OptionsMenuMainTab.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Content.Shared._CP14.Configuration;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;

namespace Content.Client._CP14.Options;

[GenerateTypedNameReferences]
public sealed partial class CP14OptionsMenuMainTab : Control
{
public CP14OptionsMenuMainTab()
{
RobustXamlLoader.Load(this);

Control.AddOptionCheckBox(CP14ConfigVars.WaveShaderEnabled, WaveShaderEnabled);

Control.Initialize();
}
}
2 changes: 1 addition & 1 deletion Content.Shared/_CP14/Configuration/CP14ConfigVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ namespace Content.Shared._CP14.Configuration;
public sealed class CP14ConfigVars : CVars
{
public static readonly CVarDef<bool>
WaveShaderEnabled = CVarDef.Create("cp14_rendering.wave_shader_enabled", true, CVar.CLIENT);
WaveShaderEnabled = CVarDef.Create("cp14_rendering.wave_shader_enabled", true, CVar.CLIENT | CVar.ARCHIVE);
}
8 changes: 8 additions & 0 deletions Resources/Locale/en-US/_CP14/escape-menu/ui/options-menu.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## General stuff

cp14-ui-options-tab-main = CP14

## Graphics

cp14-ui-options-main-graphics-label = Graphics
cp14-ui-options-main-graphics-wave-shader = Wave shader:
8 changes: 8 additions & 0 deletions Resources/Locale/ru-RU/_CP14/escape-menu/ui/options-menu.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## General stuff

cp14-ui-options-tab-main = CP14

## Graphics

cp14-ui-options-main-graphics-label = Графика
cp14-ui-options-main-graphics-wave-shader = Шейдер покачивания (Wave shader):
Loading