[MIRROR] Fixes borg flashlight color picker not working (#1072)

* Fixes borg flashlight color picker not working (#53996)

* Fixes borg flashlight color picker not working

Co-authored-by: zxaber <37497534+zxaber@users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-09-30 03:43:02 +01:00
committed by GitHub
co-authored by zxaber
parent 967806d87b
commit 261bed29a7
3 changed files with 47 additions and 38 deletions
@@ -346,6 +346,38 @@
enabled = 0
update_icon()
/**
* Toggles the computer's flashlight, if it has one.
*
* Called from ui_act(), does as the name implies.
* It is seperated from ui_act() to be overwritten as needed.
*/
/obj/item/modular_computer/proc/toggle_flashlight()
if(!has_light)
return FALSE
set_light_on(!light_on)
if(light_on)
set_light(comp_light_luminosity, 1, comp_light_color)
else
set_light(0)
return TRUE
/**
* Sets the computer's light color, if it has a light.
*
* Called from ui_act(), this proc takes a color string and applies it.
* It is seperated from ui_act() to be overwritten as needed.
* Arguments:
** color is the string that holds the color value that we should use. Proc auto-fails if this is null.
*/
/obj/item/modular_computer/proc/set_flashlight_color(color)
if(!has_light || !color)
return FALSE
comp_light_color = color
set_light_color(color)
update_light()
return TRUE
/obj/item/modular_computer/screwdriver_act(mob/user, obj/item/tool)
if(!all_components.len)
to_chat(user, "<span class='warning'>This device doesn't have any components installed.</span>")