mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
Adds tgui color picker (#94313)
## About The Pull Request Ports https://github.com/Monkestation/Monkestation2.0/pull/1231 which is a port of https://github.com/BeeStation/BeeStation-Hornet/pull/9417 which is a port of https://github.com/omgovich/react-colorful/ Also a port of https://github.com/effigy-se/effigy/blob/main/tgui/packages/tgui/interfaces/effigy/ColorPickerModal.tsx for hex color presets Admin stuff got excluded (pref-like picker, filterrific, get-variables) https://github.com/user-attachments/assets/7069bef9-81cd-4636-bf68-cbad227ef09e ## Why It's Good For The Game It's one of the only input areas that still doesn't use TGUI, leaving darkmode players flashbanged every single time a color selection UI is opened. This is also just visually great and I think a big upgrade from byond's. ## Changelog 🆑 omgovich, itsmeow, Absolucy, JohnFulpWillard, jlsnow301, TealSeer, lessthnthree add: Color selection panels now use TGUI (If you have TGUI enabled in settings). /🆑
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
|
||||
/obj/structure/curtain/attackby(obj/item/W, mob/user)
|
||||
if (istype(W, /obj/item/toy/crayon))
|
||||
color = input(user,"","Choose Color",color) as color
|
||||
color = tgui_color_picker(user, "", "Choose Color", color)
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
if(new_undies)
|
||||
dressing_human.underwear = new_undies
|
||||
if("Underwear Color")
|
||||
var/new_underwear_color = input(dressing_human, "Choose your underwear color", "Underwear Color", dressing_human.underwear_color) as color|null
|
||||
var/new_underwear_color = tgui_color_picker(dressing_human, "Choose your underwear color", "Underwear Color", dressing_human.underwear_color)
|
||||
if(new_underwear_color)
|
||||
dressing_human.underwear_color = sanitize_hexcolor(new_underwear_color)
|
||||
if("Undershirt")
|
||||
|
||||
@@ -148,7 +148,7 @@ at the cost of risking a vicious bite.**/
|
||||
var/altar_result = show_radial_menu(user, src, altar_options, custom_check = CALLBACK(src, PROC_REF(check_menu), user), require_near = TRUE, tooltips = TRUE)
|
||||
switch(altar_result)
|
||||
if("Change Color")
|
||||
var/chosen_color = input(user, "", "Choose Color", pants_color) as color|null
|
||||
var/chosen_color = tgui_color_picker(user, "", "Choose Color", pants_color)
|
||||
if(!isnull(chosen_color) && user.can_perform_action(src))
|
||||
pants_color = chosen_color
|
||||
if("Create Artefact")
|
||||
|
||||
@@ -207,7 +207,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/mirror/broken, 28)
|
||||
race_changer.skin_tone = new_s_tone
|
||||
race_changer.dna.update_ui_block(/datum/dna_block/identity/skin_tone)
|
||||
else if(HAS_TRAIT(race_changer, TRAIT_MUTANT_COLORS) && !HAS_TRAIT(race_changer, TRAIT_FIXED_MUTANT_COLORS))
|
||||
var/new_mutantcolor = input(race_changer, "Choose your skin color:", "Race change", race_changer.dna.features[FEATURE_MUTANT_COLOR]) as color|null
|
||||
var/new_mutantcolor = tgui_color_picker(race_changer, "Choose your skin color:", "Race change", race_changer.dna.features[FEATURE_MUTANT_COLOR])
|
||||
if(new_mutantcolor && can_use_mirror(race_changer))
|
||||
var/list/mutant_hsv = rgb2hsv(new_mutantcolor)
|
||||
if(mutant_hsv[3] >= 50) // mutantcolors must be bright
|
||||
@@ -257,7 +257,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/mirror/broken, 28)
|
||||
sexy.update_clothing(ITEM_SLOT_ICLOTHING) // update gender shaped clothing
|
||||
|
||||
/obj/structure/mirror/proc/change_eyes(mob/living/carbon/human/user)
|
||||
var/new_eye_color = input(user, "Choose your eye color", "Eye Color", user.eye_color_left) as color|null
|
||||
var/new_eye_color = tgui_color_picker(user, "Choose your eye color", "Eye Color", user.eye_color_left)
|
||||
if(isnull(new_eye_color) || !can_use_mirror(user))
|
||||
return
|
||||
user.set_eye_color(sanitize_hexcolor(new_eye_color))
|
||||
@@ -387,14 +387,14 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/mirror/broken, 28)
|
||||
if(hairchoice == "Style") //So you just want to use a mirror then?
|
||||
return ..()
|
||||
|
||||
var/new_hair_color = input(user, "Choose your hair color", "Hair Color", user.hair_color) as color|null
|
||||
var/new_hair_color = tgui_color_picker(user, "Choose your hair color", "Hair Color", user.hair_color)
|
||||
if(!new_hair_color || !can_use_mirror(user))
|
||||
return
|
||||
if(new_hair_color)
|
||||
user.set_haircolor(sanitize_hexcolor(new_hair_color))
|
||||
user.dna.update_ui_block(/datum/dna_block/identity/hair_color)
|
||||
if(user.physique == MALE)
|
||||
var/new_face_color = input(user, "Choose your facial hair color", "Hair Color", user.facial_hair_color) as color|null
|
||||
var/new_face_color = tgui_color_picker(user, "Choose your facial hair color", "Hair Color", user.facial_hair_color)
|
||||
if(new_face_color && can_use_mirror(user))
|
||||
user.set_facial_haircolor(sanitize_hexcolor(new_face_color))
|
||||
user.dna.update_ui_block(/datum/dna_block/identity/facial_color)
|
||||
|
||||
Reference in New Issue
Block a user