Skip to content

Commit

Permalink
Merge branch 'master' of github.com:/pxc1984/space-sunrise into centc…
Browse files Browse the repository at this point in the history
…om-rework
  • Loading branch information
pxc1984 committed Dec 1, 2024
2 parents 12ae7ea + 30655bd commit 2215216
Show file tree
Hide file tree
Showing 190 changed files with 806 additions and 962 deletions.
12 changes: 9 additions & 3 deletions Content.Client/Buckle/BuckleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,17 @@ private void OnStrapMoveEvent(EntityUid uid, StrapComponent component, ref MoveE

private void OnAppearanceChange(EntityUid uid, BuckleComponent component, ref AppearanceChangeEvent args)
{
if (!TryComp<RotationVisualsComponent>(uid, out var rotVisuals)
|| !Appearance.TryGetData<bool>(uid, BuckleVisuals.Buckled, out var buckled, args.Component)
|| !buckled || args.Sprite == null)
if (!TryComp<RotationVisualsComponent>(uid, out var rotVisuals))
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
5 changes: 0 additions & 5 deletions Content.Client/Input/ContentContexts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ public static void SetupContexts(IInputContextContainer contexts)
human.AddFunction(ContentKeyFunctions.Arcade2);
human.AddFunction(ContentKeyFunctions.Arcade3);

// Sunrise
human.AddFunction(ContentKeyFunctions.ToggleStanding);
human.AddFunction(ContentKeyFunctions.LookUp);
// Sunrise

// actions should be common (for ghosts, mobs, etc)
common.AddFunction(ContentKeyFunctions.OpenActionsMenu);

Expand Down
1 change: 0 additions & 1 deletion Content.Client/Options/UI/Tabs/GraphicsTab.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Content.Shared.CCVar;
using Content.Shared._Sunrise.SunriseCCVars;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
Expand Down
21 changes: 0 additions & 21 deletions Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,6 @@ private void HandleToggleWalk(BaseButton.ButtonToggledEventArgs args)
_deferCommands.Add(_inputManager.SaveToUserData);
}

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

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

private void HandleStaticStorageUI(BaseButton.ButtonToggledEventArgs args)
{
_cfg.SetCVar(CCVars.StaticStorageUI, args.Pressed);
Expand Down Expand Up @@ -200,13 +186,6 @@ void AddCheckBox(string checkBoxName, bool currentState, Action<BaseButton.Butto
AddButton(ContentKeyFunctions.RotateStoredItem);
AddButton(ContentKeyFunctions.SaveItemLocation);

// Sunrise
AddButton(ContentKeyFunctions.ToggleStanding);
AddButton(ContentKeyFunctions.LookUp);
AddCheckBox("ui-options-function-auto-get-up", _cfg.GetCVar(SunriseCCVars.AutoGetUp), HandleToggleAutoGetUp);
AddCheckBox("ui-options-function-hold-look-up", _cfg.GetCVar(SunriseCCVars.HoldLookUp), HandleHoldLookUp);
// Sunrise

AddHeader("ui-options-header-interaction-adv");
AddButton(ContentKeyFunctions.SmartEquipBackpack);
AddButton(ContentKeyFunctions.SmartEquipBelt);
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Options/UI/Tabs/SunriseTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public SunriseTab()
Control.AddOptionDropDown(SunriseCCVars.LobbyParallax, DropDownLobbyParallax, lobbyParallaxes);
Control.AddOptionPercentSlider(SunriseCCVars.LobbyOpacity, LobbyOpacitySlider);
Control.AddOptionCheckBox(SunriseCCVars.DamageOverlay, DamageOverlayCheckBox);
Control.AddOptionCheckBox(SunriseCCVars.ShowFootprints, ShowFootprintsCheckBox);

Control.Initialize();
}
Expand Down
74 changes: 0 additions & 74 deletions Content.Client/Standing/LayingDownSystem.cs

This file was deleted.

129 changes: 0 additions & 129 deletions Content.Client/Telescope/TelescopeSystem.cs

This file was deleted.

28 changes: 1 addition & 27 deletions Content.Client/_Sunrise/Footprints/FootPrintsVisualizerSystem.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Content.Shared._Sunrise.Footprints;
using Content.Shared._Sunrise.SunriseCCVars;
using Content.Shared._Sunrise.Footprints;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Shared.Configuration;
using Robust.Shared.Random;

namespace Content.Client._Sunrise.Footprints;
Expand All @@ -14,31 +12,16 @@ public sealed class FootprintVisualizerSystem : VisualizerSystem<FootprintCompon
{
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;

private bool _showFootprints;

/// <inheritdoc/>
public override void Initialize()
{
base.Initialize();

_cfg.OnValueChanged(SunriseCCVars.ShowFootprints, OnShowFootprintsChanged, true);

SubscribeLocalEvent<FootprintComponent, ComponentInit>(OnFootprintInitialized);
SubscribeLocalEvent<FootprintComponent, ComponentShutdown>(OnFootprintShutdown);
}

private void OnShowFootprintsChanged(bool value)
{
_showFootprints = value;
var query = EntityManager.AllEntityQueryEnumerator<FootprintComponent, SpriteComponent>();
while (query.MoveNext(out var uid, out var footprint, out var sprite))
{
UpdateFootprintVisuals(uid, footprint, sprite);
}
}

/// <summary>
/// Initializes the visual appearance of a new footprint
/// </summary>
Expand Down Expand Up @@ -91,15 +74,6 @@ private void UpdateFootprintVisuals(EntityUid uid, FootprintComponent footprint,
|| !TryComp<AppearanceComponent>(uid, out var appearance))
return;

// Hide footprints if disabled in settings
if (!_showFootprints)
{
sprite.Visible = false;
return;
}

sprite.Visible = true;

if (!_appearanceSystem.TryGetData<FootprintVisualType>(
uid,
FootprintVisualParameter.VisualState,
Expand Down
10 changes: 10 additions & 0 deletions Content.Server/Chemistry/TileReactions/CleanDecalsReaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using System.Numerics;
using Content.Shared._Sunrise.Footprints;
using Robust.Server.GameObjects;

namespace Content.Server.Chemistry.TileReactions;

Expand Down Expand Up @@ -54,6 +56,14 @@ public FixedPoint2 TileReact(TileRef tile,
amount += CleanCost;
}

// Sunrise-start
var footprints = lookupSystem.GetEntitiesInRange<FootprintComponent>(new EntityCoordinates(tile.GridUid, tile.X, tile.Y), 0.5f);
foreach (var footprint in footprints)
{
entityManager.QueueDeleteEntity(footprint);
}
// Sunrise-end

return amount;
}
}
10 changes: 10 additions & 0 deletions Content.Server/Chemistry/TileReactions/CleanTileReaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Robust.Shared.Map;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using System.Linq;
using Content.Shared._Sunrise.Footprints;

namespace Content.Server.Chemistry.TileReactions;

Expand Down Expand Up @@ -61,6 +62,15 @@ IEntityManager entityManager
break;
}

var lookupSystem = entityManager.System<EntityLookupSystem>();
// Sunrise-start
var footprints = lookupSystem.GetEntitiesInRange<FootprintComponent>(new EntityCoordinates(tile.GridUid, tile.X, tile.Y), 0.5f);
foreach (var footprint in footprints)
{
entityManager.QueueDeleteEntity(footprint);
}
// Sunrise-end

return (reactVolume / CleanAmountMultiplier - purgeAmount) * CleanAmountMultiplier;
}
}
Loading

0 comments on commit 2215216

Please sign in to comment.