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

Upstream sync #1672

Merged
merged 39 commits into from
Dec 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e559c08
Update WizDen's borg definition of crew (#22873)
Chief-Engineer Dec 23, 2023
99d6aff
Check for divide by near zero (#22876)
Partmedia Dec 23, 2023
def4e0f
Doggy Ears (#22832)
TheShuEd Dec 23, 2023
ffe4569
jaws cant pry bolted doors (#22860)
deltanedas Dec 23, 2023
8604efc
add saturation to TC inhand sprites (#22870)
lzk228 Dec 23, 2023
3f8ad3a
Anomaly synchronizer buff (#22771)
TheShuEd Dec 23, 2023
c64c98e
New sprites for books on bookshelves in order to look less sad. (#22874)
Moomoobeef Dec 23, 2023
e61b7d1
Drug overlay shader rework - a little more motion-sickness friendly, …
deathride58 Dec 23, 2023
6baf564
Cargo request plasma canister locale (#22858)
lapatison Dec 23, 2023
33399db
Vial Drinking (#22886)
liltenhead Dec 23, 2023
9b18357
Corner Clothing UI (#22883)
EmoGarbage404 Dec 23, 2023
06a663d
Move HUD options to general options tab (#22884)
EmoGarbage404 Dec 23, 2023
a09efd4
Add a bottle of water to the survival box (#22881)
Blackern5000 Dec 23, 2023
dfa71af
Add Chef's Belt (#22868)
IamVelcroboy Dec 23, 2023
0f6d062
temporarily override WizDen admin names (#22878)
Chief-Engineer Dec 23, 2023
9103061
Correct spelling mistakes for daily tips (#22893)
SpaceyLady Dec 23, 2023
9870c7f
Fixes GLES2 crashing when compiling the drug shader (#22899)
deathride58 Dec 23, 2023
f2cb05b
Fix accidental plasma burn nerf (#22894)
BasedUser Dec 23, 2023
3addd3e
fixes drug shader in compatibility mode FOR REAL THIS TIME (#22903)
deathride58 Dec 23, 2023
1db2230
Update Credits (#22906)
github-actions[bot] Dec 24, 2023
5d0624b
fix cargo backpack inhand sprite (#22888)
lzk228 Dec 24, 2023
30ff5fd
Adds a vscode launch option for starting the client in the compatibil…
deathride58 Dec 24, 2023
ecf65fb
Clamp after AdjustMoles() (#22907)
Partmedia Dec 24, 2023
54a2f84
Fix missing pipe on barratry (#22889)
lzk228 Dec 24, 2023
734da59
Added Santa's hardsuit and helmet. (#22898)
StanTheCarpenter Dec 24, 2023
e6b52cc
Fix nettle seeds inhand sprite (#22891)
lzk228 Dec 24, 2023
1de682e
Power monitoring console overhaul (#20927)
chromiumboy Dec 24, 2023
a3fbab8
ItemToggle system expansion (#22369)
Darkenson Dec 24, 2023
ba4b03f
Core update (#22909)
UbaserB Dec 24, 2023
681f9a2
Ion law visuals (#22908)
EmoGarbage404 Dec 24, 2023
044f5e7
Fixed PaperSystem bugs (#22896)
LordCarve Dec 24, 2023
82349d4
bagel update (#22910)
Emisse Dec 24, 2023
144af23
New Thief minor antagonist (#21520)
TheShuEd Dec 24, 2023
06fea3e
New boxstation emergency shuttle (#22912)
Flareguy Dec 24, 2023
df2b4c1
add ninja borg laws (#22778)
deltanedas Dec 24, 2023
2c3f3e5
Add maximum atmos temperature limit (#22882)
Partmedia Dec 24, 2023
bd398a6
Adds sound to Smoke Grenades (#22866)
Hmeister-fake Dec 24, 2023
c333fc2
Merge remote-tracking branch 'upstream/master' into upstream-sync
Morb0 Dec 24, 2023
1efc71f
Update locale
Morb0 Dec 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Client (Compatibility renderer)",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/bin/Content.Client/Content.Client.dll",
"args": "--cvar display.compat=true",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Server",
"type": "coreclr",
Expand Down
9 changes: 9 additions & 0 deletions Content.Client/Items/Systems/ItemToggleSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Content.Shared.Item.ItemToggle;

namespace Content.Shared.Item;

/// <inheritdoc/>
public sealed class ItemToggleSystem : SharedItemToggleSystem
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
xmlns:ui="clr-namespace:Content.Client.Medical.CrewMonitoring"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc 'crew-monitoring-user-interface-title'}"
SetSize="1200 700"
MinSize="1200 700">
SetSize="1210 700"
MinSize="1210 700">
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal" VerticalExpand="True" HorizontalExpand="True">
<ui:CrewMonitoringNavMapControl Name="NavMap" HorizontalExpand="True" VerticalExpand="True" Margin="5 20"/>
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Vertical" Margin="0 0 10 0">
<controls:StripeBack>
<PanelContainer>
<Label Name="StationName" Text="Unknown station" Align="Center" />
<Label Name="StationName" Text="Unknown station" Align="Center" Margin="0 5 0 3"/>
</PanelContainer>
</controls:StripeBack>

Expand Down
10 changes: 0 additions & 10 deletions Content.Client/Options/UI/Tabs/GraphicsTab.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
<Control MinSize="4 0" />
<OptionButton Name="UIScaleOption" />
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'ui-options-hud-theme'}" />
<Control MinSize="4 0" />
<OptionButton Name="HudThemeOption" />
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<CheckBox Name="ViewportStretchCheckBox" Text="{Loc 'ui-options-vp-stretch'}" />
<BoxContainer Name="ViewportScaleBox" Orientation="Horizontal">
Expand All @@ -38,11 +33,6 @@
Rounded="True"
MinWidth="200" />
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'ui-options-hud-layout'}" />
<Control MinSize="4 0" />
<OptionButton Name="HudLayoutOption" />
</BoxContainer>
<CheckBox Name="IntegerScalingCheckBox"
Text="{Loc 'ui-options-vp-integer-scaling'}"
ToolTip="{Loc 'ui-options-vp-integer-scaling-tooltip'}" />
Expand Down
60 changes: 1 addition & 59 deletions Content.Client/Options/UI/Tabs/GraphicsTab.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
using Content.Client.UserInterface.Screens;
using Content.Shared.CCVar;
using Content.Shared.HUD;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared;
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;

namespace Content.Client.Options.UI.Tabs
{
Expand All @@ -26,10 +23,7 @@ public sealed partial class GraphicsTab : Control
2f
};

private Dictionary<string, int> hudThemeIdToIndex = new();

[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;

public GraphicsTab()
{
Expand All @@ -55,34 +49,6 @@ public GraphicsTab()
UIScaleOption.AddItem(Loc.GetString("ui-options-scale-200"));
UIScaleOption.OnItemSelected += OnUIScaleChanged;

foreach (var gear in _prototypeManager.EnumeratePrototypes<HudThemePrototype>())
{
HudThemeOption.AddItem(Loc.GetString(gear.Name));
hudThemeIdToIndex.Add(gear.ID, HudThemeOption.GetItemId(HudThemeOption.ItemCount - 1));
}
HudThemeOption.OnItemSelected += OnHudThemeChanged;

var hudLayout = _cfg.GetCVar(CCVars.UILayout);
var id = 0;
foreach (var layout in Enum.GetValues(typeof(ScreenType)))
{
var name = layout.ToString()!;
HudLayoutOption.AddItem(name, id);
if (name == hudLayout)
{
HudLayoutOption.SelectId(id);
}
HudLayoutOption.SetItemMetadata(id, name);

id++;
}

HudLayoutOption.OnItemSelected += args =>
{
HudLayoutOption.SelectId(args.Id);
UpdateApplyButton();
};

ViewportStretchCheckBox.OnToggled += _ =>
{
UpdateViewportScale();
Expand Down Expand Up @@ -110,7 +76,6 @@ public GraphicsTab()
FullscreenCheckBox.Pressed = ConfigIsFullscreen;
LightingPresetOption.SelectId(GetConfigLightingQuality());
UIScaleOption.SelectId(GetConfigUIScalePreset(ConfigUIScale));
HudThemeOption.SelectId(hudThemeIdToIndex.GetValueOrDefault(_cfg.GetCVar(CVars.InterfaceTheme), 0));
ViewportScaleSlider.Value = _cfg.GetCVar(CCVars.ViewportFixedScaleFactor);
ViewportStretchCheckBox.Pressed = _cfg.GetCVar(CCVars.ViewportStretch);
IntegerScalingCheckBox.Pressed = _cfg.GetCVar(CCVars.ViewportSnapToleranceMargin) != 0;
Expand All @@ -134,25 +99,11 @@ private void OnUIScaleChanged(OptionButton.ItemSelectedEventArgs args)
UpdateApplyButton();
}

private void OnHudThemeChanged(OptionButton.ItemSelectedEventArgs args)
{
HudThemeOption.SelectId(args.Id);
UpdateApplyButton();
}

private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args)
{
_cfg.SetCVar(CVars.DisplayVSync, VSyncCheckBox.Pressed);
SetConfigLightingQuality(LightingPresetOption.SelectedId);

foreach (var theme in _prototypeManager.EnumeratePrototypes<HudThemePrototype>())
{
if (hudThemeIdToIndex[theme.ID] != HudThemeOption.SelectedId)
continue;
_cfg.SetCVar(CVars.InterfaceTheme, theme.ID);
break;
}

_cfg.SetCVar(CVars.DisplayWindowMode,
(int) (FullscreenCheckBox.Pressed ? WindowMode.Fullscreen : WindowMode.Windowed));
_cfg.SetCVar(CVars.DisplayUIScale, UIScaleOptions[UIScaleOption.SelectedId]);
Expand All @@ -165,11 +116,6 @@ private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args)
_cfg.SetCVar(CCVars.HudFpsCounterVisible, FpsCounterCheckBox.Pressed);
_cfg.SetCVar(CCVars.ViewportWidth, (int) ViewportWidthSlider.Value);

if (HudLayoutOption.SelectedMetadata is string opt)
{
_cfg.SetCVar(CCVars.UILayout, opt);
}

_cfg.SaveToFile();
UpdateApplyButton();
}
Expand All @@ -190,7 +136,6 @@ private void UpdateApplyButton()
var isVSyncSame = VSyncCheckBox.Pressed == _cfg.GetCVar(CVars.DisplayVSync);
var isFullscreenSame = FullscreenCheckBox.Pressed == ConfigIsFullscreen;
var isLightingQualitySame = LightingPresetOption.SelectedId == GetConfigLightingQuality();
var isHudThemeSame = HudThemeOption.SelectedId == hudThemeIdToIndex.GetValueOrDefault(_cfg.GetCVar(CVars.InterfaceTheme), 0);
var isUIScaleSame = MathHelper.CloseToPercent(UIScaleOptions[UIScaleOption.SelectedId], ConfigUIScale);
var isVPStretchSame = ViewportStretchCheckBox.Pressed == _cfg.GetCVar(CCVars.ViewportStretch);
var isVPScaleSame = (int) ViewportScaleSlider.Value == _cfg.GetCVar(CCVars.ViewportFixedScaleFactor);
Expand All @@ -199,7 +144,6 @@ private void UpdateApplyButton()
var isPLQSame = ParallaxLowQualityCheckBox.Pressed == _cfg.GetCVar(CCVars.ParallaxLowQuality);
var isFpsCounterVisibleSame = FpsCounterCheckBox.Pressed == _cfg.GetCVar(CCVars.HudFpsCounterVisible);
var isWidthSame = (int) ViewportWidthSlider.Value == _cfg.GetCVar(CCVars.ViewportWidth);
var isLayoutSame = HudLayoutOption.SelectedMetadata is string opt && opt == _cfg.GetCVar(CCVars.UILayout);

ApplyButton.Disabled = isVSyncSame &&
isFullscreenSame &&
Expand All @@ -210,10 +154,8 @@ private void UpdateApplyButton()
isIntegerScalingSame &&
isVPResSame &&
isPLQSame &&
isHudThemeSame &&
isFpsCounterVisibleSame &&
isWidthSame &&
isLayoutSame;
isWidthSame;
}

private bool ConfigIsFullscreen =>
Expand Down
13 changes: 13 additions & 0 deletions Content.Client/Options/UI/Tabs/MiscTab.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@
xmlns:s="clr-namespace:Content.Client.Stylesheets">
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Vertical" Margin="8 8 8 8" VerticalExpand="True">
<Label Text="{Loc 'ui-options-general-ui-style'}"
FontColorOverride="{xNamespace:Static s:StyleNano.NanoGold}"
StyleClasses="LabelKeyText"/>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'ui-options-hud-theme'}" />
<Control MinSize="4 0" />
<OptionButton Name="HudThemeOption" />
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'ui-options-hud-layout'}" />
<Control MinSize="4 0" />
<OptionButton Name="HudLayoutOption" />
</BoxContainer>
<Label Text="{Loc 'ui-options-general-discord'}"
FontColorOverride="{xNamespace:Static s:StyleNano.NanoGold}"
StyleClasses="LabelKeyText"/>
Expand Down
67 changes: 63 additions & 4 deletions Content.Client/Options/UI/Tabs/MiscTab.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,60 @@
using Content.Shared.CCVar;
using System.Linq;
using Content.Client.UserInterface.Screens;
using Content.Shared.CCVar;
using Content.Shared.HUD;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared;
using Robust.Shared.Configuration;
using Robust.Shared.Input;
using Robust.Shared.Prototypes;

namespace Content.Client.Options.UI.Tabs
{
[GenerateTypedNameReferences]
public sealed partial class MiscTab : Control
{

[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;

private readonly Dictionary<string, int> _hudThemeIdToIndex = new();

public MiscTab()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);

var themes = _prototypeManager.EnumeratePrototypes<HudThemePrototype>().ToList();
themes.Sort();
foreach (var gear in themes)
{
HudThemeOption.AddItem(Loc.GetString(gear.Name));
_hudThemeIdToIndex.Add(gear.ID, HudThemeOption.GetItemId(HudThemeOption.ItemCount - 1));
}

var hudLayout = _cfg.GetCVar(CCVars.UILayout);
var id = 0;
foreach (var layout in Enum.GetValues(typeof(ScreenType)))
{
var name = layout.ToString()!;
HudLayoutOption.AddItem(name, id);
if (name == hudLayout)
{
HudLayoutOption.SelectId(id);
}
HudLayoutOption.SetItemMetadata(id, name);

id++;
}

HudLayoutOption.OnItemSelected += args =>
{
HudLayoutOption.SelectId(args.Id);
UpdateApplyButton();
};

HudThemeOption.OnItemSelected += OnHudThemeChanged;
DiscordRich.OnToggled += OnCheckBoxToggled;
ShowLoocAboveHeadCheckBox.OnToggled += OnCheckBoxToggled;
ShowHeldItemCheckBox.OnToggled += OnCheckBoxToggled;
Expand All @@ -30,6 +65,7 @@ public MiscTab()
// ToggleWalk.OnToggled += OnCheckBoxToggled;
StaticStorageUI.OnToggled += OnCheckBoxToggled;

HudThemeOption.SelectId(_hudThemeIdToIndex.GetValueOrDefault(_cfg.GetCVar(CVars.InterfaceTheme), 0));
DiscordRich.Pressed = _cfg.GetCVar(CVars.DiscordEnabled);
ShowLoocAboveHeadCheckBox.Pressed = _cfg.GetCVar(CCVars.LoocAboveHeadShow);
ShowHeldItemCheckBox.Pressed = _cfg.GetCVar(CCVars.HudHeldItemShow);
Expand All @@ -50,8 +86,22 @@ private void OnCheckBoxToggled(BaseButton.ButtonToggledEventArgs args)
UpdateApplyButton();
}

private void OnHudThemeChanged(OptionButton.ItemSelectedEventArgs args)
{
HudThemeOption.SelectId(args.Id);
UpdateApplyButton();
}

private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args)
{
foreach (var theme in _prototypeManager.EnumeratePrototypes<HudThemePrototype>())
{
if (_hudThemeIdToIndex[theme.ID] != HudThemeOption.SelectedId)
continue;
_cfg.SetCVar(CVars.InterfaceTheme, theme.ID);
break;
}

_cfg.SetCVar(CVars.DiscordEnabled, DiscordRich.Pressed);
_cfg.SetCVar(CCVars.HudHeldItemShow, ShowHeldItemCheckBox.Pressed);
_cfg.SetCVar(CCVars.CombatModeIndicatorsPointShow, ShowCombatModeIndicatorsCheckBox.Pressed);
Expand All @@ -62,12 +112,19 @@ private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args)
// _cfg.SetCVar(CCVars.ToggleWalk, ToggleWalk.Pressed);
_cfg.SetCVar(CCVars.StaticStorageUI, StaticStorageUI.Pressed);

if (HudLayoutOption.SelectedMetadata is string opt)
{
_cfg.SetCVar(CCVars.UILayout, opt);
}

_cfg.SaveToFile();
UpdateApplyButton();
}

private void UpdateApplyButton()
{
var isHudThemeSame = HudThemeOption.SelectedId == _hudThemeIdToIndex.GetValueOrDefault(_cfg.GetCVar(CVars.InterfaceTheme), 0);
var isLayoutSame = HudLayoutOption.SelectedMetadata is string opt && opt == _cfg.GetCVar(CCVars.UILayout);
var isDiscordSame = DiscordRich.Pressed == _cfg.GetCVar(CVars.DiscordEnabled);
var isShowHeldItemSame = ShowHeldItemCheckBox.Pressed == _cfg.GetCVar(CCVars.HudHeldItemShow);
var isCombatModeIndicatorsSame = ShowCombatModeIndicatorsCheckBox.Pressed == _cfg.GetCVar(CCVars.CombatModeIndicatorsPointShow);
Expand All @@ -78,7 +135,9 @@ private void UpdateApplyButton()
// var isToggleWalkSame = ToggleWalk.Pressed == _cfg.GetCVar(CCVars.ToggleWalk);
var isStaticStorageUISame = StaticStorageUI.Pressed == _cfg.GetCVar(CCVars.StaticStorageUI);

ApplyButton.Disabled = isDiscordSame &&
ApplyButton.Disabled = isHudThemeSame &&
isLayoutSame &&
isDiscordSame &&
isShowHeldItemSame &&
isCombatModeIndicatorsSame &&
isOpaqueStorageWindow &&
Expand Down
14 changes: 5 additions & 9 deletions Content.Client/Paper/UI/PaperBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Input;
using Robust.Shared.Utility;
Expand Down Expand Up @@ -49,15 +48,12 @@ protected override void UpdateState(BoundUserInterfaceState state)

private void Input_OnTextEntered(string text)
{
if (!string.IsNullOrEmpty(text))
{
SendMessage(new PaperInputTextMessage(text));
SendMessage(new PaperInputTextMessage(text));

if (_window != null)
{
_window.Input.TextRope = Rope.Leaf.Empty;
_window.Input.CursorPosition = new TextEdit.CursorPos(0, TextEdit.LineBreakBias.Top);
}
if (_window != null)
{
_window.Input.TextRope = Rope.Leaf.Empty;
_window.Input.CursorPosition = new TextEdit.CursorPos(0, TextEdit.LineBreakBias.Top);
}
}

Expand Down
Loading
Loading