mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
[MIRROR] fix robot multibelts tgui usage (#11980)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9ae66b7e85
commit
c50f4d228f
@@ -28,5 +28,6 @@
|
|||||||
#define JOINTEXT(X) jointext(X, null)
|
#define JOINTEXT(X) jointext(X, null)
|
||||||
|
|
||||||
#define isbelly(A) istype(A, /obj/belly)
|
#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 isgripperpocket(A) istype(A, /obj/item/storage/internal/gripper)
|
||||||
#define iscapturecrystal(A) istype(A, /obj/item/capture_crystal)
|
#define iscapturecrystal(A) istype(A, /obj/item/capture_crystal)
|
||||||
|
|||||||
@@ -636,7 +636,7 @@
|
|||||||
..()
|
..()
|
||||||
|
|
||||||
/obj/item/weldingtool/electric/proc/get_external_power_supply()
|
/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.
|
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
|
var/mob/living/silicon/robot/R = src.loc.loc
|
||||||
return R.cell
|
return R.cell
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
/mob/living/silicon/robot/get_active_hand(atom/A)
|
/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)
|
if(module_active == A) //If we are interacting with the item itself (I.E swapping multibelt items)
|
||||||
return module_active
|
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
|
var/obj/item/robotic_multibelt/belt = module_active
|
||||||
if(belt.selected_item)
|
if(belt.selected_item)
|
||||||
return belt.selected_item
|
return belt.selected_item
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
if(module_state_1 == I)
|
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
|
var/obj/item/robotic_multibelt/toolbelt = module_state_1
|
||||||
toolbelt.original_state()
|
toolbelt.original_state()
|
||||||
if(istype(module_state_1,/obj/item/borg/sight))
|
if(istype(module_state_1,/obj/item/borg/sight))
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
module_state_1 = null
|
module_state_1 = null
|
||||||
inv1.icon_state = "inv1"
|
inv1.icon_state = "inv1"
|
||||||
else if(module_state_2 == I)
|
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
|
var/obj/item/robotic_multibelt/toolbelt = module_state_2
|
||||||
toolbelt.original_state()
|
toolbelt.original_state()
|
||||||
if(istype(module_state_2,/obj/item/borg/sight))
|
if(istype(module_state_2,/obj/item/borg/sight))
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
module_state_2 = null
|
module_state_2 = null
|
||||||
inv2.icon_state = "inv2"
|
inv2.icon_state = "inv2"
|
||||||
else if(module_state_3 == I)
|
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
|
var/obj/item/robotic_multibelt/toolbelt = module_state_3
|
||||||
toolbelt.original_state()
|
toolbelt.original_state()
|
||||||
if(istype(module_state_3,/obj/item/borg/sight))
|
if(istype(module_state_3,/obj/item/borg/sight))
|
||||||
|
|||||||
@@ -166,7 +166,7 @@
|
|||||||
|
|
||||||
/obj/item/weldingtool/electric/mounted/cyborg/update_icon()
|
/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
|
var/obj/item/robotic_multibelt/our_belt = loc
|
||||||
if(welding)
|
if(welding)
|
||||||
our_belt.add_overlay("indwelder_cyborg-on")
|
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)
|
var/selected_type = tgui_input_list(user, "Pick new colour.", "Cable Colour", GLOB.possible_cable_coil_colours)
|
||||||
set_cable_color(selected_type, user)
|
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/obj/item/robotic_multibelt/our_belt = loc
|
||||||
var/image/cable_image = our_belt.integrated_tool_images[name]
|
var/image/cable_image = our_belt.integrated_tool_images[name]
|
||||||
cable_image.color = color
|
cable_image.color = color
|
||||||
|
|||||||
@@ -7,11 +7,12 @@
|
|||||||
* tgui state: inventory_state
|
* tgui state: inventory_state
|
||||||
*
|
*
|
||||||
* Checks that the src_object is in the user's top-level (hand, ear, pocket, belt, etc) inventory.
|
* 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)
|
GLOBAL_DATUM_INIT(tgui_inventory_state, /datum/tgui_state/inventory_state, new)
|
||||||
|
|
||||||
/datum/tgui_state/inventory_state/can_use_topic(src_object, mob/user)
|
/datum/tgui_state/inventory_state/can_use_topic(atom/src_object, mob/user)
|
||||||
if(!(src_object in user))
|
if(!(src_object in user) && !(isrobotmultibelt(src_object.loc)))
|
||||||
return STATUS_CLOSE
|
return STATUS_CLOSE
|
||||||
return user.shared_tgui_interaction(src_object)
|
return user.shared_tgui_interaction(src_object)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export const PlantAnalyzer = (props) => {
|
|||||||
// Resizable just in case the calculatedHeight fails
|
// Resizable just in case the calculatedHeight fails
|
||||||
return (
|
return (
|
||||||
<Window width={400} height={calculatedHeight}>
|
<Window width={400} height={calculatedHeight}>
|
||||||
<Window.Content scrollable>
|
<Window.Content>
|
||||||
<PlantAnalyzerContent />
|
<PlantAnalyzerContent />
|
||||||
</Window.Content>
|
</Window.Content>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -57,6 +57,8 @@ const PlantAnalyzerContent = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Section
|
<Section
|
||||||
|
fill
|
||||||
|
scrollable
|
||||||
title="Plant Information"
|
title="Plant Information"
|
||||||
buttons={
|
buttons={
|
||||||
<Stack>
|
<Stack>
|
||||||
|
|||||||
Reference in New Issue
Block a user