Inline Name

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 15:25:51 +01:00
parent 61be228ad0
commit ee4ff9cfe8
97 changed files with 237 additions and 177 deletions

View File

@@ -1,6 +1,8 @@
using Content.Server.Popups;
using Content.Shared.Actions.Behaviors;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Actions.Actions
@@ -11,14 +13,14 @@ namespace Content.Server.Actions.Actions
{
public void DoTargetEntityAction(TargetEntityItemActionEventArgs args)
{
args.Performer.PopupMessageEveryone(args.Item.Name + ": Clicked " +
args.Target.Name);
args.Performer.PopupMessageEveryone(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Item.Uid).EntityName + ": Clicked " +
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Target.Uid).EntityName);
}
public void DoTargetEntityAction(TargetEntityActionEventArgs args)
{
args.Performer.PopupMessageEveryone("Clicked " +
args.Target.Name);
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Target.Uid).EntityName);
}
}
}

View File

@@ -1,6 +1,8 @@
using Content.Server.Popups;
using Content.Shared.Actions.Behaviors;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Actions.Actions
@@ -11,7 +13,7 @@ namespace Content.Server.Actions.Actions
{
public void DoTargetPointAction(TargetPointItemActionEventArgs args)
{
args.Performer.PopupMessageEveryone(args.Item.Name + ": Clicked local position " +
args.Performer.PopupMessageEveryone(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Item.Uid).EntityName + ": Clicked local position " +
args.Target);
}

View File

@@ -2,6 +2,8 @@
using Content.Shared.Actions.Behaviors;
using Content.Shared.Actions.Behaviors.Item;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Actions.Actions
@@ -17,11 +19,11 @@ namespace Content.Server.Actions.Actions
{
if (args.ToggledOn)
{
args.Performer.PopupMessageEveryone(args.Item.Name + ": " + MessageOn);
args.Performer.PopupMessageEveryone(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Item.Uid).EntityName + ": " + MessageOn);
}
else
{
args.Performer.PopupMessageEveryone(args.Item.Name + ": " +MessageOff);
args.Performer.PopupMessageEveryone(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Item.Uid).EntityName + ": " +MessageOff);
}
return true;

View File

@@ -84,10 +84,10 @@ namespace Content.Server.Actions.Actions
SoundSystem.Play(Filter.Pvs(args.Performer), PunchMissSound.GetSound(), args.Performer, AudioHelpers.WithVariation(0.025f));
args.Performer.PopupMessageOtherClients(Loc.GetString("disarm-action-popup-message-other-clients",
("performerName", args.Performer.Name),
("targetName", args.Target.Name)));
("performerName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Performer.Uid).EntityName),
("targetName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Target.Uid).EntityName)));
args.Performer.PopupMessageCursor(Loc.GetString("disarm-action-popup-message-cursor",
("targetName", args.Target.Name)));
("targetName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Target.Uid).EntityName)));
system.SendLunge(angle, args.Performer);
return;
}

View File

@@ -63,7 +63,7 @@ namespace Content.Server.Actions
if (!attempt.TryGetActionState(this, out var actionState) || !actionState.Enabled)
{
Logger.DebugS("action", "user {0} attempted to use" +
" action {1} which is not granted to them", player.Name,
" action {1} which is not granted to them", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.Uid).EntityName,
attempt);
return;
}
@@ -71,7 +71,7 @@ namespace Content.Server.Actions
if (actionState.IsOnCooldown(GameTiming))
{
Logger.DebugS("action", "user {0} attempted to use" +
" action {1} which is on cooldown", player.Name,
" action {1} which is on cooldown", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.Uid).EntityName,
attempt);
return;
}
@@ -86,7 +86,7 @@ namespace Content.Server.Actions
if (toggleMsg.ToggleOn == actionState.ToggledOn)
{
Logger.DebugS("action", "user {0} attempted to" +
" toggle action {1} to {2}, but it is already toggled {2}", player.Name,
" toggle action {1} to {2}, but it is already toggled {2}", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.Uid).EntityName,
attempt.Action.Name, toggleMsg.ToggleOn);
return;
}
@@ -113,7 +113,7 @@ namespace Content.Server.Actions
{
Logger.DebugS("action", "user {0} attempted to" +
" perform target entity action {1} but could not find entity with " +
"provided uid {2}", player.Name, attempt.Action.Name,
"provided uid {2}", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.Uid).EntityName, attempt.Action.Name,
targetEntityMsg.Target);
return;
}
@@ -204,7 +204,7 @@ namespace Content.Server.Actions
{
Logger.DebugS("action", "user {0} attempted to" +
" perform target action further than allowed range",
player.Name);
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.Uid).EntityName);
return false;
}