Cyborg Inventory Refactor (#27788)

* Initial variable changes

* Add defines

* oh my god huds

* Removes update_items(), it seems useless but this might need reverting later

* the hud doesn't work but the inventory itself seems to

* Renames a var, gets inventory working properly

* Activation/Deactivation support, ore bag fixed

* Fixes CL and also this would have been a massive, hilarious bug

* Apply suggestions from code review

Dr and Lewc reviews

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Drsmail <60036448+Drsmail@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/_onclick/hud/robot_hud.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Fixes a comment

* Wait I forgot this worked like this for a reason

* Lewc Suggestions

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Burza Suggestions

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

---------

Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Drsmail <60036448+Drsmail@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
BiancaWilkson
2025-02-12 16:55:11 -05:00
committed by GitHub
parent c895b91bb3
commit 4fdc79ca90
14 changed files with 250 additions and 308 deletions
+1 -1
View File
@@ -383,7 +383,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
return
var/mob/living/silicon/robot/R = user
if(!R.low_power_mode) // Can't equip modules with an empty cell.
R.activate_module(src)
R.activate_item(src)
R.hud_used.update_robot_modules_display()
// Due to storage type consolidation this should get used more now.
@@ -179,17 +179,26 @@
. = ..()
if(listening_to == user)
return
begin_listening(src, user)
/obj/item/storage/bag/ore/proc/begin_listening(datum/source, mob/user) // Even though its unused, the datum/source argument is required to make the signals work.
SIGNAL_HANDLER // COMSIG_CYBORG_ITEM_ACTIVATED
if(listening_to)
UnregisterSignal(listening_to, COMSIG_MOVABLE_MOVED)
RegisterSignal(user, COMSIG_MOVABLE_MOVED, PROC_REF(pickup_ores))
listening_to = user
/obj/item/storage/bag/ore/dropped()
. = ..()
/obj/item/storage/bag/ore/proc/end_listening()
SIGNAL_HANDLER // COMSIG_CYBORG_ITEM_DEACTIVATED
if(listening_to)
UnregisterSignal(listening_to, COMSIG_MOVABLE_MOVED)
listening_to = null
/obj/item/storage/bag/ore/dropped()
. = ..()
end_listening()
/obj/item/storage/bag/ore/proc/pickup_ores(mob/living/user)
SIGNAL_HANDLER // COMSIG_MOVABLE_MOVED
var/turf/simulated/floor/plating/asteroid/tile = get_turf(user)
@@ -208,6 +217,16 @@
name = "cyborg mining satchel"
flags = NODROP
/obj/item/storage/bag/ore/cyborg/Initialize(mapload)
. = ..()
RegisterSignal(src, COMSIG_CYBORG_ITEM_ACTIVATED, PROC_REF(begin_listening))
RegisterSignal(src, COMSIG_CYBORG_ITEM_DEACTIVATED, PROC_REF(end_listening))
/obj/item/storage/bag/ore/cyborg/Destroy()
UnregisterSignal(src, COMSIG_CYBORG_ITEM_ACTIVATED)
UnregisterSignal(src, COMSIG_CYBORG_ITEM_DEACTIVATED)
return ..()
/// miners, your messiah has arrived
/obj/item/storage/bag/ore/holding
name = "mining satchel of holding"