Let's you paint items in loadout and spray can coloring modes (#5508)

## About The Pull Request
Adds new options for spray can that let you paint items without actually
making them washable with water, you also get an option to remove
permanent coloring just like prismatic gray extract does.
You also can now paint non-greyscale items from loadout so you don't
need to take spray can and use it after you spawn.

I ran into an issue where after recoloring your item in loadout caused
runtimes so i had to make it such there is no preview for colored items
in loadout, but if you wanted to help to fix it i left a comment where
(i think) additional checks should be added- It shouldn't be a big deal
anyway, you most likely already know what color you want for your items
and if not just check it on station and then update your loadout
accordingly
## Why It's Good For The Game
We all hate it when you get sprayed with water and all of your custom
colored clothing turns back to how it was initially.
## Proof Of Testing
<details>
<summary>Screenshots/Videos</summary>
<img width="396" height="219" alt="loadout1"
src="https://github.com/user-attachments/assets/f4f29085-d8ae-49e6-8f04-c327777922a1"
/>
<img width="382" height="236" alt="spraycan"
src="https://github.com/user-attachments/assets/a6bdf733-41cc-4dea-9569-0664613bb277"
/>
<img width="146" height="143" alt="yes its actually doesnt wash"
src="https://github.com/user-attachments/assets/1904a22c-b0c1-4f8f-b507-9c2824802021"
/>

</details>

## Changelog
🆑
add: You can now repaint non-greyscale items in loadout the same way
spraycan does
add: Spray cans can color items in such a way water cant remove the
paint, and also remove permanent paint
/🆑

---------

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Roxy <94389951+SapphoQueer@users.noreply.github.com>
Co-authored-by: buffyuwu <buffyvrc@gmail.com>
This commit is contained in:
explosivekitty
2026-05-09 06:39:23 +02:00
committed by GitHub
co-authored by Copilot Roxy buffyuwu
parent 779b7c2590
commit 0afe97837f
4 changed files with 92 additions and 3 deletions
+56
View File
@@ -153,6 +153,45 @@ GLOBAL_LIST_INIT(all_loadout_categories, init_loadout_categories())
if(reskin_datum)
return set_skin(manager, user, params)
if("select_color_simple")
return item_color_painting(manager, user)
if("set_color_mode")
return item_color_mode(manager, user)
return TRUE
/datum/loadout_item/proc/item_color_painting(datum/preference_middleware/loadout/manager, mob/user)
if(manager.menu)
return FALSE
var/list/loadout = manager.get_current_loadout()
if(!loadout?[item_path])
return FALSE
var/chosen_color = tgui_color_picker(user, "Pick new color. Setting color to pitch black will remove the existing color.", "Repaint item", "#000000")
if(isnull(chosen_color))
return FALSE
var/hsl = rgb2num(chosen_color, COLORSPACE_HSL)
if(hsl[3] == 0)
loadout[item_path][INFO_CUSTOM_COLOR] = null
else
loadout[item_path][INFO_CUSTOM_COLOR] = chosen_color
manager.save_current_loadout(loadout)
return TRUE
/datum/loadout_item/proc/item_color_mode(datum/preference_middleware/loadout/manager, mob/user)
var/list/loadout = manager.get_current_loadout()
if(!loadout?[item_path])
return FALSE
if(isnull(loadout[item_path][INFO_COLOR_MODE]))
loadout[item_path][INFO_COLOR_MODE] = FALSE
loadout[item_path][INFO_COLOR_MODE] = !loadout[item_path][INFO_COLOR_MODE]
manager.save_current_loadout(loadout)
return TRUE
/// Opens up the GAGS editing menu.
@@ -305,6 +344,9 @@ GLOBAL_LIST_INIT(all_loadout_categories, init_loadout_categories())
equipped_item.set_greyscale(item_color)
update_flag |= equipped_item.slot_flags
if(item_details?[INFO_CUSTOM_COLOR] && !istype(equipper, /mob/living/carbon/human/dummy)) //the dummy check makes it not color the item in the loadout because that causes runtimes, joining into the game colors the item as intended. If you want to fix it, start here
equipped_item.add_atom_colour(color_transition_filter(item_details[INFO_CUSTOM_COLOR], item_details[INFO_COLOR_MODE] ? SATURATION_OVERRIDE : SATURATION_MULTIPLY), FIXED_COLOUR_PRIORITY)
// BUBBER EDIT CHANGE BEGIN - Descriptions
if((loadout_flags & LOADOUT_FLAG_ALLOW_NAMING) && !visuals_only)
var/renamed = FALSE
@@ -444,6 +486,20 @@ GLOBAL_LIST_INIT(all_loadout_categories, init_loadout_categories())
"button_icon" = FA_ICON_PALETTE,
"active_key" = INFO_GREYSCALE,
))
else
UNTYPED_LIST_ADD(button_list, list(
"label" = "Repaint",
"act_key" = "select_color_simple",
"button_icon" = FA_ICON_PALETTE,
"active_key" = INFO_CUSTOM_COLOR,
))
UNTYPED_LIST_ADD(button_list, list(
"label" = "Repainting mode",
"act_key" = "set_color_mode",
"active_key" = INFO_COLOR_MODE,
"active_text" = "Override Color",
"inactive_text" = "Multiply Color",
))
if(loadout_flags & LOADOUT_FLAG_ALLOW_NAMING)
UNTYPED_LIST_ADD(button_list, list(