More minor UI refactor changes (#11213)

This commit is contained in:
wrexbe
2022-09-11 21:30:11 -07:00
committed by GitHub
parent 2acae9e833
commit b3f75f9ffe
21 changed files with 34 additions and 45 deletions

View File

@@ -1,4 +1,3 @@
using System;
using System.Linq; using System.Linq;
using Content.Client.Resources; using Content.Client.Resources;
using Content.Client.Stylesheets; using Content.Client.Stylesheets;
@@ -11,9 +10,6 @@ using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;
using Robust.Shared.Console; using Robust.Shared.Console;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using static Content.Client.Changelog.ChangelogManager; using static Content.Client.Changelog.ChangelogManager;
using static Robust.Client.UserInterface.Controls.BoxContainer; using static Robust.Client.UserInterface.Controls.BoxContainer;

View File

@@ -1,4 +1,4 @@
using Content.Client.Actions; using Content.Client.Actions;
using Content.Client.Mapping; using Content.Client.Mapping;
using Content.Shared.Administration; using Content.Shared.Administration;
using Robust.Shared.Console; using Robust.Shared.Console;

View File

@@ -1,5 +1,4 @@
using Robust.Client.Input; using Robust.Client.Input;
using Robust.Shared.IoC;
using Robust.Shared.Map; using Robust.Shared.Map;
namespace Content.Client.DragDrop namespace Content.Client.DragDrop

View File

@@ -2,7 +2,6 @@ using Content.Client.Audio;
using Content.Client.Gameplay; using Content.Client.Gameplay;
using Content.Client.Lobby; using Content.Client.Lobby;
using Content.Client.RoundEnd; using Content.Client.RoundEnd;
using Content.Client.Viewport;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Content.Shared.GameTicking; using Content.Shared.GameTicking;
using Content.Shared.GameWindow; using Content.Shared.GameWindow;
@@ -11,7 +10,6 @@ using Robust.Client.Graphics;
using Robust.Client.State; using Robust.Client.State;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Configuration; using Robust.Shared.Configuration;
using Robust.Shared.Network;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Utility; using Robust.Shared.Utility;

View File

@@ -1,16 +1,9 @@
using System; using Content.Shared.Gravity;
using Content.Client.Message;
using Content.Client.UserInterface.Controls;
using Content.Shared.Gravity;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;
using Robust.Shared.GameObjects; using FancyWindow = Content.Client.UserInterface.Controls.FancyWindow;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
namespace Content.Client.Gravity.UI namespace Content.Client.Gravity.UI
{ {

View File

@@ -1,7 +1,7 @@
using Content.Client.CrewManifest; using Content.Client.CrewManifest;
using Content.Client.GameTicking.Managers; using Content.Client.GameTicking.Managers;
using Content.Client.Players.PlayTimeTracking;
using Content.Client.UserInterface.Controls; using Content.Client.UserInterface.Controls;
using Content.Client.Players.PlayTimeTracking;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Content.Shared.Roles; using Content.Shared.Roles;
using Robust.Client.Console; using Robust.Client.Console;

View File

@@ -37,7 +37,9 @@
Text="{Loc 'main-menu-quit-button'}" Text="{Loc 'main-menu-quit-button'}"
TextAlign="Center" TextAlign="Center"
StyleIdentifier="mainMenu" /> StyleIdentifier="mainMenu" />
<clog:ChangelogButton /> <clog:ChangelogButton
Name="ChangelogButton"
Access="Public"/>
</BoxContainer> </BoxContainer>
<Label Name="VersionLabel" Text="v0.1" /> <Label Name="VersionLabel" Text="v0.1" />
</LayoutContainer> </LayoutContainer>

View File

@@ -1,4 +1,4 @@
<controls:FancyWindow xmlns="https://spacestation14.io" <controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:networkConfigurator="clr-namespace:Content.Client.NetworkConfigurator" xmlns:networkConfigurator="clr-namespace:Content.Client.NetworkConfigurator"
Title="Network Configurator" MinSize="350 100"> Title="Network Configurator" MinSize="350 100">

View File

@@ -1,13 +1,13 @@
<controls:FancyWindow xmlns="https://spacestation14.io" <controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:networkConfigurator="clr-namespace:Content.Client.NetworkConfigurator" xmlns:networkConfigurator="clr-namespace:Content.Client.NetworkConfigurator"
Title="Network Configurator" MinSize="220 400"> Title="Network Configurator" MinSize="220 400">
<BoxContainer Orientation="Vertical" VerticalExpand="True"> <BoxContainer Orientation="Vertical" VerticalExpand="True">
<networkConfigurator:NetworkConfiguratorDeviceList Name="DeviceList" /> <networkConfigurator:NetworkConfiguratorDeviceList Name="DeviceList" />
<BoxContainer Orientation="Horizontal" Margin="8 8 8 8"> <BoxContainer Orientation="Horizontal" Margin="8 8 8 8">
<Label Name="DeviceCountLabel" Margin="16 0 0 0" MaxWidth="64"></Label> <Label Name="DeviceCountLabel" Margin="16 0 0 0" MaxWidth="64" />
<Control HorizontalExpand="True" /> <Control HorizontalExpand="True" />
<Button Name="ClearButton" Access="Public" Text="{Loc 'network-configurator-ui-clear-button'}"></Button> <Button Name="ClearButton" Access="Public" Text="{Loc 'network-configurator-ui-clear-button'}" />
</BoxContainer> </BoxContainer>
</BoxContainer> </BoxContainer>
</controls:FancyWindow> </controls:FancyWindow>

View File

@@ -16,8 +16,7 @@
<Label Name="DockingPortsLabel" Text="{Loc 'shuttle-console-dock-label'}" HorizontalAlignment="Center"/> <Label Name="DockingPortsLabel" Text="{Loc 'shuttle-console-dock-label'}" HorizontalAlignment="Center"/>
</controls:StripeBack> </controls:StripeBack>
<BoxContainer Name="DockPorts" <BoxContainer Name="DockPorts"
Orientation="Vertical"> Orientation="Vertical"/>
</BoxContainer>
</BoxContainer> </BoxContainer>
<BoxContainer Orientation="Vertical"> <BoxContainer Orientation="Vertical">
<controls:StripeBack> <controls:StripeBack>

View File

@@ -1,4 +1,4 @@

<controls:FancyWindow xmlns="https://spacestation14.io" <controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
MouseFilter="Stop" MouseFilter="Stop"

View File

@@ -1,7 +1,6 @@
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;
using Robust.Shared.Maths;
namespace Content.Client.UserInterface.Controls namespace Content.Client.UserInterface.Controls
{ {

View File

@@ -1,4 +1,4 @@
using Content.Client.UserInterface.Controls; using Content.Client.UserInterface.Controls;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Robust.Shared.Configuration; using Robust.Shared.Configuration;

View File

@@ -1,6 +1,6 @@
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Prototypes;
using Content.Shared.Actions.ActionTypes; using Content.Shared.Actions.ActionTypes;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Utility; using Robust.Shared.Utility;
namespace Content.Server.Abilities.Mime namespace Content.Server.Abilities.Mime

View File

@@ -1,6 +1,6 @@
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Prototypes;
using Content.Shared.Actions.ActionTypes; using Content.Shared.Actions.ActionTypes;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Utility; using Robust.Shared.Utility;
namespace Content.Server.Bible.Components namespace Content.Server.Bible.Components

View File

@@ -184,7 +184,7 @@ namespace Content.Server.Polymorph.Systems
var act = new InstantAction() var act = new InstantAction()
{ {
Event = new PolymorphActionEvent() Event = new PolymorphActionEvent
{ {
Prototype = polyproto, Prototype = polyproto,
}, },

View File

@@ -45,7 +45,7 @@ public abstract class SharedHandsComponent : Component
} }
[Serializable, NetSerializable] [Serializable, NetSerializable]
public sealed class Hand public sealed class Hand //TODO: This should definitely be a struct - Jezi
{ {
[ViewVariables] [ViewVariables]
public string Name { get; } public string Name { get; }

View File

@@ -16,6 +16,8 @@ public abstract partial class SharedHandsSystem : EntitySystem
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!; [Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
[Dependency] private readonly SharedContainerSystem _containerSystem = default!; [Dependency] private readonly SharedContainerSystem _containerSystem = default!;
protected Action<SharedHandsComponent?>? OnHandSetActive;
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
@@ -29,7 +31,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
CommandBinds.Unregister<SharedHandsSystem>(); CommandBinds.Unregister<SharedHandsSystem>();
} }
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)) if (!Resolve(uid, ref handsComp, false))
return; return;
@@ -51,7 +53,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
Dirty(handsComp); 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)) if (!Resolve(uid, ref handsComp, false))
return; return;
@@ -154,7 +156,6 @@ public abstract partial class SharedHandsSystem : EntitySystem
Hand? hand = null; Hand? hand = null;
if (name != null && !handComp.Hands.TryGetValue(name, out hand)) if (name != null && !handComp.Hands.TryGetValue(name, out hand))
return false; return false;
return SetActiveHand(uid, hand, handComp); return SetActiveHand(uid, hand, handComp);
} }
@@ -163,7 +164,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
/// </summary> /// </summary>
/// <returns>True if the active hand was set to a NEW value. Setting it to the same value returns false and does /// <returns>True if the active hand was set to a NEW value. Setting it to the same value returns false and does
/// not trigger interactions.</returns> /// not trigger interactions.</returns>
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)) if (!Resolve(uid, ref handComp))
return false; return false;
@@ -181,10 +182,10 @@ public abstract partial class SharedHandsSystem : EntitySystem
} }
handComp.ActiveHand = hand; handComp.ActiveHand = hand;
OnHandSetActive?.Invoke(handComp);
if (hand.HeldEntity != null) if (hand.HeldEntity != null)
RaiseLocalEvent(hand.HeldEntity.Value, new HandSelectedEvent(uid), false); RaiseLocalEvent(hand.HeldEntity.Value, new HandSelectedEvent(uid), false);
Dirty(handComp); Dirty(handComp);
return true; return true;
} }

View File

@@ -528,6 +528,7 @@ public sealed class $CLASS$ : Shared$CLASS$ {
<s:Boolean x:Key="/Default/UserDictionary/Words/=Grindable/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=Grindable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=hardcode/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=hardcode/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=hbox/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=hbox/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=hotbar/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=inhand/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=inhand/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Jitteriness/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=Jitteriness/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Jittering/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=Jittering/@EntryIndexedValue">True</s:Boolean>
@@ -539,6 +540,7 @@ public sealed class $CLASS$ : Shared$CLASS$ {
<s:Boolean x:Key="/Default/UserDictionary/Words/=Lacunarity/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=Lacunarity/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Lerp/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=Lerp/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=lerping/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=lerping/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=loadout/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=LOOC/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=LOOC/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Magboots/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=Magboots/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=metabolizable/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=metabolizable/@EntryIndexedValue">True</s:Boolean>