From b3f75f9ffee6674a9833c8037467b123aa73d593 Mon Sep 17 00:00:00 2001
From: wrexbe <81056464+wrexbe@users.noreply.github.com>
Date: Sun, 11 Sep 2022 21:30:11 -0700
Subject: [PATCH] More minor UI refactor changes (#11213)
---
Content.Client/Changelog/ChangelogWindow.xaml.cs | 4 ----
Content.Client/Commands/ActionsCommands.cs | 2 +-
Content.Client/DragDrop/DragDropHelper.cs | 1 -
.../GameTicking/Managers/ClientGameTicker.cs | 2 --
.../Gravity/UI/GravityGeneratorWindow.xaml.cs | 11 ++---------
Content.Client/LateJoin/LateJoinGui.cs | 2 +-
Content.Client/MainMenu/UI/MainMenuControl.xaml | 4 +++-
.../NetworkConfiguratorConfigurationMenu.xaml | 2 +-
.../NetworkConfiguratorListMenu.xaml | 6 +++---
Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml | 9 ++++-----
.../UserInterface/Controls/FancyWindow.xaml | 2 +-
.../UserInterface/Controls/FancyWindow.xaml.cs | 1 -
Content.Client/Viewport/ViewportManager.cs | 2 +-
Content.Server/Abilities/Mime/MimePowersComponent.cs | 4 ++--
.../Bible/Components/SummonableComponent.cs | 4 ++--
.../Polymorph/Systems/PolymorphableSystem.cs | 2 +-
.../Polymorph/Systems/PolymorphedEntitySystem.cs | 4 ++--
Content.Shared/Actions/ActionEvents.cs | 2 +-
.../Hands/Components/SharedHandsComponent.cs | 2 +-
.../Hands/EntitySystems/SharedHandsSystem.cs | 11 ++++++-----
SpaceStation14.sln.DotSettings | 2 ++
21 files changed, 34 insertions(+), 45 deletions(-)
diff --git a/Content.Client/Changelog/ChangelogWindow.xaml.cs b/Content.Client/Changelog/ChangelogWindow.xaml.cs
index 8fbfb3fc5c..2134f8275a 100644
--- a/Content.Client/Changelog/ChangelogWindow.xaml.cs
+++ b/Content.Client/Changelog/ChangelogWindow.xaml.cs
@@ -1,4 +1,3 @@
-using System;
using System.Linq;
using Content.Client.Resources;
using Content.Client.Stylesheets;
@@ -11,9 +10,6 @@ using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Console;
-using Robust.Shared.IoC;
-using Robust.Shared.Localization;
-using Robust.Shared.Maths;
using Robust.Shared.Utility;
using static Content.Client.Changelog.ChangelogManager;
using static Robust.Client.UserInterface.Controls.BoxContainer;
diff --git a/Content.Client/Commands/ActionsCommands.cs b/Content.Client/Commands/ActionsCommands.cs
index 840d175ca9..f8eb67d78a 100644
--- a/Content.Client/Commands/ActionsCommands.cs
+++ b/Content.Client/Commands/ActionsCommands.cs
@@ -1,4 +1,4 @@
-using Content.Client.Actions;
+using Content.Client.Actions;
using Content.Client.Mapping;
using Content.Shared.Administration;
using Robust.Shared.Console;
diff --git a/Content.Client/DragDrop/DragDropHelper.cs b/Content.Client/DragDrop/DragDropHelper.cs
index 28b6e853a7..8f4f2381c5 100644
--- a/Content.Client/DragDrop/DragDropHelper.cs
+++ b/Content.Client/DragDrop/DragDropHelper.cs
@@ -1,5 +1,4 @@
using Robust.Client.Input;
-using Robust.Shared.IoC;
using Robust.Shared.Map;
namespace Content.Client.DragDrop
diff --git a/Content.Client/GameTicking/Managers/ClientGameTicker.cs b/Content.Client/GameTicking/Managers/ClientGameTicker.cs
index 27fc7261d7..f1e29a2ea1 100644
--- a/Content.Client/GameTicking/Managers/ClientGameTicker.cs
+++ b/Content.Client/GameTicking/Managers/ClientGameTicker.cs
@@ -2,7 +2,6 @@ using Content.Client.Audio;
using Content.Client.Gameplay;
using Content.Client.Lobby;
using Content.Client.RoundEnd;
-using Content.Client.Viewport;
using Content.Shared.CCVar;
using Content.Shared.GameTicking;
using Content.Shared.GameWindow;
@@ -11,7 +10,6 @@ using Robust.Client.Graphics;
using Robust.Client.State;
using Robust.Shared.Audio;
using Robust.Shared.Configuration;
-using Robust.Shared.Network;
using Robust.Shared.Player;
using Robust.Shared.Utility;
diff --git a/Content.Client/Gravity/UI/GravityGeneratorWindow.xaml.cs b/Content.Client/Gravity/UI/GravityGeneratorWindow.xaml.cs
index 5b04c4eaf4..99b41954a1 100644
--- a/Content.Client/Gravity/UI/GravityGeneratorWindow.xaml.cs
+++ b/Content.Client/Gravity/UI/GravityGeneratorWindow.xaml.cs
@@ -1,16 +1,9 @@
-using System;
-using Content.Client.Message;
-using Content.Client.UserInterface.Controls;
-using Content.Shared.Gravity;
+using Content.Shared.Gravity;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls;
-using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
-using Robust.Shared.GameObjects;
-using Robust.Shared.IoC;
-using Robust.Shared.Localization;
-using Robust.Shared.Maths;
+using FancyWindow = Content.Client.UserInterface.Controls.FancyWindow;
namespace Content.Client.Gravity.UI
{
diff --git a/Content.Client/LateJoin/LateJoinGui.cs b/Content.Client/LateJoin/LateJoinGui.cs
index ad6b8ac582..7e9b72acf4 100644
--- a/Content.Client/LateJoin/LateJoinGui.cs
+++ b/Content.Client/LateJoin/LateJoinGui.cs
@@ -1,7 +1,7 @@
using Content.Client.CrewManifest;
using Content.Client.GameTicking.Managers;
-using Content.Client.Players.PlayTimeTracking;
using Content.Client.UserInterface.Controls;
+using Content.Client.Players.PlayTimeTracking;
using Content.Shared.CCVar;
using Content.Shared.Roles;
using Robust.Client.Console;
diff --git a/Content.Client/MainMenu/UI/MainMenuControl.xaml b/Content.Client/MainMenu/UI/MainMenuControl.xaml
index fe14bff37d..671519adc9 100644
--- a/Content.Client/MainMenu/UI/MainMenuControl.xaml
+++ b/Content.Client/MainMenu/UI/MainMenuControl.xaml
@@ -37,7 +37,9 @@
Text="{Loc 'main-menu-quit-button'}"
TextAlign="Center"
StyleIdentifier="mainMenu" />
-
+
diff --git a/Content.Client/NetworkConfigurator/NetworkConfiguratorConfigurationMenu.xaml b/Content.Client/NetworkConfigurator/NetworkConfiguratorConfigurationMenu.xaml
index ac6174c7dd..0f4efa56c8 100644
--- a/Content.Client/NetworkConfigurator/NetworkConfiguratorConfigurationMenu.xaml
+++ b/Content.Client/NetworkConfigurator/NetworkConfiguratorConfigurationMenu.xaml
@@ -1,4 +1,4 @@
-
diff --git a/Content.Client/NetworkConfigurator/NetworkConfiguratorListMenu.xaml b/Content.Client/NetworkConfigurator/NetworkConfiguratorListMenu.xaml
index 437d7055c9..8d46ecfb20 100644
--- a/Content.Client/NetworkConfigurator/NetworkConfiguratorListMenu.xaml
+++ b/Content.Client/NetworkConfigurator/NetworkConfiguratorListMenu.xaml
@@ -1,13 +1,13 @@
-
-
+
-
+
diff --git a/Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml b/Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml
index c0c0bba05f..9e57ba8325 100644
--- a/Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml
+++ b/Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml
@@ -1,7 +1,7 @@
+ xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
+ xmlns:ui="clr-namespace:Content.Client.Shuttles.UI"
+ Title="{Loc 'shuttle-console-window-title'}">
@@ -16,8 +16,7 @@
-
+ Orientation="Vertical"/>
diff --git a/Content.Client/UserInterface/Controls/FancyWindow.xaml b/Content.Client/UserInterface/Controls/FancyWindow.xaml
index f7224eb9c2..d076a552bf 100644
--- a/Content.Client/UserInterface/Controls/FancyWindow.xaml
+++ b/Content.Client/UserInterface/Controls/FancyWindow.xaml
@@ -1,4 +1,4 @@
-
+
(uid, out var component))
return;
@@ -118,7 +118,7 @@ namespace Content.Server.Polymorph.Systems
Description = Loc.GetString("polymorph-revert-action-description"),
UseDelay = TimeSpan.FromSeconds(component.Prototype.Delay),
};
-
+
_actions.AddAction(uid, act, null);
}
diff --git a/Content.Shared/Actions/ActionEvents.cs b/Content.Shared/Actions/ActionEvents.cs
index 716ca1ce2b..bd316e6ae2 100644
--- a/Content.Shared/Actions/ActionEvents.cs
+++ b/Content.Shared/Actions/ActionEvents.cs
@@ -9,7 +9,7 @@ namespace Content.Shared.Actions;
///
/// Event raised directed at items or clothing when they are equipped or held. In order for an item to grant actions some
-/// system can subscribe to this event and add actions to the list.
+/// system can subscribe to this event and add actions to the list.
///
///
/// Note that a system could also just manually add actions as a result of a or ? OnHandSetActive;
+
public override void Initialize()
{
base.Initialize();
@@ -29,7 +31,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
CommandBinds.Unregister();
}
- public void AddHand(EntityUid uid, string handName, HandLocation handLocation, SharedHandsComponent? handsComp = null)
+ public virtual void AddHand(EntityUid uid, string handName, HandLocation handLocation, SharedHandsComponent? handsComp = null)
{
if (!Resolve(uid, ref handsComp, false))
return;
@@ -51,7 +53,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
Dirty(handsComp);
}
- public void RemoveHand(EntityUid uid, string handName, SharedHandsComponent? handsComp = null)
+ public virtual void RemoveHand(EntityUid uid, string handName, SharedHandsComponent? handsComp = null)
{
if (!Resolve(uid, ref handsComp, false))
return;
@@ -154,7 +156,6 @@ public abstract partial class SharedHandsSystem : EntitySystem
Hand? hand = null;
if (name != null && !handComp.Hands.TryGetValue(name, out hand))
return false;
-
return SetActiveHand(uid, hand, handComp);
}
@@ -163,7 +164,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
///
/// True if the active hand was set to a NEW value. Setting it to the same value returns false and does
/// not trigger interactions.
- public virtual bool SetActiveHand(EntityUid uid, Hand? hand, SharedHandsComponent? handComp = null)
+ public bool SetActiveHand(EntityUid uid, Hand? hand, SharedHandsComponent? handComp = null)
{
if (!Resolve(uid, ref handComp))
return false;
@@ -181,10 +182,10 @@ public abstract partial class SharedHandsSystem : EntitySystem
}
handComp.ActiveHand = hand;
+ OnHandSetActive?.Invoke(handComp);
if (hand.HeldEntity != null)
RaiseLocalEvent(hand.HeldEntity.Value, new HandSelectedEvent(uid), false);
-
Dirty(handComp);
return true;
}
diff --git a/SpaceStation14.sln.DotSettings b/SpaceStation14.sln.DotSettings
index d4ee3bded9..d946e311d4 100644
--- a/SpaceStation14.sln.DotSettings
+++ b/SpaceStation14.sln.DotSettings
@@ -528,6 +528,7 @@ public sealed class $CLASS$ : Shared$CLASS$ {
True
True
True
+ True
True
True
True
@@ -539,6 +540,7 @@ public sealed class $CLASS$ : Shared$CLASS$ {
True
True
True
+ True
True
True
True