mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-23 00:31:57 +00:00
Also makes the mode selection interface far less tedious/painful Adds unsimulated turf overriding, and admin logging Temporary commit for storing the sdql buildmode Adds extra documentation also requires a path to be selected for "advanced" and "fill" modes, now Spaces out mode switch buttons nicer removes need for debug rights to do a fill with mob paths Adds a bunch of extra fancy paths Fox Changes pt 1 Backports /tg/station changes Fixes a double-tap issue with dclick handling of certain mobs Also no longer shows the "selection canceled" if you haven't selected a region for the buildmode that supports region selection Updates buildmode stuff
60 lines
2.1 KiB
Plaintext
60 lines
2.1 KiB
Plaintext
/datum/buildmode_mode/area_edit
|
|
key = "areaedit"
|
|
var/area/storedarea
|
|
var/image/areaimage
|
|
|
|
/datum/buildmode_mode/area_edit/New()
|
|
areaimage = image('icons/turf/areas.dmi', null, "yellow")
|
|
..()
|
|
|
|
/datum/buildmode_mode/area_edit/enter_mode(datum/click_intercept/buildmode/BM)
|
|
BM.holder.images += areaimage
|
|
|
|
/datum/buildmode_mode/area_edit/exit_mode(datum/click_intercept/buildmode/BM)
|
|
areaimage.loc = null // de-color the area
|
|
BM.holder.images -= areaimage
|
|
return ..()
|
|
|
|
/datum/buildmode_mode/area_edit/Destroy()
|
|
QDEL_NULL(areaimage)
|
|
return ..()
|
|
|
|
/datum/buildmode_mode/area_edit/show_help(mob/user)
|
|
to_chat(user, "<span class='notice'>***********************************************************</span>")
|
|
to_chat(user, "<span class='notice'>Left Mouse Button on obj/turf/mob = Paint area</span>")
|
|
to_chat(user, "<span class='notice'>Right Mouse Button on obj/turf/mob = Select area to paint</span>")
|
|
to_chat(user, "<span class='notice'>Right Mouse Button on buildmode button = Create new area</span>")
|
|
to_chat(user, "<span class='notice'>***********************************************************</span>")
|
|
|
|
/datum/buildmode_mode/area_edit/change_settings(mob/user)
|
|
var/target_path = input(user,"Enter typepath:", "Typepath", "/area")
|
|
var/areatype = text2path(target_path)
|
|
if(ispath(areatype,/area))
|
|
var/areaname = input(user,"Enter area name:", "Area name", "Area")
|
|
if(!areaname || !length(areaname))
|
|
return
|
|
storedarea = new areatype
|
|
storedarea.power_equip = 0
|
|
storedarea.power_light = 0
|
|
storedarea.power_environ = 0
|
|
storedarea.always_unpowered = 0
|
|
storedarea.name = areaname
|
|
areaimage.loc = storedarea // color our area
|
|
|
|
/datum/buildmode_mode/area_edit/handle_click(user, params, object)
|
|
var/list/pa = params2list(params)
|
|
var/left_click = pa.Find("left")
|
|
var/right_click = pa.Find("right")
|
|
|
|
if(left_click)
|
|
if(!storedarea)
|
|
to_chat(user, "<span class='warning'>Configure or select the area you want to paint first!</span>")
|
|
return
|
|
var/turf/T = get_turf(object)
|
|
if(get_area(T) != storedarea)
|
|
storedarea.contents.Add(T)
|
|
else if(right_click)
|
|
var/turf/T = get_turf(object)
|
|
storedarea = get_area(T)
|
|
areaimage.loc = storedarea // color our area
|