Icon Autoslicing (#79659)

## About The Pull Request

Ok so you know all the dmis we have that are made to work with the
smoothing system? carpets, walls, etc.

The proper way to edit those is to convert them into a png with 5
"states' it in (one for 0 connections, one for horizontal, one for
vertical, one for all cardinals and one for all directions) and then
modify THAT, then run it through [the cutter
tool.](https://github.com/tgstation/icon-cutter)

But none ever does that, because we explain it fucking nowhere. So
instead, let's keep all those "base" files in the repo, alongside the
configs they work with, and "cut" the pngs into dmis as a part of the
build process.

I wrote a guide for how to interact with this system as a spriter, you
can find it
[HERE](https://github.com/LemonInTheDark/tgstation/blob/slice-the-sky/icons/Cutter.md).

[Adds a icon cutter build
task](https://github.com/tgstation/tgstation/commit/52143d2e96498de92421d516e0dd3f23936f88d8)

This relies on action ninja's hypnagogic (find more
[here](https://github.com/actioninja/hypnagogic)), a rust based icon
cutter.
It operates inline with the file structure, searching the codebase for
templates and resource files and compiling them down to dmis.

It can do way more then just bitmask stuff, but that is what we are
using it for rn.

Hope is to prevent for eternity the "I'm just gonna edit each of these
255 icon states that's how this carpet was made right?" meme, and allow
more expansive use of smoothing in future

[Adds a lint that ensures config files work
right](https://github.com/tgstation/tgstation/commit/21eeab9cf831c5fdac5a9b366478a9dab285c20c)

Checks to ensure they have a paired png and dmi, and also avoids issues
with uncompiled changes by double checking that nothing happens
before/after a cutter run

[Pulls all non smoothed states out of structures into bespoke
dmis](https://github.com/tgstation/tgstation/commit/a730e0cb47fc0a622fe265bccc296cec8d3a8fea)

This is required because the cutter cannot output named icon states,
only the actual cut icon

[Does something similar to
walls](https://github.com/tgstation/tgstation/commit/40780e9481103c8ee9e16538d1c2d0cdc124eeb9)

Moves reinforced walls decon stuff from their icon to a var on the type
and a set of states in the reinforced_states dmi

Moves falsewalls into their own dmi, this involved some changes to
gamecode to ensure falsewalls knew which dmi to use and what key.
Makes falsewalls display as such in editor rather then just walls

Moves smoothrock's gibonite overlays into their own file for similar
reasons

[Same thing different day
(Floors)](https://github.com/tgstation/tgstation/commit/9a3da3b69705278f39af109ac5ce86d27c2479a1)

Pulls bespoke floor icon states into their own file, splits up neon
carpets into multiple files to make cutting possible

[Actually adds the cut templates and their matching png
files](https://github.com/tgstation/tgstation/commit/1bd8920dc90d1ee1b934b6dadc39f2331854f5fa)

Not much to report here, outside of I changed the prefix for bamboo
walls to bamboo_wall so it works with false_walls

## Why It's Good For The Game


![image](https://github.com/tgstation/tgstation/assets/58055496/7c3ac7fb-873c-481b-8667-082e39432876)

None should have to manually edit cut dmis. Ever.
Also this makes adding a new smoothed thing trivial, don't even need to
know what tool you're using to do it. V good v good.
Sets us up nicely for wallening's well, wall of sprites.

Some structural decisions, we are essentially committing build artifacts
here. That's the best way of handling it because otherwise mappers could
need to run build.bat before opening a map, and that is stupid!

## Changelog
🆑
refactor: (Almost) all smoothed icons can now be edited in their pre cut
forms
/🆑
This commit is contained in:
LemonInTheDark
2023-12-06 19:43:00 -08:00
committed by GitHub
parent 46ed40579e
commit b8fc9b367e
371 changed files with 1058 additions and 81 deletions
+44 -34
View File
@@ -5,8 +5,8 @@
name = "wall"
desc = "A huge chunk of metal used to separate rooms."
anchored = TRUE
icon = 'icons/turf/walls/wall.dmi'
icon_state = "wall-0"
icon = 'icons/turf/walls/false_walls.dmi'
icon_state = "wall-open"
base_icon_state = "wall"
layer = LOW_OBJ_LAYER
density = TRUE
@@ -19,6 +19,8 @@
can_atmos_pass = ATMOS_PASS_DENSITY
rad_insulation = RAD_MEDIUM_INSULATION
material_flags = MATERIAL_EFFECTS
/// The icon this falsewall is faking being. we'll switch out our icon with this when we're in fake mode
var/fake_icon = 'icons/turf/walls/wall.dmi'
var/mineral = /obj/item/stack/sheet/iron
var/mineral_amount = 2
var/walltype = /turf/closed/wall
@@ -71,9 +73,15 @@
/obj/structure/falsewall/update_icon_state()
if(opening)
icon_state = "fwall_[density ? "opening" : "closing"]"
icon = fake_icon
icon_state = "[base_icon_state]-[density ? "opening" : "closing"]"
return ..()
icon_state = density ? "[base_icon_state]-[smoothing_junction]" : "fwall_open"
if(density)
icon = initial(icon)
icon_state = "[base_icon_state]-[smoothing_junction]"
else
icon = fake_icon
icon_state = "[base_icon_state]-open"
return ..()
/obj/structure/falsewall/proc/ChangeToWall(delete = 1)
@@ -148,8 +156,8 @@
/obj/structure/falsewall/reinforced
name = "reinforced wall"
desc = "A huge chunk of reinforced metal used to separate rooms."
icon = 'icons/turf/walls/reinforced_wall.dmi'
icon_state = "reinforced_wall-0"
fake_icon = 'icons/turf/walls/reinforced_wall.dmi'
icon_state = "reinforced_wall-open"
base_icon_state = "reinforced_wall"
walltype = /turf/closed/wall/r_wall
mineral = /obj/item/stack/sheet/plasteel
@@ -171,8 +179,8 @@
/obj/structure/falsewall/uranium
name = "uranium wall"
desc = "A wall with uranium plating. This is probably a bad idea."
icon = 'icons/turf/walls/uranium_wall.dmi'
icon_state = "uranium_wall-0"
fake_icon = 'icons/turf/walls/uranium_wall.dmi'
icon_state = "uranium_wall-open"
base_icon_state = "uranium_wall"
mineral = /obj/item/stack/sheet/mineral/uranium
walltype = /turf/closed/wall/mineral/uranium
@@ -222,8 +230,8 @@
/obj/structure/falsewall/gold
name = "gold wall"
desc = "A wall with gold plating. Swag!"
icon = 'icons/turf/walls/gold_wall.dmi'
icon_state = "gold_wall-0"
fake_icon = 'icons/turf/walls/gold_wall.dmi'
icon_state = "gold_wall-open"
base_icon_state = "gold_wall"
mineral = /obj/item/stack/sheet/mineral/gold
walltype = /turf/closed/wall/mineral/gold
@@ -234,8 +242,8 @@
/obj/structure/falsewall/silver
name = "silver wall"
desc = "A wall with silver plating. Shiny."
icon = 'icons/turf/walls/silver_wall.dmi'
icon_state = "silver_wall-0"
fake_icon = 'icons/turf/walls/silver_wall.dmi'
icon_state = "silver_wall-open"
base_icon_state = "silver_wall"
mineral = /obj/item/stack/sheet/mineral/silver
walltype = /turf/closed/wall/mineral/silver
@@ -246,8 +254,8 @@
/obj/structure/falsewall/diamond
name = "diamond wall"
desc = "A wall with diamond plating. You monster."
icon = 'icons/turf/walls/diamond_wall.dmi'
icon_state = "diamond_wall-0"
fake_icon = 'icons/turf/walls/diamond_wall.dmi'
icon_state = "diamond_wall-open"
base_icon_state = "diamond_wall"
mineral = /obj/item/stack/sheet/mineral/diamond
walltype = /turf/closed/wall/mineral/diamond
@@ -259,8 +267,8 @@
/obj/structure/falsewall/plasma
name = "plasma wall"
desc = "A wall with plasma plating. This is definitely a bad idea."
icon = 'icons/turf/walls/plasma_wall.dmi'
icon_state = "plasma_wall-0"
fake_icon = 'icons/turf/walls/plasma_wall.dmi'
icon_state = "plasma_wall-open"
base_icon_state = "plasma_wall"
mineral = /obj/item/stack/sheet/mineral/plasma
walltype = /turf/closed/wall/mineral/plasma
@@ -271,8 +279,8 @@
/obj/structure/falsewall/bananium
name = "bananium wall"
desc = "A wall with bananium plating. Honk!"
icon = 'icons/turf/walls/bananium_wall.dmi'
icon_state = "bananium_wall-0"
fake_icon = 'icons/turf/walls/bananium_wall.dmi'
icon_state = "bananium_wall-open"
base_icon_state = "bananium_wall"
mineral = /obj/item/stack/sheet/mineral/bananium
walltype = /turf/closed/wall/mineral/bananium
@@ -284,8 +292,8 @@
/obj/structure/falsewall/sandstone
name = "sandstone wall"
desc = "A wall with sandstone plating. Rough."
icon = 'icons/turf/walls/sandstone_wall.dmi'
icon_state = "sandstone_wall-0"
fake_icon = 'icons/turf/walls/sandstone_wall.dmi'
icon_state = "sandstone_wall-open"
base_icon_state = "sandstone_wall"
mineral = /obj/item/stack/sheet/mineral/sandstone
walltype = /turf/closed/wall/mineral/sandstone
@@ -296,8 +304,8 @@
/obj/structure/falsewall/wood
name = "wooden wall"
desc = "A wall with wooden plating. Stiff."
icon = 'icons/turf/walls/wood_wall.dmi'
icon_state = "wood_wall-0"
fake_icon = 'icons/turf/walls/wood_wall.dmi'
icon_state = "wood_wall-open"
base_icon_state = "wood_wall"
mineral = /obj/item/stack/sheet/mineral/wood
walltype = /turf/closed/wall/mineral/wood
@@ -308,7 +316,9 @@
/obj/structure/falsewall/bamboo
name = "bamboo wall"
desc = "A wall with bamboo finish. Zen."
icon = 'icons/turf/walls/bamboo_wall.dmi'
fake_icon = 'icons/turf/walls/bamboo_wall.dmi'
icon_state = "bamboo_wall-open"
base_icon_state = "bamboo_wall"
mineral = /obj/item/stack/sheet/mineral/bamboo
walltype = /turf/closed/wall/mineral/bamboo
smoothing_flags = SMOOTH_BITMASK
@@ -318,8 +328,8 @@
/obj/structure/falsewall/iron
name = "rough iron wall"
desc = "A wall with rough metal plating."
icon = 'icons/turf/walls/iron_wall.dmi'
icon_state = "iron_wall-0"
fake_icon = 'icons/turf/walls/iron_wall.dmi'
icon_state = "iron_wall-open"
base_icon_state = "iron_wall"
mineral = /obj/item/stack/rods
mineral_amount = 5
@@ -332,8 +342,8 @@
/obj/structure/falsewall/abductor
name = "alien wall"
desc = "A wall with alien alloy plating."
icon = 'icons/turf/walls/abductor_wall.dmi'
icon_state = "abductor_wall-0"
fake_icon = 'icons/turf/walls/abductor_wall.dmi'
icon_state = "abductor_wall-open"
base_icon_state = "abductor_wall"
mineral = /obj/item/stack/sheet/mineral/abductor
walltype = /turf/closed/wall/mineral/abductor
@@ -344,8 +354,8 @@
/obj/structure/falsewall/titanium
name = "wall"
desc = "A light-weight titanium wall used in shuttles."
icon = 'icons/turf/walls/shuttle_wall.dmi'
icon_state = "shuttle_wall-0"
fake_icon = 'icons/turf/walls/shuttle_wall.dmi'
icon_state = "shuttle_wall-open"
base_icon_state = "shuttle_wall"
mineral = /obj/item/stack/sheet/mineral/titanium
walltype = /turf/closed/wall/mineral/titanium
@@ -356,8 +366,8 @@
/obj/structure/falsewall/plastitanium
name = "wall"
desc = "An evil wall of plasma and titanium."
icon = 'icons/turf/walls/plastitanium_wall.dmi'
icon_state = "plastitanium_wall-0"
fake_icon = 'icons/turf/walls/plastitanium_wall.dmi'
icon_state = "plastitanium_wall-open"
base_icon_state = "plastitanium_wall"
mineral = /obj/item/stack/sheet/mineral/plastitanium
walltype = /turf/closed/wall/mineral/plastitanium
@@ -368,9 +378,9 @@
/obj/structure/falsewall/material
name = "wall"
desc = "A huge chunk of material used to separate rooms."
icon = 'icons/turf/walls/materialwall.dmi'
icon_state = "materialwall-0"
base_icon_state = "materialwall"
fake_icon = 'icons/turf/walls/material_wall.dmi'
icon_state = "material_wall-open"
base_icon_state = "material_wall"
walltype = /turf/closed/wall/material
smoothing_flags = SMOOTH_BITMASK
smoothing_groups = SMOOTH_GROUP_WALLS + SMOOTH_GROUP_CLOSED_TURFS + SMOOTH_GROUP_MATERIAL_WALLS
+5 -4
View File
@@ -867,8 +867,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/window/reinforced/tinted/frosted/spaw
bash_sound = 'sound/weapons/slashmiss.ogg'
break_sound = 'sound/items/poster_ripped.ogg'
hit_sound = 'sound/weapons/slashmiss.ogg'
var/static/mutable_appearance/torn = mutable_appearance('icons/obj/smooth_structures/paperframes.dmi',icon_state = "torn", layer = ABOVE_OBJ_LAYER - 0.1)
var/static/mutable_appearance/paper = mutable_appearance('icons/obj/smooth_structures/paperframes.dmi',icon_state = "paper", layer = ABOVE_OBJ_LAYER - 0.1)
var/static/mutable_appearance/torn = mutable_appearance('icons/obj/smooth_structures/structure_variations.dmi',icon_state = "paper-torn", layer = ABOVE_OBJ_LAYER - 0.1)
var/static/mutable_appearance/paper = mutable_appearance('icons/obj/smooth_structures/structure_variations.dmi',icon_state = "paper-whole", layer = ABOVE_OBJ_LAYER - 0.1)
/obj/structure/window/paperframe/Initialize(mapload)
. = ..()
@@ -927,14 +927,15 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/window/reinforced/tinted/frosted/spaw
/obj/structure/window/bronze
name = "brass window"
desc = "A paper-thin pane of translucent yet reinforced brass. Nevermind, this is just weak bronze!"
icon = 'icons/obj/smooth_structures/clockwork_window.dmi'
icon_state = "clockwork_window_single"
icon = 'icons/obj/smooth_structures/structure_variations.dmi'
icon_state = "clockwork_window-single"
glass_type = /obj/item/stack/sheet/bronze
/obj/structure/window/bronze/unanchored
anchored = FALSE
/obj/structure/window/bronze/fulltile
icon = 'icons/obj/smooth_structures/clockwork_window.dmi'
icon_state = "clockwork_window-0"
base_icon_state = "clockwork_window"
smoothing_flags = SMOOTH_BITMASK