mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 08:07:28 +00:00
* 1 * 2 * remove dismantle testing changes * add ammount handling, and add random angle * code-side things * code-side things * code-side things * 3 * 4 * 5 * 6 * changed description for now * whoops * 7 * 8 * 9 * Texture fix * Tada! I diiid iiitttt * Delete .icon.png-autosave.kra * 10 * test another * 11 * Localization fixes 2 Also some minor rebalancing of armor/shield/helmet crafting * ROOOUND 33333 * test wawa * wiz * fixes * MORE FIXES * MORE MORE FIXES * Smg mag fix * Why does it have reflet Removed reflect chance and made the damage the same as a plasteel arming sword * belt fix * phosphorus addition * improvised round bulk crafting * Update tags * tags update 2 * Update tags.yml * fix tags AGAIN * TAG FIX AGAIN * Fixed the sound path * Fixed missing components hopefully * fix it hopefully * Update tidebreaker.yml * fixed errors * fixed? * Update shields.yml * Update tools.yml * Fixes * Update tools.yml * Update tools.yml * Update tools.yml * Update tools.yml * Update tools.yml * screwdriver fix 200 * Update tools.yml * Update tools.yml * Apply suggestions from code review Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update SharedItemSwitchSystem.cs * review changes * Fix server and client files * Namespace fixes. * Update Resources/Prototypes/Entities/Clothing/Belt/belts.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/Entities/Clothing/Belt/belts.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/Entities/Clothing/Belt/belts.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/Entities/Clothing/Belt/belts.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/Entities/Clothing/Belt/belts.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/Entities/Clothing/Belt/belts.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/Entities/Objects/Tools/crowbars.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/Entities/Objects/Tools/tools.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/Entities/Objects/Tools/tools.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/Entities/Objects/Tools/tools.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/Entities/Objects/Tools/tools.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/Entities/Clothing/Belt/belts.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/Entities/Clothing/Belt/belts.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/Entities/Clothing/Belt/belts.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/Entities/Clothing/Belt/belts.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/Entities/Clothing/Belt/belts.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/Entities/Clothing/Belt/belts.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/Recipes/Crafting/Graphs/improvised/improvised_omnitool.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/Recipes/Crafting/Graphs/improvised/improvised_omnitool.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/Recipes/Crafting/Graphs/improvised/improvised_omnitool.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/Recipes/Crafting/Graphs/improvised/improvised_omnitool.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/tags.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/tags.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/tags.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/tags.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/tags.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/tags.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/tags.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/tags.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/tags.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_StarLight/tags.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update SharedWeaponDismantleOnShootSystem.cs * Update Resources/Prototypes/Recipes/Crafting/Graphs/improvised/improvised_shotgun_shell.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> * Update Resources/Prototypes/_DV/Entities/Objects/Weapons/Guns/Ammunition/Boxes/improvised.yml Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> --------- Signed-off-by: Apachito <ivanlopezlegos2004@gmail.com> Co-authored-by: KillerTheFlareon <tyler443344@outlook.com> Co-authored-by: Matthew Herber <matthewherber@sbcglobal.net> Co-authored-by: Athena-AI <AthenaTheAI@outlook.com> Co-authored-by: stickycheZ101 <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> Co-authored-by: stickycheZ101 <96800602+stickycheZ101@users.noreply.github.com> Co-authored-by: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Co-authored-by: Vanessa <vanessalouwagie@gmail.com>
102 lines
3.8 KiB
C#
102 lines
3.8 KiB
C#
using Content.Shared.Storage;
|
|
using Content.Shared.Storage.EntitySystems;
|
|
using Content.Shared.Inventory;
|
|
using Content.Shared.Hands.EntitySystems;
|
|
using Content.Shared.Clothing.EntitySystems;
|
|
using Content.Shared.Verbs;
|
|
using Robust.Shared.Utility;
|
|
using Robust.Shared.Audio.Systems;
|
|
using Content.Shared.Inventory.Events;
|
|
|
|
namespace Content.Shared._Starlight.Inventory;
|
|
|
|
public sealed class SwitchableEquipModeSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly SharedStorageSystem _storage = default!;
|
|
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
|
[Dependency] private readonly InventorySystem _inventory = default!;
|
|
[Dependency] private readonly SharedHandsSystem _hands = default!;
|
|
[Dependency] private readonly SharedUserInterfaceSystem _ui = default!;
|
|
|
|
private readonly Dictionary<EquipMode, string> _equipModeLocaleMapping = new() {
|
|
{ EquipMode.Remove, "equipmode-mode-remove" },
|
|
{ EquipMode.Open, "equipmode-mode-open" }
|
|
};
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<SwitchableEquipModeComponent, InventoryUseSlotEvent>(OnInventoryUseSlot);
|
|
SubscribeLocalEvent<SwitchableEquipModeComponent, GetVerbsEvent<ActivationVerb>>(OnGetVerbs);
|
|
SubscribeLocalEvent<SwitchableEquipModeComponent, GotUnequippedEvent>(OnUnequipped);
|
|
}
|
|
|
|
private void OnInventoryUseSlot(EntityUid uid, SwitchableEquipModeComponent switchModeComp, ref InventoryUseSlotEvent args)
|
|
{
|
|
if (!TryComp<StorageComponent>(uid, out var storageComp)) return;
|
|
|
|
switch (switchModeComp.Mode)
|
|
{
|
|
case EquipMode.Remove:
|
|
return; // pass to next
|
|
|
|
case EquipMode.Open:
|
|
args.Handled = true;
|
|
if (_ui.IsUiOpen(uid, StorageComponent.StorageUiKey.Key, args.Actor)) return; // stop sound spam
|
|
|
|
_storage.OpenStorageUI(args.Target, args.Actor);
|
|
_audio.PlayPredicted(storageComp.StorageOpenSound, uid, args.Actor);
|
|
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void OnGetVerbs(EntityUid uid, SwitchableEquipModeComponent switchModeComp, ref GetVerbsEvent<ActivationVerb> args)
|
|
{
|
|
if (!args.CanInteract || !args.CanAccess) return;
|
|
if (!TryComp<StorageComponent>(uid, out var storageComp)) return;
|
|
if (!_inventory.TryGetContainingSlot(uid, out var slot)) return;
|
|
|
|
var modeCount = Enum.GetNames<EquipMode>().Length;
|
|
EquipMode nextMode = (EquipMode)(((int)switchModeComp.Mode + 1) % modeCount);
|
|
|
|
ActivationVerb switchVerb = new()
|
|
{
|
|
Text = Loc.GetString("equipmode-switch", ("type", Loc.GetString(new(_equipModeLocaleMapping[nextMode])))),
|
|
Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/outfit.svg.192dpi.png")),
|
|
Priority = -1,
|
|
Act = () => switchModeComp.Mode = nextMode
|
|
};
|
|
args.Verbs.Add(switchVerb);
|
|
|
|
// misc verbs
|
|
|
|
EntityUid user = args.User;
|
|
|
|
ActivationVerb unequipVerb = new()
|
|
{
|
|
Text = Loc.GetString("equipmode-remove"),
|
|
Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/eject.svg.192dpi.png")),
|
|
Priority = 0,
|
|
Act = () =>
|
|
{
|
|
_inventory.TryUnequip(user, slot.Name, false, true);
|
|
_hands.TryPickup(user, uid);
|
|
}
|
|
};
|
|
|
|
switch (switchModeComp.Mode)
|
|
{
|
|
// we want an unequip option if the default click option isn't to remove
|
|
case EquipMode.Open:
|
|
args.Verbs.Add(unequipVerb);
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
};
|
|
}
|
|
|
|
private void OnUnequipped(Entity<SwitchableEquipModeComponent> ent, ref GotUnequippedEvent _) => ent.Comp.Mode = EquipMode.Remove; // revert to default behaviour
|
|
} |