diff --git a/code/modules/integrated_electronics/core/assemblies/clothing.dm b/code/modules/integrated_electronics/core/assemblies/clothing.dm index acf4322f2bf..fe851c173f2 100644 --- a/code/modules/integrated_electronics/core/assemblies/clothing.dm +++ b/code/modules/integrated_electronics/core/assemblies/clothing.dm @@ -18,6 +18,9 @@ /obj/item/device/electronic_assembly/clothing/resolve_ui_host() return clothing +/obj/item/device/electronic_assembly/clothing/get_assembly_holder() + return clothing + /obj/item/device/electronic_assembly/clothing/update_icon() ..() clothing.icon_state = icon_state diff --git a/code/modules/integrated_electronics/core/assemblies/generic.dm b/code/modules/integrated_electronics/core/assemblies/generic.dm index aac232f8d67..6a77e645b8d 100644 --- a/code/modules/integrated_electronics/core/assemblies/generic.dm +++ b/code/modules/integrated_electronics/core/assemblies/generic.dm @@ -249,3 +249,6 @@ w_class = ITEMSIZE_TINY max_components = IC_COMPONENTS_BASE / 2 max_complexity = IC_COMPLEXITY_BASE / 2 + +/obj/item/device/electronic_assembly/proc/get_assembly_holder() + return src \ No newline at end of file diff --git a/code/modules/integrated_electronics/subtypes/output.dm b/code/modules/integrated_electronics/subtypes/output.dm index a425b3b92b1..f0f9fae1ce6 100644 --- a/code/modules/integrated_electronics/subtypes/output.dm +++ b/code/modules/integrated_electronics/subtypes/output.dm @@ -65,22 +65,23 @@ outputs = list() activators = list("toggle light" = IC_PINTYPE_PULSE_IN) spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH - var/light_toggled = 0 + var/light_toggled = FALSE var/light_brightness = 3 - var/light_rgb = "#FFFFFF" + var/light_rgb = COLOR_WHITE power_draw_idle = 0 // Adjusted based on brightness. + light_wedge = LIGHT_WIDE /obj/item/integrated_circuit/output/light/do_work() light_toggled = !light_toggled update_lighting() /obj/item/integrated_circuit/output/light/proc/update_lighting() - if(light_toggled) - if(assembly) - assembly.set_light(l_range = light_brightness, l_power = light_brightness, l_color = light_rgb) - else - if(assembly) - assembly.set_light(0) + if(assembly) + var/atom/atom_holder = assembly.get_assembly_holder() + if(light_toggled) + atom_holder.set_light(l_range = light_brightness, l_power = light_brightness, l_color = light_rgb, uv = 0, angle = light_wedge) + else + atom_holder.set_light(0) power_draw_idle = light_toggled ? light_brightness * 2 : 0 /obj/item/integrated_circuit/output/light/disconnect_all() diff --git a/html/changelogs/lights_in_clothes.yml b/html/changelogs/lights_in_clothes.yml new file mode 100644 index 00000000000..e09367d3a7a --- /dev/null +++ b/html/changelogs/lights_in_clothes.yml @@ -0,0 +1,8 @@ +author: mikomyazaki + +delete-after: True + +changes: + - bugfix: "Lights will now work properly when inside clothing assemblies." + - tweak: "Lighting ICs now only illuminate a cone infront of them, like flashlights." + - balance: "Lighting ICs now do not produce UV." \ No newline at end of file