Skip to content

Commit

Permalink
Merge Upstream 12/12/23 (#73)
Browse files Browse the repository at this point in the history
Merge Upstream 12/12/23
  • Loading branch information
LankLTE authored Dec 14, 2023
2 parents 170b3fa + 6951863 commit d95f4bc
Show file tree
Hide file tree
Showing 591 changed files with 139,452 additions and 305,557 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private void GenerateButton(ListData data, ListContainerButton button)
}
}
});
button.EnableAllKeybinds = true;

button.AddStyleClass(ListContainer.StyleClassListContainerButton);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<ContainerButton xmlns="https://spacestation14.io"
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"
EnableAllKeybinds="True">
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls">
<PanelContainer Name="BackgroundColorPanel"/>
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<ContainerButton xmlns="https://spacestation14.io"
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"
EnableAllKeybinds="True">
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls">
<PanelContainer Name="BackgroundColorPanel"/>
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<ContainerButton xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
EnableAllKeybinds="True">
<Control xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls">
<PanelContainer Name="BackgroundColorPanel" Access="Public"/>
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
Expand Down Expand Up @@ -39,4 +38,4 @@
Text="{Loc player-tab-playtime}"
MouseFilter="Pass"/>
</BoxContainer>
</ContainerButton>
</Control>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Content.Client.Administration.UI.Tabs.PlayerTab;

[GenerateTypedNameReferences]
public sealed partial class PlayerTabHeader : ContainerButton
public sealed partial class PlayerTabHeader : Control
{
public event Action<Header>? OnHeaderClicked;

Expand Down
11 changes: 7 additions & 4 deletions Content.Client/Audio/BackgroundAudioSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ namespace Content.Client.Audio;
[UsedImplicitly]
public sealed class BackgroundAudioSystem : EntitySystem
{
/*
* TODO: Nuke this system and merge into contentaudiosystem
*/
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly IBaseClient _client = default!;
[Dependency] private readonly IConfigurationManager _configManager = default!;
Expand All @@ -22,7 +25,7 @@ public sealed class BackgroundAudioSystem : EntitySystem

private readonly AudioParams _lobbyParams = new(-5f, 1, "Master", 0, 0, 0, true, 0f);

private EntityUid? _lobbyStream;
public EntityUid? LobbyStream;

public override void Initialize()
{
Expand Down Expand Up @@ -109,7 +112,7 @@ public void RestartLobbyMusic()

public void StartLobbyMusic()
{
if (_lobbyStream != null || !_configManager.GetCVar(CCVars.LobbyMusicEnabled))
if (LobbyStream != null || !_configManager.GetCVar(CCVars.LobbyMusicEnabled))
return;

var file = _gameTicker.LobbySong;
Expand All @@ -118,12 +121,12 @@ public void StartLobbyMusic()
return;
}

_lobbyStream = _audio.PlayGlobal(file, Filter.Local(), false,
LobbyStream = _audio.PlayGlobal(file, Filter.Local(), false,
_lobbyParams.WithVolume(_lobbyParams.Volume + SharedAudioSystem.GainToVolume(_configManager.GetCVar(CCVars.LobbyMusicVolume))))?.Entity;
}

private void EndLobbyMusic()
{
_lobbyStream = _audio.Stop(_lobbyStream);
LobbyStream = _audio.Stop(LobbyStream);
}
}
2 changes: 1 addition & 1 deletion Content.Client/Audio/ContentAudioSystem.AmbientMusic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private void UpdateAmbientMusic()
// Update still runs in lobby so just ignore it.
if (_state.CurrentState is not GameplayState)
{
FadeOut(_ambientMusicStream);
Audio.Stop(_ambientMusicStream);
_ambientMusicStream = null;
_musicProto = null;
return;
Expand Down
19 changes: 19 additions & 0 deletions Content.Client/Audio/ContentAudioSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Content.Shared.Audio;
using Content.Shared.CCVar;
using Content.Shared.GameTicking;
using Robust.Client.GameObjects;
using Robust.Shared;
using Robust.Shared.Audio;
Expand Down Expand Up @@ -37,6 +38,24 @@ public override void Initialize()
base.Initialize();
UpdatesOutsidePrediction = true;
InitializeAmbientMusic();
SubscribeNetworkEvent<RoundRestartCleanupEvent>(OnRoundCleanup);
}

private void OnRoundCleanup(RoundRestartCleanupEvent ev)
{
_fadingOut.Clear();

// Preserve lobby music but everything else should get dumped.
var lobbyStream = EntityManager.System<BackgroundAudioSystem>().LobbyStream;
TryComp(lobbyStream, out AudioComponent? audioComp);
var oldGain = audioComp?.Gain;

SilenceAudio();

if (oldGain != null)
{
Audio.SetGain(lobbyStream, oldGain.Value, audioComp);
}
}

public override void Shutdown()
Expand Down
7 changes: 6 additions & 1 deletion Content.Client/Construction/ConstructionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Client.Popups;
using Content.Shared.Construction;
using Content.Shared.Construction.Prototypes;
using Content.Shared.Construction.Steps;
using Content.Shared.Examine;
using Content.Shared.Input;
using Content.Shared.Interaction;
Expand Down Expand Up @@ -97,7 +98,11 @@ private void HandleConstructionGhostExamined(EntityUid uid, ConstructionGhostCom
return;
}

edge.Steps[0].DoExamine(args);
foreach (ConstructionGraphStep step in edge.Steps)
{
args.Message.PushNewline();
step.DoExamine(args);
}
}

public event EventHandler<CraftingAvailabilityChangedArgs>? CraftingAvailabilityChanged;
Expand Down
3 changes: 1 addition & 2 deletions Content.Client/Info/PlaytimeStats/PlaytimeStatsEntry.xaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<ContainerButton xmlns="https://spacestation14.io"
xmlns:customControls1="clr-namespace:Content.Client.Administration.UI.CustomControls"
EnableAllKeybinds="True">
xmlns:customControls1="clr-namespace:Content.Client.Administration.UI.CustomControls">
<PanelContainer Name="BackgroundColorPanel"/>
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Info/PlaytimeStats/PlaytimeStatsHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Content.Client.Info.PlaytimeStats;

[GenerateTypedNameReferences]
public sealed partial class PlaytimeStatsHeader : ContainerButton
public sealed partial class PlaytimeStatsHeader : Control
{
public event Action<Header, SortDirection>? OnHeaderClicked;
private SortDirection _roleDirection = SortDirection.Ascending;
Expand Down
7 changes: 3 additions & 4 deletions Content.Client/Info/PlaytimeStats/PlaytimeStatsHeader.xaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<ContainerButton xmlns="https://spacestation14.io"
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"
EnableAllKeybinds="True">
<Control xmlns="https://spacestation14.io"
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls">
<PanelContainer Name="BackgroundColorPlaytimePanel" Access="Public"/>
<BoxContainer Orientation="Vertical"
HorizontalExpand="True">
Expand All @@ -26,4 +25,4 @@
<!-- Horizontal Separator -->
<customControls:HSeparator/>
</BoxContainer>
</ContainerButton>
</Control>
1 change: 1 addition & 0 deletions Content.Client/Options/UI/OptionsMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Title="{Loc 'ui-options-title'}"
MinSize="800 450">
<TabContainer Name="Tabs" Access="Public">
<tabs:MiscTab Name="MiscTab" />
<tabs:GraphicsTab Name="GraphicsTab" />
<tabs:KeyRebindTab Name="KeyRebindTab" />
<tabs:AudioTab Name="AudioTab" />
Expand Down
9 changes: 5 additions & 4 deletions Content.Client/Options/UI/OptionsMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ public OptionsMenu()
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);

Tabs.SetTabTitle(0, Loc.GetString("ui-options-tab-graphics"));
Tabs.SetTabTitle(1, Loc.GetString("ui-options-tab-controls"));
Tabs.SetTabTitle(2, Loc.GetString("ui-options-tab-audio"));
Tabs.SetTabTitle(3, Loc.GetString("ui-options-tab-network"));
Tabs.SetTabTitle(0, Loc.GetString("ui-options-tab-misc"));
Tabs.SetTabTitle(1, Loc.GetString("ui-options-tab-graphics"));
Tabs.SetTabTitle(2, Loc.GetString("ui-options-tab-controls"));
Tabs.SetTabTitle(3, Loc.GetString("ui-options-tab-audio"));
Tabs.SetTabTitle(4, Loc.GetString("ui-options-tab-network"));

UpdateTabs();
}
Expand Down
5 changes: 0 additions & 5 deletions Content.Client/Options/UI/Tabs/GraphicsTab.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
<Control MinSize="4 0" />
<OptionButton Name="HudThemeOption" />
</BoxContainer>
<CheckBox Name="ShowHeldItemCheckBox" Text="{Loc 'ui-options-show-held-item'}" />
<CheckBox Name="ShowCombatModeIndicatorsCheckBox" Text="{Loc 'ui-options-show-combat-mode-indicators'}" />
<CheckBox Name="ShowLoocAboveHeadCheckBox" Text="{Loc 'ui-options-show-looc-on-head'}" />
<CheckBox Name="FancySpeechBubblesCheckBox" Text="{Loc 'ui-options-fancy-speech'}" />
<CheckBox Name="FancyNameBackgroundsCheckBox" Text="{Loc 'ui-options-fancy-name-background'}" />
<BoxContainer Orientation="Horizontal">
<CheckBox Name="ViewportStretchCheckBox" Text="{Loc 'ui-options-vp-stretch'}" />
<BoxContainer Name="ViewportScaleBox" Orientation="Horizontal">
Expand Down
25 changes: 0 additions & 25 deletions Content.Client/Options/UI/Tabs/GraphicsTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ public GraphicsTab()
UpdateApplyButton();
};

ShowHeldItemCheckBox.OnToggled += OnCheckBoxToggled;
ShowCombatModeIndicatorsCheckBox.OnToggled += OnCheckBoxToggled;
ShowLoocAboveHeadCheckBox.OnToggled += OnCheckBoxToggled;
FancySpeechBubblesCheckBox.OnToggled += OnCheckBoxToggled;
FancyNameBackgroundsCheckBox.OnToggled += OnCheckBoxToggled;
IntegerScalingCheckBox.OnToggled += OnCheckBoxToggled;
ViewportLowResCheckBox.OnToggled += OnCheckBoxToggled;
ParallaxLowQualityCheckBox.OnToggled += OnCheckBoxToggled;
Expand All @@ -122,11 +117,6 @@ public GraphicsTab()
ViewportLowResCheckBox.Pressed = !_cfg.GetCVar(CCVars.ViewportScaleRender);
ParallaxLowQualityCheckBox.Pressed = _cfg.GetCVar(CCVars.ParallaxLowQuality);
FpsCounterCheckBox.Pressed = _cfg.GetCVar(CCVars.HudFpsCounterVisible);
ShowHeldItemCheckBox.Pressed = _cfg.GetCVar(CCVars.HudHeldItemShow);
ShowCombatModeIndicatorsCheckBox.Pressed = _cfg.GetCVar(CCVars.CombatModeIndicatorsPointShow);
ShowLoocAboveHeadCheckBox.Pressed = _cfg.GetCVar(CCVars.LoocAboveHeadShow);
FancySpeechBubblesCheckBox.Pressed = _cfg.GetCVar(CCVars.ChatEnableFancyBubbles);
FancyNameBackgroundsCheckBox.Pressed = _cfg.GetCVar(CCVars.ChatFancyNameBackground);
ViewportWidthSlider.Value = _cfg.GetCVar(CCVars.ViewportWidth);

_cfg.OnValueChanged(CCVars.ViewportMinimumWidth, _ => UpdateViewportWidthRange());
Expand Down Expand Up @@ -172,11 +162,6 @@ private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args)
IntegerScalingCheckBox.Pressed ? CCVars.ViewportSnapToleranceMargin.DefaultValue : 0);
_cfg.SetCVar(CCVars.ViewportScaleRender, !ViewportLowResCheckBox.Pressed);
_cfg.SetCVar(CCVars.ParallaxLowQuality, ParallaxLowQualityCheckBox.Pressed);
_cfg.SetCVar(CCVars.HudHeldItemShow, ShowHeldItemCheckBox.Pressed);
_cfg.SetCVar(CCVars.CombatModeIndicatorsPointShow, ShowCombatModeIndicatorsCheckBox.Pressed);
_cfg.SetCVar(CCVars.LoocAboveHeadShow, ShowLoocAboveHeadCheckBox.Pressed);
_cfg.SetCVar(CCVars.ChatEnableFancyBubbles, FancySpeechBubblesCheckBox.Pressed);
_cfg.SetCVar(CCVars.ChatFancyNameBackground, FancyNameBackgroundsCheckBox.Pressed);
_cfg.SetCVar(CCVars.HudFpsCounterVisible, FpsCounterCheckBox.Pressed);
_cfg.SetCVar(CCVars.ViewportWidth, (int) ViewportWidthSlider.Value);

Expand Down Expand Up @@ -212,11 +197,6 @@ private void UpdateApplyButton()
var isIntegerScalingSame = IntegerScalingCheckBox.Pressed == (_cfg.GetCVar(CCVars.ViewportSnapToleranceMargin) != 0);
var isVPResSame = ViewportLowResCheckBox.Pressed == !_cfg.GetCVar(CCVars.ViewportScaleRender);
var isPLQSame = ParallaxLowQualityCheckBox.Pressed == _cfg.GetCVar(CCVars.ParallaxLowQuality);
var isShowHeldItemSame = ShowHeldItemCheckBox.Pressed == _cfg.GetCVar(CCVars.HudHeldItemShow);
var isCombatModeIndicatorsSame = ShowCombatModeIndicatorsCheckBox.Pressed == _cfg.GetCVar(CCVars.CombatModeIndicatorsPointShow);
var isLoocShowSame = ShowLoocAboveHeadCheckBox.Pressed == _cfg.GetCVar(CCVars.LoocAboveHeadShow);
var isFancyChatSame = FancySpeechBubblesCheckBox.Pressed == _cfg.GetCVar(CCVars.ChatEnableFancyBubbles);
var isFancyBackgroundSame = FancyNameBackgroundsCheckBox.Pressed == _cfg.GetCVar(CCVars.ChatFancyNameBackground);
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);
Expand All @@ -231,11 +211,6 @@ private void UpdateApplyButton()
isVPResSame &&
isPLQSame &&
isHudThemeSame &&
isShowHeldItemSame &&
isCombatModeIndicatorsSame &&
isLoocShowSame &&
isFancyChatSame &&
isFancyBackgroundSame &&
isFpsCounterVisibleSame &&
isWidthSame &&
isLayoutSame;
Expand Down
41 changes: 41 additions & 0 deletions Content.Client/Options/UI/Tabs/MiscTab.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<tabs:MiscTab xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:tabs="clr-namespace:Content.Client.Options.UI.Tabs"
xmlns:xNamespace="http://schemas.microsoft.com/winfx/2006/xaml"
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-discord'}"
FontColorOverride="{xNamespace:Static s:StyleNano.NanoGold}"
StyleClasses="LabelKeyText"/>
<CheckBox Name="DiscordRich" Text="{Loc 'ui-options-discordrich'}" />
<Label Text="{Loc 'ui-options-general-speech'}"
FontColorOverride="{xNamespace:Static s:StyleNano.NanoGold}"
StyleClasses="LabelKeyText"/>
<CheckBox Name="ShowLoocAboveHeadCheckBox" Text="{Loc 'ui-options-show-looc-on-head'}" />
<CheckBox Name="FancySpeechBubblesCheckBox" Text="{Loc 'ui-options-fancy-speech'}" />
<CheckBox Name="FancyNameBackgroundsCheckBox" Text="{Loc 'ui-options-fancy-name-background'}" />
<Label Text="{Loc 'ui-options-general-cursor'}"
FontColorOverride="{xNamespace:Static s:StyleNano.NanoGold}"
StyleClasses="LabelKeyText"/>
<CheckBox Name="ShowHeldItemCheckBox" Text="{Loc 'ui-options-show-held-item'}" />
<CheckBox Name="ShowCombatModeIndicatorsCheckBox" Text="{Loc 'ui-options-show-combat-mode-indicators'}" />
<Label Text="{Loc 'ui-options-general-storage'}"
FontColorOverride="{xNamespace:Static s:StyleNano.NanoGold}"
StyleClasses="LabelKeyText"/>
<CheckBox Name="OpaqueStorageWindowCheckBox" Text="{Loc 'ui-options-opaque-storage-window'}" />
<CheckBox Name="StaticStorageUI" Text="{Loc 'ui-options-static-storage-ui'}" />
<!-- <CheckBox Name="ToggleWalk" Text="{Loc 'ui-options-hotkey-toggle-walk'}" /> -->

</BoxContainer>
<controls:StripeBack HasBottomEdge="False" HasMargins="False">
<Button Name="ApplyButton"
Text="{Loc 'ui-options-apply'}"
TextAlign="Center"
HorizontalAlignment="Right" />
</controls:StripeBack>
</BoxContainer>
</tabs:MiscTab>



Loading

0 comments on commit d95f4bc

Please sign in to comment.