mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-14 19:32:32 +00:00
Ports the changes to clicking and build mode made in https://github.com/Baystation12/Baystation12/pull/16292
52 lines
1.1 KiB
Plaintext
52 lines
1.1 KiB
Plaintext
/datum/build_mode
|
|
var/the_default = FALSE
|
|
var/name
|
|
var/icon_state
|
|
var/datum/click_handler/build_mode/host
|
|
var/mob/user
|
|
|
|
/datum/build_mode/New(var/host)
|
|
..()
|
|
src.host = host
|
|
user = src.host.user
|
|
|
|
/datum/build_mode/Destroy()
|
|
host = null
|
|
. = ..()
|
|
|
|
/datum/build_mode/proc/OnClick(var/atom/A, var/list/parameters)
|
|
return
|
|
|
|
/datum/build_mode/proc/Configurate()
|
|
return
|
|
|
|
/datum/build_mode/proc/Help()
|
|
return
|
|
|
|
/datum/build_mode/proc/Log(message)
|
|
log_admin("BUILD MODE - [name] - [key_name(usr)] - [message]")
|
|
|
|
/datum/build_mode/proc/Warn(message)
|
|
to_chat(user, "BUILD MODE - [name] - [message])")
|
|
|
|
/datum/build_mode/proc/select_subpath(given_path)
|
|
var/desired_path = input("Enter full or partial typepath.","Typepath","[given_path]") as text|null
|
|
if(!desired_path)
|
|
return
|
|
|
|
var/list/types = typesof(/atom)
|
|
var/list/matches = list()
|
|
|
|
for(var/path in types)
|
|
if(findtext("[path]", desired_path))
|
|
matches += path
|
|
|
|
if(!matches.len)
|
|
alert("No results found. Sorry.")
|
|
return
|
|
|
|
if(matches.len==1)
|
|
return matches[1]
|
|
else
|
|
return (input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches)
|