Files
Bubberstation/code/modules/buildmode/submodes/copy.dm
SkyratBot eaf6c62f02 [MIRROR] Build Mode Preview + better help text [MDB IGNORE] (#22023)
* Build Mode Preview + better help text (#76095)

## About The Pull Request
Gives `Adv Build Mode` and `Fill` an item preview, and puts the help
text for build mode modes into an examine block.

https://github.com/tgstation/tgstation/assets/66640614/6751c721-6ddd-4761-8311-fb002ea905ac

![image](https://github.com/tgstation/tgstation/assets/66640614/3f6fe986-1767-4639-94d3-523f1039c947)

![image](https://github.com/tgstation/tgstation/assets/66640614/a7eae938-a575-46bd-b00e-865f04e0de20)

## Why It's Good For The Game
It's good to see what you're doing.

## Changelog
🆑 Tattle
admin: build mode help text is in an examine block
admin: adv build mode and fill now have item previews
/🆑

---------

Co-authored-by: tattle <article.disaster@ gmail.com>
Co-authored-by: san7890 <the@ san7890.com>

* Build Mode Preview + better help text

---------

Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
Co-authored-by: tattle <article.disaster@ gmail.com>
Co-authored-by: san7890 <the@ san7890.com>
2023-07-01 16:17:31 -04:00

27 lines
909 B
Plaintext

/datum/buildmode_mode/copy
key = "copy"
var/atom/movable/stored = null
/datum/buildmode_mode/copy/Destroy()
stored = null
return ..()
/datum/buildmode_mode/copy/show_help(client/builder)
to_chat(builder, span_purple(examine_block(
"[span_bold("Spawn a copy of selected target")] -> Left Mouse Button on obj/turf/mob\n\
[span_bold("Select target to copy")] -> Right Mouse Button on obj/mob"))
)
/datum/buildmode_mode/copy/handle_click(client/c, params, obj/object)
var/list/modifiers = params2list(params)
if(LAZYACCESS(modifiers, LEFT_CLICK))
var/turf/T = get_turf(object)
if(stored)
duplicate_object(stored, spawning_location = T)
log_admin("Build Mode: [key_name(c)] copied [stored] to [AREACOORD(object)]")
else if(LAZYACCESS(modifiers, RIGHT_CLICK))
if(ismovable(object)) // No copying turfs for now.
to_chat(c, span_notice("[object] set as template."))
stored = object