using Content.Shared.Verbs;
using Robust.Client.Console;
+using Robust.Shared.Utility;
namespace Content.Client.Administration.Systems
{
Verb verb = new();
verb.Category = VerbCategory.Debug;
verb.Text = "View Variables";
- verb.IconTexture = "/Textures/Interface/VerbIcons/vv.svg.192dpi.png";
+ verb.Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/vv.svg.192dpi.png"));
verb.Act = () => _clientConsoleHost.ExecuteCommand($"vv {args.Target}");
verb.ClientExclusive = true; // opening VV window is client-side. Don't ask server to run this verb.
args.Verbs.Add(verb);
SetHeight = ElementHeight
};
- if (verb.IconTexture != null)
+ if (verb.Icon != null)
{
- var icon = new SpriteSpecifier.Texture(new ResourcePath(verb.IconTexture));
-
- Icon.Texture = icon.Frame0();
+ Icon.Texture = verb.Icon.Frame0();
Icon.Stretch = TextureRect.StretchMode.KeepAspectCentered;
AddChild(Icon);
CommandBinds.Builder
.Bind(ContentKeyFunctions.ExamineEntity, new PointerInputCmdHandler(HandleExamine, outsidePrediction: true))
.Register<ExamineSystem>();
-
+
_idCounter = 0;
}
// Center it on the entity if they use the verb instead.
verb.Act = () => DoExamine(args.Target, false);
verb.Text = Loc.GetString("examine-verb-name");
- verb.IconTexture = "/Textures/Interface/VerbIcons/examine.svg.192dpi.png";
+ verb.Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/examine.svg.192dpi.png"));
verb.ShowOnExamineTooltip = false;
verb.ClientExclusive = true;
args.Verbs.Add(verb);
// Prevent updating a new tooltip.
if (ev.Id != 0 && ev.Id != _idCounter)
return;
-
+
// Tooltips coming in from the server generally prioritize
// opening at the old tooltip rather than the cursor/another entity,
// since there's probably one open already if it's coming in from the server.
if (verb is not ExamineVerb examine)
continue;
- if (examine.IconTexture == null)
+ if (examine.Icon == null)
continue;
if (!examine.ShowOnExamineTooltip)
using Robust.Shared.Input.Binding;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
+using Robust.Shared.Utility;
namespace Content.Client.Guidebook;
args.Verbs.Add(new()
{
Text = Loc.GetString("guide-help-verb"),
- IconTexture = "/Textures/Interface/VerbIcons/information.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/information.svg.192dpi.png")),
Act = () => OpenGuidebook(component.Guides, includeChildren: component.IncludeChildren, selected: component.Guides[0]),
ClientExclusive = true,
CloseMenu = true
using Content.Shared.Pointing;
using Content.Shared.Verbs;
using Robust.Client.GameObjects;
+using Robust.Shared.Utility;
using DrawDepth = Content.Shared.DrawDepth.DrawDepth;
namespace Content.Client.Pointing;
Verb verb = new()
{
Text = Loc.GetString("pointing-verb-get-data-text"),
- IconTexture = "/Textures/Interface/VerbIcons/point.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/point.svg.192dpi.png")),
ClientExclusive = true,
Act = () => RaiseNetworkEvent(new PointingAttemptEvent(args.Target))
};
Category = VerbCategory.Examine,
Disabled = !detailsRange,
Message = Loc.GetString("id-examinable-component-verb-disabled"),
- IconTexture = "/Textures/Interface/VerbIcons/information.svg.192dpi.png"
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/information.svg.192dpi.png"))
};
args.Verbs.Add(verb);
using Content.Shared.Verbs;
using Robust.Server.GameObjects;
using Robust.Shared.Console;
+using Robust.Shared.Utility;
namespace Content.Server.Administration.Notes;
{
Text = Loc.GetString("admin-notes-verb-text"),
Category = VerbCategory.Admin,
- IconTexture = "/Textures/Interface/VerbIcons/examine.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/examine.svg.192dpi.png")),
Act = () => _console.RemoteExecuteCommand(user, $"{OpenAdminNotesCommand.CommandName} \"{target.UserId}\""),
Impact = LogImpact.Low
};
using Content.Shared.Verbs;
using Robust.Server.GameObjects;
using Robust.Shared.Configuration;
+using Robust.Shared.Utility;
namespace Content.Server.Administration.Systems;
{
Text = "Make Traitor",
Category = VerbCategory.Antag,
- IconTexture = "/Textures/Structures/Wallmounts/posters.rsi/poster5_contraband.png",
+ Icon = new SpriteSpecifier.Rsi((new ResourcePath("/Textures/Structures/Wallmounts/posters.rsi")), "poster5_contraband"),
Act = () =>
{
if (targetMindComp.Mind == null || targetMindComp.Mind.Session == null)
{
Text = "Make Zombie",
Category = VerbCategory.Antag,
- IconTexture = "/Textures/Structures/Wallmounts/signs.rsi/bio.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Structures/Wallmounts/signs.rsi"), "bio"),
Act = () =>
{
TryComp(args.Target, out MindComponent? mindComp);
{
Text = "Make nuclear operative",
Category = VerbCategory.Antag,
- IconTexture = "/Textures/Structures/Wallmounts/signs.rsi/radiation.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Structures/Wallmounts/signs.rsi"), "radiation"),
Act = () =>
{
if (targetMindComp.Mind == null || targetMindComp.Mind.Session == null)
{
Text = "Make Pirate",
Category = VerbCategory.Antag,
- IconTexture = "/Textures/Clothing/Head/Hats/pirate.rsi/icon.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Clothing/Head/Hats/pirate.rsi"), "icon"),
Act = () =>
{
if (targetMindComp.Mind == null || targetMindComp.Mind.Session == null)
using Robust.Shared.Physics.Systems;
using Robust.Shared.Player;
using Robust.Shared.Random;
+using Robust.Shared.Utility;
using Timer = Robust.Shared.Timing.Timer;
namespace Content.Server.Administration.Systems;
[Dependency] private readonly InventorySystem _inventorySystem = default!;
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifierSystem = default!;
[Dependency] private readonly PolymorphableSystem _polymorphableSystem = default!;
- [Dependency] private readonly MobStateSystem _mobStateSystem = default!;
[Dependency] private readonly MobThresholdSystem _mobThresholdSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
{
Text = "Explode",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Interface/VerbIcons/smite.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/smite.svg.192dpi.png")),
Act = () =>
{
var coords = Transform(args.Target).MapPosition;
{
Text = "Chess Dimension",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Objects/Fun/Tabletop/chessboard.rsi/chessboard.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Fun/Tabletop/chessboard.rsi"), "chessboard"),
Act = () =>
{
_godmodeSystem.EnableGodmode(args.Target); // So they don't suffocate.
{
Text = "Set Alight",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Interface/Alerts/Fire/fire.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/Alerts/Fire/fire.png")),
Act = () =>
{
// Fuck you. Burn Forever.
{
Text = "Monkeyify",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Mobs/Animals/monkey.rsi/dead.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Mobs/Animals/monkey.rsi"), "dead"),
Act = () =>
{
_polymorphableSystem.PolymorphEntity(args.Target, "AdminMonkeySmite");
{
Text = "Garbage Can",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Structures/Piping/disposal.rsi/disposal.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Structures/Piping/disposal.rsi"), "disposal"),
Act = () =>
{
_polymorphableSystem.PolymorphEntity(args.Target, "AdminDisposalsSmite");
{
Text = "Lung Cancer",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Mobs/Species/Human/organs.rsi/lung-l.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Mobs/Species/Human/organs.rsi"), "lung-l"),
Act = () =>
{
_diseaseSystem.TryInfect(carrier, _prototypeManager.Index<DiseasePrototype>("StageIIIALungCancer"),
}
if (TryComp<DamageableComponent>(args.Target, out var damageable) &&
- TryComp<MobStateComponent>(args.Target, out var mobState))
+ HasComp<MobStateComponent>(args.Target))
{
Verb hardElectrocute = new()
{
Text = "Electrocute",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Clothing/Hands/Gloves/Color/yellow.rsi/icon.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Clothing/Hands/Gloves/Color/yellow.rsi"), "icon"),
Act = () =>
{
int damageToDeal;
{
Text = "Creampie",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Objects/Consumable/Food/Baked/pie.rsi/plain-slice.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Consumable/Food/Baked/pie.rsi"), "plain-slice"),
Act = () =>
{
_creamPieSystem.SetCreamPied(args.Target, creamPied, true);
{
Text = "Remove blood",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Fluids/tomato_splat.rsi/puddle-1.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Fluids/tomato_splat.rsi"), "puddle-1"),
Act = () =>
{
_bloodstreamSystem.SpillAllSolutions(args.Target, bloodstream);
{
Text = "Vomit organs",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Fluids/vomit_toxin.rsi/vomit_toxin-1.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Fluids/vomit_toxin.rsi"), "vomit_toxin-1"),
Act = () =>
{
_vomitSystem.Vomit(args.Target, -1000, -1000); // You feel hollow!
{
Text = "Remove hands",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Interface/AdminActions/remove-hands.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/remove-hands.png")),
Act = () =>
{
var baseXform = Transform(args.Target);
{
Text = "Remove hands",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Interface/AdminActions/remove-hand.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/remove-hand.png")),
Act = () =>
{
var baseXform = Transform(args.Target);
{
Text = "Stomach Removal",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Mobs/Species/Human/organs.rsi/stomach.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Mobs/Species/Human/organs.rsi"), "stomach"),
Act = () =>
{
foreach (var (component, _) in _bodySystem.GetBodyOrganComponents<StomachComponent>(args.Target, body))
{
Text = "Lungs Removal",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Mobs/Species/Human/organs.rsi/lung-r.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Mobs/Species/Human/organs.rsi"), "lung-r"),
Act = () =>
{
foreach (var (component, _) in _bodySystem.GetBodyOrganComponents<LungComponent>(args.Target, body))
{
Text = "Pinball",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Objects/Fun/toys.rsi/basketball.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Fun/toys.rsi"), "basketball"),
Act = () =>
{
var xform = Transform(args.Target);
{
Text = "Yeet",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Interface/VerbIcons/eject.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/eject.svg.192dpi.png")),
Act = () =>
{
var xform = Transform(args.Target);
{
Text = "Become Bread",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Objects/Consumable/Food/Baked/bread.rsi/plain.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Consumable/Food/Baked/bread.rsi"), "plain"),
Act = () =>
{
_polymorphableSystem.PolymorphEntity(args.Target, "AdminBreadSmite");
{
Text = "Become Mouse",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Mobs/Animals/mouse.rsi/icon-0.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Mobs/Animals/mouse.rsi"), "icon-0"),
Act = () =>
{
_polymorphableSystem.PolymorphEntity(args.Target, "AdminMouseSmite");
{
Text = "Ghostkick",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Interface/gavel.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/gavel.svg.192dpi.png")),
Act = () =>
{
_ghostKickManager.DoDisconnect(actorComponent.PlayerSession.ConnectedClient, "Smitten.");
{
Text = "Nyanify",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Clothing/Head/Hats/catears.rsi/icon.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Clothing/Head/Hats/catears.rsi"), "icon"),
Act = () =>
{
var ears = Spawn("ClothingHeadHatCatEars", Transform(args.Target).Coordinates);
{
Text = "Kill sign",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Objects/Misc/killsign.rsi/icon.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Misc/killsign.rsi"), "icon"),
Act = () =>
{
EnsureComp<KillSignComponent>(args.Target);
{
Text = "Clown",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Objects/Fun/bikehorn.rsi/icon.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Fun/bikehorn.rsi"), "icon"),
Act = () =>
{
SetOutfitCommand.SetOutfit(args.Target, "ClownGear", EntityManager, (_, clothing) =>
{
Text = "Maid",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Clothing/Uniforms/Jumpskirt/janimaid.rsi/icon.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Clothing/Uniforms/Jumpskirt/janimaid.rsi"), "icon"),
Act = () =>
{
SetOutfitCommand.SetOutfit(args.Target, "JanitorMaidGear", EntityManager, (_, clothing) =>
Message = Loc.GetString("admin-smite-maid-description")
};
args.Verbs.Add(maiden);
-
-
}
Verb angerPointingArrows = new()
{
Text = "Anger Pointing Arrows",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Interface/Misc/pointing.rsi/pointing.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Interface/Misc/pointing.rsi"), "pointing"),
Act = () =>
{
EnsureComp<PointingArrowAngeringComponent>(args.Target);
{
Text = "Dust",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Objects/Materials/materials.rsi/ash.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Materials/materials"), "ash"),
Act = () =>
{
EntityManager.QueueDeleteEntity(args.Target);
{
Text = "Buffering",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Interface/Misc/buffering_smite_icon.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/Misc/buffering_smite_icon.png")),
Act = () =>
{
EnsureComp<BufferingComponent>(args.Target);
{
Text = "Become Instrument",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Objects/Fun/Instruments/h_synthesizer.rsi/icon.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Fun/Instruments/h_synthesizer.rsi"), "icon"),
Act = () =>
{
_polymorphableSystem.PolymorphEntity(args.Target, "AdminInstrumentSmite");
{
Text = "Remove gravity",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Structures/Machines/gravity_generator.rsi/off.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Structures/Machines/gravity_generator.rsi"), "off"),
Act = () =>
{
var grav = EnsureComp<MovementIgnoreGravityComponent>(args.Target);
{
Text = "Reptilian Species Swap",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Objects/Fun/toys.rsi/plushie_lizard.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Fun/toys.rsi"), "plushie_lizard"),
Act = () =>
{
_polymorphableSystem.PolymorphEntity(args.Target, "AdminLizardSmite");
{
Text = "Locker stuff",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Structures/Storage/closet.rsi/generic.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Structures/Storage/closet.rsi"), "generic"),
Act = () =>
{
var xform = Transform(args.Target);
{
Text = "Headstand",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Interface/VerbIcons/refresh.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/refresh.svg.192dpi.png")),
Act = () =>
{
EnsureComp<HeadstandComponent>(args.Target);
{
Text = "Zoom in",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Interface/AdminActions/zoom.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/zoom.png")),
Act = () =>
{
var eye = EnsureComp<EyeComponent>(args.Target);
{
Text = "Flip eye",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Interface/AdminActions/flip.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/flip.png")),
Act = () =>
{
var eye = EnsureComp<EyeComponent>(args.Target);
{
Text = "Run Walk Swap",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Interface/AdminActions/run-walk-swap.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/run-walk-swap.png")),
Act = () =>
{
var movementSpeed = EnsureComp<MovementSpeedModifierComponent>(args.Target);
{
Text = "Speak Backwards",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Interface/AdminActions/help-backwards.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/help-backwards.png")),
Act = () =>
{
EnsureComp<BackwardsAccentComponent>(args.Target);
{
Text = "Disarm Prone",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Interface/Actions/disarm.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/Actions/disarm.png")),
Act = () =>
{
EnsureComp<DisarmProneComponent>(args.Target);
{
Text = "Super speed",
Category = VerbCategory.Smite,
- IconTexture = "/Textures/Interface/AdminActions/super_speed.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/super_speed.png")),
Act = () =>
{
var movementSpeed = EnsureComp<MovementSpeedModifierComponent>(args.Target);
using Robust.Shared.Physics;
using Robust.Shared.Physics.Components;
using Robust.Shared.Prototypes;
+using Robust.Shared.Utility;
namespace Content.Server.Administration.Systems;
{
Text = airlock.BoltsDown ? "Unbolt" : "Bolt",
Category = VerbCategory.Tricks,
- IconTexture = airlock.BoltsDown
- ? "/Textures/Interface/AdminActions/unbolt.png"
- : "/Textures/Interface/AdminActions/bolt.png",
+ Icon = airlock.BoltsDown
+ ? new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/unbolt.png"))
+ : new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/bolt.png")),
Act = () =>
{
_airlockSystem.SetBoltsWithAudio(args.Target, airlock, !airlock.BoltsDown);
{
Text = airlock.EmergencyAccess ? "Emergency Access Off" : "Emergency Access On",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/emergency_access.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/emergency_access.png")),
Act = () =>
{
_airlockSystem.ToggleEmergencyAccess(args.Target, airlock);
{
Text = "Rejuvenate",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/rejuvenate.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/rejuvenate.png")),
Act = () =>
{
RejuvenateCommand.PerformRejuvenate(args.Target);
{
Text = "Make Indestructible",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/VerbIcons/plus.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/plus.svg.192dpi.png")),
Act = () =>
{
_godmodeSystem.EnableGodmode(args.Target);
{
Text = "Make Vulnerable",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/VerbIcons/plus.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/plus.svg.192dpi.png")),
Act = () =>
{
_godmodeSystem.DisableGodmode(args.Target);
{
Text = "Refill Battery",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/fill_battery.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/fill_battery.png")),
Act = () =>
{
battery.CurrentCharge = battery.MaxCharge;
{
Text = "Drain Battery",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/drain_battery.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/drain_battery.png")),
Act = () =>
{
battery.CurrentCharge = 0;
{
Text = "Infinite Battery",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/infinite_battery.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/infinite_battery.png")),
Act = () =>
{
var recharger = EnsureComp<BatterySelfRechargerComponent>(args.Target);
{
Text = "Block Unanchoring",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/VerbIcons/anchor.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/anchor.svg.192dpi.png")),
Act = () =>
{
RemComp(args.Target, anchor);
{
Text = "Refill Internals Oxygen",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Objects/Tanks/oxygen.rsi/icon.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Tanks/oxygen.rsi"), "icon"),
Act = () =>
{
RefillGasTank(args.Target, Gas.Oxygen, tank);
{
Text = "Refill Internals Nitrogen",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Objects/Tanks/red.rsi/icon.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Tanks/red.rsi"), "icon"),
Act = () =>
{
RefillGasTank(args.Target, Gas.Nitrogen, tank);
{
Text = "Refill Internals Plasma",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Objects/Tanks/plasma.rsi/icon.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Tanks/plasma.rsi"), "icon"),
Act = () =>
{
RefillGasTank(args.Target, Gas.Plasma, tank);
args.Verbs.Add(refillInternalsPlasma);
}
- if (TryComp<InventoryComponent>(args.Target, out var inventory))
+ if (HasComp<InventoryComponent>(args.Target))
{
Verb refillInternalsO2 = new()
{
Text = "Refill Internals Oxygen",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Objects/Tanks/oxygen.rsi/icon.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Tanks/oxygen.rsi"), "icon"),
Act = () =>
{
foreach (var slot in _inventorySystem.GetSlots(args.Target))
if (!_inventorySystem.TryGetSlotEntity(args.Target, slot.Name, out var entity))
continue;
- if (!TryComp<GasTankComponent>(entity, out var tank))
+ if (!TryComp(entity, out tank))
continue;
RefillGasTank(entity.Value, Gas.Oxygen, tank);
foreach (var held in _handsSystem.EnumerateHeld(args.Target))
{
- if (!TryComp<GasTankComponent>(held, out var tank))
+ if (!TryComp(held, out tank))
continue;
RefillGasTank(held, Gas.Oxygen, tank);
{
Text = "Refill Internals Nitrogen",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Objects/Tanks/red.rsi/icon.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Tanks/red.rsi"), "icon"),
Act = () =>
{
foreach (var slot in _inventorySystem.GetSlots(args.Target))
if (!_inventorySystem.TryGetSlotEntity(args.Target, slot.Name, out var entity))
continue;
- if (!TryComp<GasTankComponent>(entity, out var tank))
+ if (!TryComp(entity, out tank))
continue;
RefillGasTank(entity.Value, Gas.Nitrogen, tank);
foreach (var held in _handsSystem.EnumerateHeld(args.Target))
{
- if (!TryComp<GasTankComponent>(held, out var tank))
+ if (!TryComp(held, out tank))
continue;
RefillGasTank(held, Gas.Nitrogen, tank);
{
Text = "Refill Internals Plasma",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Objects/Tanks/plasma.rsi/icon.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Tanks/plasma.rsi"), "icon"),
Act = () =>
{
foreach (var slot in _inventorySystem.GetSlots(args.Target))
if (!_inventorySystem.TryGetSlotEntity(args.Target, slot.Name, out var entity))
continue;
- if (!TryComp<GasTankComponent>(entity, out var tank))
+ if (!TryComp(entity, out tank))
continue;
RefillGasTank(entity.Value, Gas.Plasma, tank);
foreach (var held in _handsSystem.EnumerateHeld(args.Target))
{
- if (!TryComp<GasTankComponent>(held, out var tank))
+ if (!TryComp(held, out tank))
continue;
RefillGasTank(held, Gas.Plasma, tank);
{
Text = "Send to test arena",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/VerbIcons/eject.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/eject.svg.192dpi.png")),
Act = () =>
{
{
Text = "Grant All Access",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Objects/Misc/id_cards.rsi/centcom.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Misc/id_cards.rsi"), "centcom"),
Act = () =>
{
GiveAllAccess(activeId.Value);
{
Text = "Revoke All Access",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Objects/Misc/id_cards.rsi/default.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Misc/id_cards.rsi"), "default"),
Act = () =>
{
RevokeAllAccess(activeId.Value);
{
Text = "Grant All Access",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Objects/Misc/id_cards.rsi/centcom.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Misc/id_cards.rsi"), "centcom"),
Act = () =>
{
GiveAllAccess(args.Target);
{
Text = "Revoke All Access",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Objects/Misc/id_cards.rsi/default.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Misc/id_cards.rsi"), "default"),
Act = () =>
{
RevokeAllAccess(args.Target);
{
Text = "Adjust Stack",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/adjust-stack.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/adjust-stack.png")),
Act = () =>
{
// Unbounded intentionally.
{
Text = "Fill Stack",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/fill-stack.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/fill-stack.png")),
Act = () =>
{
_stackSystem.SetCount(args.Target, _stackSystem.GetMaxCount(stack), stack);
{
Text = "Rename",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/rename.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/rename.png")),
Act = () =>
{
_quickDialog.OpenDialog(player, "Rename", "Name", (string newName) =>
{
Text = "Redescribe",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/redescribe.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/redescribe.png")),
Act = () =>
{
_quickDialog.OpenDialog(player, "Redescribe", "Description", (LongString newDescription) =>
{
Text = "Redescribe",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/rename_and_redescribe.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/rename_and_redescribe.png")),
Act = () =>
{
_quickDialog.OpenDialog(player, "Rename & Redescribe", "Name", "Description",
{
Text = "Bar job slots",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/bar_jobslots.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/bar_jobslots.png")),
Act = () =>
{
foreach (var (job, _) in _stationJobsSystem.GetJobs(args.Target))
{
Text = "Locate Cargo Shuttle",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Clothing/Head/Soft/cargosoft.rsi/icon.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Clothing/Head/Soft/cargosoft.rsi"), "icon"),
Act = () =>
{
var shuttle = Comp<StationCargoOrderDatabaseComponent>(args.Target).Shuttle;
{
Text = "Refill Battery",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/fill_battery.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/fill_battery.png")),
Act = () =>
{
foreach (var ent in childEnum)
{
Text = "Drain Battery",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/drain_battery.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/drain_battery.png")),
Act = () =>
{
foreach (var ent in childEnum)
{
Text = "Infinite Battery",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/infinite_battery.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/infinite_battery.png")),
Act = () =>
{
// this kills the sloth
{
Text = "Halt Movement",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/halt.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/halt.png")),
Act = () =>
{
_physics.SetLinearVelocity(args.Target, Vector2.Zero, body: physics);
{
Text = "Unpause Map",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/play.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/play.png")),
Act = () =>
{
_mapManager.SetMapPaused(map.WorldMap, false);
{
Text = "Pause Map",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/pause.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/pause.png")),
Act = () =>
{
_mapManager.SetMapPaused(map.WorldMap, true);
{
Text = "Snap Joints",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Interface/AdminActions/snap_joints.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/AdminActions/snap_joints.png")),
Act = () =>
{
_jointSystem.ClearJoints(joints);
{
Text = "Make Minigun",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Objects/Weapons/Guns/HMGs/minigun.rsi/icon.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Weapons/Guns/HMGs/minigun.rsi"), "icon"),
Act = () =>
{
gun.FireRate = 15;
{
Text = "Set Bullet Amount",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Objects/Fun/caps.rsi/mag-6.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Objects/Fun/caps.rsi"), "mag-6"),
Act = () =>
{
_quickDialog.OpenDialog(player, "Set Bullet Amount", $"Amount (max {ballisticAmmo.Capacity}):", (int amount) =>
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
+using Robust.Shared.Utility;
using static Content.Shared.Configurable.ConfigurationComponent;
namespace Content.Server.Administration.Systems
Verb verb = new();
verb.Text = Loc.GetString("ahelp-verb-get-data-text");
verb.Category = VerbCategory.Admin;
- verb.IconTexture = "/Textures/Interface/gavel.svg.192dpi.png";
+ verb.Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/gavel.svg.192dpi.png"));
verb.Act = () =>
_console.RemoteExecuteCommand(player, $"openahelp \"{targetActor.PlayerSession.UserId}\"");
verb.Impact = LogImpact.Low;
Verb prayerVerb = new();
prayerVerb.Text = Loc.GetString("prayer-verbs-subtle-message");
prayerVerb.Category = VerbCategory.Admin;
- prayerVerb.IconTexture = "/Textures/Interface/pray.svg.png";
+ prayerVerb.Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/pray.svg.png"));
prayerVerb.Act = () =>
{
_quickDialog.OpenDialog(player, "Subtle Message", "Message", "Popup Message", (string message, string popupMessage) =>
? Loc.GetString("admin-verbs-unfreeze")
: Loc.GetString("admin-verbs-freeze"),
Category = VerbCategory.Admin,
- IconTexture = "/Textures/Interface/VerbIcons/snow.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/snow.svg.192dpi.png")),
Act = () =>
{
if (frozen)
{
Text = Loc.GetString("admin-verbs-teleport-to"),
Category = VerbCategory.Admin,
- IconTexture = "/Textures/Interface/VerbIcons/open.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/open.svg.192dpi.png")),
Act = () => _console.ExecuteCommand(player, $"tpto {args.Target}"),
Impact = LogImpact.Low
});
{
Text = Loc.GetString("admin-verbs-teleport-here"),
Category = VerbCategory.Admin,
- IconTexture = "/Textures/Interface/VerbIcons/close.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/close.svg.192dpi.png")),
Act = () => _console.ExecuteCommand(player, $"tpto {args.Target} {args.User}"),
Impact = LogImpact.Low
});
{
Text = Loc.GetString("delete-verb-get-data-text"),
Category = VerbCategory.Debug,
- IconTexture = "/Textures/Interface/VerbIcons/delete_transparent.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/delete_transparent.svg.192dpi.png")),
Act = () => EntityManager.DeleteEntity(args.Target),
Impact = LogImpact.Medium,
ConfirmationPopup = true
{
Text = Loc.GetString("rejuvenate-verb-get-data-text"),
Category = VerbCategory.Debug,
- IconTexture = "/Textures/Interface/VerbIcons/rejuvenate.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/rejuvenate.svg.192dpi.png")),
Act = () => RejuvenateCommand.PerformRejuvenate(args.Target),
Impact = LogImpact.Medium
};
{
Text = Loc.GetString("make-sentient-verb-get-data-text"),
Category = VerbCategory.Debug,
- IconTexture = "/Textures/Interface/VerbIcons/sentient.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/sentient.svg.192dpi.png")),
Act = () => MakeSentientCommand.MakeSentient(args.Target, EntityManager),
Impact = LogImpact.Medium
};
{
Text = Loc.GetString("set-outfit-verb-get-data-text"),
Category = VerbCategory.Debug,
- IconTexture = "/Textures/Interface/VerbIcons/outfit.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/outfit.svg.192dpi.png")),
Act = () => _euiManager.OpenEui(new SetOutfitEui(args.Target), player),
Impact = LogImpact.Medium
};
{
Text = Loc.GetString("in-range-unoccluded-verb-get-data-text"),
Category = VerbCategory.Debug,
- IconTexture = "/Textures/Interface/VerbIcons/information.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/information.svg.192dpi.png")),
Act = () =>
{
var message = args.User.InRangeUnOccluded(args.Target)
{
Text = Loc.GetString("tube-direction-verb-get-data-text"),
Category = VerbCategory.Debug,
- IconTexture = "/Textures/Interface/VerbIcons/information.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/information.svg.192dpi.png")),
Act = () => tube.PopupDirections(args.User)
};
args.Verbs.Add(verb);
Verb verb = new()
{
Text = Loc.GetString("configure-verb-get-data-text"),
- IconTexture = "/Textures/Interface/VerbIcons/settings.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/settings.svg.192dpi.png")),
Category = VerbCategory.Debug,
Act = () => _uiSystem.TryOpen(args.Target, ConfigurationUiKey.Key, actor.PlayerSession)
};
{
Text = Loc.GetString("edit-solutions-verb-get-data-text"),
Category = VerbCategory.Debug,
- IconTexture = "/Textures/Interface/VerbIcons/spill.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/spill.svg.192dpi.png")),
Act = () => OpenEditSolutionsEui(player, args.Target),
Impact = LogImpact.Medium // maybe high depending on WHAT reagents they add...
};
using Content.Server.Popups;
using Content.Server.DoAfter;
using Content.Shared.DoAfter;
+using Robust.Shared.Utility;
namespace Content.Server.Body.Systems;
ToggleInternals(uid, args.User, false, component);
},
Message = Loc.GetString("action-description-internals-toggle"),
- IconTexture = "/Textures/Interface/VerbIcons/dot.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/dot.svg.192dpi.png")),
Text = Loc.GetString("action-name-internals-toggle"),
};
using Content.Shared.Vehicle.Components;
using Content.Shared.Verbs;
using Robust.Shared.GameStates;
+using Robust.Shared.Utility;
namespace Content.Server.Buckle.Systems;
{
Act = () => TryUnbuckle(uid, args.User, buckle: component),
Text = Loc.GetString("verb-categories-unbuckle"),
- IconTexture = "/Textures/Interface/VerbIcons/unbuckle.svg.192dpi.png"
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/unbuckle.svg.192dpi.png"))
};
if (args.Target == args.User && args.Using == null)
using Robust.Server.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
+using Robust.Shared.Utility;
namespace Content.Server.Clothing.Systems;
args.Verbs.Add(new InteractionVerb()
{
Text = Loc.GetString("chameleon-component-verb-text"),
- IconTexture = "/Textures/Interface/VerbIcons/settings.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/settings.svg.192dpi.png")),
Act = () => TryOpenUi(uid, args.User, component)
});
}
using Content.Shared.Popups;
using Content.Shared.Verbs;
using Robust.Shared.Player;
+using Robust.Shared.Utility;
namespace Content.Server.Construction
{
//verb.Category = VerbCategories.Construction;
//TODO VERBS add more construction verbs? Until then, removing construction category
verb.Text = Loc.GetString("deconstructible-verb-begin-deconstruct");
- verb.IconTexture = "/Textures/Interface/hammer_scaled.svg.192dpi.png";
+ verb.Icon = new SpriteSpecifier.Texture(
+ new ResourcePath("/Textures/Interface/hammer_scaled.svg.192dpi.png"));
verb.Act = () =>
{
Text = Loc.GetString("machine-upgrade-examinable-verb-text"),
Message = Loc.GetString("machine-upgrade-examinable-verb-message"),
Category = VerbCategory.Examine,
- IconTexture = "/Textures/Interface/VerbIcons/pickup.svg.192dpi.png"
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/pickup.svg.192dpi.png"))
};
args.Verbs.Add(verb);
Category = VerbCategory.Examine,
Disabled = !detailsRange,
Message = Loc.GetString("detail-examinable-verb-disabled"),
- IconTexture = "/Textures/Interface/VerbIcons/examine.svg.192dpi.png"
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/examine.svg.192dpi.png"))
};
args.Verbs.Add(verb);
using System.Linq;
using Content.Server.DeviceNetwork.Components;
-using Content.Server.UserInterface;
using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
using Content.Shared.Database;
using Content.Shared.DeviceNetwork;
using Content.Shared.Interaction;
-using Content.Shared.Interaction.Events;
-using Content.Shared.Movement;
using Content.Shared.Popups;
using Content.Shared.Verbs;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
-using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.Player;
+using Robust.Shared.Utility;
namespace Content.Server.DeviceNetwork.Systems;
foreach (var component in EntityManager.EntityQuery<NetworkConfiguratorComponent>())
{
+ var uid = component.Owner;
+
if (component.ActiveDeviceList != null && EntityManager.EntityExists(component.ActiveDeviceList.Value) &&
- _interactionSystem.InRangeUnobstructed(component.Owner, component.ActiveDeviceList.Value))
+ _interactionSystem.InRangeUnobstructed(uid, component.ActiveDeviceList.Value))
{
- return;
+ continue;
}
//The network configurator is a handheld device. There can only ever be an ui session open for the player holding the device.
- _uiSystem.GetUiOrNull(component.Owner, NetworkConfiguratorUiKey.Configure)?.CloseAll();
+ _uiSystem.GetUiOrNull(uid, NetworkConfiguratorUiKey.Configure)?.CloseAll();
}
}
private void OnComponentRemoved(EntityUid uid, DeviceListComponent component, ComponentRemove args)
{
- _uiSystem.GetUiOrNull(component.Owner, NetworkConfiguratorUiKey.Configure)?.CloseAll();
+ _uiSystem.GetUiOrNull(uid, NetworkConfiguratorUiKey.Configure)?.CloseAll();
}
#region Interactions
UtilityVerb verb = new()
{
Text = Loc.GetString(isDeviceList ? "network-configurator-configure" : "network-configurator-save-device"),
- IconTexture = isDeviceList ? "/Textures/Interface/VerbIcons/settings.svg.192dpi.png" : "/Textures/Interface/VerbIcons/in.svg.192dpi.png",
+ Icon = isDeviceList ?
+ new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/settings.svg.192dpi.png")) :
+ new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/in.svg.192dpi.png")),
Act = () => OnUsed(uid, component, args.Target, args.User),
Impact = LogImpact.Low
};
AlternativeVerb verb = new()
{
Text = Loc.GetString("network-configurator-save-device"),
- IconTexture = "/Textures/Interface/VerbIcons/in.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/in.svg.192dpi.png")),
Act = () => TryAddNetworkDevice(args.Target, args.Using.Value, args.User),
Impact = LogImpact.Low
};
using Robust.Shared.Physics.Components;
using Robust.Shared.Random;
using Robust.Shared.Map.Components;
+using Robust.Shared.Utility;
namespace Content.Server.Disposal.Unit.EntitySystems
{
AlternativeVerb flushVerb = new();
flushVerb.Act = () => Engage(uid, component);
flushVerb.Text = Loc.GetString("disposal-flush-verb-get-data-text");
- flushVerb.IconTexture = "/Textures/Interface/VerbIcons/delete_transparent.svg.192dpi.png";
+ flushVerb.Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/delete_transparent.svg.192dpi.png"));
flushVerb.Priority = 1;
args.Verbs.Add(flushVerb);
using Content.Shared.Verbs;
using JetBrains.Annotations;
using Robust.Shared.Containers;
+using Robust.Shared.Utility;
namespace Content.Server.Foldable
{
args.Cancelled = true;
}
- public bool TryToggleFold(FoldableComponent comp)
+ public bool TryToggleFold(EntityUid uid, FoldableComponent comp)
{
- return TrySetFolded(comp, !comp.IsFolded);
+ return TrySetFolded(uid, comp, !comp.IsFolded);
}
public bool CanToggleFold(EntityUid uid, FoldableComponent? fold = null)
/// <summary>
/// Try to fold/unfold
/// </summary>
- /// <param name="comp"></param>
- /// <param name="state">Folded state we want</param>
- /// <returns>True if successful</returns>
- public bool TrySetFolded(FoldableComponent comp, bool state)
+ public bool TrySetFolded(EntityUid uid, FoldableComponent comp, bool state)
{
if (state == comp.IsFolded)
return false;
- if (!CanToggleFold(comp.Owner, comp))
+ if (!CanToggleFold(uid, comp))
return false;
- SetFolded(comp, state);
+ SetFolded(uid, comp, state);
return true;
}
/// </summary>
/// <param name="component"></param>
/// <param name="folded">If true, the component will become folded, else unfolded</param>
- public override void SetFolded(FoldableComponent component, bool folded)
+ public override void SetFolded(EntityUid uid, FoldableComponent component, bool folded)
{
- base.SetFolded(component, folded);
+ base.SetFolded(uid, component, folded);
// You can't buckle an entity to a folded object
- _buckle.StrapSetEnabled(component.Owner, !component.IsFolded);
+ _buckle.StrapSetEnabled(uid, !component.IsFolded);
}
public void OnStoreThisAttempt(EntityUid uid, FoldableComponent comp, ref StoreMobInItemContainerAttemptEvent args)
AlternativeVerb verb = new()
{
- Act = () => TryToggleFold(component),
+ Act = () => TryToggleFold(uid, component),
Text = component.IsFolded ? Loc.GetString("unfold-verb") : Loc.GetString("fold-verb"),
- IconTexture = "/Textures/Interface/VerbIcons/fold.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/fold.svg.192dpi.png")),
// If the object is unfolded and they click it, they want to fold it, if it's folded, they want to pick it up
Priority = component.IsFolded ? 0 : 2,
Category = VerbCategory.Examine,
Disabled = !detailsRange,
Message = Loc.GetString("health-examinable-verb-disabled"),
- IconTexture = "/Textures/Interface/VerbIcons/rejuvenate.svg.192dpi.png"
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/rejuvenate.svg.192dpi.png"))
};
args.Verbs.Add(verb);
using Content.Shared.Verbs;
using Robust.Server.GameObjects;
using Robust.Server.Player;
+using Robust.Shared.Utility;
namespace Content.Server.Humanoid;
{
Text = "Modify markings",
Category = VerbCategory.Tricks,
- IconTexture = "/Textures/Mobs/Customization/reptilian_parts.rsi/tail_smooth.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Mobs/Customization/reptilian_parts.rsi"), "tail_smooth"),
Act = () =>
{
_uiSystem.TryOpen(uid, HumanoidMarkingModifierKey.Key, actor.PlayerSession);
-using Content.Server.Body.Systems;
+using Content.Server.Body.Systems;
using Content.Server.DoAfter;
using Content.Server.Kitchen.Components;
using Content.Shared.Body.Components;
using Content.Shared.Mobs.Systems;
using Robust.Server.Containers;
using Robust.Shared.Random;
+using Robust.Shared.Utility;
namespace Content.Server.Kitchen.EntitySystems;
},
Message = message,
Disabled = disabled,
- IconTexture = "/Textures/Interface/VerbIcons/cutlery.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/cutlery.svg.192dpi.png")),
Text = Loc.GetString("butcherable-verb-name"),
};
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Player;
+using Robust.Shared.Utility;
namespace Content.Server.Light.EntitySystems
{
ActivationVerb verb = new()
{
Text = Loc.GetString("expendable-light-start-verb"),
- IconTexture = "/Textures/Interface/VerbIcons/light.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/light.svg.192dpi.png")),
Act = () => TryActivate(component)
};
args.Verbs.Add(verb);
EntInsertedIntoContainerMessage args)
{
// Not guaranteed to be the correct container for our slot, I don't care.
- UpdateLevel(component);
+ UpdateLevel(uid, component);
}
private void OnEntRemoved(
EntRemovedFromContainerMessage args)
{
// Ditto above
- UpdateLevel(component);
+ UpdateLevel(uid, component);
}
private void OnGetActions(EntityUid uid, HandheldLightComponent component, GetItemActionsEvent args)
return;
if (component.Activated)
- TurnOff(component);
+ TurnOff(uid, component);
else
- TurnOn(args.Performer, component);
+ TurnOn(args.Performer, uid, component);
args.Handled = true;
}
private void OnGetState(EntityUid uid, HandheldLightComponent component, ref ComponentGetState args)
{
- args.State = new HandheldLightComponent.HandheldLightComponentState(component.Activated, GetLevel(component));
+ args.State = new HandheldLightComponent.HandheldLightComponentState(component.Activated, GetLevel(uid, component));
}
- private byte? GetLevel(HandheldLightComponent component)
+ private byte? GetLevel(EntityUid uid, HandheldLightComponent component)
{
// Curently every single flashlight has the same number of levels for status and that's all it uses the charge for
// Thus we'll just check if the level changes.
- if (!_powerCell.TryGetBatteryFromSlot(component.Owner, out var battery))
+ if (!_powerCell.TryGetBatteryFromSlot(uid, out var battery))
return null;
if (MathHelper.CloseToPercent(battery.CurrentCharge, 0) || component.Wattage > battery.CurrentCharge)
private void OnActivate(EntityUid uid, HandheldLightComponent component, ActivateInWorldEvent args)
{
- if (args.Handled) return;
+ if (args.Handled)
+ return;
- if (ToggleStatus(args.User, component))
+ if (ToggleStatus(args.User, uid, component))
args.Handled = true;
}
/// Illuminates the light if it is not active, extinguishes it if it is active.
/// </summary>
/// <returns>True if the light's status was toggled, false otherwise.</returns>
- public bool ToggleStatus(EntityUid user, HandheldLightComponent component)
+ public bool ToggleStatus(EntityUid user, EntityUid uid, HandheldLightComponent component)
{
- return component.Activated ? TurnOff(component) : TurnOn(user, component);
+ return component.Activated ? TurnOff(uid, component) : TurnOn(user, uid, component);
}
private void OnExamine(EntityUid uid, HandheldLightComponent component, ExaminedEvent args)
foreach (var handheld in _activeLights)
{
+ var uid = handheld.Owner;
+
if (handheld.Deleted)
{
toRemove.Add(handheld);
continue;
}
- if (Paused(handheld.Owner)) continue;
- TryUpdate(handheld, frameTime);
+ if (Paused(uid)) continue;
+ TryUpdate(uid, handheld, frameTime);
}
foreach (var light in toRemove)
private void AddToggleLightVerb(EntityUid uid, HandheldLightComponent component, GetVerbsEvent<ActivationVerb> args)
{
- if (!args.CanAccess || !args.CanInteract) return;
+ if (!args.CanAccess || !args.CanInteract)
+ return;
ActivationVerb verb = new()
{
Text = Loc.GetString("verb-common-toggle-light"),
- IconTexture = "/Textures/Interface/VerbIcons/light.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/light.svg.192dpi.png")),
Act = component.Activated
- ? () => TurnOff(component)
- : () => TurnOn(args.User, component)
+ ? () => TurnOff(uid, component)
+ : () => TurnOn(args.User, uid, component)
};
args.Verbs.Add(verb);
}
- public bool TurnOff(HandheldLightComponent component, bool makeNoise = true)
+ public bool TurnOff(EntityUid uid, HandheldLightComponent component, bool makeNoise = true)
{
- if (!component.Activated || !TryComp<PointLightComponent>(component.Owner, out var pointLightComponent))
+ if (!component.Activated || !TryComp<PointLightComponent>(uid, out var pointLightComponent))
{
return false;
}
pointLightComponent.Enabled = false;
- SetActivated(component.Owner, false, component, makeNoise);
+ SetActivated(uid, false, component, makeNoise);
component.Level = null;
_activeLights.Remove(component);
return true;
}
- public bool TurnOn(EntityUid user, HandheldLightComponent component)
+ public bool TurnOn(EntityUid user, EntityUid uid, HandheldLightComponent component)
{
- if (component.Activated || !TryComp<PointLightComponent>(component.Owner, out var pointLightComponent))
+ if (component.Activated || !TryComp<PointLightComponent>(uid, out var pointLightComponent))
{
return false;
}
- if (!_powerCell.TryGetBatteryFromSlot(component.Owner, out var battery) &&
- !TryComp(component.Owner, out battery))
+ if (!_powerCell.TryGetBatteryFromSlot(uid, out var battery) &&
+ !TryComp(uid, out battery))
{
- _audio.PlayPvs(_audio.GetSound(component.TurnOnFailSound), component.Owner);
- _popup.PopupEntity(Loc.GetString("handheld-light-component-cell-missing-message"), component.Owner, user);
+ _audio.PlayPvs(_audio.GetSound(component.TurnOnFailSound), uid);
+ _popup.PopupEntity(Loc.GetString("handheld-light-component-cell-missing-message"), uid, user);
return false;
}
// Simple enough.
if (component.Wattage > battery.CurrentCharge)
{
- _audio.PlayPvs(_audio.GetSound(component.TurnOnFailSound), component.Owner);
- _popup.PopupEntity(Loc.GetString("handheld-light-component-cell-dead-message"), component.Owner, user);
+ _audio.PlayPvs(_audio.GetSound(component.TurnOnFailSound), uid);
+ _popup.PopupEntity(Loc.GetString("handheld-light-component-cell-dead-message"), uid, user);
return false;
}
pointLightComponent.Enabled = true;
- SetActivated(component.Owner, true, component, true);
+ SetActivated(uid, true, component, true);
_activeLights.Add(component);
return true;
}
- public void TryUpdate(HandheldLightComponent component, float frameTime)
+ public void TryUpdate(EntityUid uid, HandheldLightComponent component, float frameTime)
{
- if (!_powerCell.TryGetBatteryFromSlot(component.Owner, out var battery) &&
- !TryComp(component.Owner, out battery))
+ if (!_powerCell.TryGetBatteryFromSlot(uid, out var battery) &&
+ !TryComp(uid, out battery))
{
- TurnOff(component, false);
+ TurnOff(uid, component, false);
return;
}
- var appearanceComponent = EntityManager.GetComponent<AppearanceComponent>(component.Owner);
+ var appearanceComponent = EntityManager.GetComponentOrNull<AppearanceComponent>(uid);
var fraction = battery.CurrentCharge / battery.MaxCharge;
if (fraction >= 0.30)
{
- _appearance.SetData(component.Owner, HandheldLightVisuals.Power, HandheldLightPowerStates.FullPower, appearanceComponent);
+ _appearance.SetData(uid, HandheldLightVisuals.Power, HandheldLightPowerStates.FullPower, appearanceComponent);
}
else if (fraction >= 0.10)
{
- _appearance.SetData(component.Owner, HandheldLightVisuals.Power, HandheldLightPowerStates.LowPower, appearanceComponent);
+ _appearance.SetData(uid, HandheldLightVisuals.Power, HandheldLightPowerStates.LowPower, appearanceComponent);
}
else
{
- _appearance.SetData(component.Owner, HandheldLightVisuals.Power, HandheldLightPowerStates.Dying, appearanceComponent);
+ _appearance.SetData(uid, HandheldLightVisuals.Power, HandheldLightPowerStates.Dying, appearanceComponent);
}
if (component.Activated && !battery.TryUseCharge(component.Wattage * frameTime))
- TurnOff(component, false);
+ TurnOff(uid, component, false);
- UpdateLevel(component);
+ UpdateLevel(uid, component);
}
- private void UpdateLevel(HandheldLightComponent comp)
+ private void UpdateLevel(EntityUid uid, HandheldLightComponent comp)
{
- var level = GetLevel(comp);
+ var level = GetLevel(uid, comp);
if (level == comp.Level)
return;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Player;
+using Robust.Shared.Utility;
namespace Content.Server.Light.EntitySystems
{
ActivationVerb verb = new();
verb.Text = Loc.GetString("toggle-flashlight-verb-get-data-text");
- verb.IconTexture = "/Textures/Interface/VerbIcons/light.svg.192dpi.png";
+ verb.Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/light.svg.192dpi.png"));
verb.Act = () => ToggleLight(uid, component);
verb.Priority = -1; // For things like PDA's, Open-UI and other verbs that should be higher priority.
using Content.Shared.MachineLinking;
using Content.Shared.Verbs;
using Robust.Server.GameObjects;
+using Robust.Shared.Utility;
namespace Content.Server.MachineLinking.System
{
Category = VerbCategory.Lever,
Message = Loc.GetString("two-way-lever-cant"),
Disabled = component.State == TwoWayLeverState.Left,
- IconTexture = $"/Textures/Interface/VerbIcons/{_leftToggleImage}",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath($"/Textures/Interface/VerbIcons/{_leftToggleImage}")),
Text = Loc.GetString("two-way-lever-left"),
};
Category = VerbCategory.Lever,
Message = Loc.GetString("two-way-lever-cant"),
Disabled = component.State == TwoWayLeverState.Right,
- IconTexture = $"/Textures/Interface/VerbIcons/{_rightToggleImage}",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath($"/Textures/Interface/VerbIcons/{_rightToggleImage}")),
Text = Loc.GetString("two-way-lever-right"),
};
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.DoAfter;
+using Robust.Shared.Utility;
namespace Content.Server.Medical
{
StartListening(component.Stethoscope, uid, args.Target, stetho); // start doafter
},
Text = Loc.GetString("stethoscope-verb"),
- IconTexture = "Clothing/Neck/Misc/stethoscope.rsi/icon.png",
+ Icon = new SpriteSpecifier.Rsi(new ResourcePath("Clothing/Neck/Misc/stethoscope.rsi"), "icon"),
Priority = 2
};
args.Verbs.Add(verb);
{
TryDrink(ev.User, ev.User, component, uid);
},
- IconTexture = "/Textures/Interface/VerbIcons/drink.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/drink.svg.192dpi.png")),
Text = Loc.GetString("drink-system-verb-drink"),
Priority = 2
};
{
TryFeed(ev.User, ev.User, uid, component);
},
- IconTexture = "/Textures/Interface/VerbIcons/cutlery.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/cutlery.svg.192dpi.png")),
Text = Loc.GetString("food-system-verb-eat"),
Priority = -1
};
Message = Loc.GetString("cable-multitool-system-verb-tooltip"),
Text = Loc.GetString("cable-multitool-system-verb-name"),
Category = VerbCategory.Examine,
- IconTexture = "/Textures/Interface/VerbIcons/zap.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/zap.svg.192dpi.png")),
Act = () =>
{
var markup = FormattedMessage.FromMarkup(GenerateCableMarkup(uid));
using Robust.Shared.Audio;
using Content.Server.Administration.Managers;
using Content.Shared.Administration;
+using Robust.Shared.Utility;
namespace Content.Server.Power.EntitySystems
{
{
Text = Loc.GetString("verb-debug-toggle-need-power"),
Category = VerbCategory.Debug,
- IconTexture = "/Textures/Interface/VerbIcons/smite.svg.192dpi.png", // "smite" is a lightning bolt
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/smite.svg.192dpi.png")), // "smite" is a lightning bolt
Act = () => component.NeedsPower = !component.NeedsPower
});
}
{
TogglePower(uid, user: args.User);
},
- IconTexture = "/Textures/Interface/VerbIcons/Spare/poweronoff.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/Spare/poweronoff.svg.192dpi.png")),
Text = Loc.GetString("power-switch-component-toggle-verb"),
Priority = -3
};
-namespace Content.Server.Prayer
+using Robust.Shared.Utility;
+
+namespace Content.Server.Prayer
{
/// <summary>
/// Allows an entity to be prayed on in the context menu
/// </summary>
[DataField("verbImage")]
[ViewVariables(VVAccess.ReadOnly)]
- public string VerbImage = "/Textures/Interface/pray.svg.png";
+ public SpriteSpecifier? VerbImage = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/pray.svg.png"));
}
}
var prayerVerb = new ActivationVerb
{
Text = Loc.GetString(comp.Verb),
- IconTexture = comp.VerbImage == "" ? null : comp.VerbImage,
+ Icon = comp.VerbImage,
Act = () =>
{
if (comp.BibleUserOnly && !EntityManager.TryGetComponent<BibleUserComponent>(args.User, out var bibleUser))
+using Content.Server.Popups;
using Content.Shared.Popups;
using Content.Shared.Rotatable;
using Content.Shared.Verbs;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Components;
+using Robust.Shared.Utility;
namespace Content.Server.Rotatable
{
/// </summary>
public sealed class RotatableSystem : EntitySystem
{
+ [Dependency] private readonly PopupSystem _popup = default!;
+
public override void Initialize()
{
SubscribeLocalEvent<FlippableComponent, GetVerbsEvent<Verb>>(AddFlipVerb);
private void AddFlipVerb(EntityUid uid, FlippableComponent component, GetVerbsEvent<Verb> args)
{
- if (!args.CanAccess || !args.CanInteract || component.MirrorEntity == null)
+ if (!args.CanAccess || !args.CanInteract)
return;
- Verb verb = new();
- verb.Act = () => TryFlip(component, args.User);
- verb.Text = Loc.GetString("flippable-verb-get-data-text");
- verb.DoContactInteraction = true;
+ Verb verb = new()
+ {
+ Act = () => TryFlip(uid, component, args.User),
+ Text = Loc.GetString("flippable-verb-get-data-text"),
+ DoContactInteraction = true
+ };
// TODO VERB ICONS Add Uno reverse card style icon?
args.Verbs.Add(verb);
}
// Check if the object is anchored, and whether we are still allowed to rotate it.
if (!component.RotateWhileAnchored &&
- EntityManager.TryGetComponent(component.Owner, out PhysicsComponent? physics) &&
+ EntityManager.TryGetComponent(uid, out PhysicsComponent? physics) &&
physics.BodyType == BodyType.Static)
return;
Verb resetRotation = new ()
{
DoContactInteraction = true,
- Act = () => EntityManager.GetComponent<TransformComponent>(component.Owner).LocalRotation = Angle.Zero,
+ Act = () => EntityManager.GetComponent<TransformComponent>(uid).LocalRotation = Angle.Zero,
Category = VerbCategory.Rotate,
- IconTexture = "/Textures/Interface/VerbIcons/refresh.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/refresh.svg.192dpi.png")),
Text = "Reset",
Priority = -2, // show CCW, then CW, then reset
CloseMenu = false,
// rotate clockwise
Verb rotateCW = new()
{
- Act = () => EntityManager.GetComponent<TransformComponent>(component.Owner).LocalRotation -= component.Increment,
+ Act = () => EntityManager.GetComponent<TransformComponent>(uid).LocalRotation -= component.Increment,
Category = VerbCategory.Rotate,
- IconTexture = "/Textures/Interface/VerbIcons/rotate_cw.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/rotate_cw.svg.192dpi.png")),
Priority = -1,
CloseMenu = false, // allow for easy double rotations.
};
// rotate counter-clockwise
Verb rotateCCW = new()
{
- Act = () => EntityManager.GetComponent<TransformComponent>(component.Owner).LocalRotation += component.Increment,
+ Act = () => EntityManager.GetComponent<TransformComponent>(uid).LocalRotation += component.Increment,
Category = VerbCategory.Rotate,
- IconTexture = "/Textures/Interface/VerbIcons/rotate_ccw.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/rotate_ccw.svg.192dpi.png")),
Priority = 0,
CloseMenu = false, // allow for easy double rotations.
};
/// <summary>
/// Replace a flippable entity with it's flipped / mirror-symmetric entity.
/// </summary>
- public void TryFlip(FlippableComponent component, EntityUid user)
+ public void TryFlip(EntityUid uid, FlippableComponent component, EntityUid user)
{
- if (EntityManager.TryGetComponent(component.Owner, out PhysicsComponent? physics) &&
+ if (EntityManager.TryGetComponent(uid, out PhysicsComponent? physics) &&
physics.BodyType == BodyType.Static)
{
- component.Owner.PopupMessage(user, Loc.GetString("flippable-component-try-flip-is-stuck"));
+ _popup.PopupEntity(Loc.GetString("flippable-component-try-flip-is-stuck"), uid, user);
return;
}
- var oldTransform = EntityManager.GetComponent<TransformComponent>(component.Owner);
+ var oldTransform = EntityManager.GetComponent<TransformComponent>(uid);
var entity = EntityManager.SpawnEntity(component.MirrorEntity, oldTransform.Coordinates);
var newTransform = EntityManager.GetComponent<TransformComponent>(entity);
newTransform.LocalRotation = oldTransform.LocalRotation;
newTransform.Anchored = false;
- EntityManager.DeleteEntity(component.Owner);
+ EntityManager.DeleteEntity(uid);
}
}
}
using Robust.Server.GameObjects;
using Robust.Shared.Containers;
using Robust.Shared.Player;
+using Robust.Shared.Utility;
namespace Content.Server.Sticky.Systems;
{
DoContactInteraction = true,
Text = Loc.GetString("comp-sticky-unstick-verb-text"),
- IconTexture = "/Textures/Interface/VerbIcons/eject.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/eject.svg.192dpi.png")),
Act = () => StartUnsticking(uid, args.User, component)
});
}
using Content.Shared.Storage;
using Robust.Shared.Containers;
using Robust.Shared.Random;
+using Robust.Shared.Utility;
namespace Content.Server.Storage.EntitySystems
{
StartDoAfter(uid, null, args.User, dumpable);//Had multiplier of 0.6f
},
Text = Loc.GetString("dump-verb-name"),
- IconTexture = "/Textures/Interface/VerbIcons/drop.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/drop.svg.192dpi.png")),
};
args.Verbs.Add(verb);
}
if (component.Open)
{
verb.Text = Loc.GetString("verb-common-close");
- verb.IconTexture = "/Textures/Interface/VerbIcons/close.svg.192dpi.png";
+ verb.Icon = new SpriteSpecifier.Texture(
+ new ResourcePath("/Textures/Interface/VerbIcons/close.svg.192dpi.png"));
}
else
{
verb.Text = Loc.GetString("verb-common-open");
- verb.IconTexture = "/Textures/Interface/VerbIcons/open.svg.192dpi.png";
+ verb.Icon = new SpriteSpecifier.Texture(
+ new ResourcePath("/Textures/Interface/VerbIcons/open.svg.192dpi.png"));
}
verb.Act = () => _entityStorage.ToggleOpen(args.User, args.Target, component);
args.Verbs.Add(verb);
if (uiOpen)
{
verb.Text = Loc.GetString("verb-common-close-ui");
- verb.IconTexture = "/Textures/Interface/VerbIcons/close.svg.192dpi.png";
+ verb.Icon = new SpriteSpecifier.Texture(
+ new ResourcePath("/Textures/Interface/VerbIcons/close.svg.192dpi.png"));
}
else
{
verb.Text = Loc.GetString("verb-common-open-ui");
- verb.IconTexture = "/Textures/Interface/VerbIcons/open.svg.192dpi.png";
+ verb.Icon = new SpriteSpecifier.Texture(
+ new ResourcePath("/Textures/Interface/VerbIcons/open.svg.192dpi.png"));
}
args.Verbs.Add(verb);
}
using Content.Shared.Ensnaring.Components;
using Content.Shared.Interaction;
using Content.Shared.Strip;
+using Robust.Shared.Utility;
namespace Content.Server.Strip
{
Verb verb = new()
{
Text = Loc.GetString("strip-verb-get-data-text"),
- IconTexture = "/Textures/Interface/VerbIcons/outfit.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/outfit.svg.192dpi.png")),
Act = () => StartOpeningStripper(args.User, component, true),
};
args.Verbs.Add(verb);
ExamineVerb verb = new()
{
Text = Loc.GetString("strip-verb-get-data-text"),
- IconTexture = "/Textures/Interface/VerbIcons/outfit.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/outfit.svg.192dpi.png")),
Act = () => StartOpeningStripper(args.User, component, true),
Category = VerbCategory.Examine,
};
using Robust.Server.Player;
using Robust.Shared.Enums;
using Robust.Shared.Map;
+using Robust.Shared.Utility;
namespace Content.Server.Tabletop
{
ActivationVerb verb = new();
verb.Text = Loc.GetString("tabletop-verb-play-game");
- verb.IconTexture = "/Textures/Interface/VerbIcons/die.svg.192dpi.png";
+ verb.Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/die.svg.192dpi.png"));
verb.Act = () => OpenSessionFor(actor.PlayerSession, uid);
args.Verbs.Add(verb);
}
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Random;
+using Robust.Shared.Utility;
namespace Content.Server.Weapons.Melee;
Text = Loc.GetString("damage-examinable-verb-text"),
Message = Loc.GetString("damage-examinable-verb-message"),
Category = VerbCategory.Examine,
- IconTexture = "/Textures/Interface/VerbIcons/smite.svg.192dpi.png"
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/smite.svg.192dpi.png")),
};
args.Verbs.Add(verb);
using Content.Shared.Weapons.Ranged;
using Content.Shared.Weapons.Ranged.Components;
using Robust.Shared.Prototypes;
+using Robust.Shared.Utility;
namespace Content.Server.Weapons.Ranged.Systems;
private void UpdateShots(EntityUid uid, BatteryAmmoProviderComponent component)
{
- if (!TryComp<BatteryComponent>(uid, out var battery)) return;
- UpdateShots(component, battery);
+ if (!TryComp<BatteryComponent>(uid, out var battery))
+ return;
+
+ UpdateShots(uid, component, battery);
}
- private void UpdateShots(BatteryAmmoProviderComponent component, BatteryComponent battery)
+ private void UpdateShots(EntityUid uid, BatteryAmmoProviderComponent component, BatteryComponent battery)
{
var shots = (int) (battery.CurrentCharge / component.FireCost);
var maxShots = (int) (battery.MaxCharge / component.FireCost);
component.Shots = shots;
component.Capacity = maxShots;
- UpdateBatteryAppearance(component.Owner, component);
+ UpdateBatteryAppearance(uid, component);
}
private void OnBatteryExaminableVerb(EntityUid uid, BatteryAmmoProviderComponent component, GetVerbsEvent<ExamineVerb> args)
Text = Loc.GetString("damage-examinable-verb-text"),
Message = Loc.GetString("damage-examinable-verb-message"),
Category = VerbCategory.Examine,
- IconTexture = "/Textures/Interface/VerbIcons/smite.svg.192dpi.png"
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/smite.svg.192dpi.png")),
};
args.Verbs.Add(verb);
protected override void TakeCharge(EntityUid uid, BatteryAmmoProviderComponent component)
{
- if (!TryComp<BatteryComponent>(uid, out var battery)) return;
+ if (!TryComp<BatteryComponent>(uid, out var battery))
+ return;
battery.CurrentCharge -= component.FireCost;
- UpdateShots(component, battery);
+ UpdateShots(uid, component, battery);
}
}
using Content.Shared.Verbs;
using Content.Shared.Weapons.Ranged.Components;
using Robust.Shared.Prototypes;
+using Robust.Shared.Utility;
namespace Content.Server.Weapons.Ranged.Systems;
Text = Loc.GetString("damage-examinable-verb-text"),
Message = Loc.GetString("damage-examinable-verb-message"),
Category = VerbCategory.Examine,
- IconTexture = "/Textures/Interface/VerbIcons/smite.svg.192dpi.png"
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/smite.svg.192dpi.png")),
};
args.Verbs.Add(verb);
using Robust.Shared.Containers;
using Robust.Shared.GameStates;
using Robust.Shared.Timing;
+using Robust.Shared.Utility;
namespace Content.Shared.Cabinet;
if (cabinet.Opened)
{
toggleVerb.Text = Loc.GetString("verb-common-close");
- toggleVerb.IconTexture = "/Textures/Interface/VerbIcons/close.svg.192dpi.png";
+ toggleVerb.Icon =
+ new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/close.svg.192dpi.png"));
}
else
{
toggleVerb.Text = Loc.GetString("verb-common-open");
- toggleVerb.IconTexture = "/Textures/Interface/VerbIcons/open.svg.192dpi.png";
+ toggleVerb.Icon =
+ new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/open.svg.192dpi.png"));
}
args.Verbs.Add(toggleVerb);
}
if (slot.InsertVerbText != null)
{
insertVerb.Text = Loc.GetString(slot.InsertVerbText);
- insertVerb.IconTexture = "/Textures/Interface/VerbIcons/insert.svg.192dpi.png";
+ insertVerb.Icon =
+ new SpriteSpecifier.Texture(
+ new ResourcePath("/Textures/Interface/VerbIcons/insert.svg.192dpi.png"));
}
else if(slot.EjectOnInteract)
{
// Inserting/ejecting is a primary interaction for this entity. Instead of using the insert
// category, we will use a single "Place <item>" verb.
insertVerb.Text = Loc.GetString("place-item-verb-text", ("subject", verbSubject));
- insertVerb.IconTexture = "/Textures/Interface/VerbIcons/drop.svg.192dpi.png";
+ insertVerb.Icon =
+ new SpriteSpecifier.Texture(
+ new ResourcePath("/Textures/Interface/VerbIcons/drop.svg.192dpi.png"));
}
else
{
Text = group.ContextText,
Message = group.HoverMessage,
Category = VerbCategory.Examine,
- IconTexture = group.Icon
+ Icon = new SpriteSpecifier.Texture(new ResourcePath(group.Icon)),
};
args.Verbs.Add(examineVerb);
Text = verbText,
Message = hoverMessage,
Category = VerbCategory.Examine,
- IconTexture = iconTexture
+ Icon = new SpriteSpecifier.Texture(new ResourcePath(iconTexture)),
};
verbsEvent.Verbs.Add(examineVerb);
return;
if (state.IsFolded != component.IsFolded)
- SetFolded(component, state.IsFolded);
+ SetFolded(uid, component, state.IsFolded);
}
private void OnFoldableInit(EntityUid uid, FoldableComponent component, ComponentInit args)
{
- SetFolded(component, component.IsFolded);
+ SetFolded(uid, component, component.IsFolded);
}
/// <summary>
/// Set the folded state of the given <see cref="FoldableComponent"/>
/// </summary>
- /// <param name="component"></param>
- /// <param name="folded">If true, the component will become folded, else unfolded</param>
- public virtual void SetFolded(FoldableComponent component, bool folded)
+ public virtual void SetFolded(EntityUid uid, FoldableComponent component, bool folded)
{
+ if (component.IsFolded == folded)
+ return;
+
component.IsFolded = folded;
Dirty(component);
- Appearance.SetData(component.Owner, FoldedVisuals.State, folded);
+ Appearance.SetData(uid, FoldedVisuals.State, folded);
}
private void OnInsertEvent(EntityUid uid, FoldableComponent component, ContainerGettingInsertedAttemptEvent args)
using Content.Shared.Movement.Events;
using Content.Shared.Verbs;
using Robust.Shared.Map;
+using Robust.Shared.Utility;
namespace Content.Shared.Follower;
}),
Impact = LogImpact.Low,
Text = Loc.GetString("verb-follow-text"),
- IconTexture = "/Textures/Interface/VerbIcons/open.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/open.svg.192dpi.png")),
};
ev.Verbs.Add(verb);
using Content.Shared.Verbs;
using Robust.Shared.Containers;
using Robust.Shared.GameStates;
+using Robust.Shared.Utility;
namespace Content.Shared.Item;
InteractionVerb verb = new();
verb.Act = () => _handsSystem.TryPickupAnyHand(args.User, args.Target, checkActionBlocker: false,
handsComp: args.Hands, item: component);
- verb.IconTexture = "/Textures/Interface/VerbIcons/pickup.svg.192dpi.png";
+ verb.Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/pickup.svg.192dpi.png"));
// if the item already in a container (that is not the same as the user's), then change the text.
// this occurs when the item is in their inventory or in an open backpack
using Robust.Shared.GameStates;
using Robust.Shared.Network;
using Robust.Shared.Timing;
+using Robust.Shared.Utility;
namespace Content.Shared.Lock;
() => TryUnlock(uid, args.User, component) :
() => TryLock(uid, args.User, component),
Text = Loc.GetString(component.Locked ? "toggle-lock-verb-unlock" : "toggle-lock-verb-lock"),
- IconTexture = component.Locked ? "/Textures/Interface/VerbIcons/unlock.svg.192dpi.png" : "/Textures/Interface/VerbIcons/lock.svg.192dpi.png"
+ Icon = component.Locked ?
+ new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/unlock.svg.192dpi.png")) :
+ new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/lock.svg.192dpi.png")),
};
args.Verbs.Add(verb);
}
/// <summary>
/// Sprite of the icon that the user sees on the verb button.
/// </summary>
- public SpriteSpecifier? Icon
- {
- get => _icon ??=
- IconTexture == null ? null : new SpriteSpecifier.Texture(new ResourcePath(IconTexture));
- set => _icon = value;
- }
- [NonSerialized]
- private SpriteSpecifier? _icon;
+ public SpriteSpecifier? Icon;
/// <summary>
/// Name of the category this button is under. Used to group verbs in the context menu.
/// </remarks>
public int Priority;
- /// <summary>
- /// Raw texture path used to load the <see cref="Icon"/> for displaying on the client.
- /// </summary>
- public string? IconTexture;
-
/// <summary>
/// If this is not null, and no icon or icon texture were specified, a sprite view of this entity will be
/// used as the icon for this verb.
}
// Finally, compare icon texture paths. Note that this matters for verbs that don't have any text (e.g., the rotate-verbs)
- return string.Compare(IconTexture, otherVerb.IconTexture, StringComparison.CurrentCulture);
+ return string.Compare(Icon?.ToString(), otherVerb.Icon?.ToString(), StringComparison.CurrentCulture);
}
/// <summary>
{
Act = () => SelectFire(component, nextMode, args.User),
Text = Loc.GetString("gun-selector-verb", ("mode", GetLocSelector(nextMode))),
- IconTexture = "/Textures/Interface/VerbIcons/fold.svg.192dpi.png",
+ Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/fold.svg.192dpi.png")),
};
args.Verbs.Add(verb);
sentMessage: prayer-popup-notify-centcom-sent
notifiactionPrefix: prayer-chat-notify-centcom
verb: prayer-verbs-call
- verbImage: ""
+ verbImage: null
- type: entity
parent: BaseHandheldInstrument
sentMessage: prayer-popup-notify-honkmother-sent
notifiactionPrefix: prayer-chat-notify-honkmother
verb: prayer-verbs-call
- verbImage: ""
+ verbImage: null