[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

@@ -129,7 +129,7 @@
if(usr.incapacitated())
return
var/new_colour = input(usr, "Choose a colour.", name, paint_colour) as color|null
var/new_colour = tgui_color_picker(usr, "Choose a colour.", name, paint_colour)
if(new_colour && new_colour != paint_colour)
paint_colour = new_colour
to_chat(usr, span_notice("You set \the [src] to paint with <font color='[paint_colour]'>a new colour</font>."))

View File

@@ -318,7 +318,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
if(href_list["track_color"])
var/obj/item/gps/gps = locate(href_list["track_color"])
if(istype(gps) && !QDELETED(gps))
var/new_colour = input(usr, "Enter a new tracking color.", "GPS Waypoint Color") as color|null
var/new_colour = tgui_color_picker(usr, "Enter a new tracking color.", "GPS Waypoint Color")
if(new_colour && istype(gps) && !QDELETED(gps) && holder == usr && !usr.incapacitated())
to_chat(usr, span_notice("You adjust the colour \the [src] is using to highlight [gps.gps_tag]."))
LAZYSET(tracking_devices, href_list["track_color"], new_colour)

View File

@@ -38,7 +38,7 @@
resetmode = 1
to_chat(usr, span_infoplain("Painter reset."))
else
var/color_input = input(usr,"","Choose Light Color",setcolor) as color|null
var/color_input = tgui_color_picker(usr,"","Choose Light Color",setcolor)
if(color_input)
setcolor = sanitize_hexcolor(color_input)
var/list/setcolorRGB = hex2rgb(setcolor)

View File

@@ -138,7 +138,7 @@
return
*/
to_chat(user, "It has [uses] lights remaining.")
var/new_color = input(user, "Choose a color to set the light to! (Default is [LIGHT_COLOR_INCANDESCENT_TUBE])", "", selected_color) as color|null
var/new_color = tgui_color_picker(user, "Choose a color to set the light to! (Default is [LIGHT_COLOR_INCANDESCENT_TUBE])", "", selected_color)
if(new_color)
selected_color = new_color
to_chat(user, "The light color has been changed.")

View File

@@ -211,7 +211,7 @@
to_chat(user, span_notice("You remove the cell from \the [src]."))
update_icon()
else if(istype(W,/obj/item/multitool))
var/new_color = input(usr, "Choose a color to set the shield to!", "", effect_color) as color|null
var/new_color = tgui_color_picker(usr, "Choose a color to set the shield to!", "", effect_color)
if(new_color)
effect_color = new_color
else

View File

@@ -198,7 +198,7 @@
return
if(tgui_alert(user, "Are you sure you want to recolor your blade?", "Confirm Recolor", list("Yes", "No")) == "Yes")
var/energy_color_input = input(user,"","Choose Energy Color",lcolor) as color|null
var/energy_color_input = tgui_color_picker(user,"","Choose Energy Color",lcolor)
if(energy_color_input)
lcolor = sanitize_hexcolor(energy_color_input)
update_icon()

View File

@@ -34,6 +34,6 @@
/obj/item/grenade/smokebomb/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I,/obj/item/multitool))
var/new_smoke_color = input(user, "Choose a color for the smoke:", "Smoke Color", smoke_color) as color|null
var/new_smoke_color = tgui_color_picker(user, "Choose a color for the smoke:", "Smoke Color", smoke_color)
if(new_smoke_color)
smoke_color = new_smoke_color

View File

@@ -188,10 +188,12 @@
return
if(tgui_alert(user, "Are you sure you want to recolor your blade?", "Confirm Recolor", list("Yes", "No")) == "Yes")
var/energy_color_input = input(user,"","Choose Energy Color",lcolor) as color|null
var/energy_color_input = tgui_color_picker(user,"","Choose Energy Color",lcolor)
if(energy_color_input)
lcolor = sanitize_hexcolor(energy_color_input)
update_icon()
if(active)
set_light(lrange, lpower, lcolor)
/obj/item/melee/energy/examine(mob/user)
. = ..()

View File

@@ -209,7 +209,7 @@
to_chat(user, span_warning("You can't do that right now!"))
return
if(tgui_alert(user, "Are you sure you want to recolor your shield?", "Confirm Recolor", list("Yes", "No")) == "Yes")
var/energy_color_input = input(user,"","Choose Energy Color",lcolor) as color|null
var/energy_color_input = tgui_color_picker(user,"","Choose Energy Color",lcolor)
if(energy_color_input)
lcolor = sanitize_hexcolor(energy_color_input)
update_icon()

View File

@@ -120,7 +120,7 @@
if(usr.stat || usr.restrained() || usr.incapacitated())
return
var/new_color = input(usr, "Pick a new color", "Wallet Color", color) as color|null
var/new_color = tgui_color_picker(usr, "Pick a new color", "Wallet Color", color)
if(new_color && (new_color != color))
color = new_color