Added CP14 options menu (#454)

This commit is contained in:
Tornado Tech
2024-09-24 20:30:19 +10:00
committed by GitHub
parent 468e3c9f69
commit f3e9209af5
7 changed files with 79 additions and 1 deletions

View File

@@ -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">
@@ -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>

View File

@@ -19,6 +19,10 @@ namespace Content.Client.Options.UI
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();
}

View File

@@ -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>

View File

@@ -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();
}
}

View File

@@ -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);
}

View File

@@ -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:

View File

@@ -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):