Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paintable multi-tile airlocks #1378

Merged
merged 5 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modular_ss220/objects/_objects.dme
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@
#include "code/flashlight.dm"
#include "code/material_pouch.dm"
#include "code/components.dm"
#include "code/airlock_painter.dm"
44 changes: 44 additions & 0 deletions modular_ss220/objects/code/airlock_painter.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Tweak for multi-tile airlocks, to make them paintable

/obj/machinery/door/airlock/multi_tile
paintable = TRUE

// Special behavior for multi-tile airlocks
/datum/painter/airlock/paint_atom(atom/target, mob/user)
if(!istype(target, /obj/machinery/door/airlock/multi_tile))
AyIong marked this conversation as resolved.
Show resolved Hide resolved
return ..()
if(!paint_setting)
to_chat(user, span_warning("Сперва вам нужно выбрать стиль покраски."))
return

var/obj/machinery/door/airlock/A = target
if(!A.paintable)
to_chat(user, span_warning("Этот тип шлюза не может быть покрашен."))
return

var/static/list/multi_paint_jobs = list(
"Atmospherics" = /obj/machinery/door/airlock/multi_tile/atmospheric,
"Command" = /obj/machinery/door/airlock/multi_tile/command,
"Engineering" = /obj/machinery/door/airlock/multi_tile/engineering,
"Mining" = /obj/machinery/door/airlock/multi_tile/supply,
dj-34 marked this conversation as resolved.
Show resolved Hide resolved
"Public" = /obj/machinery/door/airlock/multi_tile,
"Security" = /obj/machinery/door/airlock/multi_tile/security,
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот код нужно перенести прямо в датум, а не оставлять в проке, как сделано в оригинале.


var/obj/machinery/door/airlock/airlock = multi_paint_jobs["[paint_setting]"]
if(isnull(airlock))
to_chat(user, span_warning("У выбранного стиля шлюзов нету двойной версии."))
return
AyIong marked this conversation as resolved.
Show resolved Hide resolved

var/obj/structure/door_assembly/assembly = initial(airlock.assemblytype)
if(A.assemblytype == assembly)
to_chat(user, span_notice("Этот шлюз уже покрашен в цветовую схему \"[paint_setting]\"!"))
return

if(do_after_once(user, 2 SECONDS, FALSE, A))
A.icon = initial(airlock.icon)
A.overlays_file = initial(airlock.overlays_file)
A.assemblytype = initial(airlock.assemblytype)
A.update_icon()
return TRUE
return
Loading