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
+14 -14
View File
@@ -116,7 +116,7 @@
return owner.change_skin_tone(new_s_tone)
if("skin_color")
if(can_change_skin_color(owner))
var/new_skin = input(ui.user, "Choose your character's skin colour: ", "Skin Color", rgb(owner.r_skin, owner.g_skin, owner.b_skin)) as color|null
var/new_skin = tgui_color_picker(ui.user, "Choose your character's skin colour: ", "Skin Color", rgb(owner.r_skin, owner.g_skin, owner.b_skin))
if(new_skin && can_still_topic(owner, state))
var/r_skin = hex2num(copytext(new_skin, 2, 4))
var/g_skin = hex2num(copytext(new_skin, 4, 6))
@@ -133,7 +133,7 @@
return 1
if("hair_color")
if(can_change(owner, APPEARANCE_HAIR_COLOR))
var/new_hair = input(ui.user, "Please select hair color.", "Hair Color", rgb(owner.r_hair, owner.g_hair, owner.b_hair)) as color|null
var/new_hair = tgui_color_picker(ui.user, "Please select hair color.", "Hair Color", rgb(owner.r_hair, owner.g_hair, owner.b_hair))
if(new_hair && can_still_topic(owner, state))
var/r_hair = hex2num(copytext(new_hair, 2, 4))
var/g_hair = hex2num(copytext(new_hair, 4, 6))
@@ -150,7 +150,7 @@
return 1
if("facial_hair_color")
if(can_change(owner, APPEARANCE_FACIAL_HAIR_COLOR))
var/new_facial = input(ui.user, "Please select facial hair color.", "Facial Hair Color", rgb(owner.r_facial, owner.g_facial, owner.b_facial)) as color|null
var/new_facial = tgui_color_picker(ui.user, "Please select facial hair color.", "Facial Hair Color", rgb(owner.r_facial, owner.g_facial, owner.b_facial))
if(new_facial && can_still_topic(owner, state))
var/r_facial = hex2num(copytext(new_facial, 2, 4))
var/g_facial = hex2num(copytext(new_facial, 4, 6))
@@ -161,7 +161,7 @@
return 1
if("eye_color")
if(can_change(owner, APPEARANCE_EYE_COLOR))
var/new_eyes = input(ui.user, "Please select eye color.", "Eye Color", rgb(owner.r_eyes, owner.g_eyes, owner.b_eyes)) as color|null
var/new_eyes = tgui_color_picker(ui.user, "Please select eye color.", "Eye Color", rgb(owner.r_eyes, owner.g_eyes, owner.b_eyes))
if(new_eyes && can_still_topic(owner, state))
var/r_eyes = hex2num(copytext(new_eyes, 2, 4))
var/g_eyes = hex2num(copytext(new_eyes, 4, 6))
@@ -201,7 +201,7 @@
return TRUE
if("ears_color")
if(can_change(owner, APPEARANCE_HAIR_COLOR))
var/new_hair = input(ui.user, "Please select ear color.", "Ear Color", rgb(owner.r_ears, owner.g_ears, owner.b_ears)) as color|null
var/new_hair = tgui_color_picker(ui.user, "Please select ear color.", "Ear Color", rgb(owner.r_ears, owner.g_ears, owner.b_ears))
if(new_hair && can_still_topic(owner, state))
owner.r_ears = hex2num(copytext(new_hair, 2, 4))
owner.g_ears = hex2num(copytext(new_hair, 4, 6))
@@ -212,7 +212,7 @@
return 1
if("ears2_color")
if(can_change(owner, APPEARANCE_HAIR_COLOR))
var/new_hair = input(ui.user, "Please select secondary ear color.", "2nd Ear Color", rgb(owner.r_ears2, owner.g_ears2, owner.b_ears2)) as color|null
var/new_hair = tgui_color_picker(ui.user, "Please select secondary ear color.", "2nd Ear Color", rgb(owner.r_ears2, owner.g_ears2, owner.b_ears2))
if(new_hair && can_still_topic(owner, state))
owner.r_ears2 = hex2num(copytext(new_hair, 2, 4))
owner.g_ears2 = hex2num(copytext(new_hair, 4, 6))
@@ -227,7 +227,7 @@
if(channel > length(owner.ear_secondary_colors))
return TRUE
var/existing = LAZYACCESS(owner.ear_secondary_colors, channel) || "#ffffff"
var/new_color = input(ui.user, "Please select ear color.", "2nd Ear Color", existing) as color|null
var/new_color = tgui_color_picker(ui.user, "Please select ear color.", "2nd Ear Color", existing)
if(new_color && can_still_topic(owner, state))
owner.ear_secondary_colors[channel] = new_color
update_dna(owner)
@@ -248,7 +248,7 @@
return TRUE
if("tail_color")
if(can_change(owner, APPEARANCE_HAIR_COLOR))
var/new_hair = input(ui.user, "Please select tail color.", "Tail Color", rgb(owner.r_tail, owner.g_tail, owner.b_tail)) as color|null
var/new_hair = tgui_color_picker(ui.user, "Please select tail color.", "Tail Color", rgb(owner.r_tail, owner.g_tail, owner.b_tail))
if(new_hair && can_still_topic(owner, state))
owner.r_tail = hex2num(copytext(new_hair, 2, 4))
owner.g_tail = hex2num(copytext(new_hair, 4, 6))
@@ -259,7 +259,7 @@
return 1
if("tail2_color")
if(can_change(owner, APPEARANCE_HAIR_COLOR))
var/new_hair = input(ui.user, "Please select secondary tail color.", "2nd Tail Color", rgb(owner.r_tail2, owner.g_tail2, owner.b_tail2)) as color|null
var/new_hair = tgui_color_picker(ui.user, "Please select secondary tail color.", "2nd Tail Color", rgb(owner.r_tail2, owner.g_tail2, owner.b_tail2))
if(new_hair && can_still_topic(owner, state))
owner.r_tail2 = hex2num(copytext(new_hair, 2, 4))
owner.g_tail2 = hex2num(copytext(new_hair, 4, 6))
@@ -270,7 +270,7 @@
return 1
if("tail3_color")
if(can_change(owner, APPEARANCE_HAIR_COLOR))
var/new_hair = input(ui.user, "Please select secondary tail color.", "3rd Tail Color", rgb(owner.r_tail3, owner.g_tail3, owner.b_tail3)) as color|null
var/new_hair = tgui_color_picker(ui.user, "Please select secondary tail color.", "3rd Tail Color", rgb(owner.r_tail3, owner.g_tail3, owner.b_tail3))
if(new_hair && can_still_topic(owner, state))
owner.r_tail3 = hex2num(copytext(new_hair, 2, 4))
owner.g_tail3 = hex2num(copytext(new_hair, 4, 6))
@@ -293,7 +293,7 @@
return TRUE
if("wing_color")
if(can_change(owner, APPEARANCE_HAIR_COLOR))
var/new_hair = input(ui.user, "Please select wing color.", "Wing Color", rgb(owner.r_wing, owner.g_wing, owner.b_wing)) as color|null
var/new_hair = tgui_color_picker(ui.user, "Please select wing color.", "Wing Color", rgb(owner.r_wing, owner.g_wing, owner.b_wing))
if(new_hair && can_still_topic(owner, state))
owner.r_wing = hex2num(copytext(new_hair, 2, 4))
owner.g_wing = hex2num(copytext(new_hair, 4, 6))
@@ -304,7 +304,7 @@
return 1
if("wing2_color")
if(can_change(owner, APPEARANCE_HAIR_COLOR))
var/new_hair = input(ui.user, "Please select secondary wing color.", "2nd Wing Color", rgb(owner.r_wing2, owner.g_wing2, owner.b_wing2)) as color|null
var/new_hair = tgui_color_picker(ui.user, "Please select secondary wing color.", "2nd Wing Color", rgb(owner.r_wing2, owner.g_wing2, owner.b_wing2))
if(new_hair && can_still_topic(owner, state))
owner.r_wing2 = hex2num(copytext(new_hair, 2, 4))
owner.g_wing2 = hex2num(copytext(new_hair, 4, 6))
@@ -315,7 +315,7 @@
return 1
if("wing3_color")
if(can_change(owner, APPEARANCE_HAIR_COLOR))
var/new_hair = input(ui.user, "Please select secondary wing color.", "3rd Wing Color", rgb(owner.r_wing3, owner.g_wing3, owner.b_wing3)) as color|null
var/new_hair = tgui_color_picker(ui.user, "Please select secondary wing color.", "3rd Wing Color", rgb(owner.r_wing3, owner.g_wing3, owner.b_wing3))
if(new_hair && can_still_topic(owner, state))
owner.r_wing3 = hex2num(copytext(new_hair, 2, 4))
owner.g_wing3 = hex2num(copytext(new_hair, 4, 6))
@@ -353,7 +353,7 @@
return TRUE
if (4) //color
var/current = markings[name_marking] ? markings[name_marking] : "#000000"
var/marking_color = input(ui.user, "Please select marking color", "Marking color", current) as color|null
var/marking_color = tgui_color_picker(ui.user, "Please select marking color", "Marking color", current)
if(marking_color && can_still_topic(owner, state))
var/datum/sprite_accessory/marking/mark_datum = body_marking_styles_list[name_marking]
if (owner.change_marking_color(mark_datum, marking_color))
+2 -1
View File
@@ -33,7 +33,8 @@
/datum/tgui_module/ship/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
var/list/data = ..()
data["mapRef"] = linked?.map_name
if(linked)
data["mapRef"] = linked.map_name
return data
/datum/tgui_module/ship/tgui_status(mob/user)