Add briefcase in hand & update setoutfit (#11634)
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using Content.Server.Administration.UI;
|
||||
using Content.Server.EUI;
|
||||
using Content.Server.Hands.Components;
|
||||
using Content.Server.Hands.Systems;
|
||||
using Content.Server.Preferences.Managers;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Inventory;
|
||||
@@ -17,6 +19,9 @@ namespace Content.Server.Administration.Commands
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
sealed class SetOutfitCommand : IConsoleCommand
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entities = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypes = default!;
|
||||
|
||||
public string Command => "setoutfit";
|
||||
|
||||
public string Description => Loc.GetString("set-outfit-command-description", ("requiredComponent", nameof(InventoryComponent)));
|
||||
@@ -37,17 +42,15 @@ namespace Content.Server.Administration.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
var target = new EntityUid(entityUid);
|
||||
|
||||
if (!target.IsValid() || !entityManager.EntityExists(target))
|
||||
if (!target.IsValid() || !_entities.EntityExists(target))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("shell-invalid-entity-id"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!entityManager.HasComponent<InventoryComponent?>(target))
|
||||
if (!_entities.HasComponent<InventoryComponent?>(target))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("shell-target-entity-does-not-have-message",("missing", "inventory")));
|
||||
return;
|
||||
@@ -67,7 +70,7 @@ namespace Content.Server.Administration.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SetOutfit(target, args[1], entityManager))
|
||||
if (!SetOutfit(target, args[1], _entities))
|
||||
shell.WriteLine(Loc.GetString("set-outfit-command-invalid-outfit-id-error"));
|
||||
}
|
||||
|
||||
@@ -90,7 +93,7 @@ namespace Content.Server.Administration.Commands
|
||||
profile = prefs.SelectedCharacter as HumanoidCharacterProfile;
|
||||
}
|
||||
|
||||
var invSystem = EntitySystem.Get<InventorySystem>();
|
||||
var invSystem = entityManager.System<InventorySystem>();
|
||||
if (invSystem.TryGetSlots(target, out var slotDefinitions, inventoryComponent))
|
||||
{
|
||||
foreach (var slot in slotDefinitions)
|
||||
@@ -115,6 +118,17 @@ namespace Content.Server.Administration.Commands
|
||||
}
|
||||
}
|
||||
|
||||
if (entityManager.TryGetComponent(target, out HandsComponent? handsComponent))
|
||||
{
|
||||
var handsSystem = entityManager.System<HandsSystem>();
|
||||
var coords = entityManager.GetComponent<TransformComponent>(target).Coordinates;
|
||||
foreach (var (hand, prototype) in startingGear.Inhand)
|
||||
{
|
||||
var inhandEntity = entityManager.SpawnEntity(prototype, coords);
|
||||
handsSystem.TryPickup(target, inhandEntity, hand, checkActionBlocker: false, handsComp: handsComponent);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,18 +7,6 @@
|
||||
contents:
|
||||
- id: BoxSurvival
|
||||
|
||||
#This should be temporary, at least until briefcases can spawn in hands.
|
||||
|
||||
- type: entity
|
||||
noSpawn: true
|
||||
parent: ClothingBackpack
|
||||
id: ClothingBackpackBriefcaseFilled
|
||||
components:
|
||||
- type: StorageFill
|
||||
contents:
|
||||
- id: BoxSurvival
|
||||
- id: BriefcaseBrownFilled
|
||||
|
||||
- type: entity
|
||||
noSpawn: true
|
||||
parent: ClothingBackpackClown
|
||||
|
||||
@@ -14,9 +14,11 @@
|
||||
id: LawyerGear
|
||||
equipment:
|
||||
jumpsuit: ClothingUniformJumpsuitLawyerBlack # TODO change jumpsuit to randomiser of the 4 variants
|
||||
back: ClothingBackpackBriefcaseFilled
|
||||
back: ClothingBackpackFilled
|
||||
shoes: ClothingShoesBootsLaceup
|
||||
id: LawyerPDA
|
||||
ears: ClothingHeadsetSecurity
|
||||
# TODO add copy of space law
|
||||
inhand:
|
||||
right hand: BriefcaseBrownFilled
|
||||
innerclothingskirt: ClothingUniformJumpskirtLawyerBlack
|
||||
|
||||
@@ -13,10 +13,12 @@
|
||||
id: LibrarianGear
|
||||
equipment:
|
||||
jumpsuit: ClothingUniformJumpsuitLibrarian
|
||||
back: ClothingBackpackBriefcaseFilled
|
||||
back: ClothingBackpackFilled
|
||||
shoes: ClothingShoesBootsLaceup
|
||||
id: LibrarianPDA
|
||||
ears: ClothingHeadsetService
|
||||
pocket1: d10Dice
|
||||
inhand:
|
||||
right hand: BriefcaseBrownFilled
|
||||
innerclothingskirt: ClothingUniformJumpskirtColorLightBrown
|
||||
|
||||
|
||||
Reference in New Issue
Block a user