From 4df9d4ca24e4662d80c064b23fe8360c22d9622a Mon Sep 17 00:00:00 2001 From: HellCatten <126400932+HellCatten@users.noreply.github.com> Date: Fri, 23 Aug 2024 22:03:39 +0300 Subject: [PATCH 01/12] [NEW] Added toggle to magnetPickupSystem / [FIX] ore processor fix --- .../EntitySystems/MagnetPickupSystem.cs | 18 ++++++++++++++++++ .../components/magnet-pickup-component.ftl | 4 ++++ .../Objects/Specific/Salvage/ore_bag.yml | 9 +++++++++ .../Entities/Structures/Machines/lathe.yml | 3 ++- 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 Resources/Locale/en-US/storage/components/magnet-pickup-component.ftl diff --git a/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs b/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs index 21861f57da..fd95c25f26 100644 --- a/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs +++ b/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs @@ -1,5 +1,8 @@ using Content.Server.Storage.Components; +using Content.Shared.Examine; using Content.Shared.Inventory; +using Content.Shared.Item.ItemToggle; +using Content.Shared.Item.ItemToggle.Components; using Robust.Shared.Map; using Robust.Shared.Physics.Components; using Robust.Shared.Timing; @@ -16,6 +19,7 @@ public sealed class MagnetPickupSystem : EntitySystem [Dependency] private readonly InventorySystem _inventory = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly SharedStorageSystem _storage = default!; + [Dependency] private readonly SharedItemToggleSystem _itemToggle = default!; private static readonly TimeSpan ScanDelay = TimeSpan.FromSeconds(1); @@ -25,6 +29,7 @@ public override void Initialize() { base.Initialize(); _physicsQuery = GetEntityQuery(); + SubscribeLocalEvent(onExamined); SubscribeLocalEvent(OnMagnetMapInit); } @@ -33,6 +38,14 @@ private void OnMagnetMapInit(EntityUid uid, MagnetPickupComponent component, Map component.NextScan = _timing.CurTime; } + private void onExamined(Entity entity, ref ExaminedEvent args) + { + var onMsg = _itemToggle.IsActivated(entity.Owner) + ? Loc.GetString("comp-magnet-pickup-examined-on") + : Loc.GetString("comp-magnet-pickup-examined-off"); + args.PushMarkup(onMsg); + } + public override void Update(float frameTime) { base.Update(frameTime); @@ -41,6 +54,11 @@ public override void Update(float frameTime) while (query.MoveNext(out var uid, out var comp, out var storage, out var xform, out var meta)) { + TryComp(uid, out var toggle); + + if (!_itemToggle.IsActivated(uid, toggle)) + continue; + if (comp.NextScan > currentTime) continue; diff --git a/Resources/Locale/en-US/storage/components/magnet-pickup-component.ftl b/Resources/Locale/en-US/storage/components/magnet-pickup-component.ftl new file mode 100644 index 0000000000..baa827228e --- /dev/null +++ b/Resources/Locale/en-US/storage/components/magnet-pickup-component.ftl @@ -0,0 +1,4 @@ +## Used when examining the MagnetPickupComponent + +comp-magnet-pickup-examined-on = the magnet is currently [color=darkgreen]on[/color]. +comp-magnet-pickup-examined-off = the magnet is currently [color=darkred]off[/color]. diff --git a/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag.yml b/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag.yml index a36bfaf676..f86a32eb1c 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag.yml @@ -26,3 +26,12 @@ - ArtifactFragment - Ore - type: Dumpable + - type: ItemToggle + soundActivate: + collection: sparks + params: + variation: 0.250 + soundDeactivate: + collection: sparks + params: + variation: 0.250 diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml index de72dfcd5e..56e322cf2a 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml @@ -1216,6 +1216,7 @@ - type: MaterialStorageMagnetPickup # Delta V - Summary: Adds magnet pull from Frontier magnetEnabled: True range: 0.30 # Delta V - End Magnet Pull + - type: PlaceableSurface - type: entity parent: OreProcessor @@ -1412,4 +1413,4 @@ - type: MaterialStorage whitelist: tags: - - PrizeTicket \ No newline at end of file + - PrizeTicket From de05685d61b74fd077cd5fc2b22b0f54c5c762c4 Mon Sep 17 00:00:00 2001 From: HellCatten <126400932+HellCatten@users.noreply.github.com> Date: Fri, 23 Aug 2024 22:31:21 +0300 Subject: [PATCH 02/12] Ru locale / En localisation fix --- .../en-US/storage/components/magnet-pickup-component.ftl | 4 ++-- .../_white/storage/components/magnet-pickup-component.ftl | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 Resources/Locale/ru-RU/_white/storage/components/magnet-pickup-component.ftl diff --git a/Resources/Locale/en-US/storage/components/magnet-pickup-component.ftl b/Resources/Locale/en-US/storage/components/magnet-pickup-component.ftl index baa827228e..d56293dd5b 100644 --- a/Resources/Locale/en-US/storage/components/magnet-pickup-component.ftl +++ b/Resources/Locale/en-US/storage/components/magnet-pickup-component.ftl @@ -1,4 +1,4 @@ ## Used when examining the MagnetPickupComponent -comp-magnet-pickup-examined-on = the magnet is currently [color=darkgreen]on[/color]. -comp-magnet-pickup-examined-off = the magnet is currently [color=darkred]off[/color]. +comp-magnet-pickup-examined-on = The magnet is currently [color=darkgreen]on[/color]. +comp-magnet-pickup-examined-off = The magnet is currently [color=darkred]off[/color]. diff --git a/Resources/Locale/ru-RU/_white/storage/components/magnet-pickup-component.ftl b/Resources/Locale/ru-RU/_white/storage/components/magnet-pickup-component.ftl new file mode 100644 index 0000000000..908df6033c --- /dev/null +++ b/Resources/Locale/ru-RU/_white/storage/components/magnet-pickup-component.ftl @@ -0,0 +1,5 @@ +## Used when examining the MagnetPickupComponent +## Выводится при осмотре предмета с MagnetPickupCompontent + +comp-magnet-pickup-examined-on = Магнит сейчас [color=darkgreen]включен[/color]. +comp-magnet-pickup-examined-off = Магнит сейчас [color=darkred]выключен[/color]. From f85c918ee634f49d8bcf5d042a88e32cff9cb81d Mon Sep 17 00:00:00 2001 From: HellCatten <126400932+HellCatten@users.noreply.github.com> Date: Sat, 24 Aug 2024 22:12:15 +0300 Subject: [PATCH 03/12] code change after review --- Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs | 3 ++- .../_white/storage/components/magnet-pickup-component.ftl | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs b/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs index fd95c25f26..a410f601d4 100644 --- a/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs +++ b/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs @@ -54,7 +54,8 @@ public override void Update(float frameTime) while (query.MoveNext(out var uid, out var comp, out var storage, out var xform, out var meta)) { - TryComp(uid, out var toggle); + if (!TryComp(uid, out var toggle)) + continue; if (!_itemToggle.IsActivated(uid, toggle)) continue; diff --git a/Resources/Locale/ru-RU/_white/storage/components/magnet-pickup-component.ftl b/Resources/Locale/ru-RU/_white/storage/components/magnet-pickup-component.ftl index 908df6033c..9a58288220 100644 --- a/Resources/Locale/ru-RU/_white/storage/components/magnet-pickup-component.ftl +++ b/Resources/Locale/ru-RU/_white/storage/components/magnet-pickup-component.ftl @@ -1,5 +1,4 @@ -## Used when examining the MagnetPickupComponent -## Выводится при осмотре предмета с MagnetPickupCompontent +## Выводится при осмотре предмета с MagnetPickupCompontent comp-magnet-pickup-examined-on = Магнит сейчас [color=darkgreen]включен[/color]. comp-magnet-pickup-examined-off = Магнит сейчас [color=darkred]выключен[/color]. From d954321e53668633e9acaa05b0b3abb83294f012 Mon Sep 17 00:00:00 2001 From: HellCatten <126400932+HellCatten@users.noreply.github.com> Date: Sat, 24 Aug 2024 22:17:42 +0300 Subject: [PATCH 04/12] WHITE comments added --- Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs | 7 +++++-- .../Entities/Objects/Specific/Salvage/ore_bag.yml | 2 ++ .../Prototypes/Entities/Structures/Machines/lathe.yml | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs b/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs index a410f601d4..cc55615453 100644 --- a/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs +++ b/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs @@ -19,7 +19,7 @@ public sealed class MagnetPickupSystem : EntitySystem [Dependency] private readonly InventorySystem _inventory = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly SharedStorageSystem _storage = default!; - [Dependency] private readonly SharedItemToggleSystem _itemToggle = default!; + [Dependency] private readonly SharedItemToggleSystem _itemToggle = default!; // WD EDIT private static readonly TimeSpan ScanDelay = TimeSpan.FromSeconds(1); @@ -29,7 +29,7 @@ public override void Initialize() { base.Initialize(); _physicsQuery = GetEntityQuery(); - SubscribeLocalEvent(onExamined); + SubscribeLocalEvent(onExamined); // WD EDIT SubscribeLocalEvent(OnMagnetMapInit); } @@ -38,6 +38,7 @@ private void OnMagnetMapInit(EntityUid uid, MagnetPickupComponent component, Map component.NextScan = _timing.CurTime; } + //WD EDIT private void onExamined(Entity entity, ref ExaminedEvent args) { var onMsg = _itemToggle.IsActivated(entity.Owner) @@ -54,11 +55,13 @@ public override void Update(float frameTime) while (query.MoveNext(out var uid, out var comp, out var storage, out var xform, out var meta)) { + // WD EDIT START if (!TryComp(uid, out var toggle)) continue; if (!_itemToggle.IsActivated(uid, toggle)) continue; + // WD EDIT END if (comp.NextScan > currentTime) continue; diff --git a/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag.yml b/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag.yml index f86a32eb1c..ff882a96c2 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag.yml @@ -26,6 +26,7 @@ - ArtifactFragment - Ore - type: Dumpable + # WHITE EDIT START - type: ItemToggle soundActivate: collection: sparks @@ -35,3 +36,4 @@ collection: sparks params: variation: 0.250 + # WHITE EDIT END diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml index 56e322cf2a..f1900a7153 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml @@ -1216,7 +1216,7 @@ - type: MaterialStorageMagnetPickup # Delta V - Summary: Adds magnet pull from Frontier magnetEnabled: True range: 0.30 # Delta V - End Magnet Pull - - type: PlaceableSurface + - type: PlaceableSurface # WHITE EDIT - type: entity parent: OreProcessor From 1f330194f926a61d9eea04429be9df086c8bd987 Mon Sep 17 00:00:00 2001 From: HellCatten <126400932+HellCatten@users.noreply.github.com> Date: Tue, 27 Aug 2024 13:45:43 +0300 Subject: [PATCH 05/12] ON sprites added by @kilath --- .../EntitySystems/MagnetPickupSystem.cs | 9 +++++++ .../Objects/Specific/Salvage/ore_bag.yml | 12 ++++++++- .../Specific/Salvage/ore_bag_holding.yml | 10 +++++++- .../Specific/Mining/ore_bag.rsi/meta.json | 17 +++++++++++-- .../ore_bag.rsi/{icon.png => orebag_off.png} | Bin .../Specific/Mining/ore_bag.rsi/orebag_on.png | Bin 0 -> 1344 bytes .../Mining/ore_bag_holding.rsi/meta.json | 23 ++++++++++++++++-- .../{icon.png => orebag_off.png} | Bin .../Mining/ore_bag_holding.rsi/orebag_on.png | Bin 0 -> 2162 bytes 9 files changed, 65 insertions(+), 6 deletions(-) rename Resources/Textures/Objects/Specific/Mining/ore_bag.rsi/{icon.png => orebag_off.png} (100%) create mode 100644 Resources/Textures/Objects/Specific/Mining/ore_bag.rsi/orebag_on.png rename Resources/Textures/Objects/Specific/Mining/ore_bag_holding.rsi/{icon.png => orebag_off.png} (100%) create mode 100644 Resources/Textures/Objects/Specific/Mining/ore_bag_holding.rsi/orebag_on.png diff --git a/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs b/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs index cc55615453..dc87aee3d7 100644 --- a/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs +++ b/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs @@ -1,6 +1,8 @@ using Content.Server.Storage.Components; using Content.Shared.Examine; +using Content.Shared.Hands.EntitySystems; using Content.Shared.Inventory; +using Content.Shared.Item; using Content.Shared.Item.ItemToggle; using Content.Shared.Item.ItemToggle.Components; using Robust.Shared.Map; @@ -20,6 +22,7 @@ public sealed class MagnetPickupSystem : EntitySystem [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly SharedStorageSystem _storage = default!; [Dependency] private readonly SharedItemToggleSystem _itemToggle = default!; // WD EDIT + [Dependency] private readonly SharedItemSystem _item = default!; private static readonly TimeSpan ScanDelay = TimeSpan.FromSeconds(1); @@ -29,6 +32,7 @@ public override void Initialize() { base.Initialize(); _physicsQuery = GetEntityQuery(); + SubscribeLocalEvent(ToggleDone); SubscribeLocalEvent(onExamined); // WD EDIT SubscribeLocalEvent(OnMagnetMapInit); } @@ -47,6 +51,11 @@ private void onExamined(Entity entity, ref ExaminedEvent args.PushMarkup(onMsg); } + private void ToggleDone(Entity entity, ref ItemToggledEvent args) + { + _item.SetHeldPrefix(entity.Owner, args.Activated ? "on" : "off"); + } + public override void Update(float frameTime) { base.Update(frameTime); diff --git a/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag.yml b/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag.yml index ff882a96c2..469ba4c36f 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag.yml @@ -7,13 +7,16 @@ - type: MagnetPickup - type: Sprite sprite: Objects/Specific/Mining/ore_bag.rsi - state: icon + layers: + - state: orebag_off + map: [ "enum.ToggleVisuals.Layer" ] - type: Clothing sprite: Objects/Specific/Mining/ore_bag.rsi quickEquip: false slots: - belt - type: Item + heldPrefix: off size: Ginormous - type: Storage maxItemSize: Normal @@ -36,4 +39,11 @@ collection: sparks params: variation: 0.250 + - type: Appearance + - type: GenericVisualizer + visuals: + enum.ToggleVisuals.Toggled: + enum.ToggleVisuals.Layer: + True: { state: orebag_on } + False: { state: orebag_off } # WHITE EDIT END diff --git a/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag_holding.yml b/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag_holding.yml index e8c7fa37dd..54cd834213 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag_holding.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag_holding.yml @@ -8,7 +8,15 @@ range: 2 - type: Sprite sprite: Objects/Specific/Mining/ore_bag_holding.rsi - state: icon + layers: + - state: oregab_off + map: [ "enum.ToggleVisuals.Layer" ] + - type: GenericVisualizer + visuals: + enum.ToggleVisuals.Toggled: + enum.ToggleVisuals.Layer: + True: { state: orebag_on } + False: { state: orebag_off } - type: Clothing sprite: Objects/Specific/Mining/ore_bag_holding.rsi - type: Storage diff --git a/Resources/Textures/Objects/Specific/Mining/ore_bag.rsi/meta.json b/Resources/Textures/Objects/Specific/Mining/ore_bag.rsi/meta.json index 8d6202dde4..596d686f64 100644 --- a/Resources/Textures/Objects/Specific/Mining/ore_bag.rsi/meta.json +++ b/Resources/Textures/Objects/Specific/Mining/ore_bag.rsi/meta.json @@ -1,14 +1,14 @@ { "version": 1, "license": "CC-BY-SA-3.0", - "copyright": "Homegrown by @ninruB#7795, inhand sprites by лазік#7305", + "copyright": "Homegrown by @ninruB#7795, inhand sprites by лазік#7305, ON state sprite by @kilath", "size": { "x": 32, "y": 32 }, "states": [ { - "name": "icon" + "name": "orebag_off" }, { "name": "equipped-BELT", @@ -21,6 +21,19 @@ { "name": "inhand-right", "directions": 4 + }, + { + "name": "orebag_on", + "delays": [ + [ + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1 + ] + ] } ] } diff --git a/Resources/Textures/Objects/Specific/Mining/ore_bag.rsi/icon.png b/Resources/Textures/Objects/Specific/Mining/ore_bag.rsi/orebag_off.png similarity index 100% rename from Resources/Textures/Objects/Specific/Mining/ore_bag.rsi/icon.png rename to Resources/Textures/Objects/Specific/Mining/ore_bag.rsi/orebag_off.png diff --git a/Resources/Textures/Objects/Specific/Mining/ore_bag.rsi/orebag_on.png b/Resources/Textures/Objects/Specific/Mining/ore_bag.rsi/orebag_on.png new file mode 100644 index 0000000000000000000000000000000000000000..b39ff0e6da1fe642fd03c64720177c8f27416f92 GIT binary patch literal 1344 zcmV-G1;6@% z!T&&4!Bs&J6hXw%+1DZ^p4$o)X>YhWKfZgv!^sy2Oeec38(1N0yv;`$a8C*R<4(=xKQ@)>ZER z^Yk*qL*?$RacFoBg7+S1+=b#!5PTm8LGc8_PjH#9_*W&T(NEELDq8dqBAal2Rnd$+ zxY&ZuM@M({k`$I5%4Fc}4B8f;{T7;+%31xMbNT?u4f#bkuzvu(azC>C19)v{L8LgM zWB>pF32;bRa{vG?BLDy{BLR4&KXw2B19?eAK~#8N?V3$%6G0fqrxK|~OIn&kt5BsP zR0Yx8L@%w-s|bR(;?Zv)egg60C-5M>c@i%kl(rY4Hx8K|C2o1 z>5}ZTFPSdV{|}bT%QN#ELMF2_yT%Yg2qAaQYSX_PKka9Adb+i^v}7eSLAusl zw&h2w$2+ZRt)zp{pr3wU{zF=T3*?)n!#3U6*b2)fjXD{i59p`A-+pz5favl9sw0(9 z?516k%)lhjPk*$mUw$iY9z@H&cJiG$nd_W%%y{POKnVg5zq zoO#ulv=`D+ju^yB9&}s6l0rZIKK(r>02W0#b-PrsS*E0sMzJ^^K@Lkwck#_b~u zaejR9cOF~_V~g-VoIe(hVZZ$Veq1sM_uCKPmq}2BALQ}(yf?xOoDDV~FN2MQJB!ev z?7ATa_!6Wn8Y_LIy$?+4hZ_{(cR8qjOg{Vx6yb;abNzI#-(TzsfDOlNX9q5u3NY1N zwnF&_LVBw6Ai|AB+ua8f=}F=TMfrt;?3W*Z5q`My{{GY_!QDC-4a%;X59a3GZJU2K zKV(cfh^y;u(?UP}QTpkRodB|n#;$s-a|Sy*h#mH@nYp!L9zPneXS0=ZJ03G`ZPkRa z?q(zl^wSS~`qg7lARXa|$?X(!dFUWl@{elmF>;yok zxUWJ-B9~n`z$0i}0_qThSUG}{`?xI7Prq-!`Yw4f zPrq-!Iz4xH-|Y_F_pO^l?b$c5y|br{#M+I>ipd52^!xOyGc)>5MjEgTWu5&3{q+0v zCmLMVxA`=AQs}2&i|Izc{Dcrf2qA~Rh literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Specific/Mining/ore_bag_holding.rsi/meta.json b/Resources/Textures/Objects/Specific/Mining/ore_bag_holding.rsi/meta.json index 3b28912df0..8a3908f419 100644 --- a/Resources/Textures/Objects/Specific/Mining/ore_bag_holding.rsi/meta.json +++ b/Resources/Textures/Objects/Specific/Mining/ore_bag_holding.rsi/meta.json @@ -1,14 +1,14 @@ { "version": 1, "license": "CC-BY-SA-3.0", - "copyright": "Taken from Paradise at https://github.com/ParadiseSS13/Paradise/blob/5ce5a66c814c4a60118d24885389357fd0240002/icons/obj/mining.dmi", + "copyright": "Taken from Paradise at https://github.com/ParadiseSS13/Paradise/blob/5ce5a66c814c4a60118d24885389357fd0240002/icons/obj/mining.dmi, ON state sprite by @kilath", "size": { "x": 32, "y": 32 }, "states": [ { - "name": "icon", + "name": "orebag_off", "delays": [ [ 0.1, @@ -19,6 +19,25 @@ ] ] }, + { + "name": "orebag_on", + "delays": [ + [ + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1 + ] + ] + }, { "name": "equipped-BELT", "directions": 4 diff --git a/Resources/Textures/Objects/Specific/Mining/ore_bag_holding.rsi/icon.png b/Resources/Textures/Objects/Specific/Mining/ore_bag_holding.rsi/orebag_off.png similarity index 100% rename from Resources/Textures/Objects/Specific/Mining/ore_bag_holding.rsi/icon.png rename to Resources/Textures/Objects/Specific/Mining/ore_bag_holding.rsi/orebag_off.png diff --git a/Resources/Textures/Objects/Specific/Mining/ore_bag_holding.rsi/orebag_on.png b/Resources/Textures/Objects/Specific/Mining/ore_bag_holding.rsi/orebag_on.png new file mode 100644 index 0000000000000000000000000000000000000000..42382c71f40a67ee22a68449e79aad6679455901 GIT binary patch literal 2162 zcmaJ?dpOg58~;gd$ea>2=i<#Hhv*R%?~lYBvZ3T`mL)<)#Zu2E(fbr{q#lyPWKud! z2SZ}!oRp0zL(au8!Wf(JZavrY{PAAb`~LC0ug`VgpZorNzu)V+@B4-a5&@Hg%K-oY zb8$ZE1prb>Vyr6z5nGLCly723bcBP0M?`2S02toBc)P}}(L=R`NWD3FP2te**4W3R zA&#m|o<@_!3Khu|0~hoWFNdsMqefNMG780M6#9mp58c~dN!7lI$^Np-ps-(Vdqhmt zL9p&Jt?|9OjJsbcwU%Z@LZmL~Sp z`CP0h=_-`H=-#lqbWG4-0XrU9N5%(KHFj`*8QDET@PVk-oqX&0UA>uYK{SlNb0b!! ztk8d1QG?jqQBB2>a4f3a_c@y>H~;R{YQM6eS2gp_`&=|(*Ea3-U1=)$Zt!}lj-C~B z-FyDtLcDM5c0_hQUg&7z{N)WReKO*b@n`SZjYXbCqr~|gjOm|C;6#gL?4*-y-E=TQ8 z;DfmZsBqN;)z+bZ=s87A8x&Ks{4?*XMAmPHZ(~k9(0$;^JnLdsR{q}J^%ou^(0D22 z@(-3>nyfb}y3feGG)FrXMY+*D)*ck`x=D%xH@FIfOfz!o%6~%tVJ9LV@&2T@WjDezE6Bj|_iFB!b=H`0)_wSF7H4c8aaw9bC z%$f5o1Jjx0z{y7vp^Q!v-xgr>^%;@LWD6^+J#N{?%7MP}Fxd9Q8yHG@dU|g~d%G)} z8l9JKd->!g_j7;cp>Y6<#cC5QO>+g~<0Zoitl{CJuY&^SoW;TJkT2@)L3bi)&t6X> zPJ5VE#JdCq1sy_EGf?7RlNOB4t7`&)qIQ+g**2^ilf67nTOgoQqs*rxKgNB#>)d@p z*UEHH$zW8%>30W=R@X>81FWkG2d?5y5EcBEfUWNM;xWhGKn}%t?R|`?D8m%+@XI8j zr5+j?xX+T63x}69R&I1yE*5}jhpx(vlGRcQ@*W(14A$K>%?1;Tj;I6>4_Lm#L@ITz z>nwY>E%@hB=&v{0`nNB%$4MZO#RGY@7hr|Lp~{xIM6_{L(jM0(ljP$W|a@m7(bKRL$BPpdd#);UN8KI&Pe}|P!Q&F>p9gj1Xx}E0Qx*k z5OW+DHN@q&ZTwS_^-4Uh;-}g@aZl) zuheH-inz?B<)L5EdBLy-_`W0?VP_s?vi7l*^y5I{d+GYCkeTu=SkDgLjZN_KMuj5d z(PgsK;TfQP*EtYg9vXcMH$(V!ST!InWo)@0l7Gsmbum3w7%h#&Kt0rAh0G+ac;K{h zr4Fq3Pe)AHIpeccacQjQIPlTD6P?oT@WQ84=yBV}9WE4SwF zrD;uzu5U4!E0l+3o{>PUcbPKK%otikJ#NGDju@T+;rj-1=JXq+#@QJV`2>dMVDcgt zA$?uwbRMt45UcN)C5OF~ZhI|3`#+Zb$>ZBCa&h9i?42qj}QfvW?y3s5E z*WDC&Iwfak&NhpI)%$H}VYO6ye`?)ne$S&@v8n+nPNqb+#h~fz9DZAi!<}_ew3%PR z=ry}|!lL}z_x#4%(J?!P{DryJga4}G;B++(i-fVCMp`a|L7nv(=M}65g$LK=*Q_US zW3{Blf`nR0bT(XN^~LM18l4HvS#0-Ixw`mD`Hf%u-yEEAEEI{kWN3fziBj5dUcI_m z@LejE%8ReuX`WLzPqB#|SQBCr!MM9y#hoqg+x1lbgch(eBXdQ2 z%jbDJ`g|v{4K)U~FLN=PsDcsx@s}aCBD)4z^VTTT#HE!V7$(WRKvt3qeinB#WpGmi zMRz2@1%=khs{OaHOQ_d$4dQD-a*{Tb`Ox!pG3G?}PbE+^zp{03ldJo!A}aM{eBDbo zi0QCr3L-UlSB3zJZGKTQu>Ka+(%SmrK0!giQJ2i514Pf}YPZ{7%<<+Ups3Hhx`;&J z-aCaa6iu1vLf7@#0~}0E6$nDE-U%V4)qrSf=Ff)jrj-+x$hsEnAFK3a#T^&qc~5mf z_?DmJ@d^X|7F~N3hecn Date: Wed, 28 Aug 2024 18:38:37 +0300 Subject: [PATCH 06/12] update test. From 55f815a98d8e2b260a1fb93dfdac1b8c590b5ed7 Mon Sep 17 00:00:00 2001 From: HellCatten <126400932+HellCatten@users.noreply.github.com> Date: Wed, 28 Aug 2024 19:14:58 +0300 Subject: [PATCH 07/12] fix --- .../Entities/Objects/Specific/Salvage/ore_bag_holding.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag_holding.yml b/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag_holding.yml index 54cd834213..c0e21cb8a3 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag_holding.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag_holding.yml @@ -9,7 +9,7 @@ - type: Sprite sprite: Objects/Specific/Mining/ore_bag_holding.rsi layers: - - state: oregab_off + - state: orebag_off map: [ "enum.ToggleVisuals.Layer" ] - type: GenericVisualizer visuals: From 7d0ef5571c5a4aa20b8fe1369e0788911264ca97 Mon Sep 17 00:00:00 2001 From: HellCatten <126400932+HellCatten@users.noreply.github.com> Date: Thu, 29 Aug 2024 15:48:30 +0300 Subject: [PATCH 08/12] update tests From f797483a89fc6a7d1a8700bbc0fd85d5817fa4db Mon Sep 17 00:00:00 2001 From: HellCatten <126400932+HellCatten@users.noreply.github.com> Date: Fri, 30 Aug 2024 22:33:35 +0300 Subject: [PATCH 09/12] Changed ContainingSlot/SlotDef checks. Added ForcePickup. --- .../Storage/Components/MagnetPickupComponent.cs | 6 +++--- .../Storage/EntitySystems/MagnetPickupSystem.cs | 15 ++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Content.Shared/Storage/Components/MagnetPickupComponent.cs b/Content.Shared/Storage/Components/MagnetPickupComponent.cs index 3467439a6d..b6bbe0438e 100644 --- a/Content.Shared/Storage/Components/MagnetPickupComponent.cs +++ b/Content.Shared/Storage/Components/MagnetPickupComponent.cs @@ -13,10 +13,10 @@ public sealed partial class MagnetPickupComponent : Component public TimeSpan NextScan = TimeSpan.Zero; /// - /// What container slot the magnet needs to be in to work. + /// If true, ignores SlotFlags and can magnet pickup on hands/ground. /// - [ViewVariables(VVAccess.ReadWrite), DataField("slotFlags")] - public SlotFlags SlotFlags = SlotFlags.BELT; + [ViewVariables(VVAccess.ReadWrite)] + public bool ForcePickup = true; [ViewVariables(VVAccess.ReadWrite), DataField("range")] public float Range = 1f; diff --git a/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs b/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs index dc87aee3d7..c7398f0fc2 100644 --- a/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs +++ b/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs @@ -22,7 +22,7 @@ public sealed class MagnetPickupSystem : EntitySystem [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly SharedStorageSystem _storage = default!; [Dependency] private readonly SharedItemToggleSystem _itemToggle = default!; // WD EDIT - [Dependency] private readonly SharedItemSystem _item = default!; + [Dependency] private readonly SharedItemSystem _item = default!; // White Dream private static readonly TimeSpan ScanDelay = TimeSpan.FromSeconds(1); @@ -32,7 +32,7 @@ public override void Initialize() { base.Initialize(); _physicsQuery = GetEntityQuery(); - SubscribeLocalEvent(ToggleDone); + SubscribeLocalEvent(ToggleDone); // White Dream SubscribeLocalEvent(onExamined); // WD EDIT SubscribeLocalEvent(OnMagnetMapInit); } @@ -42,7 +42,7 @@ private void OnMagnetMapInit(EntityUid uid, MagnetPickupComponent component, Map component.NextScan = _timing.CurTime; } - //WD EDIT + //WD EDIT start private void onExamined(Entity entity, ref ExaminedEvent args) { var onMsg = _itemToggle.IsActivated(entity.Owner) @@ -55,6 +55,7 @@ private void ToggleDone(Entity entity, ref ItemToggledEve { _item.SetHeldPrefix(entity.Owner, args.Activated ? "on" : "off"); } + //WD EDIT end public override void Update(float frameTime) { @@ -77,11 +78,11 @@ public override void Update(float frameTime) comp.NextScan += ScanDelay; - if (!_inventory.TryGetContainingSlot((uid, xform, meta), out var slotDef)) - continue; - - if ((slotDef.SlotFlags & comp.SlotFlags) == 0x0) + // WD EDIT START. Added ForcePickup. + if (!comp.ForcePickup && + !_inventory.TryGetContainingSlot((uid, xform, meta), out var slotDef)) continue; + //WD EDIT END. // No space if (!_storage.HasSpace((uid, storage))) From 3b01084562969aebcd518bafab2beb975ee4ef8d Mon Sep 17 00:00:00 2001 From: HellCatten <126400932+HellCatten@users.noreply.github.com> Date: Mon, 2 Sep 2024 12:44:33 +0300 Subject: [PATCH 10/12] Component fixed --- .../Storage/Components/MagnetPickupComponent.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Content.Shared/Storage/Components/MagnetPickupComponent.cs b/Content.Shared/Storage/Components/MagnetPickupComponent.cs index b6bbe0438e..70117d702e 100644 --- a/Content.Shared/Storage/Components/MagnetPickupComponent.cs +++ b/Content.Shared/Storage/Components/MagnetPickupComponent.cs @@ -1,11 +1,13 @@ using Content.Shared.Inventory; +using Robust.Shared.GameStates; namespace Content.Server.Storage.Components; /// /// Applies an ongoing pickup area around the attached entity. /// -[RegisterComponent, AutoGenerateComponentPause] +[NetworkedComponent] +[RegisterComponent, AutoGenerateComponentPause, AutoGenerateComponentState] public sealed partial class MagnetPickupComponent : Component { [ViewVariables(VVAccess.ReadWrite), DataField("nextScan")] @@ -15,7 +17,9 @@ public sealed partial class MagnetPickupComponent : Component /// /// If true, ignores SlotFlags and can magnet pickup on hands/ground. /// - [ViewVariables(VVAccess.ReadWrite)] + + [ViewVariables(VVAccess.ReadWrite), DataField()] + [AutoNetworkedField] public bool ForcePickup = true; [ViewVariables(VVAccess.ReadWrite), DataField("range")] From 35788e814c53707e62bcc6e9a4f4455580f9e2c9 Mon Sep 17 00:00:00 2001 From: HellCatten <126400932+HellCatten@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:53:01 +0300 Subject: [PATCH 11/12] microfix --- Content.Shared/Storage/Components/MagnetPickupComponent.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Content.Shared/Storage/Components/MagnetPickupComponent.cs b/Content.Shared/Storage/Components/MagnetPickupComponent.cs index 70117d702e..23b5a13ae2 100644 --- a/Content.Shared/Storage/Components/MagnetPickupComponent.cs +++ b/Content.Shared/Storage/Components/MagnetPickupComponent.cs @@ -17,8 +17,7 @@ public sealed partial class MagnetPickupComponent : Component /// /// If true, ignores SlotFlags and can magnet pickup on hands/ground. /// - - [ViewVariables(VVAccess.ReadWrite), DataField()] + [ViewVariables(VVAccess.ReadWrite), DataField] [AutoNetworkedField] public bool ForcePickup = true; From 9a1e7105140e0b686e5b05abf2f7d29df075017c Mon Sep 17 00:00:00 2001 From: Remuchi Date: Tue, 3 Sep 2024 17:17:07 +0700 Subject: [PATCH 12/12] style: a bit of styling --- .../EntitySystems/MagnetPickupSystem.cs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs b/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs index c7398f0fc2..8a7fdb57c8 100644 --- a/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs +++ b/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs @@ -1,6 +1,5 @@ using Content.Server.Storage.Components; using Content.Shared.Examine; -using Content.Shared.Hands.EntitySystems; using Content.Shared.Inventory; using Content.Shared.Item; using Content.Shared.Item.ItemToggle; @@ -32,8 +31,8 @@ public override void Initialize() { base.Initialize(); _physicsQuery = GetEntityQuery(); - SubscribeLocalEvent(ToggleDone); // White Dream - SubscribeLocalEvent(onExamined); // WD EDIT + SubscribeLocalEvent(OnItemToggled); // White Dream + SubscribeLocalEvent(OnExamined); // WD EDIT SubscribeLocalEvent(OnMagnetMapInit); } @@ -43,7 +42,7 @@ private void OnMagnetMapInit(EntityUid uid, MagnetPickupComponent component, Map } //WD EDIT start - private void onExamined(Entity entity, ref ExaminedEvent args) + private void OnExamined(Entity entity, ref ExaminedEvent args) { var onMsg = _itemToggle.IsActivated(entity.Owner) ? Loc.GetString("comp-magnet-pickup-examined-on") @@ -51,7 +50,7 @@ private void onExamined(Entity entity, ref ExaminedEvent args.PushMarkup(onMsg); } - private void ToggleDone(Entity entity, ref ItemToggledEvent args) + private void OnItemToggled(Entity entity, ref ItemToggledEvent args) { _item.SetHeldPrefix(entity.Owner, args.Activated ? "on" : "off"); } @@ -79,8 +78,7 @@ public override void Update(float frameTime) comp.NextScan += ScanDelay; // WD EDIT START. Added ForcePickup. - if (!comp.ForcePickup && - !_inventory.TryGetContainingSlot((uid, xform, meta), out var slotDef)) + if (!comp.ForcePickup && !_inventory.TryGetContainingSlot((uid, xform, meta), out _)) continue; //WD EDIT END. @@ -109,17 +107,14 @@ public override void Update(float frameTime) // the problem is that stack pickups delete the original entity, which is fine, but due to // game state handling we can't show a lerp animation for it. var nearXform = Transform(near); - var nearMap = nearXform.MapPosition; + var nearMap = _transform.GetMapCoordinates(near); var nearCoords = EntityCoordinates.FromMap(moverCoords.EntityId, nearMap, _transform, EntityManager); if (!_storage.Insert(uid, near, out var stacked, storageComp: storage, playSound: !playedSound)) continue; // Play pickup animation for either the stack entity or the original entity. - if (stacked != null) - _storage.PlayPickupAnimation(stacked.Value, nearCoords, finalCoords, nearXform.LocalRotation); - else - _storage.PlayPickupAnimation(near, nearCoords, finalCoords, nearXform.LocalRotation); + _storage.PlayPickupAnimation(stacked ?? near, nearCoords, finalCoords, nearXform.LocalRotation); playedSound = true; }