diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm index 7183f59e496..6edf6a3ecff 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -296,12 +296,18 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O out += "[tail_spacing ? "
" : ""]Hair
" if(has_flag(mob_species, HAS_HAIR_COLOR)) out += "Change Color [HTML_RECT(rgb(pref.r_hair, pref.g_hair, pref.b_hair))] " - out += " Style: [pref.h_style]
" + out += " Style: " \ + + " < " \ + + " > " \ + + "[pref.h_style]
" out += "
Facial
" if(has_flag(mob_species, HAS_HAIR_COLOR)) out += "Change Color [HTML_RECT(rgb(pref.r_facial, pref.g_facial, pref.b_facial))] " - out += " Style: [pref.f_style]
" + out += " Style: " \ + + " < " \ + + " > " \ + + "[pref.f_style]
" out += "
Gradient
" if(has_flag(mob_species, HAS_HAIR_COLOR)) @@ -501,7 +507,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O pref.tail_style = new_tail_style return TOPIC_REFRESH_UPDATE_PREVIEW - else if(href_list["hair_style"]) + else if(href_list["hair_style"] || href_list["next_hair_style"] || href_list["previous_hair_style"]) if(mob_species.bald) return //var/bodytype = mob_species.get_bodytype() @@ -517,7 +523,30 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O valid_hairstyles[hairstyle] = GLOB.hair_styles_list[hairstyle] - var/new_h_style = tgui_input_list(user, "Choose your character's hair style.", "Character Preference", valid_hairstyles, pref.h_style) + var/new_h_style + var/selected_style_index = valid_hairstyles.Find(pref.h_style) + + if(href_list["next_hair_style"]) + if(selected_style_index >= valid_hairstyles.len) + new_h_style = valid_hairstyles[1] + else + new_h_style = valid_hairstyles[selected_style_index + 1] + + else if(href_list["previous_hair_style"]) + if(selected_style_index <= 1) + new_h_style = valid_hairstyles[valid_hairstyles.len] + else + new_h_style = valid_hairstyles[selected_style_index - 1] + + else + new_h_style = tgui_input_list( + user, + "Choose your character's hair style.", + "Character Preference", + valid_hairstyles, + pref.h_style + ) + if(new_h_style && CanUseTopic(user)) pref.h_style = new_h_style return TOPIC_REFRESH_UPDATE_PREVIEW @@ -583,7 +612,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O pref.b_skin = GetBluePart(new_preset) return TOPIC_REFRESH_UPDATE_PREVIEW - else if(href_list["facial_style"]) + else if(href_list["facial_style"] || href_list["next_facial_style"] || href_list["previous_facial_style"]) if(mob_species.bald) return var/list/valid_facialhairstyles = list() @@ -599,7 +628,30 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O valid_facialhairstyles[facialhairstyle] = GLOB.facial_hair_styles_list[facialhairstyle] - var/new_f_style = tgui_input_list(user, "Choose your character's facial-hair style:", "Character Preference", valid_facialhairstyles, pref.f_style) + var/new_f_style + var/selected_style_index = valid_facialhairstyles.Find(pref.f_style) + + if(href_list["next_facial_style"]) + if(selected_style_index >= valid_facialhairstyles.len) + new_f_style = valid_facialhairstyles[1] + else + new_f_style = valid_facialhairstyles[selected_style_index + 1] + + else if(href_list["previous_facial_style"]) + if(selected_style_index <= 1) + new_f_style = valid_facialhairstyles[valid_facialhairstyles.len] + else + new_f_style = valid_facialhairstyles[selected_style_index - 1] + + else + new_f_style = tgui_input_list( + user, + "Choose your character's facial-hair style:", + "Character Preference", + valid_facialhairstyles, + pref.f_style + ) + if(new_f_style && has_flag(mob_species, HAS_HAIR_COLOR) && CanUseTopic(user)) pref.f_style = new_f_style return TOPIC_REFRESH_UPDATE_PREVIEW diff --git a/html/changelogs/sidveld-hairstyle-quick-switch.yml b/html/changelogs/sidveld-hairstyle-quick-switch.yml new file mode 100644 index 00000000000..154df680092 --- /dev/null +++ b/html/changelogs/sidveld-hairstyle-quick-switch.yml @@ -0,0 +1,6 @@ +author: SidVeld + +delete-after: True + +changes: + - rscadd: "Added buttons that can be used to quickly change a character's hairstyle or beard without using a list."