Files
Bubberstation/code/game/objects/structures/beds_chairs/sofa.dm
Bloop cb51a652a9 Adds automatic GAGS icon generation for mapping and the loadout menu (#90940)
## About The Pull Request

Revival of https://github.com/tgstation/tgstation/pull/86482, which is
even more doable now that we have rustg iconforge generation.

What this PR does:

- Sets up every single GAGS icon in the game to have their own preview
icon autogenerated during compile. This is configurable to not run
during live. The icons are created in `icons/map_icons/..`
- This also has the side effect of providing accurate GAGS icons for
things like the loadout menu. No more having to create your own
previews.


![FOuGL6ofxC](https://github.com/user-attachments/assets/e5414971-7f13-4883-9f7f-a8a212b46fe8)

<details><summary>Mappers rejoice!</summary>


![StrongDMM_1oeMSoRHXT](https://github.com/user-attachments/assets/83dcfe4c-31be-4953-98f3-dff90268bbc4)


![StrongDMM_uyqu3CggPn](https://github.com/user-attachments/assets/7896f99e-2656-40e1-a9da-3a513882365a)

</details>

<details><summary>Uses iconforge so it does not take up much time during
init</summary>


![dreamdaemon_u4Md3Dqwge](https://github.com/user-attachments/assets/17baaff8-5d5e-4a4d-ba8f-9dd548024155)

</details>

---

### Copied from https://github.com/tgstation/tgstation/pull/86482 as
this still applies:

Note for Spriters:

After you've assigned the correct values to vars, you must run the game
through init on your local machine and commit the changes to the map
icon dmi files. Unit tests should catch all cases of forgetting to
assign the correct vars, or not running through init.

Note for Server Operators:

In order to not generate these icons on live I've added a new config
entry which should be disabled on live called GENERATE_ASSETS_IN_INIT in
the config.txt


## Why It's Good For The Game

No more error icons in SDMM and loadout.

## Changelog

🆑
refactor: preview icons for greyscale items are now automatically
generated, meaning you can see GAGS as they actually appear ingame while
mapping or viewing the loadout menu.
/🆑

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2025-05-24 15:21:02 -07:00

122 lines
3.5 KiB
Plaintext

/// Create colored subtypes for sofas
#define COLORED_SOFA(path, color_name, sofa_color) \
path/middle/color_name {\
color = sofa_color; \
} \
path/right/color_name {\
color = sofa_color; \
} \
path/left/color_name {\
color = sofa_color; \
} \
path/corner/color_name {\
color = sofa_color; \
}
/obj/structure/chair/sofa
name = "old ratty sofa"
icon_state = "error"
icon = 'icons/obj/chairs_wide.dmi'
buildstackamount = 1
item_chair = null
fishing_modifier = -6
has_armrest = TRUE
/obj/structure/chair/sofa/Initialize(mapload)
. = ..()
AddElement(/datum/element/soft_landing)
/obj/structure/chair/sofa/electrify_self(obj/item/assembly/shock_kit/input_shock_kit, mob/user, list/overlays_from_child_procs)
if(!overlays_from_child_procs)
var/mutable_appearance/echair_overlay = mutable_appearance('icons/obj/chairs.dmi', "echair_over", OBJ_LAYER, src, appearance_flags = KEEP_APART)
echair_overlay.pixel_x = -1
overlays_from_child_procs = list(echair_overlay)
. = ..()
/obj/structure/chair/sofa/corner/handle_layer() //only the armrest/back of this chair should cover the mob.
return
/obj/structure/chair/sofa/middle
icon_state = "sofamiddle"
/obj/structure/chair/sofa/left
icon_state = "sofaend_left"
/obj/structure/chair/sofa/right
icon_state = "sofaend_right"
/obj/structure/chair/sofa/corner
icon_state = "sofacorner"
COLORED_SOFA(/obj/structure/chair/sofa, brown, SOFA_BROWN)
COLORED_SOFA(/obj/structure/chair/sofa, maroon, SOFA_MAROON)
// Original icon ported from Eris(?) and updated to work here.
/obj/structure/chair/sofa/corp
name = "sofa"
desc = "Soft and cushy."
icon_state = "corp_sofamiddle"
/obj/structure/chair/sofa/corp/left
icon_state = "corp_sofaend_left"
/obj/structure/chair/sofa/corp/right
icon_state = "corp_sofaend_right"
/obj/structure/chair/sofa/corp/corner
icon_state = "corp_sofacorner"
/obj/structure/chair/sofa/corp/corner/handle_layer() //only the armrest/back of this chair should cover the mob.
return
// Ported from Skyrat
/obj/structure/chair/sofa/bench
name = "bench"
desc = "Perfectly designed to be comfortable to sit on, and hellish to sleep on."
icon = 'icons/map_icons/objects.dmi'
icon_state = "/obj/structure/chair/sofa/bench"
post_init_icon_state = "bench_middle"
greyscale_config = /datum/greyscale_config/bench_middle
greyscale_colors = "#af7d28"
has_armrest = FALSE
/obj/structure/chair/sofa/bench/left
icon_state = "/obj/structure/chair/sofa/bench/left"
post_init_icon_state = "bench_left"
greyscale_config = /datum/greyscale_config/bench_left
/obj/structure/chair/sofa/bench/right
icon_state = "/obj/structure/chair/sofa/bench/right"
post_init_icon_state = "bench_right"
greyscale_config = /datum/greyscale_config/bench_right
/obj/structure/chair/sofa/bench/corner
icon_state = "/obj/structure/chair/sofa/bench/corner"
post_init_icon_state = "bench_corner"
greyscale_config = /datum/greyscale_config/bench_corner
/obj/structure/chair/sofa/bench/solo
icon_state = "/obj/structure/chair/sofa/bench/solo"
post_init_icon_state = "bench_solo"
greyscale_config = /datum/greyscale_config/bench_solo
// Bamboo benches
/obj/structure/chair/sofa/bamboo
name = "bamboo bench"
desc = "A makeshift bench with a rustic aesthetic."
icon_state = "bamboo_sofamiddle"
resistance_flags = FLAMMABLE
max_integrity = 60
buildstacktype = /obj/item/stack/sheet/mineral/bamboo
buildstackamount = 3
has_armrest = FALSE
/obj/structure/chair/sofa/bamboo/left
icon_state = "bamboo_sofaend_left"
/obj/structure/chair/sofa/bamboo/right
icon_state = "bamboo_sofaend_right"
#undef COLORED_SOFA