From 973af110eb8d47c99fdf3d401b6fc7ceaa6b9ecd Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 29 Mar 2023 23:28:25 +0200 Subject: [PATCH] [MIRROR] Adds preference for "Tagger" paint color. [MDB IGNORE] (#20132) * Adds preference for "Tagger" paint color. (#74281) ## About The Pull Request Per the title, this PR allows you to pick your starting paint color from the "Tagger" quirk on the character preferences menu. ![image](https://user-images.githubusercontent.com/105025397/227810007-4706c743-31c2-47d8-80ac-e11687d36c00.png) This replaces the starting color being random; it does not prevent you from changing the color later as normal. ## Why It's Good For The Game It's a minor quality of life change. This will mostly be helpful to players who have some "signature" color they like to use, to prevent having to manually select it (and possibly input a color code) every round. It will be of less relevance to those who tend to select new colors every round anyway. Possible downsides are mainly adding another pref to the menu, although this shouldn't be too much of an annoyance since it only appears if you already have the relevant quirk. It does also remove the _ability_ to have a randomly-chosen paint color, though I'm not sure if that matters. ## Changelog :cl: qol: you can choose your default paint color for the "Tagger" quirk from prefs. /:cl: * Adds preference for "Tagger" paint color. --------- Co-authored-by: lizardqueenlexi <105025397+lizardqueenlexi@users.noreply.github.com> --- code/datums/quirks/positive_quirks.dm | 4 +++- code/modules/client/preferences/paint_color.dm | 14 ++++++++++++++ tgstation.dme | 1 + .../features/character_preferences/paint_color.tsx | 6 ++++++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 code/modules/client/preferences/paint_color.dm create mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/paint_color.tsx diff --git a/code/datums/quirks/positive_quirks.dm b/code/datums/quirks/positive_quirks.dm index 4c4beb01a6b..30854202ea4 100644 --- a/code/datums/quirks/positive_quirks.dm +++ b/code/datums/quirks/positive_quirks.dm @@ -295,7 +295,9 @@ ) /datum/quirk/item_quirk/tagger/add_unique(client/client_source) - give_item_to_holder(/obj/item/toy/crayon/spraycan, list(LOCATION_BACKPACK = ITEM_SLOT_BACKPACK, LOCATION_HANDS = ITEM_SLOT_HANDS)) + var/obj/item/toy/crayon/spraycan/can = new + can.set_painting_tool_color(client_source?.prefs.read_preference(/datum/preference/color/paint_color)) + give_item_to_holder(can, list(LOCATION_BACKPACK = ITEM_SLOT_BACKPACK, LOCATION_HANDS = ITEM_SLOT_HANDS)) /datum/quirk/throwingarm name = "Throwing Arm" diff --git a/code/modules/client/preferences/paint_color.dm b/code/modules/client/preferences/paint_color.dm new file mode 100644 index 00000000000..a44208b8325 --- /dev/null +++ b/code/modules/client/preferences/paint_color.dm @@ -0,0 +1,14 @@ +/// Preference for the roundstart color of the spraycan given by the Tagger quirk. +/datum/preference/color/paint_color + savefile_key = "paint_color" + savefile_identifier = PREFERENCE_CHARACTER + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + +/datum/preference/color/paint_color/is_accessible(datum/preferences/preferences) + if (!..(preferences)) + return FALSE + + return "Tagger" in preferences.all_quirks + +/datum/preference/color/paint_color/apply_to_human(mob/living/carbon/human/target, value) + return diff --git a/tgstation.dme b/tgstation.dme index 488addc69a0..5531cc418f6 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3047,6 +3047,7 @@ #include "code\modules\client\preferences\multiz_performance.dm" #include "code\modules\client\preferences\names.dm" #include "code\modules\client\preferences\ooc.dm" +#include "code\modules\client\preferences\paint_color.dm" #include "code\modules\client\preferences\parallax.dm" #include "code\modules\client\preferences\pda.dm" #include "code\modules\client\preferences\persistent_scars.dm" diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/paint_color.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/paint_color.tsx new file mode 100644 index 00000000000..e2b9ef00993 --- /dev/null +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/paint_color.tsx @@ -0,0 +1,6 @@ +import { Feature, FeatureColorInput } from '../base'; + +export const paint_color: Feature = { + name: 'Spray paint color', + component: FeatureColorInput, +};