Skip to content

Commit

Permalink
lightmaker
Browse files Browse the repository at this point in the history
  • Loading branch information
cuddleandtea committed Apr 16, 2024
1 parent 2edaf65 commit f89fdc0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions code/modules/buildmode/submodes/lightmaker.dm
Original file line number Diff line number Diff line change
@@ -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,0, COLOR_WHITE)
Binary file modified icons/misc/buildmode.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions shiptest.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1846,6 +1846,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"
Expand Down

0 comments on commit f89fdc0

Please sign in to comment.