forked from ParadiseSS13/Paradise
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Paintable multi-tile airlocks (#1378)
## Что этот PR делает Добавляет возможность использовать краситель шлюзов на двойных шлюзах. При выборе стилей, у которых нету спрайтов двойных шлюзов выводит сообщение об этом пользователю. ## Почему это хорошо для игры Больше кастомизации при строительстве. ## Изображения изменений ![image](https://github.com/ss220club/Paradise-SS220/assets/69719123/fb602e67-f08b-4c6a-93d7-c6a57aa207a1) ## Тестирование Пробежался на локалочке, всё покрасил, всё красивенько. Багов не заметил. ## Changelog :cl: tweak: Двойные шлюзы теперь можно красить (но только в определённые стили). /:cl:
- Loading branch information
1 parent
4595c1b
commit 58dbad5
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Tweak for multi-tile airlocks, to make them paintable | ||
|
||
/obj/machinery/door/airlock/multi_tile | ||
paintable = TRUE | ||
|
||
/datum/painter/airlock | ||
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, | ||
"Public" = /obj/machinery/door/airlock/multi_tile, | ||
"Security" = /obj/machinery/door/airlock/multi_tile/security, | ||
) | ||
|
||
// Special behavior for multi-tile airlocks | ||
/datum/painter/airlock/paint_atom(atom/target, mob/user) | ||
if(!istype(target, /obj/machinery/door/airlock/multi_tile)) | ||
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/obj/machinery/door/airlock/airlock = multi_paint_jobs["[paint_setting]"] | ||
if(isnull(airlock)) | ||
to_chat(user, span_warning("У выбранного стиля шлюзов нету двойной версии.")) | ||
return | ||
|
||
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 |