Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds support for non-standard underwear #405

Merged
merged 3 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,7 @@ var/const/MAX_SAVE_SLOTS = 10
if("underwear")
var/list/underwear_options = gender == MALE ? GLOB.underwear_m : GLOB.underwear_f
var/old_gender = gender
var/new_underwear = tgui_input_list(user, "Choose your character's underwear:", "Character Preference", underwear_options)
var/new_underwear = tgui_input_list(user, "Choose your character's underwear:", "Character Preference", underwear_options-GLOB.underwear_restricted)
if(old_gender != gender)
return
if(new_underwear)
Expand All @@ -1604,7 +1604,7 @@ var/const/MAX_SAVE_SLOTS = 10
if("undershirt")
var/list/undershirt_options = gender == MALE ? GLOB.undershirt_m : GLOB.undershirt_f
var/old_gender = gender
var/new_undershirt = tgui_input_list(user, "Choose your character's undershirt:", "Character Preference", undershirt_options)
var/new_undershirt = tgui_input_list(user, "Choose your character's undershirt:", "Character Preference", undershirt_options-GLOB.undershirt_restricted)
if(old_gender != gender)
return
if(new_undershirt)
Expand Down
6 changes: 4 additions & 2 deletions code/modules/mob/new_player/preferences_setup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
randomize_hair_color("facial")
randomize_eyes_color()
randomize_skin_color()
underwear = gender == MALE ? pick(GLOB.underwear_m) : pick(GLOB.underwear_f)
undershirt = gender == MALE ? pick(GLOB.undershirt_m) : pick(GLOB.undershirt_f)
var/list/undershirt_options = gender == MALE ? GLOB.undershirt_m : GLOB.undershirt_f
undershirt = pick(undershirt_options-GLOB.undershirt_restricted)
var/list/underwear_options = gender == MALE ? GLOB.underwear_m : GLOB.underwear_f
underwear = pick(underwear_options-GLOB.underwear_restricted)
backbag = 2
age = rand(AGE_MIN,AGE_MAX)
if(H)
Expand Down
13 changes: 12 additions & 1 deletion code/modules/mob/new_player/sprite_accessories/undershirt.dm
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
GLOBAL_LIST_INIT_TYPED(undershirt_m, /datum/sprite_accessory/undershirt, setup_undershirt(MALE))
GLOBAL_LIST_INIT_TYPED(undershirt_f, /datum/sprite_accessory/undershirt, setup_undershirt(FEMALE))
GLOBAL_LIST_INIT_TYPED(undershirt_restricted, /datum/sprite_accessory/undershirt, setup_undershirt(null, TRUE))

/proc/setup_undershirt(restricted_gender)
/proc/setup_undershirt(restricted_gender, restricted)
var/list/undershirt_list = list()
for(var/undershirt_type in subtypesof(/datum/sprite_accessory/undershirt))
var/datum/sprite_accessory/undershirt/undershirt_datum = new undershirt_type
if(restricted_gender && undershirt_datum.gender != restricted_gender && (undershirt_datum.gender == MALE || undershirt_datum.gender == FEMALE))
continue
if(restricted && !undershirt_datum.restricted)
continue
if(undershirt_datum.camo_conforming)
undershirt_list["[undershirt_datum.name] (Camo Conforming)"] = undershirt_datum
var/datum/sprite_accessory/undershirt/classic_datum = new undershirt_type
Expand All @@ -28,6 +31,7 @@ GLOBAL_LIST_INIT_TYPED(undershirt_f, /datum/sprite_accessory/undershirt, setup_u
/datum/sprite_accessory/undershirt
icon = 'icons/mob/humans/undershirt.dmi'
var/camo_conforming = FALSE
var/restricted = FALSE

/datum/sprite_accessory/undershirt/proc/get_image(mob_gender)
var/selected_icon_state = icon_state
Expand Down Expand Up @@ -117,3 +121,10 @@ GLOBAL_LIST_INIT_TYPED(undershirt_f, /datum/sprite_accessory/undershirt, setup_u
icon_state = "strapless"
gender = FEMALE
camo_conforming = TRUE

// Restricted
/datum/sprite_accessory/undershirt/telnyashka
name = "Telnyashka"
icon_state = "telnyashka"
gender = NEUTER
restricted = TRUE
6 changes: 5 additions & 1 deletion code/modules/mob/new_player/sprite_accessories/underwear.dm
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
GLOBAL_LIST_INIT_TYPED(underwear_m, /datum/sprite_accessory/underwear, setup_underwear(MALE))
GLOBAL_LIST_INIT_TYPED(underwear_f, /datum/sprite_accessory/underwear, setup_underwear(FEMALE))
GLOBAL_LIST_INIT_TYPED(underwear_restricted, /datum/sprite_accessory/underwear, setup_underwear(null, TRUE))

/proc/setup_underwear(restricted_gender)
/proc/setup_underwear(restricted_gender, restricted)
var/list/underwear_list = list()
for(var/underwear_type in subtypesof(/datum/sprite_accessory/underwear))
var/datum/sprite_accessory/underwear/underwear_datum = new underwear_type
if(restricted_gender && underwear_datum.gender != restricted_gender && (underwear_datum.gender == MALE || underwear_datum.gender == FEMALE))
continue
if(restricted && !underwear_datum.restricted)
continue
if(underwear_datum.camo_conforming)
underwear_list["[underwear_datum.name] (Camo Conforming)"] = underwear_datum
var/datum/sprite_accessory/underwear/classic_datum = new underwear_type
Expand All @@ -28,6 +31,7 @@ GLOBAL_LIST_INIT_TYPED(underwear_f, /datum/sprite_accessory/underwear, setup_und
/datum/sprite_accessory/underwear
icon = 'icons/mob/humans/underwear.dmi'
var/camo_conforming = FALSE
var/restricted = FALSE

/datum/sprite_accessory/underwear/proc/get_image(mob_gender)
var/selected_icon_state = icon_state
Expand Down
Binary file modified icons/mob/humans/undershirt.dmi
Binary file not shown.
Loading