[MIRROR] fix robot multibelts tgui usage (#11980)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-11-14 17:13:20 -07:00
committed by GitHub
parent 9ae66b7e85
commit c50f4d228f
6 changed files with 14 additions and 10 deletions

View File

@@ -28,5 +28,6 @@
#define JOINTEXT(X) jointext(X, null)
#define isbelly(A) istype(A, /obj/belly)
#define isrobotmultibelt(A) istype(A, /obj/item/robotic_multibelt)
#define isgripperpocket(A) istype(A, /obj/item/storage/internal/gripper)
#define iscapturecrystal(A) istype(A, /obj/item/capture_crystal)

View File

@@ -636,7 +636,7 @@
..()
/obj/item/weldingtool/electric/proc/get_external_power_supply()
if(istype(src.loc, /obj/item/robotic_multibelt)) //We are in a multibelt
if(isrobotmultibelt(src.loc)) //We are in a multibelt
if(istype(src.loc.loc, /mob/living/silicon/robot)) //We are in a multibelt that is in a robot! This is sanity in case someone spawns a multibelt in via admin commands.
var/mob/living/silicon/robot/R = src.loc.loc
return R.cell

View File

@@ -5,7 +5,7 @@
/mob/living/silicon/robot/get_active_hand(atom/A)
if(module_active == A) //If we are interacting with the item itself (I.E swapping multibelt items)
return module_active
else if(istype(module_active, /obj/item/robotic_multibelt)) //If we are hitting something with a multibelt
else if(isrobotmultibelt(module_active)) //If we are hitting something with a multibelt
var/obj/item/robotic_multibelt/belt = module_active
if(belt.selected_item)
return belt.selected_item
@@ -29,7 +29,7 @@
return
if(module_state_1 == I)
if(istype(module_state_1,/obj/item/robotic_multibelt))
if(isrobotmultibelt(module_state_1))
var/obj/item/robotic_multibelt/toolbelt = module_state_1
toolbelt.original_state()
if(istype(module_state_1,/obj/item/borg/sight))
@@ -42,7 +42,7 @@
module_state_1 = null
inv1.icon_state = "inv1"
else if(module_state_2 == I)
if(istype(module_state_2,/obj/item/robotic_multibelt))
if(isrobotmultibelt(module_state_2))
var/obj/item/robotic_multibelt/toolbelt = module_state_2
toolbelt.original_state()
if(istype(module_state_2,/obj/item/borg/sight))
@@ -55,7 +55,7 @@
module_state_2 = null
inv2.icon_state = "inv2"
else if(module_state_3 == I)
if(istype(module_state_3,/obj/item/robotic_multibelt))
if(isrobotmultibelt(module_state_3))
var/obj/item/robotic_multibelt/toolbelt = module_state_3
toolbelt.original_state()
if(istype(module_state_3,/obj/item/borg/sight))

View File

@@ -166,7 +166,7 @@
/obj/item/weldingtool/electric/mounted/cyborg/update_icon()
. = ..()
if(istype(loc, /obj/item/robotic_multibelt))
if(isrobotmultibelt(loc))
var/obj/item/robotic_multibelt/our_belt = loc
if(welding)
our_belt.add_overlay("indwelder_cyborg-on")
@@ -226,7 +226,7 @@
var/selected_type = tgui_input_list(user, "Pick new colour.", "Cable Colour", GLOB.possible_cable_coil_colours)
set_cable_color(selected_type, user)
if(istype(loc, /obj/item/robotic_multibelt))
if(isrobotmultibelt(loc))
var/obj/item/robotic_multibelt/our_belt = loc
var/image/cable_image = our_belt.integrated_tool_images[name]
cable_image.color = color

View File

@@ -7,11 +7,12 @@
* tgui state: inventory_state
*
* Checks that the src_object is in the user's top-level (hand, ear, pocket, belt, etc) inventory.
* Or part of a robotic toolbelt.
**/
GLOBAL_DATUM_INIT(tgui_inventory_state, /datum/tgui_state/inventory_state, new)
/datum/tgui_state/inventory_state/can_use_topic(src_object, mob/user)
if(!(src_object in user))
/datum/tgui_state/inventory_state/can_use_topic(atom/src_object, mob/user)
if(!(src_object in user) && !(isrobotmultibelt(src_object.loc)))
return STATUS_CLOSE
return user.shared_tgui_interaction(src_object)

View File

@@ -35,7 +35,7 @@ export const PlantAnalyzer = (props) => {
// Resizable just in case the calculatedHeight fails
return (
<Window width={400} height={calculatedHeight}>
<Window.Content scrollable>
<Window.Content>
<PlantAnalyzerContent />
</Window.Content>
</Window>
@@ -57,6 +57,8 @@ const PlantAnalyzerContent = (props) => {
return (
<Section
fill
scrollable
title="Plant Information"
buttons={
<Stack>