Skip to content

Commit

Permalink
Paintable multi-tile airlocks (#1378)
Browse files Browse the repository at this point in the history
## Что этот PR делает

Добавляет возможность использовать краситель шлюзов на двойных шлюзах.
При выборе стилей, у которых нету спрайтов двойных шлюзов выводит
сообщение об этом пользователю.

## Почему это хорошо для игры

Больше кастомизации при строительстве.

## Изображения изменений


![image](https://github.com/ss220club/Paradise-SS220/assets/69719123/fb602e67-f08b-4c6a-93d7-c6a57aa207a1)

## Тестирование

Пробежался на локалочке, всё покрасил, всё красивенько. Багов не
заметил.

## Changelog

:cl:
tweak: Двойные шлюзы теперь можно красить (но только в определённые
стили).
/:cl:
  • Loading branch information
ThaumicNik committed Jul 18, 2024
1 parent 4595c1b commit 58dbad5
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
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"
45 changes: 45 additions & 0 deletions modular_ss220/objects/code/airlock_painter.dm
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

0 comments on commit 58dbad5

Please sign in to comment.