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

[MIRROR] Better contrasted wall sprites & wall paint layering system #3029

Open
wants to merge 1 commit into
base: dev-sierra
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
11 changes: 0 additions & 11 deletions code/__defines/doors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,3 @@
#define DOOR_OPERATING_YES 1
/// Door has been emagged or is otherwise non functional.
#define DOOR_OPERATING_BROKEN -1


// Flags for `/obj/machinery/door/airlock/var/paintable`
/// The main airlock body is paintable.
#define AIRLOCK_PAINTABLE_MAIN FLAG(0)
/// The stripe decal is paintable.
#define AIRLOCK_PAINTABLE_STRIPE FLAG(1)
/// Other detailing is paintable.
#define AIRLOCK_PAINTABLE_DETAIL FLAG(2)
/// The window is paintable.
#define AIRLOCK_PAINTABLE_WINDOW FLAG(3)
7 changes: 7 additions & 0 deletions code/__defines/materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,10 @@
#define MATERIAL_RIGID 40
#define MATERIAL_HARD 60
#define MATERIAL_VERY_HARD 80

//Wall & Airlock layering flags
#define MATERIAL_PAINTABLE_MAIN FLAG(0)
#define MATERIAL_PAINTABLE_STRIPE FLAG(1)
#define MATERIAL_PAINTABLE_DETAIL FLAG(2)
#define MATERIAL_PAINTABLE_WINDOW FLAG(3)
#define MATERIAL_WALL_HAS_EDGES FLAG(4)
24 changes: 24 additions & 0 deletions code/_global_vars/lists/objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,27 @@ GLOBAL_DATUM_INIT(universe, /datum/universal_state, new)
GLOBAL_LIST_INIT(full_alphabet, list("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"))

GLOBAL_LIST_EMPTY(meteor_list)
<<<<<<< ours
=======

GLOBAL_LIST_EMPTY(shield_generators) // All shield generators

GLOBAL_LIST_INIT(wall_blend_objects, list(
/obj/machinery/door,
/obj/structure/wall_frame,
/obj/structure/grille,
/obj/structure/window/reinforced/full,
/obj/structure/window/reinforced/polarized/full,
/obj/structure/window/shuttle,
/obj/structure/window/boron_basic/full,
/obj/structure/window/boron_reinforced/full
))

GLOBAL_LIST_INIT(wall_noblend_objects, list(
/obj/machinery/door/window
))

GLOBAL_LIST_INIT(wall_fullblend_objects, list(
/obj/structure/wall_frame
))
>>>>>>> theirs
10 changes: 5 additions & 5 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
/// String. Partial icon state for generating the airlock appearance overlay.
var/airlock_type = "Standard"
var/static/list/airlock_icon_cache = list()
/// Bitflag (Any of `AIRLOCK_PAINTABLE_*`). Determines what parts of the airlock can be recolored with paint.
var/paintable = AIRLOCK_PAINTABLE_MAIN | AIRLOCK_PAINTABLE_STRIPE
/// Bitflag (Any of `MATERIAL_PAINTABLE*`). Determines what parts of the airlock can be recolored with paint.
var/paintable = MATERIAL_PAINTABLE_MAIN | MATERIAL_PAINTABLE_STRIPE
/// Color. The color of the main door body.
var/door_color = null
/// Color. The color of the stripe detail.
Expand Down Expand Up @@ -255,7 +255,7 @@
emag_file = 'icons/obj/doors/external/emag.dmi'
assembly_type = /obj/structure/door_assembly/door_assembly_ext
door_color = COLOR_NT_RED
paintable = AIRLOCK_PAINTABLE_MAIN
paintable = MATERIAL_PAINTABLE_MAIN

/obj/machinery/door/airlock/external/inherit_access_from_area()
..()
Expand Down Expand Up @@ -380,7 +380,7 @@
explosion_resistance = 20
opacity = 1
assembly_type = /obj/structure/door_assembly/door_assembly_hatch
paintable = AIRLOCK_PAINTABLE_STRIPE
paintable = MATERIAL_PAINTABLE_STRIPE

/obj/machinery/door/airlock/hatch/maintenance
name = "Maintenance Hatch"
Expand Down Expand Up @@ -1344,7 +1344,7 @@ About the new airlock wires panel:
brace.update_access()
update_icon()
if (glass)
paintable |= AIRLOCK_PAINTABLE_WINDOW
paintable |= MATERIAL_PAINTABLE_WINDOW
window_material = SSmaterials.get_material_by_name(init_material_window)
if (!window_color)
window_color = window_material.icon_colour
Expand Down
6 changes: 5 additions & 1 deletion code/game/objects/effects/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@
/obj/paint/LateInitialize(mapload)
var/turf/simulated/wall/W = get_turf(src)
if(istype(W))
W.paint_color = color
if(W.material.wall_flags & MATERIAL_PAINTABLE_MAIN)
W.paint_color = color
if(W.material.wall_flags & MATERIAL_PAINTABLE_STRIPE)
W.stripe_color = color
W.update_icon()
var/obj/structure/wall_frame/WF = locate() in loc
if(WF)
WF.paint_color = color
WF.stripe_color = color
WF.update_icon()
qdel(src)

Expand Down
126 changes: 103 additions & 23 deletions code/game/objects/items/devices/paint_sprayer.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define AIRLOCK_REGION_PAINT "Paint"
#define AIRLOCK_REGION_STRIPE "Stripe"
#define AIRLOCK_REGION_WINDOW "Window"
#define PAINT_REGION_PAINT "Paint"
#define PAINT_REGION_STRIPE "Stripe"
#define PAINT_REGION_WINDOW "Window"

#define PLACEMENT_MODE_QUARTERS 1
#define PLACEMENT_MODE_TRIANGLES 2
Expand All @@ -19,6 +19,7 @@
desc = "A slender and none-too-sophisticated device capable of applying paint on floors, walls, exosuits and certain airlocks."
var/decal = "Quarter-Tile"
var/paint_color
var/wall_paint_region = PAINT_REGION_PAINT
var/category

var/list/decals = list(
Expand Down Expand Up @@ -109,6 +110,7 @@
var/radial = list()
radial["Remove all decals"] = mutable_appearance("icons/screen/radial.dmi", "cable_invalid")
radial["Pick color"] = mutable_appearance("icons/screen/radial.dmi", "color_hexagon")
radial["Switch wall paint region"] = mutable_appearance("icons/screen/radial.dmi", "wall_paint_swap")
for (var/key in categories)
radial[key] = mutable_appearance("icons/screen/radial.dmi", categories[key]["icon_state"])
var/choice = show_radial_menu(user, user, radial, require_near = TRUE, radius = 50, tooltips = TRUE, check_locs = list(src))
Expand All @@ -121,6 +123,9 @@
if ("Pick color")
choose_color(user)
return
if ("Switch wall paint region")
choose_wall_paint_region(user)
return
category = categories[choice]["id"]
show_decals_by_category(user)

Expand Down Expand Up @@ -178,22 +183,31 @@
new_color = pick_color_from_floor(A, user)
else if (istype(A, /obj/machinery/door/airlock))
new_color = pick_color_from_airlock(A, user)
else if (istype(A, /turf/simulated/wall))
new_color = pick_color_from_wall(A, user)
else if (istype(A, /obj/structure/wall_frame))
var/obj/structure/wall_frame/wall_frame = A
new_color = wall_frame.stripe_color
else if (A.atom_flags & ATOM_FLAG_CAN_BE_PAINTED)
new_color = A.get_color()
if (!change_color(new_color, user))
to_chat(user, SPAN_WARNING("\The [A] does not have a color that you could pick from."))
return TRUE // There was an attempt to pick a color.

/obj/item/device/paint_sprayer/proc/apply_paint(atom/A, mob/user, click_parameters)
if (A.atom_flags & ATOM_FLAG_CAN_BE_PAINTED)
A.set_color(paint_color)
. = TRUE
if (istype(A, /turf/simulated/wall))
. = paint_wall(A, user)
else if (istype(A, /turf/simulated/floor))
. = paint_floor(A, user, click_parameters)
else if (istype(A, /obj/machinery/door/airlock))
. = paint_airlock(A, user)
else if (istype(A, /obj/structure/wall_frame))
. = paint_wall_frame(A, user)
else if (istype(A, /mob/living/exosuit))
to_chat(user, SPAN_WARNING("You can't paint an active exosuit. Dismantle it first."))
else if (A.atom_flags & ATOM_FLAG_CAN_BE_PAINTED)
A.set_color(paint_color)
. = TRUE
if (.)
playsound(get_turf(src), 'sound/effects/spray3.ogg', 30, 1, -6)
return .
Expand All @@ -207,6 +221,14 @@
LIST_DEC(F.decals)
F.update_icon()
. = TRUE
else if (istype(A, /turf/simulated/wall))
var/turf/simulated/wall/wall = A
wall.paint_wall(null)
wall.stripe_wall(null)
. = TRUE
else if (istype(A, /obj/structure/wall_frame))
var/obj/structure/wall_frame/wall_frame = A
. = wall_frame.stripe_wall_frame(null)
else if (istype(A, /obj/machinery/door/airlock))
var/obj/machinery/door/airlock/D = A
if (D.paintable)
Expand Down Expand Up @@ -308,11 +330,11 @@
if (!D.paintable)
return FALSE
switch (select_airlock_region(D, user, "Where do you wish to pick the color from?"))
if (AIRLOCK_REGION_PAINT)
if (PAINT_REGION_PAINT)
return D.door_color
if (AIRLOCK_REGION_STRIPE)
if (PAINT_REGION_STRIPE)
return D.stripe_color
if (AIRLOCK_REGION_WINDOW)
if (PAINT_REGION_WINDOW)
return D.window_color
else
return FALSE
Expand All @@ -323,30 +345,80 @@
return FALSE

switch (select_airlock_region(D, user, "What do you wish to paint?"))
if (AIRLOCK_REGION_PAINT)
if (PAINT_REGION_PAINT)
D.paint_airlock(paint_color)
if (AIRLOCK_REGION_STRIPE)
if (PAINT_REGION_STRIPE)
D.stripe_airlock(paint_color)
if (AIRLOCK_REGION_WINDOW)
if (PAINT_REGION_WINDOW)
D.paint_window(paint_color)
else
return FALSE
return TRUE

/obj/item/device/paint_sprayer/proc/select_airlock_region(obj/machinery/door/airlock/D, mob/user, input_text)
/obj/item/device/paint_sprayer/proc/select_airlock_region(obj/machinery/door/airlock/door, mob/user, input_text)
var/choice
var/list/choices = list()
if (D.paintable & AIRLOCK_PAINTABLE_MAIN)
choices |= AIRLOCK_REGION_PAINT
if (D.paintable & AIRLOCK_PAINTABLE_STRIPE)
choices |= AIRLOCK_REGION_STRIPE
if (D.paintable & AIRLOCK_PAINTABLE_WINDOW)
choices |= AIRLOCK_REGION_WINDOW
if (door.paintable & MATERIAL_PAINTABLE_MAIN)
choices |= PAINT_REGION_PAINT
if (door.paintable & MATERIAL_PAINTABLE_STRIPE)
choices |= PAINT_REGION_STRIPE
if (door.paintable & MATERIAL_PAINTABLE_WINDOW)
choices |= PAINT_REGION_WINDOW
choice = input(user, input_text) as null|anything in sortList(choices)
if (user.incapacitated() || !D || !user.Adjacent(D))
if (!user.use_sanity_check(door, src))
return FALSE
return choice

/obj/item/device/paint_sprayer/proc/paint_wall(turf/simulated/wall/wall, mob/user)
if(istype(wall) && (!wall.material?.wall_flags))
to_chat(user, SPAN_WARNING("You can't paint this wall type."))
return
if (!user.use_sanity_check(wall, src))
return FALSE
if(istype(wall))
if(wall_paint_region == PAINT_REGION_PAINT)
if(!(wall.material?.wall_flags & MATERIAL_PAINTABLE_MAIN))
to_chat(user, SPAN_WARNING("You can't paint this wall type."))
return FALSE
wall.paint_wall(paint_color)
return TRUE
else if(wall_paint_region == PAINT_REGION_STRIPE)
if(!(wall.material?.wall_flags & MATERIAL_PAINTABLE_STRIPE))
to_chat(user, SPAN_WARNING("You can't stripe this wall type."))
return FALSE
wall.stripe_wall(paint_color)
return TRUE


/obj/item/device/paint_sprayer/proc/pick_color_from_wall(turf/simulated/wall/wall, mob/user)
if (!wall.material || !wall.material.wall_flags)
return FALSE

switch (select_wall_region(wall, user, "Where do you wish to select the color from?"))
if (PAINT_REGION_PAINT)
return wall.paint_color
if (PAINT_REGION_STRIPE)
return wall.stripe_color
else
return FALSE

/obj/item/device/paint_sprayer/proc/select_wall_region(turf/simulated/wall/wall, mob/user, input_text)
var/list/choices = list()
if (wall.material.wall_flags & MATERIAL_PAINTABLE_MAIN)
choices |= PAINT_REGION_PAINT
if (wall.material.wall_flags & MATERIAL_PAINTABLE_STRIPE)
choices |= PAINT_REGION_STRIPE
var/choice = input(user, input_text) as null|anything in sortTim(choices, /proc/cmp_text_asc)
if (!user.use_sanity_check(wall, src))
return FALSE
return choice

/obj/item/device/paint_sprayer/proc/paint_wall_frame(obj/structure/wall_frame/wall_frame, mob/user)
if (!user.use_sanity_check(wall_frame, src))
return FALSE
wall_frame.stripe_wall_frame(paint_color)
return TRUE

/obj/item/device/paint_sprayer/proc/change_color(new_color, mob/user)
if (new_color)
paint_color = new_color
Expand Down Expand Up @@ -382,6 +454,14 @@
return
change_color(new_color, user)

/obj/item/device/paint_sprayer/proc/choose_wall_paint_region(mob/user)
if(wall_paint_region == PAINT_REGION_STRIPE)
wall_paint_region = PAINT_REGION_PAINT
to_chat(user, SPAN_NOTICE("You set \the [src] to paint walls."))
else
wall_paint_region = PAINT_REGION_STRIPE
to_chat(user, SPAN_NOTICE("You set \the [src] to stripe walls."))

/obj/item/device/paint_sprayer/verb/choose_preset_color()
set name = "Choose Preset Color"
set desc = "Choose a preset color."
Expand Down Expand Up @@ -409,9 +489,9 @@
return
user.ClickOn(A, params)

#undef AIRLOCK_REGION_PAINT
#undef AIRLOCK_REGION_STRIPE
#undef AIRLOCK_REGION_WINDOW
#undef PAINT_REGION_PAINT
#undef PAINT_REGION_STRIPE
#undef PAINT_REGION_WINDOW

#undef PLACEMENT_MODE_QUARTERS
#undef PLACEMENT_MODE_TRIANGLES
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/door_assembly.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
var/panel_icon = 'icons/obj/doors/station/panel.dmi'
var/fill_icon = 'icons/obj/doors/station/fill_steel.dmi'
var/glass_icon = 'icons/obj/doors/station/fill_glass.dmi'
var/paintable = AIRLOCK_PAINTABLE_MAIN|AIRLOCK_PAINTABLE_STRIPE
var/paintable = MATERIAL_PAINTABLE_MAIN|MATERIAL_PAINTABLE_STRIPE
var/door_color = "none"
var/stripe_color = "none"
var/symbol_color = "none"
Expand Down
Loading
Loading