diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 3f7a39f07e..fdc3060a44 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -375,7 +375,7 @@ /mob/living/silicon/robot/handle_light() if(lights_on) - set_light(integrated_light_power, 1, "#FFFFFF") + set_light(integrated_light_power, 1, robot_light_col) return TRUE else . = ..() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 1e31fc297a..1610036f16 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -15,6 +15,7 @@ blocks_emissive = EMISSIVE_BLOCK_UNIQUE var/lights_on = 0 // Is our integrated light on? + var/robot_light_col = "#FFFFFF" var/used_power_this_tick = 0 var/sight_mode = 0 var/custom_name = "" diff --git a/code/modules/mob/living/silicon/robot/robot_ui.dm b/code/modules/mob/living/silicon/robot/robot_ui.dm index f7c0e31079..7262f45364 100644 --- a/code/modules/mob/living/silicon/robot/robot_ui.dm +++ b/code/modules/mob/living/silicon/robot/robot_ui.dm @@ -62,6 +62,7 @@ data["max_charge"] = R.cell?.maxcharge data["health"] = R.health data["max_health"] = R.getMaxHealth() + data["light_color"] = R.robot_light_col data["weapon_lock"] = R.weapon_lock @@ -111,6 +112,11 @@ var/mob/living/silicon/robot/R = host switch(action) + if("set_light_col") + var/new_color = params["value"] + if(findtext(new_color, GLOB.is_color)) + R.robot_light_col = new_color + . = TRUE if("select_module") R.pick_module() . = TRUE diff --git a/tgui/packages/tgui/components/ColorBox.tsx b/tgui/packages/tgui/components/ColorBox.tsx index b04cdd9241..fe55366952 100644 --- a/tgui/packages/tgui/components/ColorBox.tsx +++ b/tgui/packages/tgui/components/ColorBox.tsx @@ -24,7 +24,7 @@ export function ColorBox(props: Props) { className={classes(['ColorBox', className, computeBoxClassName(rest)])} {...computeBoxProps(rest)} > - {content || '.'} + {content} ); } diff --git a/tgui/packages/tgui/interfaces/Robotact/StatusScreen.tsx b/tgui/packages/tgui/interfaces/Robotact/StatusScreen.tsx index 08ab33efc2..f07c1c4315 100644 --- a/tgui/packages/tgui/interfaces/Robotact/StatusScreen.tsx +++ b/tgui/packages/tgui/interfaces/Robotact/StatusScreen.tsx @@ -1,7 +1,9 @@ import { useBackend } from 'tgui/backend'; import { Box, + ColorBox, ImageButton, + Input, LabeledList, NoticeBox, ProgressBar, @@ -164,9 +166,9 @@ const Configuration = (props) => { }; const Status = (props) => { - const { data } = useBackend(); + const { act, data } = useBackend(); - const { charge, max_charge, health, max_health } = data; + const { charge, max_charge, health, max_health, light_color } = data; return (
@@ -199,6 +201,17 @@ const Status = (props) => { }} /> + + + + act('set_light_col', { value })} + /> + +
); diff --git a/tgui/packages/tgui/interfaces/Robotact/types.ts b/tgui/packages/tgui/interfaces/Robotact/types.ts index 9fd62f6280..bd33676d99 100644 --- a/tgui/packages/tgui/interfaces/Robotact/types.ts +++ b/tgui/packages/tgui/interfaces/Robotact/types.ts @@ -30,6 +30,8 @@ export type Data = { health: number; max_health: number; + light_color: string; + // Modules modules_static: Module[]; emag_modules_static: Module[];