Skip to content

Commit

Permalink
Merge branch 'master' into Make-Universal-Language-Non-Destructive
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxxoTrystan committed Sep 20, 2024
2 parents e61f735 + 7bce1e9 commit 016ed95
Show file tree
Hide file tree
Showing 135 changed files with 2,904 additions and 1,770 deletions.
12 changes: 3 additions & 9 deletions Content.Client/Buckle/BuckleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,11 @@ private void OnBuckleAfterAutoHandleState(EntityUid uid, BuckleComponent compone

private void OnAppearanceChange(EntityUid uid, BuckleComponent component, ref AppearanceChangeEvent args)
{
if (!TryComp<RotationVisualsComponent>(uid, out var rotVisuals))
if (!TryComp<RotationVisualsComponent>(uid, out var rotVisuals)
|| !Appearance.TryGetData<bool>(uid, BuckleVisuals.Buckled, out var buckled, args.Component)
|| !buckled || args.Sprite == null)
return;

if (!Appearance.TryGetData<bool>(uid, BuckleVisuals.Buckled, out var buckled, args.Component) ||
!buckled ||
args.Sprite == null)
{
_rotationVisualizerSystem.SetHorizontalAngle((uid, rotVisuals), rotVisuals.DefaultRotation);
return;
}

// Animate strapping yourself to something at a given angle
// TODO: Dump this when buckle is better
_rotationVisualizerSystem.AnimateSpriteRotation(uid, args.Sprite, rotVisuals.HorizontalRotation, 0.125f);
Expand Down
23 changes: 0 additions & 23 deletions Content.Client/DeltaV/Options/UI/Tabs/DeltaTab.xaml

This file was deleted.

46 changes: 0 additions & 46 deletions Content.Client/DeltaV/Options/UI/Tabs/DeltaTab.xaml.cs

This file was deleted.

1 change: 1 addition & 0 deletions Content.Client/Input/ContentContexts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public static void SetupContexts(IInputContextContainer contexts)
human.AddFunction(ContentKeyFunctions.Arcade1);
human.AddFunction(ContentKeyFunctions.Arcade2);
human.AddFunction(ContentKeyFunctions.Arcade3);
human.AddFunction(ContentKeyFunctions.LookUp);

// actions should be common (for ghosts, mobs, etc)
common.AddFunction(ContentKeyFunctions.OpenActionsMenu);
Expand Down
2 changes: 0 additions & 2 deletions Content.Client/Options/UI/OptionsMenu.xaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<DefaultWindow xmlns="https://spacestation14.io"
xmlns:tabs="clr-namespace:Content.Client.Options.UI.Tabs"
xmlns:dtabs="clr-namespace:Content.Client.DeltaV.Options.UI.Tabs"
Title="{Loc 'ui-options-title'}"
MinSize="800 450">
<TabContainer Name="Tabs" Access="Public">
Expand All @@ -9,6 +8,5 @@
<tabs:KeyRebindTab Name="KeyRebindTab" />
<tabs:AudioTab Name="AudioTab" />
<tabs:NetworkTab Name="NetworkTab" />
<dtabs:DeltaTab Name="DeltaTab" />
</TabContainer>
</DefaultWindow>
1 change: 0 additions & 1 deletion Content.Client/Options/UI/OptionsMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public OptionsMenu()
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"));
Tabs.SetTabTitle(5, Loc.GetString("ui-options-tab-deltav")); // DeltaV specific settings

UpdateTabs();
}
Expand Down
15 changes: 15 additions & 0 deletions Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ private void HandleToggleWalk(BaseButton.ButtonToggledEventArgs args)
_deferCommands.Add(_inputManager.SaveToUserData);
}

private void HandleHoldLookUp(BaseButton.ButtonToggledEventArgs args)
{
_cfg.SetCVar(CCVars.HoldLookUp, args.Pressed);
_cfg.SaveToFile();
}

private void HandleDefaultWalk(BaseButton.ButtonToggledEventArgs args)
{
_cfg.SetCVar(CCVars.DefaultWalk, args.Pressed);
Expand All @@ -109,6 +115,12 @@ private void HandleStaticStorageUI(BaseButton.ButtonToggledEventArgs args)
_cfg.SaveToFile();
}

private void HandleToggleAutoGetUp(BaseButton.ButtonToggledEventArgs args)
{
_cfg.SetCVar(CCVars.AutoGetUp, args.Pressed);
_cfg.SaveToFile();
}

public KeyRebindTab()
{
IoCManager.InjectDependencies(this);
Expand Down Expand Up @@ -193,6 +205,9 @@ void AddCheckBox(string checkBoxName, bool currentState, Action<BaseButton.Butto
AddButton(ContentKeyFunctions.OfferItem);
AddButton(ContentKeyFunctions.SaveItemLocation);
AddButton(ContentKeyFunctions.ToggleStanding);
AddButton(ContentKeyFunctions.LookUp);
AddCheckBox("ui-options-function-auto-get-up", _cfg.GetCVar(CCVars.AutoGetUp), HandleToggleAutoGetUp);
AddCheckBox("ui-options-function-hold-look-up", _cfg.GetCVar(CCVars.HoldLookUp), HandleHoldLookUp);

AddHeader("ui-options-header-interaction-adv");
AddButton(ContentKeyFunctions.SmartEquipBackpack);
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Options/UI/Tabs/MiscTab.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<CheckBox Name="ReducedMotionCheckBox" Text="{Loc 'ui-options-reduced-motion'}" />
<CheckBox Name="EnableColorNameCheckBox" Text="{Loc 'ui-options-enable-color-name'}" />
<CheckBox Name="ColorblindFriendlyCheckBox" Text="{Loc 'ui-options-colorblind-friendly'}" />
<CheckBox Name="DisableFiltersCheckBox" Text="{Loc 'ui-options-no-filters'}" />
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'ui-options-chat-window-opacity'}" Margin="8 0" />
<Slider Name="ChatWindowOpacitySlider"
Expand Down
7 changes: 6 additions & 1 deletion Content.Client/Options/UI/Tabs/MiscTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public MiscTab()
ScreenShakeIntensitySlider.OnValueChanged += OnScreenShakeIntensitySliderChanged;
// ToggleWalk.OnToggled += OnCheckBoxToggled;
StaticStorageUI.OnToggled += OnCheckBoxToggled;
DisableFiltersCheckBox.OnToggled += OnCheckBoxToggled;

HudThemeOption.SelectId(_hudThemeIdToIndex.GetValueOrDefault(_cfg.GetCVar(CVars.InterfaceTheme), 0));
DiscordRich.Pressed = _cfg.GetCVar(CVars.DiscordEnabled);
Expand All @@ -98,6 +99,7 @@ public MiscTab()
ScreenShakeIntensitySlider.Value = _cfg.GetCVar(CCVars.ScreenShakeIntensity) * 100f;
// ToggleWalk.Pressed = _cfg.GetCVar(CCVars.ToggleWalk);
StaticStorageUI.Pressed = _cfg.GetCVar(CCVars.StaticStorageUI);
DisableFiltersCheckBox.Pressed = _cfg.GetCVar(CCVars.NoVisionFilters);


ApplyButton.OnPressed += OnApplyButtonPressed;
Expand Down Expand Up @@ -154,6 +156,7 @@ private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args)
_cfg.SetCVar(CCVars.ScreenShakeIntensity, ScreenShakeIntensitySlider.Value / 100f);
// _cfg.SetCVar(CCVars.ToggleWalk, ToggleWalk.Pressed);
_cfg.SetCVar(CCVars.StaticStorageUI, StaticStorageUI.Pressed);
_cfg.SetCVar(CCVars.NoVisionFilters, DisableFiltersCheckBox.Pressed);

if (HudLayoutOption.SelectedMetadata is string opt)
{
Expand Down Expand Up @@ -184,6 +187,7 @@ private void UpdateApplyButton()
var isScreenShakeIntensitySame = Math.Abs(ScreenShakeIntensitySlider.Value / 100f - _cfg.GetCVar(CCVars.ScreenShakeIntensity)) < 0.01f;
// var isToggleWalkSame = ToggleWalk.Pressed == _cfg.GetCVar(CCVars.ToggleWalk);
var isStaticStorageUISame = StaticStorageUI.Pressed == _cfg.GetCVar(CCVars.StaticStorageUI);
var isNoVisionFiltersSame = DisableFiltersCheckBox.Pressed == _cfg.GetCVar(CCVars.NoVisionFilters);

ApplyButton.Disabled = isHudThemeSame &&
isLayoutSame &&
Expand All @@ -202,7 +206,8 @@ private void UpdateApplyButton()
isChatWindowOpacitySame &&
isScreenShakeIntensitySame &&
// isToggleWalkSame &&
isStaticStorageUISame;
isStaticStorageUISame &&
isNoVisionFiltersSame;
}

}
Expand Down
8 changes: 4 additions & 4 deletions Content.Client/Overlays/DogVisionSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Content.Shared.Traits.Assorted.Components;
using Content.Shared.DeltaV.CCVars;
using Content.Shared.CCVar;
using Robust.Client.Graphics;
using Robust.Shared.Configuration;
using Robust.Shared.Player;
Expand All @@ -23,7 +23,7 @@ public override void Initialize()
SubscribeLocalEvent<DogVisionComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<DogVisionComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);

Subs.CVar(_cfg, DCCVars.NoVisionFilters, OnNoVisionFiltersChanged);
Subs.CVar(_cfg, CCVars.NoVisionFilters, OnNoVisionFiltersChanged);

_overlay = new();
}
Expand All @@ -33,7 +33,7 @@ private void OnDogVisionInit(EntityUid uid, DogVisionComponent component, Compon
if (uid != _playerMan.LocalEntity)
return;

if (!_cfg.GetCVar(DCCVars.NoVisionFilters))
if (!_cfg.GetCVar(CCVars.NoVisionFilters))
_overlayMan.AddOverlay(_overlay);
}

Expand All @@ -47,7 +47,7 @@ private void OnDogVisionShutdown(EntityUid uid, DogVisionComponent component, Co

private void OnPlayerAttached(EntityUid uid, DogVisionComponent component, LocalPlayerAttachedEvent args)
{
if (!_cfg.GetCVar(DCCVars.NoVisionFilters))
if (!_cfg.GetCVar(CCVars.NoVisionFilters))
_overlayMan.AddOverlay(_overlay);
}

Expand Down
8 changes: 4 additions & 4 deletions Content.Client/Overlays/UltraVisionSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Content.Shared.Traits.Assorted.Components;
using Content.Shared.DeltaV.CCVars;
using Content.Shared.CCVar;
using Robust.Client.Graphics;
using Robust.Shared.Configuration;
using Robust.Shared.Player;
Expand All @@ -23,7 +23,7 @@ public override void Initialize()
SubscribeLocalEvent<UltraVisionComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<UltraVisionComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);

Subs.CVar(_cfg, DCCVars.NoVisionFilters, OnNoVisionFiltersChanged);
Subs.CVar(_cfg, CCVars.NoVisionFilters, OnNoVisionFiltersChanged);

_overlay = new();
}
Expand All @@ -33,7 +33,7 @@ private void OnUltraVisionInit(EntityUid uid, UltraVisionComponent component, Co
if (uid != _playerMan.LocalEntity)
return;

if (!_cfg.GetCVar(DCCVars.NoVisionFilters))
if (!_cfg.GetCVar(CCVars.NoVisionFilters))
_overlayMan.AddOverlay(_overlay);
}

Expand All @@ -47,7 +47,7 @@ private void OnUltraVisionShutdown(EntityUid uid, UltraVisionComponent component

private void OnPlayerAttached(EntityUid uid, UltraVisionComponent component, LocalPlayerAttachedEvent args)
{
if (!_cfg.GetCVar(DCCVars.NoVisionFilters))
if (!_cfg.GetCVar(CCVars.NoVisionFilters))
_overlayMan.AddOverlay(_overlay);
}

Expand Down
71 changes: 71 additions & 0 deletions Content.Client/Standing/LayingDownSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using Content.Shared.Buckle;
using Content.Shared.Rotation;
using Content.Shared.Standing;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Shared.Timing;

namespace Content.Client.Standing;

public sealed class LayingDownSystem : SharedLayingDownSystem
{
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IEyeManager _eyeManager = default!;
[Dependency] private readonly StandingStateSystem _standing = default!;
[Dependency] private readonly AnimationPlayerSystem _animation = default!;
[Dependency] private readonly SharedBuckleSystem _buckle = default!;

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

SubscribeLocalEvent<LayingDownComponent, MoveEvent>(OnMovementInput);

SubscribeNetworkEvent<CheckAutoGetUpEvent>(OnCheckAutoGetUp);
}

private void OnMovementInput(EntityUid uid, LayingDownComponent component, MoveEvent args)
{
if (!_timing.IsFirstTimePredicted
|| !_standing.IsDown(uid)
|| _buckle.IsBuckled(uid)
|| _animation.HasRunningAnimation(uid, "rotate")
|| !TryComp<TransformComponent>(uid, out var transform)
|| !TryComp<SpriteComponent>(uid, out var sprite)
|| !TryComp<RotationVisualsComponent>(uid, out var rotationVisuals))
return;

var rotation = transform.LocalRotation + (_eyeManager.CurrentEye.Rotation - (transform.LocalRotation - transform.WorldRotation));

if (rotation.GetDir() is Direction.SouthEast or Direction.East or Direction.NorthEast or Direction.North)
{
rotationVisuals.HorizontalRotation = Angle.FromDegrees(270);
sprite.Rotation = Angle.FromDegrees(270);
return;
}

rotationVisuals.HorizontalRotation = Angle.FromDegrees(90);
sprite.Rotation = Angle.FromDegrees(90);
}

private void OnCheckAutoGetUp(CheckAutoGetUpEvent ev, EntitySessionEventArgs args)
{
if (!_timing.IsFirstTimePredicted)
return;

var uid = GetEntity(ev.User);

if (!TryComp<TransformComponent>(uid, out var transform) || !TryComp<RotationVisualsComponent>(uid, out var rotationVisuals))
return;

var rotation = transform.LocalRotation + (_eyeManager.CurrentEye.Rotation - (transform.LocalRotation - transform.WorldRotation));

if (rotation.GetDir() is Direction.SouthEast or Direction.East or Direction.NorthEast or Direction.North)
{
rotationVisuals.HorizontalRotation = Angle.FromDegrees(270);
return;
}

rotationVisuals.HorizontalRotation = Angle.FromDegrees(90);
}
}
Loading

0 comments on commit 016ed95

Please sign in to comment.