Small UI refactor pieces (#11026)

* ActionType rename Name to DisplayName

* Gameplay State rename+move
This commit is contained in:
wrexbe
2022-09-04 17:21:14 -07:00
committed by GitHub
parent 2c0dd52776
commit c55a015b77
27 changed files with 61 additions and 56 deletions

View File

@@ -35,7 +35,7 @@ public abstract class ActionType : IEquatable<ActionType>, IComparable, ICloneab
/// Name to show in UI.
/// </summary>
[DataField("name", required: true)]
public string Name = string.Empty;
public string DisplayName = string.Empty;
/// <summary>
/// Description to show in UI. Accepts formatting.
@@ -89,7 +89,7 @@ public abstract class ActionType : IEquatable<ActionType>, IComparable, ICloneab
public EntityUid? Provider;
/// <summary>
/// Entity to use for the action icon. Defaults to using <see cref="Provider"/>.
/// Entity to use for the action icon. Defaults to using <see cref="Provider"/>.
/// </summary>
public EntityUid? EntityIcon
{
@@ -207,8 +207,8 @@ public abstract class ActionType : IEquatable<ActionType>, IComparable, ICloneab
if (Priority != otherAction.Priority)
return otherAction.Priority - Priority;
var name = FormattedMessage.RemoveMarkup(Loc.GetString(Name));
var otherName = FormattedMessage.RemoveMarkup(Loc.GetString(otherAction.Name));
var name = FormattedMessage.RemoveMarkup(Loc.GetString(DisplayName));
var otherName = FormattedMessage.RemoveMarkup(Loc.GetString(otherAction.DisplayName));
if (name != otherName)
return string.Compare(name, otherName, StringComparison.CurrentCulture);
@@ -244,7 +244,7 @@ public abstract class ActionType : IEquatable<ActionType>, IComparable, ICloneab
Priority = toClone.Priority;
Icon = toClone.Icon;
IconOn = toClone.IconOn;
Name = toClone.Name;
DisplayName = toClone.DisplayName;
Description = toClone.Description;
Provider = toClone.Provider;
AttachedEntity = toClone.AttachedEntity;
@@ -278,7 +278,7 @@ public abstract class ActionType : IEquatable<ActionType>, IComparable, ICloneab
unchecked
{
var hashCode = Priority.GetHashCode();
hashCode = (hashCode * 397) ^ Name.GetHashCode();
hashCode = (hashCode * 397) ^ DisplayName.GetHashCode();
hashCode = (hashCode * 397) ^ Provider.GetHashCode();
return hashCode;
}

View File

@@ -114,7 +114,7 @@ public abstract class SharedActionsSystem : EntitySystem
if (!component.Actions.TryGetValue(ev.Action, out var act))
{
_adminLogger.Add(LogType.Action,
$"{ToPrettyString(user):user} attempted to perform an action that they do not have: {ev.Action.Name}.");
$"{ToPrettyString(user):user} attempted to perform an action that they do not have: {ev.Action.DisplayName}.");
return;
}
@@ -128,7 +128,7 @@ public abstract class SharedActionsSystem : EntitySystem
BaseActionEvent? performEvent = null;
// Validate request by checking action blockers and the like:
var name = Loc.GetString(act.Name);
var name = Loc.GetString(act.DisplayName);
switch (act)
{
@@ -136,7 +136,7 @@ public abstract class SharedActionsSystem : EntitySystem
if (ev.EntityTarget is not EntityUid { Valid: true } entityTarget)
{
Logger.Error($"Attempted to perform an entity-targeted action without a target! Action: {entityAction.Name}");
Logger.Error($"Attempted to perform an entity-targeted action without a target! Action: {entityAction.DisplayName}");
return;
}
@@ -164,7 +164,7 @@ public abstract class SharedActionsSystem : EntitySystem
if (ev.MapTarget is not MapCoordinates mapTarget)
{
Logger.Error($"Attempted to perform a map-targeted action without a target! Action: {worldAction.Name}");
Logger.Error($"Attempted to perform a map-targeted action without a target! Action: {worldAction.DisplayName}");
return;
}