[MIRROR] ports tgui color input from bubbers (#9919)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-01-23 12:35:22 -07:00
committed by GitHub
parent 615ba5fdc7
commit fc21a0cb26
60 changed files with 1949 additions and 166 deletions

View File

@@ -195,7 +195,7 @@
// VOREStation Add End
else if(href_list["pref_runechat_color"])
var/new_runechat_color = input(user, "Choose your character's runechat colour (#000000 for random):", "Character Preference", pref.runechat_color) as color|null
var/new_runechat_color = tgui_color_picker(user, "Choose your character's runechat colour (#000000 for random):", "Character Preference", pref.runechat_color)
if(new_runechat_color && CanUseTopic(user))
pref.runechat_color = new_runechat_color
// whenever we change this, we update our mob

View File

@@ -628,7 +628,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["hair_color"])
if(!has_flag(mob_species, HAS_HAIR_COLOR))
return TOPIC_NOACTION
var/new_hair = input(user, "Choose your character's hair colour:", "Character Preference", pref.read_preference(/datum/preference/color/human/hair_color)) as color|null
var/new_hair = tgui_color_picker(user, "Choose your character's hair colour:", "Character Preference", pref.read_preference(/datum/preference/color/human/hair_color))
if(new_hair && has_flag(mob_species, HAS_HAIR_COLOR) && CanUseTopic(user))
pref.update_preference_by_type(/datum/preference/color/human/hair_color, new_hair)
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -636,7 +636,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["grad_color"])
if(!has_flag(mob_species, HAS_HAIR_COLOR))
return TOPIC_NOACTION
var/new_grad = input(user, "Choose your character's secondary hair color:", "Character Preference", pref.read_preference(/datum/preference/color/human/grad_color)) as color|null
var/new_grad = tgui_color_picker(user, "Choose your character's secondary hair color:", "Character Preference", pref.read_preference(/datum/preference/color/human/grad_color))
if(new_grad && has_flag(mob_species, HAS_HAIR_COLOR) && CanUseTopic(user))
pref.update_preference_by_type(/datum/preference/color/human/grad_color, new_grad)
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -690,7 +690,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["facial_color"])
if(!has_flag(mob_species, HAS_HAIR_COLOR))
return TOPIC_NOACTION
var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference", pref.read_preference(/datum/preference/color/human/facial_color)) as color|null
var/new_facial = tgui_color_picker(user, "Choose your character's facial-hair colour:", "Character Preference", pref.read_preference(/datum/preference/color/human/facial_color))
if(new_facial && has_flag(mob_species, HAS_HAIR_COLOR) && CanUseTopic(user))
pref.update_preference_by_type(/datum/preference/color/human/facial_color, new_facial)
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -703,7 +703,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["eye_color"])
if(!has_flag(mob_species, HAS_EYE_COLOR))
return TOPIC_NOACTION
var/new_eyes = input(user, "Choose your character's eye colour:", "Character Preference", pref.read_preference(/datum/preference/color/human/eyes_color)) as color|null
var/new_eyes = tgui_color_picker(user, "Choose your character's eye colour:", "Character Preference", pref.read_preference(/datum/preference/color/human/eyes_color))
if(new_eyes && has_flag(mob_species, HAS_EYE_COLOR) && CanUseTopic(user))
pref.update_preference_by_type(/datum/preference/color/human/eyes_color, new_eyes)
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -719,7 +719,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["skin_color"])
if(!has_flag(mob_species, HAS_SKIN_COLOR))
return TOPIC_NOACTION
var/new_skin = input(user, "Choose your character's skin colour: ", "Character Preference", pref.read_preference(/datum/preference/color/human/skin_color)) as color|null
var/new_skin = tgui_color_picker(user, "Choose your character's skin colour: ", "Character Preference", pref.read_preference(/datum/preference/color/human/skin_color))
if(new_skin && has_flag(mob_species, HAS_SKIN_COLOR) && CanUseTopic(user))
pref.update_preference_by_type(/datum/preference/color/human/skin_color, new_skin)
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -812,7 +812,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
if (isnull(pref.body_markings[M]["color"]))
if (tgui_alert(user, "You currently have customized marking colors. This will reset each bodypart's color. Are you sure you want to continue?","Reset Bodypart Colors",list("Yes","No")) != "Yes")
return TOPIC_NOACTION
var/mark_color = input(user, "Choose the [M] color: ", "Character Preference", pref.body_markings[M]["color"]) as color|null
var/mark_color = tgui_color_picker(user, "Choose the [M] color: ", "Character Preference", pref.body_markings[M]["color"])
if(mark_color && CanUseTopic(user))
pref.body_markings[M] = pref.mass_edit_marking_list(M,FALSE,TRUE,pref.body_markings[M],color="[mark_color]")
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -837,7 +837,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
if (pref.body_markings.Find(marking) == 0)
winshow(user, "prefs_markings_subwindow", FALSE)
return TOPIC_NOACTION
var/mark_color = input(user, "Choose the [marking] color: ", "Character Preference", pref.body_markings[marking]["color"]) as color|null
var/mark_color = tgui_color_picker(user, "Choose the [marking] color: ", "Character Preference", pref.body_markings[marking]["color"])
if(mark_color && CanUseTopic(user))
pref.body_markings[marking] = pref.mass_edit_marking_list(marking,FALSE,TRUE,pref.body_markings[marking],color="[mark_color]")
markings_subwindow(user, marking)
@@ -850,7 +850,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
return TOPIC_NOACTION
var/zone = href_list["zone"]
pref.body_markings[marking]["color"] = null //turn off the color button outside the submenu
var/mark_color = input(user, "Choose the [marking] color: ", "Character Preference", pref.body_markings[marking][zone]["color"]) as color|null
var/mark_color = tgui_color_picker(user, "Choose the [marking] color: ", "Character Preference", pref.body_markings[marking][zone]["color"])
if(mark_color && CanUseTopic(user))
pref.body_markings[marking][zone]["color"] = "[mark_color]"
markings_subwindow(user, marking)
@@ -1079,7 +1079,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["synth2_color"])
var/new_color = input(user, "Choose your character's synth colour: ", "Character Preference", pref.read_preference(/datum/preference/color/human/synth_color)) as color|null
var/new_color = tgui_color_picker(user, "Choose your character's synth colour: ", "Character Preference", pref.read_preference(/datum/preference/color/human/synth_color))
if(new_color && CanUseTopic(user))
pref.update_preference_by_type(/datum/preference/color/human/synth_color, new_color)
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -1132,22 +1132,22 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["ear_color"])
var/new_earc = input(user, "Choose your character's ear colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/ears_color1)) as color|null
var/new_earc = tgui_color_picker(user, "Choose your character's ear colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/ears_color1))
if(new_earc)
pref.update_preference_by_type(/datum/preference/color/human/ears_color1, new_earc)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["ear_color2"])
var/new_earc2 = input(user, "Choose your character's ear colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/ears_color2)) as color|null
var/new_earc2 = tgui_color_picker(user, "Choose your character's ear colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/ears_color2))
if(new_earc2)
pref.update_preference_by_type(/datum/preference/color/human/ears_color2, new_earc2)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["ear_color3"])
var/new_earc3 = input(user, "Choose your character's tertiary ear colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/ears_color3)) as color|null
var/new_earc3 = tgui_color_picker(user, "Choose your character's tertiary ear colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/ears_color3))
if(new_earc3)
pref.update_preference_by_type(/datum/preference/color/human/ears_color3, new_earc3)
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -1164,12 +1164,12 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
if(channel > GLOB.fancy_sprite_accessory_color_channel_names.len)
return TOPIC_NOACTION
// this would say 'secondary ears' but you'd get 'choose your character's primary secondary ear colour' which sounds silly
var/new_color = input(
var/new_color = tgui_color_picker(
user,
"Choose your character's [lowertext(GLOB.fancy_sprite_accessory_color_channel_names[channel])] ear colour:",
"Secondary Ear Coloration",
LAZYACCESS(pref.ear_secondary_colors, channel) || "#ffffff",
) as color | null
)
if(!new_color)
return TOPIC_NOACTION
// ensures color channel list is at least that long
@@ -1185,22 +1185,22 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["tail_color"])
var/new_tailc = input(user, "Choose your character's tail/taur colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/tail_color1)) as color|null
var/new_tailc = tgui_color_picker(user, "Choose your character's tail/taur colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/tail_color1))
if(new_tailc)
pref.update_preference_by_type(/datum/preference/color/human/tail_color1, new_tailc)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["tail_color2"])
var/new_tailc2 = input(user, "Choose your character's secondary tail/taur colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/tail_color2)) as color|null
var/new_tailc2 = tgui_color_picker(user, "Choose your character's secondary tail/taur colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/tail_color2))
if(new_tailc2)
pref.update_preference_by_type(/datum/preference/color/human/tail_color2, new_tailc2)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["tail_color3"])
var/new_tailc3 = input(user, "Choose your character's tertiary tail/taur colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/tail_color3)) as color|null
var/new_tailc3 = tgui_color_picker(user, "Choose your character's tertiary tail/taur colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/tail_color3))
if(new_tailc3)
pref.update_preference_by_type(/datum/preference/color/human/tail_color3, new_tailc3)
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -1213,22 +1213,22 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["wing_color"])
var/new_wingc = input(user, "Choose your character's wing colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/wing_color1)) as color|null
var/new_wingc = tgui_color_picker(user, "Choose your character's wing colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/wing_color1))
if(new_wingc)
pref.update_preference_by_type(/datum/preference/color/human/wing_color1, new_wingc)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["wing_color2"])
var/new_wingc = input(user, "Choose your character's secondary wing colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/wing_color2)) as color|null
var/new_wingc = tgui_color_picker(user, "Choose your character's secondary wing colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/wing_color2))
if(new_wingc)
pref.update_preference_by_type(/datum/preference/color/human/wing_color2, new_wingc)
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["wing_color3"])
var/new_wingc = input(user, "Choose your character's tertiary wing colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/wing_color3)) as color|null
var/new_wingc = tgui_color_picker(user, "Choose your character's tertiary wing colour:", "Character Preference",
pref.read_preference(/datum/preference/color/human/wing_color3))
if(new_wingc)
pref.update_preference_by_type(/datum/preference/color/human/wing_color3, new_wingc)
return TOPIC_REFRESH_UPDATE_PREVIEW