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

Separate theme customisation for Crystall Edge #785

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions Content.Client/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
using Content.Client.Stylesheets;
using Content.Client.Viewport;
using Content.Client.Voting;
using Content.Shared._CP14.Configuration;
using Content.Shared.Ame.Components;
using Content.Shared.CCVar;
using Content.Shared.Gravity;
Expand Down Expand Up @@ -167,8 +168,8 @@ public override void PostInit()
_clientPreferencesManager.Initialize();
_euiManager.Initialize();
_voteManager.Initialize();
_userInterfaceManager.SetDefaultTheme("SS14DefaultTheme");
_userInterfaceManager.SetActiveTheme(_configManager.GetCVar(CVars.InterfaceTheme));
_userInterfaceManager.SetDefaultTheme("CP14DefaultTheme"); // CP14-Theme
_userInterfaceManager.SetActiveTheme(_configManager.GetCVar(CP14ConfigVars.PostProcess)); // CP14-Theme
_documentParsingManager.Initialize();
_titleWindowManager.Initialize();

Expand Down
10 changes: 7 additions & 3 deletions Content.Client/Options/UI/Tabs/MiscTab.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Linq;
using Content.Client.UserInterface.Screens;
using Content.Shared._CP14.Configuration;
using Content.Shared.CCVar;
using Content.Shared.HUD;
using Robust.Client.AutoGenerated;
Expand All @@ -21,8 +22,11 @@ public MiscTab()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);

var themes = _prototypeManager.EnumeratePrototypes<HudThemePrototype>().ToList();
// CP14-Theme-Start
var themes = _prototypeManager.EnumeratePrototypes<HudThemePrototype>()
.Where(theme => theme.IsCP == true)
.ToList();
// CP14-Theme-End
themes.Sort();
var themeEntries = new List<OptionDropDownCVar<string>.ValueOption>();
foreach (var gear in themes)
Expand All @@ -40,7 +44,7 @@ public MiscTab()
// ReSharper disable once ConditionalAccessQualifierIsNonNullableAccordingToAPIContract
ShowOocPatronColor.Visible = _playerManager.LocalSession?.Channel?.UserData.PatronTier is { };

Control.AddOptionDropDown(CVars.InterfaceTheme, DropDownHudTheme, themeEntries);
Control.AddOptionDropDown(CP14ConfigVars.InterfaceTheme, DropDownHudTheme, themeEntries); // CP14-Theme
Control.AddOptionDropDown(CCVars.UILayout, DropDownHudLayout, layoutEntries);

Control.AddOptionCheckBox(CVars.DiscordEnabled, DiscordRich);
Expand Down
5 changes: 5 additions & 0 deletions Content.Shared/HUD/HudThemePrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ public sealed partial class HudThemePrototype : IPrototype, IComparable<HudTheme
[IdDataField]
public string ID { get; private set; } = string.Empty;

// CP14-Theme-Start
[DataField]
public bool IsCP { get; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public bool IsCP { get; }
public bool CP14Allowed { get; }

// CP14-Theme-End

[DataField("path", required: true)]
public string Path { get; private set; } = string.Empty;

Expand Down
6 changes: 6 additions & 0 deletions Content.Shared/_CP14/Configuration/CP14ConfigVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ public static readonly CVarDef<bool>
/// </summary>
public static readonly CVarDef<bool>
PostProcess = CVarDef.Create("cp14_graphics.post_process", true, CVar.CLIENTONLY | CVar.ARCHIVE);

/// <summary>
/// Change the UITheme
/// </summary>
public static readonly CVarDef<string>
InterfaceTheme = CVarDef.Create("cp14_interface.theme", "", CVar.CLIENTONLY | CVar.ARCHIVE);
}
6 changes: 6 additions & 0 deletions Resources/Prototypes/_CP14/hud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- type: hudTheme
id: CP14DefaultTheme
isCP: true
name: ui-options-hud-theme-default
path: Default
order: -1
16 changes: 16 additions & 0 deletions Resources/Prototypes/_CP14/themes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- type: uiTheme
id: CP14DefaultTheme
path: /Textures/Interface/CrystallPunk/
colors:
whiteText: "#FFF5EE"
slotSelectedGold: "#e6b812"
slotColor: "#0f1215"
slotOutline: "#4a3930"
slotText: "#503b33"
nanoGold: "#A88B5E"
goodGreenFore: "#31843E"
concerningOrangeFore: "#A5762F"
dangerousRedFore: "#BB3232"
disabledFore: "#5A5A5A"
_itemstatus_content_margin_right: "#06060404"
_itemstatus_content_margin_left: "#04060604"
87 changes: 41 additions & 46 deletions Resources/Prototypes/hud.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,41 @@
# Эта тема отредактирована

- type: hudTheme
id: SS14DefaultTheme
name: ui-options-hud-theme-default
path: Default
order: -1

# А остальные не будут работать с новыми слотами
# А так же они не подходят под нашу атмосферу

# - type: hudTheme
# id: SS14PlasmafireTheme
# name: ui-options-hud-theme-plasmafire
# path: Plasmafire
# order: 3

# - type: hudTheme
# id: SS14SlimecoreTheme
# name: ui-options-hud-theme-slimecore
# path: Slimecore
# order: 2

# - type: hudTheme
# id: SS14ClockworkTheme
# name: ui-options-hud-theme-clockwork
# path: Clockwork
# order: 4

# - type: hudTheme
# id: SS14RetroTheme
# name: ui-options-hud-theme-retro
# path: Retro
# order: 6

# - type: hudTheme
# id: SS14MinimalistTheme
# name: ui-options-hud-theme-minimalist
# path: Minimalist
# order: 1

# - type: hudTheme
# id: SS14AshenTheme
# name: ui-options-hud-theme-ashen
# path: Ashen
# order: 5
- type: hudTheme
id: SS14DefaultTheme
name: ui-options-hud-theme-default
path: Default
order: -1

- type: hudTheme
id: SS14PlasmafireTheme
name: ui-options-hud-theme-plasmafire
path: Plasmafire
order: 3

- type: hudTheme
id: SS14SlimecoreTheme
name: ui-options-hud-theme-slimecore
path: Slimecore
order: 2

- type: hudTheme
id: SS14ClockworkTheme
name: ui-options-hud-theme-clockwork
path: Clockwork
order: 4

- type: hudTheme
id: SS14RetroTheme
name: ui-options-hud-theme-retro
path: Retro
order: 6

- type: hudTheme
id: SS14MinimalistTheme
name: ui-options-hud-theme-minimalist
path: Minimalist
order: 1

- type: hudTheme
id: SS14AshenTheme
name: ui-options-hud-theme-ashen
path: Ashen
order: 5
6 changes: 3 additions & 3 deletions Resources/Prototypes/themes.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
- type: uiTheme
id: SS14DefaultTheme
path: /Textures/Interface/CrystallPunk/ #Edited for CP14
path: /Textures/Interface/Default/
colors:
whiteText: "#FFF5EE"
slotSelectedGold: "#e6b812"
slotColor: "#0f1215"
slotOutline: "#4a3930" #Edited CP14
slotText: "#503b33" #Edited CP14
slotOutline: "#333850"
slotText: "#333850"
nanoGold: "#A88B5E"
goodGreenFore: "#31843E"
concerningOrangeFore: "#A5762F"
Expand Down
Loading