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

Upsteam Merge 07/15/2024 #27

Merged
merged 76 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
2440284
Cherry-Pick Delta-V Asteroids (#526)
Mnemotechnician Jul 8, 2024
e0c9e8d
Automatic Changelog Update (#526)
SimpleStation14 Jul 8, 2024
78e33b3
Update Credits (#523)
github-actions[bot] Jul 8, 2024
849b330
Languages Markers (#510)
FoxxoTrystan Jul 9, 2024
eae8ea8
Automatic Changelog Update (#510)
SimpleStation14 Jul 9, 2024
be6c214
Fix Item Transfer System (#524)
Spatison Jul 9, 2024
408ab5d
Automatic Changelog Update (#524)
SimpleStation14 Jul 9, 2024
6affbc1
Power Resprite (#520)
FoxxoTrystan Jul 9, 2024
2cc737c
Automatic Changelog Update (#520)
SimpleStation14 Jul 9, 2024
399bd96
Mirror: NPC Steering Tweaks (#307)
SimpleStation14 Jul 9, 2024
8926496
Mirror: Door Remote Now Shows Mode in UI (#293)
SimpleStation14 Jul 9, 2024
24f36c1
Mirror: Pulling Rework V2 (#269)
SimpleStation14 Jul 9, 2024
a8911da
Mirror: Configuration argument for content packaging (#316)
SimpleStation14 Jul 9, 2024
6720f78
Mirror: Fix Scram! Implant Keeping You Pulled to Someone when Telepor…
SimpleStation14 Jul 10, 2024
83d6633
Mirror: Fix Decoy Bomb Uplink Category (#254)
SimpleStation14 Jul 10, 2024
68aa211
Mirror: Fix Cream Pie Bomb when Eaten or Sliced (#172)
SimpleStation14 Jul 10, 2024
1258961
Cherry-Pick PR #26312: Fix Puller Being Improperly Unset When Pulling…
VMSolidus Jul 10, 2024
d61e23d
Mirror: Added 18 New Bounties to Cargo (#239)
SimpleStation14 Jul 10, 2024
e7fd3c7
Cherry-Pick PR #26467: Update Submodule To 216.0.0 (#533)
VMSolidus Jul 10, 2024
dc46648
Arachne Plushie (#531)
CodedCrow Jul 11, 2024
02dbd8d
Automatic Changelog Update (#531)
SimpleStation14 Jul 11, 2024
9549acb
Cherry-Pick PR "Wallmount Substations Can Once Again Be Created" #271…
WarMechanic Jul 11, 2024
bf2b66e
Automatic Changelog Update (#539)
SimpleStation14 Jul 11, 2024
7463b37
More Gamemodes (#527)
Mnemotechnician Jul 11, 2024
5460b76
Automatic Changelog Update (#527)
SimpleStation14 Jul 11, 2024
4634419
Update Submodule to 217.2.1 (#534)
VMSolidus Jul 12, 2024
50ec3cd
Update Submodule to 218.2.0 (#535)
VMSolidus Jul 12, 2024
30fa120
Update Submodule to 219.2.0 (#536)
VMSolidus Jul 12, 2024
dfeb3b9
Mirror: Fix Recycled Containers Deleting Items Inside Them (#267)
SimpleStation14 Jul 12, 2024
19568f7
Mirror 25908: Chat Censorship Systems (#444)
SimpleStation14 Jul 12, 2024
318bb08
Mirror 26421: Nerf Ninja's Research Stealing (#446)
SimpleStation14 Jul 12, 2024
1c91476
Mirror 26427: Make the Chest Rig Purchasable in Uplink (#448)
SimpleStation14 Jul 12, 2024
6949685
Mirror: Fix Playglobalsound Autocompletion (#319)
SimpleStation14 Jul 12, 2024
e6779b6
Mirror: Add Stealthmins (#360)
SimpleStation14 Jul 12, 2024
6084740
Foreigner Traits (#525)
Mnemotechnician Jul 12, 2024
c9e08f3
Automatic Changelog Update (#525)
SimpleStation14 Jul 12, 2024
98d39ca
Foreigner Minor Fixes (#542)
Mnemotechnician Jul 12, 2024
4b6ed6e
Automatic Changelog Update (#542)
SimpleStation14 Jul 12, 2024
c55afe5
Fix Arachne Plushie CL (#541)
DEATHB4DEFEAT Jul 12, 2024
7916f07
Heavyweight Drunk Trait + Drunk Traits Rework (#512)
WarMechanic Jul 12, 2024
98bfbde
Automatic Changelog Update (#512)
SimpleStation14 Jul 12, 2024
e3bc8d4
Random Announcer System (#415)
DEATHB4DEFEAT Jul 12, 2024
69bf295
Automatic Changelog Update (#415)
SimpleStation14 Jul 12, 2024
806dc01
Mass Contests Remake (#480)
VMSolidus Jul 13, 2024
11982ff
Automatic Changelog Update (#480)
SimpleStation14 Jul 13, 2024
d5e175e
Update Credits (#548)
github-actions[bot] Jul 14, 2024
18df90e
IdCard Resprite (#537)
FoxxoTrystan Jul 14, 2024
2735b8f
Automatic Changelog Update (#537)
SimpleStation14 Jul 14, 2024
964ed8f
Shock Collar Tweak (#546)
Mnemotechnician Jul 14, 2024
3178ccb
Automatic Changelog Update (#546)
SimpleStation14 Jul 14, 2024
35633a7
Merge remote-tracking branch 'EE/master' into Upsteam/17/15/2024
FoxxoTrystan Jul 15, 2024
ad9e224
Merge branch 'Fansana:master' into Upsteam/17/15/2024
FoxxoTrystan Jul 16, 2024
b75ddd5
Fix the Thieving Trait Not Working (#552)
WarMechanic Jul 16, 2024
8744314
Automatic Changelog Update (#552)
SimpleStation14 Jul 16, 2024
c013146
Port Parkstation Audio Library (#457)
VMSolidus Jul 16, 2024
73a56a6
Automatic Changelog Update (#457)
SimpleStation14 Jul 16, 2024
7510040
Fixed Typos in Offer Prompt + Added New Icon (#551)
gluesniffler Jul 16, 2024
d4ddca6
Automatic Changelog Update (#551)
SimpleStation14 Jul 16, 2024
ff26317
More Zoom Levels (#547)
Mnemotechnician Jul 16, 2024
9ea7ce3
Automatic Changelog Update (#547)
SimpleStation14 Jul 16, 2024
79bcb0e
Harpy Wings (#545)
dootythefrooty Jul 16, 2024
e59c144
Automatic Changelog Update (#545)
SimpleStation14 Jul 16, 2024
62dfbfc
Display an Alert when the User Is Walking or Running. (#528)
gluesniffler Jul 16, 2024
a329086
Automatic Changelog Update (#528)
SimpleStation14 Jul 16, 2024
03f1828
Finally Put the meta.json Shema to Use (#489)
DEATHB4DEFEAT Jul 17, 2024
3bc5052
Cherry-Pick PR26540: "Fix Empty Atmos Deserialization" (#558)
VMSolidus Jul 17, 2024
7345745
Merge remote-tracking branch 'EE/master' into Upsteam/17/15/2024
FoxxoTrystan Jul 17, 2024
a2c1687
Lay Down via Keybind (#530)
Mnemotechnician Jul 18, 2024
f0c9558
Add Species Restrictions to Loadout Items (#554)
VMSolidus Jul 18, 2024
771be20
Automatic Changelog Update (#530)
SimpleStation14 Jul 18, 2024
fa1bd9f
Automatic Changelog Update (#554)
SimpleStation14 Jul 18, 2024
8939fa1
Fix Foreigner Translators AGAIN (#559)
Mnemotechnician Jul 18, 2024
20fe5d3
Automatic Changelog Update (#559)
SimpleStation14 Jul 18, 2024
952953b
Physics Based Air Throws (#342)
VMSolidus Jul 18, 2024
4177b70
Automatic Changelog Update (#342)
SimpleStation14 Jul 18, 2024
3b15ee9
Merge remote-tracking branch 'EE/master' into Upsteam/17/15/2024
FoxxoTrystan Jul 18, 2024
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
  •  
  •  
  •  
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"omnisharp.analyzeOpenDocumentsOnly": true,
"dotnet.defaultSolution": "SpaceStation14.sln"
"dotnet.defaultSolution": "SpaceStation14.sln",
"json.schemas": [
{
"fileMatch": [ "**/meta.json" ],
"url": "https://raw.githubusercontent.com/Simple-Station/Einstein-Engines/master/.github/rsi-schema.json"
}
]
}
21 changes: 10 additions & 11 deletions Content.Client/Alerts/ClientAlertsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,23 @@ public IReadOnlyDictionary<AlertKey, AlertState>? ActiveAlerts

protected override void AfterShowAlert(Entity<AlertsComponent> alerts)
{
if (_playerManager.LocalEntity != alerts.Owner)
return;

SyncAlerts?.Invoke(this, alerts.Comp.Alerts);
UpdateHud(alerts);
}

protected override void AfterClearAlert(Entity<AlertsComponent> alertsComponent)
protected override void AfterClearAlert(Entity<AlertsComponent> alerts)
{
if (_playerManager.LocalEntity != alertsComponent.Owner)
return;
UpdateHud(alerts);
}

SyncAlerts?.Invoke(this, alertsComponent.Comp.Alerts);
private void ClientAlertsHandleState(Entity<AlertsComponent> alerts, ref AfterAutoHandleStateEvent args)
{
UpdateHud(alerts);
}

private void ClientAlertsHandleState(EntityUid uid, AlertsComponent component, ref AfterAutoHandleStateEvent args)
private void UpdateHud(Entity<AlertsComponent> entity)
{
if (_playerManager.LocalEntity == uid)
SyncAlerts?.Invoke(this, component.Alerts);
if (_playerManager.LocalEntity == entity.Owner)
SyncAlerts?.Invoke(this, entity.Comp.Alerts);
}

private void OnPlayerAttached(EntityUid uid, AlertsComponent component, LocalPlayerAttachedEvent args)
Expand Down
69 changes: 69 additions & 0 deletions Content.Client/Announcements/Systems/AnnouncerSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using Content.Client.Audio;
using Content.Shared.Announcements.Events;
using Content.Shared.Announcements.Systems;
using Content.Shared.CCVar;
using Robust.Client.Audio;
using Robust.Client.Player;
using Robust.Client.ResourceManagement;
using Robust.Shared.Audio.Sources;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;

namespace Content.Client.Announcements.Systems;

public sealed class AnnouncerSystem : SharedAnnouncerSystem
{
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly IConfigurationManager _config = default!;
[Dependency] private readonly IResourceCache _cache = default!;
[Dependency] private readonly IAudioManager _audioManager = default!;

private IAudioSource? AnnouncerSource { get; set; }
private float AnnouncerVolume { get; set; }


public override void Initialize()
{
base.Initialize();

AnnouncerVolume = _config.GetCVar(CCVars.AnnouncerVolume) * 100f / ContentAudioSystem.AnnouncerMultiplier;

SubscribeNetworkEvent<AnnouncementSendEvent>(OnAnnouncementReceived);
_config.OnValueChanged(CCVars.AnnouncerVolume, OnAnnouncerVolumeChanged);
}

public override void Shutdown()
{
base.Shutdown();

_config.UnsubValueChanged(CCVars.AnnouncerVolume, OnAnnouncerVolumeChanged);
}


private void OnAnnouncerVolumeChanged(float value)
{
AnnouncerVolume = value;

if (AnnouncerSource != null)
AnnouncerSource.Gain = AnnouncerVolume;
}

private void OnAnnouncementReceived(AnnouncementSendEvent ev)
{
if (!ev.Recipients.Contains(_player.LocalSession!.UserId)
|| !_cache.TryGetResource<AudioResource>(GetAnnouncementPath(ev.AnnouncementId, ev.AnnouncerId),
out var resource))
return;

var source = _audioManager.CreateAudioSource(resource);
if (source != null)
{
source.Gain = AnnouncerVolume * SharedAudioSystem.VolumeToGain(ev.AudioParams.Volume);
source.Global = true;
}

AnnouncerSource?.Dispose();
AnnouncerSource = source;
AnnouncerSource?.StartPlaying();
}
}
1 change: 0 additions & 1 deletion Content.Client/Audio/AmbientSoundSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ protected override void QueueUpdate(EntityUid uid, AmbientSoundComponent ambienc
private static AudioParams _params = AudioParams.Default
.WithVariation(0.01f)
.WithLoop(true)
.WithAttenuation(Attenuation.LinearDistance)
.WithMaxDistance(7f);

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public sealed partial class ContentAudioSystem
[Dependency] private readonly IStateManager _stateManager = default!;
[Dependency] private readonly IResourceCache _resourceCache = default!;

private readonly AudioParams _lobbySoundtrackParams = new(-5f, 1, "Master", 0, 0, 0, false, 0f);
private readonly AudioParams _roundEndSoundEffectParams = new(-5f, 1, "Master", 0, 0, 0, false, 0f);
private readonly AudioParams _lobbySoundtrackParams = new(-5f, 1, 0, 0, 0, false, 0f);
private readonly AudioParams _roundEndSoundEffectParams = new(-5f, 1, 0, 0, 0, false, 0f);

/// <summary>
/// EntityUid of lobby restart sound component.
Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Audio/ContentAudioSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public sealed partial class ContentAudioSystem : SharedContentAudioSystem
public const float AmbientMusicMultiplier = 3f;
public const float LobbyMultiplier = 3f;
public const float InterfaceMultiplier = 2f;

public const float AnnouncerMultiplier = 3f;

public override void Initialize()
{
base.Initialize();
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Clothing/ClientClothingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private bool TryGetDefaultVisuals(EntityUid uid, ClothingComponent clothing, str
else if (TryComp(uid, out SpriteComponent? sprite))
rsi = sprite.BaseRSI;

if (rsi == null || rsi.Path == null)
if (rsi == null)
return false;

var correctedSlot = slot;
Expand Down
2 changes: 0 additions & 2 deletions Content.Client/Doors/DoorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
using Robust.Client.GameObjects;
using Robust.Client.ResourceManagement;
using Robust.Shared.Serialization.TypeSerializers.Implementations;
using Robust.Shared.Timing;

namespace Content.Client.Doors;

public sealed class DoorSystem : SharedDoorSystem
{
[Dependency] private readonly AnimationPlayerSystem _animationSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IResourceCache _resourceCache = default!;

public override void Initialize()
Expand Down
12 changes: 5 additions & 7 deletions Content.Client/IconSmoothing/IconSmoothSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ namespace Content.Client.IconSmoothing
[UsedImplicitly]
public sealed partial class IconSmoothSystem : EntitySystem
{
[Dependency] private readonly IMapManager _mapManager = default!;

private readonly Queue<EntityUid> _dirtyEntities = new();
private readonly Queue<EntityUid> _anchorChangedEntities = new();

Expand Down Expand Up @@ -47,7 +45,7 @@ private void OnStartup(EntityUid uid, IconSmoothComponent component, ComponentSt
var xform = Transform(uid);
if (xform.Anchored)
{
component.LastPosition = _mapManager.TryGetGrid(xform.GridUid, out var grid)
component.LastPosition = TryComp<MapGridComponent>(xform.GridUid, out var grid)
? (xform.GridUid.Value, grid.TileIndicesFor(xform.Coordinates))
: (null, new Vector2i(0, 0));

Expand Down Expand Up @@ -134,7 +132,7 @@ public void DirtyNeighbours(EntityUid uid, IconSmoothComponent? comp = null, Tra

Vector2i pos;

if (transform.Anchored && _mapManager.TryGetGrid(transform.GridUid, out var grid))
if (transform.Anchored && TryComp<MapGridComponent>(transform.GridUid, out var grid))
{
pos = grid.CoordinatesToTile(transform.Coordinates);
}
Expand All @@ -144,7 +142,7 @@ public void DirtyNeighbours(EntityUid uid, IconSmoothComponent? comp = null, Tra
if (comp.LastPosition is not (EntityUid gridId, Vector2i oldPos))
return;

if (!_mapManager.TryGetGrid(gridId, out grid))
if (!TryComp(gridId, out grid))
return;

pos = oldPos;
Expand Down Expand Up @@ -206,7 +204,7 @@ private void CalculateNewSprite(EntityUid uid,
{
var directions = DirectionFlag.None;

if (_mapManager.TryGetGrid(xform.GridUid, out grid))
if (TryComp(xform.GridUid, out grid))
{
var pos = grid.TileIndicesFor(xform.Coordinates);

Expand Down Expand Up @@ -240,7 +238,7 @@ private void CalculateNewSprite(EntityUid uid,

if (xform.Anchored)
{
if (!_mapManager.TryGetGrid(xform.GridUid, out grid))
if (!TryComp(xform.GridUid, out grid))
{
Log.Error($"Failed to calculate IconSmoothComponent sprite in {uid} because grid {xform.GridUid} was missing.");
return;
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Input/ContentContexts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public static void SetupContexts(IInputContextContainer contexts)
human.AddFunction(ContentKeyFunctions.OpenBackpack);
human.AddFunction(ContentKeyFunctions.OpenBelt);
human.AddFunction(ContentKeyFunctions.OfferItem);
human.AddFunction(ContentKeyFunctions.ToggleStanding);
human.AddFunction(ContentKeyFunctions.MouseMiddle);
human.AddFunction(ContentKeyFunctions.ArcadeUp);
human.AddFunction(ContentKeyFunctions.ArcadeDown);
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Items/Systems/ItemSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private bool TryGetDefaultVisuals(EntityUid uid, ItemComponent item, string defa
else if (TryComp(uid, out SpriteComponent? sprite))
rsi = sprite.BaseRSI;

if (rsi == null || rsi.Path == null)
if (rsi == null)
return false;

var state = (item.HeldPrefix == null)
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Movement/Systems/JetpackSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Shared.Movement.Systems;
using Robust.Client.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Components;
using Robust.Shared.Timing;

Expand All @@ -12,7 +13,6 @@ namespace Content.Client.Movement.Systems;
public sealed class JetpackSystem : SharedJetpackSystem
{
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly ClothingSystem _clothing = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;

Expand Down Expand Up @@ -75,7 +75,7 @@ private void CreateParticles(EntityUid uid)
var coordinates = uidXform.Coordinates;
var gridUid = coordinates.GetGridUid(EntityManager);

if (_mapManager.TryGetGrid(gridUid, out var grid))
if (TryComp<MapGridComponent>(gridUid, out var grid))
{
coordinates = new EntityCoordinates(gridUid.Value, grid.WorldToLocal(coordinates.ToMapPos(EntityManager, _transform)));
}
Expand Down
1 change: 0 additions & 1 deletion Content.Client/NPC/PathfindingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ private void DrawScreen(OverlayDrawArgs args, DrawingHandleScreen screenHandle)

var invGridMatrix = gridXform.InvWorldMatrix;
DebugPathPoly? nearest = null;
var nearestDistance = float.MaxValue;

foreach (var poly in tile)
{
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/NodeContainer/NodeVisualizationOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private void DrawScreen(in OverlayDrawArgs args)


var xform = _entityManager.GetComponent<TransformComponent>(_entityManager.GetEntity(node.Entity));
if (!_mapManager.TryGetGrid(xform.GridUid, out var grid))
if (!_entityManager.TryGetComponent<MapGridComponent>(xform.GridUid, out var grid))
return;
var gridTile = grid.TileIndicesFor(xform.Coordinates);

Expand Down Expand Up @@ -145,7 +145,7 @@ private void DrawWorld(in OverlayDrawArgs overlayDrawArgs)

foreach (var (gridId, gridDict) in _gridIndex)
{
var grid = _mapManager.GetGrid(gridId);
var grid = _entityManager.GetComponent<MapGridComponent>(gridId);
var (_, _, worldMatrix, invMatrix) = _entityManager.GetComponent<TransformComponent>(gridId).GetWorldPositionRotationMatrixWithInv();

var lCursorBox = invMatrix.TransformBox(cursorBox);
Expand Down
13 changes: 13 additions & 0 deletions Content.Client/Options/UI/Tabs/AudioTab.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@
<Label Name="AmbienceSoundsLabel" MinSize="48 0" Align="Right" />
<Control MinSize="4 0"/>
</BoxContainer>
<BoxContainer Orientation="Horizontal" Margin="5 0 0 0">
<Label Text="{Loc 'ui-options-announcer-volume'}" HorizontalExpand="True" />
<Control MinSize="8 0" />
<Slider Name="AnnouncerVolumeSlider"
MinValue="0"
MaxValue="100"
HorizontalExpand="True"
MinSize="80 0"
Rounded="True" />
<Control MinSize="8 0" />
<Label Name="AnnouncerVolumeLabel" MinSize="48 0" Align="Right" />
<Control MinSize="4 0"/>
</BoxContainer>
<Control MinSize="0 8" />
<CheckBox Name="LobbyMusicCheckBox" Text="{Loc 'ui-options-lobby-music'}" />
<CheckBox Name="RestartSoundsCheckBox" Text="{Loc 'ui-options-restart-sounds'}" />
Expand Down
18 changes: 16 additions & 2 deletions Content.Client/Options/UI/Tabs/AudioTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public AudioTab()
AmbienceSoundsSlider.OnValueChanged += OnAmbienceSoundsSliderChanged;
LobbyVolumeSlider.OnValueChanged += OnLobbyVolumeSliderChanged;
InterfaceVolumeSlider.OnValueChanged += OnInterfaceVolumeSliderChanged;
AnnouncerVolumeSlider.OnValueChanged += OnAnnouncerVolumeSliderChanged;
LobbyMusicCheckBox.OnToggled += OnLobbyMusicCheckToggled;
RestartSoundsCheckBox.OnToggled += OnRestartSoundsCheckToggled;
EventMusicCheckBox.OnToggled += OnEventMusicCheckToggled;
Expand All @@ -58,6 +59,7 @@ protected override void Dispose(bool disposing)
AmbienceVolumeSlider.OnValueChanged -= OnAmbienceVolumeSliderChanged;
LobbyVolumeSlider.OnValueChanged -= OnLobbyVolumeSliderChanged;
InterfaceVolumeSlider.OnValueChanged -= OnInterfaceVolumeSliderChanged;
AnnouncerVolumeSlider.OnValueChanged -= OnAnnouncerVolumeSliderChanged;
base.Dispose(disposing);
}

Expand Down Expand Up @@ -97,6 +99,11 @@ private void OnMidiVolumeSliderChanged(Range range)
UpdateChanges();
}

private void OnAnnouncerVolumeSliderChanged(Range range)
{
UpdateChanges();
}

private void OnLobbyMusicCheckToggled(BaseButton.ButtonEventArgs args)
{
UpdateChanges();
Expand Down Expand Up @@ -125,6 +132,7 @@ private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args)
_cfg.SetCVar(CCVars.AmbientMusicVolume, AmbientMusicVolumeSlider.Value / 100f * ContentAudioSystem.AmbientMusicMultiplier);
_cfg.SetCVar(CCVars.LobbyMusicVolume, LobbyVolumeSlider.Value / 100f * ContentAudioSystem.LobbyMultiplier);
_cfg.SetCVar(CCVars.InterfaceVolume, InterfaceVolumeSlider.Value / 100f * ContentAudioSystem.InterfaceMultiplier);
_cfg.SetCVar(CCVars.AnnouncerVolume, AnnouncerVolumeSlider.Value / 100f * ContentAudioSystem.AnnouncerMultiplier);

_cfg.SetCVar(CCVars.MaxAmbientSources, (int)AmbienceSoundsSlider.Value);

Expand All @@ -149,6 +157,7 @@ private void Reset()
AmbientMusicVolumeSlider.Value = _cfg.GetCVar(CCVars.AmbientMusicVolume) * 100f / ContentAudioSystem.AmbientMusicMultiplier;
LobbyVolumeSlider.Value = _cfg.GetCVar(CCVars.LobbyMusicVolume) * 100f / ContentAudioSystem.LobbyMultiplier;
InterfaceVolumeSlider.Value = _cfg.GetCVar(CCVars.InterfaceVolume) * 100f / ContentAudioSystem.InterfaceMultiplier;
AnnouncerVolumeSlider.Value = _cfg.GetCVar(CCVars.AnnouncerVolume) * 100f / ContentAudioSystem.AnnouncerMultiplier;

AmbienceSoundsSlider.Value = _cfg.GetCVar(CCVars.MaxAmbientSources);

Expand All @@ -174,14 +183,17 @@ private void UpdateChanges()
Math.Abs(LobbyVolumeSlider.Value - _cfg.GetCVar(CCVars.LobbyMusicVolume) * 100f / ContentAudioSystem.LobbyMultiplier) < 0.01f;
var isInterfaceVolumeSame =
Math.Abs(InterfaceVolumeSlider.Value - _cfg.GetCVar(CCVars.InterfaceVolume) * 100f / ContentAudioSystem.InterfaceMultiplier) < 0.01f;
var isAnnouncerVolumeSame =
Math.Abs(AnnouncerVolumeSlider.Value - _cfg.GetCVar(CCVars.AnnouncerVolume) * 100f / ContentAudioSystem.AnnouncerMultiplier) < 0.01f;

var isAmbientSoundsSame = (int)AmbienceSoundsSlider.Value == _cfg.GetCVar(CCVars.MaxAmbientSources);
var isLobbySame = LobbyMusicCheckBox.Pressed == _cfg.GetCVar(CCVars.LobbyMusicEnabled);
var isRestartSoundsSame = RestartSoundsCheckBox.Pressed == _cfg.GetCVar(CCVars.RestartSoundsEnabled);
var isEventSame = EventMusicCheckBox.Pressed == _cfg.GetCVar(CCVars.EventMusicEnabled);
var isAdminSoundsSame = AdminSoundsCheckBox.Pressed == _cfg.GetCVar(CCVars.AdminSoundsEnabled);
var isEverythingSame = isMasterVolumeSame && isMidiVolumeSame && isAmbientVolumeSame && isAmbientMusicVolumeSame && isAmbientSoundsSame && isLobbySame && isRestartSoundsSame && isEventSame
&& isAdminSoundsSame && isLobbyVolumeSame && isInterfaceVolumeSame;
var isEverythingSame = isMasterVolumeSame && isMidiVolumeSame && isAmbientVolumeSame
&& isAmbientMusicVolumeSame && isAmbientSoundsSame && isLobbySame && isRestartSoundsSame && isEventSame
&& isAdminSoundsSame && isLobbyVolumeSame && isInterfaceVolumeSame && isAnnouncerVolumeSame;
ApplyButton.Disabled = isEverythingSame;
ResetButton.Disabled = isEverythingSame;
MasterVolumeLabel.Text =
Expand All @@ -196,6 +208,8 @@ private void UpdateChanges()
Loc.GetString("ui-options-volume-percent", ("volume", LobbyVolumeSlider.Value / 100));
InterfaceVolumeLabel.Text =
Loc.GetString("ui-options-volume-percent", ("volume", InterfaceVolumeSlider.Value / 100));
AnnouncerVolumeLabel.Text =
Loc.GetString("ui-options-volume-percent", ("volume", AnnouncerVolumeSlider.Value / 100));
AmbienceSoundsLabel.Text = ((int)AmbienceSoundsSlider.Value).ToString();
}
}
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ void AddCheckBox(string checkBoxName, bool currentState, Action<BaseButton.Butto
AddButton(ContentKeyFunctions.MoveStoredItem);
AddButton(ContentKeyFunctions.RotateStoredItem);
AddButton(ContentKeyFunctions.OfferItem);
AddButton(ContentKeyFunctions.ToggleStanding);

AddHeader("ui-options-header-interaction-adv");
AddButton(ContentKeyFunctions.SmartEquipBackpack);
Expand Down
Loading
Loading