ports tgui color input from bubbers (#16934)

* ports tgui color input from monkeystation

* .

* push that real quick

* .

* .

* cleanup

* fix for 516

* port bubbers pre set selection

* also this

* allow 20 saved states

* oups

* regex replace

* urg

* use the update by type

* .

* .

* highlight?

* larger?

* fix those

* keep anyone below 516 on old style
This commit is contained in:
Kashargul
2025-01-22 00:27:45 +01:00
committed by GitHub
parent 7266c4c5dc
commit c0e339b1ea
56 changed files with 1913 additions and 108 deletions
@@ -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>."))
+1 -1
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)
@@ -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.")
@@ -208,7 +208,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
+1 -1
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()
@@ -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
@@ -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)
. = ..()
+1 -1
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()
@@ -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