mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-13 16:13:49 +01:00
Merge remote-tracking branch 'upstream/master' into kk-rings
This commit is contained in:
@@ -17,6 +17,15 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
var/r_ears3 = 30 // Ear tertiary color.
|
||||
var/g_ears3 = 30 // Ear tertiary color
|
||||
var/b_ears3 = 30 // Ear tertiary color
|
||||
|
||||
/// The typepath of the character's selected secondary ears.
|
||||
var/ear_secondary_style
|
||||
/// The color channels for the character's selected secondary ears
|
||||
///
|
||||
/// * This is a lazy list. Its length, when populated, should but cannot be assumed
|
||||
/// to be the number of color channels supported by the secondary ear style.
|
||||
var/list/ear_secondary_colors = list()
|
||||
|
||||
var/tail_style // Type of selected tail style
|
||||
var/r_tail = 30 // Tail/Taur color
|
||||
var/g_tail = 30 // Tail/Taur color
|
||||
@@ -27,6 +36,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
var/r_tail3 = 30 // For tertiary overlay.
|
||||
var/g_tail3 = 30 // For tertiary overlay.
|
||||
var/b_tail3 = 30 // For tertiary overlay.
|
||||
|
||||
var/wing_style // Type of selected wing style
|
||||
var/r_wing = 30 // Wing color
|
||||
var/g_wing = 30 // Wing color
|
||||
@@ -37,6 +47,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
var/r_wing3 = 30 // Wing tertiary color
|
||||
var/g_wing3 = 30 // Wing tertiary color
|
||||
var/b_wing3 = 30 // Wing tertiary color
|
||||
|
||||
var/datum/browser/markings_subwindow = null
|
||||
|
||||
// Sanitize ear/wing/tail styles
|
||||
@@ -59,6 +70,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
// Sanitize for non-existent keys.
|
||||
if(ear_style && !(ear_style in get_available_styles(global.ear_styles_list)))
|
||||
ear_style = null
|
||||
if(ear_secondary_style && !(ear_secondary_style in get_available_styles(global.ear_styles_list)))
|
||||
ear_secondary_style = null
|
||||
if(wing_style && !(wing_style in get_available_styles(global.wing_styles_list)))
|
||||
wing_style = null
|
||||
if(tail_style && !(tail_style in get_available_styles(global.tail_styles_list)))
|
||||
@@ -137,6 +150,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
pref.r_ears3 = save_data["r_ears3"]
|
||||
pref.g_ears3 = save_data["g_ears3"]
|
||||
pref.b_ears3 = save_data["b_ears3"]
|
||||
pref.ear_secondary_style = save_data["ear_secondary_style"]
|
||||
pref.ear_secondary_colors = save_data["ear_secondary_colors"]
|
||||
pref.tail_style = save_data["tail_style"]
|
||||
pref.r_tail = save_data["r_tail"]
|
||||
pref.g_tail = save_data["g_tail"]
|
||||
@@ -207,6 +222,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
save_data["r_ears3"] = pref.r_ears3
|
||||
save_data["g_ears3"] = pref.g_ears3
|
||||
save_data["b_ears3"] = pref.b_ears3
|
||||
save_data["ear_secondary_style"] = pref.ear_secondary_style
|
||||
save_data["ear_secondary_colors"] = pref.ear_secondary_colors
|
||||
save_data["tail_style"] = pref.tail_style
|
||||
save_data["r_tail"] = pref.r_tail
|
||||
save_data["g_tail"] = pref.g_tail
|
||||
@@ -274,6 +291,14 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
pref.r_ears3 = sanitize_integer(pref.r_ears3, 0, 255, initial(pref.r_ears3))
|
||||
pref.g_ears3 = sanitize_integer(pref.g_ears3, 0, 255, initial(pref.g_ears3))
|
||||
pref.b_ears3 = sanitize_integer(pref.b_ears3, 0, 255, initial(pref.b_ears3))
|
||||
|
||||
// sanitize secondary ears
|
||||
pref.ear_secondary_colors = SANITIZE_LIST(pref.ear_secondary_colors)
|
||||
if(length(pref.ear_secondary_colors) > length(GLOB.fancy_sprite_accessory_color_channel_names))
|
||||
pref.ear_secondary_colors.len = length(GLOB.fancy_sprite_accessory_color_channel_names)
|
||||
for(var/i in 1 to length(pref.ear_secondary_colors))
|
||||
pref.ear_secondary_colors[i] = sanitize_hexcolor(pref.ear_secondary_colors[i], "#ffffff")
|
||||
|
||||
pref.r_tail = sanitize_integer(pref.r_tail, 0, 255, initial(pref.r_tail))
|
||||
pref.g_tail = sanitize_integer(pref.g_tail, 0, 255, initial(pref.g_tail))
|
||||
pref.b_tail = sanitize_integer(pref.b_tail, 0, 255, initial(pref.b_tail))
|
||||
@@ -348,6 +373,10 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
character.b_ears3 = pref.b_ears3
|
||||
character.g_ears3 = pref.g_ears3
|
||||
|
||||
// apply secondary ears; sanitize again to prevent runtimes in rendering
|
||||
character.ear_secondary_style = ear_styles[pref.ear_secondary_style]
|
||||
character.ear_secondary_colors = SANITIZE_LIST(pref.ear_secondary_colors)
|
||||
|
||||
var/list/tail_styles = pref.get_available_styles(global.tail_styles_list)
|
||||
character.tail_style = tail_styles[pref.tail_style]
|
||||
character.r_tail = pref.r_tail
|
||||
@@ -623,6 +652,15 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
else
|
||||
. += " Style: <a href='?src=\ref[src];ear_style=1'>Select</a><br>"
|
||||
|
||||
var/datum/sprite_accessory/ears/ears_secondary = ear_styles[pref.ear_secondary_style]
|
||||
. += span_bold("Horns") + "<br>"
|
||||
if(istype(ears_secondary))
|
||||
. += " Style: <a href='?src=\ref[src];ear_secondary_style=1'>[ears_secondary.name]</a><br>"
|
||||
for(var/channel in 1 to min(ears_secondary.get_color_channel_count(), length(GLOB.fancy_sprite_accessory_color_channel_names)))
|
||||
. += "<a href='?src=\ref[src];ear_secondary_color=[channel]'>Change [GLOB.fancy_sprite_accessory_color_channel_names[channel]] Color</a> [color_square(hex = LAZYACCESS(pref.ear_secondary_colors, channel) || "#ffffff")]<br>"
|
||||
else
|
||||
. += " Style: <a href='?src=\ref[src];ear_secondary_style=1'>Select</a><br>"
|
||||
|
||||
var/list/tail_styles = pref.get_available_styles(global.tail_styles_list)
|
||||
var/datum/sprite_accessory/tail/tail = tail_styles[pref.tail_style]
|
||||
. += span_bold("Tail") + "<br>"
|
||||
@@ -1264,6 +1302,32 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
pref.b_ears3 = hex2num(copytext(new_earc3, 6, 8))
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["ear_secondary_style"])
|
||||
var/new_style = tgui_input_list(user, "Select an ear style for this character:", "Character Preference", pref.get_available_styles(global.ear_styles_list), pref.ear_secondary_style)
|
||||
if(!new_style)
|
||||
return TOPIC_NOACTION
|
||||
pref.ear_secondary_style = new_style
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
else if(href_list["ear_secondary_color"])
|
||||
var/channel = text2num(href_list["ear_secondary_color"])
|
||||
// very important sanity check; this makes sure someone can't crash the server by setting channel to some insanely high value
|
||||
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(
|
||||
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
|
||||
// the upper bound is to have a secondary safety check because list index set is a dangerous call
|
||||
pref.ear_secondary_colors.len = clamp(length(pref.ear_secondary_colors), channel, length(GLOB.fancy_sprite_accessory_color_channel_names))
|
||||
pref.ear_secondary_colors[channel] = new_color
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["tail_style"])
|
||||
var/new_tail_style = tgui_input_list(user, "Select a tail style for this character:", "Character Preference", pref.get_available_styles(global.tail_styles_list), pref.tail_style)
|
||||
if(new_tail_style)
|
||||
|
||||
@@ -568,4 +568,12 @@ Talon pin
|
||||
"Studded Belt" = /obj/item/clothing/accessory/belt/studded
|
||||
)
|
||||
gear_tweaks += new/datum/gear_tweak/path(wristband_lists)
|
||||
gear_tweaks += gear_tweak_free_color_choice
|
||||
gear_tweaks += gear_tweak_free_color_choice
|
||||
|
||||
/datum/gear/accessory/bunny_tail
|
||||
display_name = "bunny tail, colorable"
|
||||
path = /obj/item/clothing/accessory/bunny_tail
|
||||
|
||||
/datum/gear/accessory/bunny_tail/New()
|
||||
..()
|
||||
gear_tweaks += gear_tweak_free_color_choice
|
||||
|
||||
@@ -239,6 +239,10 @@
|
||||
display_name = "rabbit ears"
|
||||
path = /obj/item/clothing/head/rabbitears
|
||||
|
||||
/datum/gear/head/rabbit/New()
|
||||
..()
|
||||
gear_tweaks += gear_tweak_free_color_choice
|
||||
|
||||
/datum/gear/head/beanie
|
||||
display_name = "beanie"
|
||||
path = /obj/item/clothing/head/beanie
|
||||
|
||||
@@ -635,3 +635,22 @@
|
||||
"black tabard-dress"=/obj/item/clothing/under/dress/tabard/black
|
||||
)
|
||||
gear_tweaks += list(new/datum/gear_tweak/path(tabarddress))
|
||||
|
||||
//bunny suits
|
||||
|
||||
/datum/gear/uniform/bunnysuit
|
||||
display_name = "bunny suit selection, colorable"
|
||||
path = /obj/item/clothing/under/bunnysuit
|
||||
|
||||
/datum/gear/uniform/bunnysuit/New()
|
||||
..()
|
||||
var/list/bunnysuit = list(
|
||||
"bunnysuit"=/obj/item/clothing/under/bunnysuit,
|
||||
"maid bunnysuit"=/obj/item/clothing/under/bunnysuit_maid,
|
||||
"reverse bunnysuit"=/obj/item/clothing/under/reverse_bunnysuit,
|
||||
"maid reverse bunnysuit"=/obj/item/clothing/under/reverse_bunnysuit_maid,
|
||||
"reverse bunnysuit, no legs"=/obj/item/clothing/under/reverse_bunnytop,
|
||||
"maid reverse bunnysuit, no legs"=/obj/item/clothing/under/reverse_bunnytop_maid
|
||||
)
|
||||
gear_tweaks += list(new/datum/gear_tweak/path(bunnysuit))
|
||||
gear_tweaks += gear_tweak_free_color_choice
|
||||
|
||||
Reference in New Issue
Block a user