diff --git a/code/modules/buildmode/submodes/lightmaker.dm b/code/modules/buildmode/submodes/lightmaker.dm new file mode 100644 index 000000000000..2b50343c641a --- /dev/null +++ b/code/modules/buildmode/submodes/lightmaker.dm @@ -0,0 +1,31 @@ +/datum/buildmode_mode/lightmaker + key = "lightmaker" + + var/light_range = 3 + var/light_power = 1 + var/light_color = COLOR_WHITE + +/datum/buildmode_mode/lightmaker/show_help(client/target_client) + to_chat(target_client, span_purple(examine_block( + "[span_bold("Left Click")] -> Create light\n\ + [span_bold("Right Click")] -> Delete light\n\ + [span_bold("Right Click on Build Mode Button")] -> Change light properties")) + ) + +/datum/buildmode_mode/lightmaker/change_settings(client/target_client) + var/choice = alert("Change the new light range, power or color?", "Light Maker", "Range", "Power", "Color", "Cancel") + switch(choice) + if("Range") + light_range = input(target_client, "Range of light", text("Input")) as num|null + if("Power") + light_power = input(target_client, "Power of light", text("Input")) as num|null + if("Color") + light_color = input(target_client, "Light color", text("Input")) as color|null + +/datum/buildmode_mode/lightmaker/handle_click(client/target_client, params, obj/object) + var/list/modifiers = params2list(params) + + if(LAZYACCESS(modifiers, LEFT_CLICK)) + object.set_light(light_range, light_power, light_color) + if(LAZYACCESS(modifiers, RIGHT_CLICK)) + object.set_light(0,0,COLOR_WHITE) diff --git a/icons/misc/buildmode.dmi b/icons/misc/buildmode.dmi index db1e5fdba40b..44698597b02c 100644 Binary files a/icons/misc/buildmode.dmi and b/icons/misc/buildmode.dmi differ diff --git a/shiptest.dme b/shiptest.dme index a84707fb5453..114579c09d0e 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -1868,6 +1868,7 @@ #include "code\modules\buildmode\submodes\basic.dm" #include "code\modules\buildmode\submodes\boom.dm" #include "code\modules\buildmode\submodes\copy.dm" +#include "code\modules\buildmode\submodes\lightmaker.dm" #include "code\modules\buildmode\submodes\delete.dm" #include "code\modules\buildmode\submodes\fill.dm" #include "code\modules\buildmode\submodes\map_export.dm"