diff --git a/code/__DEFINES/~doppler_defines/preferences.dm b/code/__DEFINES/~doppler_defines/preferences.dm index 4ec3ef91d991e..80654911ff9e5 100644 --- a/code/__DEFINES/~doppler_defines/preferences.dm +++ b/code/__DEFINES/~doppler_defines/preferences.dm @@ -3,4 +3,9 @@ #define PREFERENCE_CATEGORY_DOPPLER_LORE "doppler_lore" +#define PREVIEW_PREF_JOB "Job" +#define PREVIEW_PREF_LOADOUT "Loadout" +#define PREVIEW_PREF_UNDERWEAR "Underwear" +#define PREVIEW_PREF_NAKED "Naked" + #define READ_PREFS(target, pref) (target.client?.prefs?.read_preference(/datum/preference/pref)) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 0af221417555c..7204e1892c634 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -166,6 +166,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) data["character_profiles"] = create_character_profiles() tainted_character_profiles = FALSE + data["preview_selection"] = preview_pref // DOPPLER EDIT ADDITION + data["character_preferences"] = compile_character_preferences(user) data["active_slot"] = default_slot @@ -178,6 +180,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) /datum/preferences/ui_static_data(mob/user) var/list/data = list() + data["preview_options"] = list(PREVIEW_PREF_JOB, PREVIEW_PREF_LOADOUT, PREVIEW_PREF_UNDERWEAR, PREVIEW_PREF_NAKED) + data["character_profiles"] = create_character_profiles() data["character_preview_view"] = character_preview_view.assigned_map @@ -268,6 +272,11 @@ GLOBAL_LIST_EMPTY(preferences_datums) return TRUE /// DOPPLER SHIFT ADDITION BEGIN + if("update_preview") + preview_pref = params["updated_preview"] + character_preview_view.update_body() + return TRUE + if ("set_tricolor_preference") var/requested_preference_key = params["preference"] var/index_key = params["value"] diff --git a/code/modules/mob/dead/new_player/preferences_setup.dm b/code/modules/mob/dead/new_player/preferences_setup.dm index fb3b97066e0bf..43a51bc6ebd69 100644 --- a/code/modules/mob/dead/new_player/preferences_setup.dm +++ b/code/modules/mob/dead/new_player/preferences_setup.dm @@ -93,6 +93,7 @@ return preview_job +/* DOPPLER EDIT REMOVAL - MOVED TO MASTER FILES /datum/preferences/proc/render_new_preview_appearance(mob/living/carbon/human/dummy/mannequin, show_job_clothes = TRUE) var/datum/job/no_job = SSjob.get_job_type(/datum/job/unassigned) var/datum/job/preview_job = get_highest_priority_job() || no_job @@ -127,3 +128,4 @@ mannequin.add_quirk(quirk_type, parent) return mannequin.appearance +*/ diff --git a/modular_doppler/modular_customization/preferences/preferences.dm b/modular_doppler/modular_customization/preferences/preferences.dm new file mode 100644 index 0000000000000..8d9cbe28c989d --- /dev/null +++ b/modular_doppler/modular_customization/preferences/preferences.dm @@ -0,0 +1,4 @@ + +/datum/preferences + /// Preference of how the preview should show the character. + var/preview_pref = PREVIEW_PREF_JOB diff --git a/modular_doppler/modular_customization/preferences/preferences_setup.dm b/modular_doppler/modular_customization/preferences/preferences_setup.dm new file mode 100644 index 0000000000000..d54c36cd35836 --- /dev/null +++ b/modular_doppler/modular_customization/preferences/preferences_setup.dm @@ -0,0 +1,48 @@ +/datum/preferences/proc/render_new_preview_appearance(mob/living/carbon/human/dummy/mannequin, show_job_clothes = TRUE) + var/datum/job/no_job = SSjob.get_job_type(/datum/job/unassigned) + var/datum/job/preview_job = get_highest_priority_job() || no_job + + // Set up the dummy for its photoshoot + apply_prefs_to(mannequin, TRUE) + + switch(preview_pref) + if(PREVIEW_PREF_JOB) + mannequin.underwear_visibility = NONE + // Silicons only need a very basic preview since there is no customization for them. + if (istype(preview_job, /datum/job/ai)) + return image('icons/mob/silicon/ai.dmi', icon_state = resolve_ai_icon(read_preference(/datum/preference/choiced/ai_core_display)), dir = SOUTH) + if (istype(preview_job, /datum/job/cyborg)) + return image('icons/mob/silicon/robots.dmi', icon_state = "robot", dir = SOUTH) + + mannequin.job = preview_job.title + mannequin.dress_up_as_job( + equipping = show_job_clothes ? preview_job : no_job, + visual_only = TRUE, + player_client = parent, + consistent = TRUE, + ) + + if(PREVIEW_PREF_LOADOUT) + mannequin.underwear_visibility = NONE + var/default_outfit = new /datum/outfit() + mannequin.equip_outfit_and_loadout(default_outfit, src, TRUE) + + if(PREVIEW_PREF_UNDERWEAR) + mannequin.underwear_visibility = NONE + + if(PREVIEW_PREF_NAKED) + mannequin.underwear_visibility = UNDERWEAR_HIDE_UNDIES | UNDERWEAR_HIDE_SHIRT | UNDERWEAR_HIDE_SOCKS | UNDERWEAR_HIDE_BRA + + // Apply visual quirks + // Yes we do it every time because it needs to be done after job gear + if(SSquirks?.initialized) + // And yes we need to clean all the quirk datums every time + mannequin.cleanse_quirk_datums() + for(var/quirk_name as anything in all_quirks) + var/datum/quirk/quirk_type = SSquirks.quirks[quirk_name] + if(!(initial(quirk_type.quirk_flags) & QUIRK_CHANGES_APPEARANCE)) + continue + mannequin.add_quirk(quirk_type, parent) + + mannequin.update_body() + return mannequin.appearance diff --git a/tgstation.dme b/tgstation.dme index 958148b16e3e0..40b9d41ffd116 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6771,6 +6771,8 @@ #include "modular_doppler\modular_customization\preferences\fluff.dm" #include "modular_doppler\modular_customization\preferences\frills.dm" #include "modular_doppler\modular_customization\preferences\horns.dm" +#include "modular_doppler\modular_customization\preferences\preferences.dm" +#include "modular_doppler\modular_customization\preferences\preferences_setup.dm" #include "modular_doppler\modular_customization\preferences\snout.dm" #include "modular_doppler\modular_customization\preferences\species_traits.dm" #include "modular_doppler\modular_customization\preferences\tail.dm" diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/MainPage.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/MainPage.tsx index 35ddf9d2a7326..08d65723eb721 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/MainPage.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/MainPage.tsx @@ -8,6 +8,7 @@ import { Autofocus, Box, Button, + Dropdown, // DOPPLER EDIT ADDITION Flex, Input, LabeledList, @@ -34,7 +35,7 @@ import { ServerPreferencesFetcher } from './ServerPreferencesFetcher'; import { useRandomToggleState } from './useRandomToggleState'; const CLOTHING_CELL_SIZE = 48; -const CLOTHING_SIDEBAR_ROWS = 9; +const CLOTHING_SIDEBAR_ROWS = 13.4; // NOVA EDIT CHANGE - ORIGINAL: 9 const CLOTHING_SELECTION_CELL_SIZE = 48; const CLOTHING_SELECTION_WIDTH = 5.4; @@ -578,13 +579,26 @@ export const MainPage = (props: { openSpecies: () => void }) => { /> - + - + {/* DOPPLER ADDITION START */} + + + act('update_preview', { + updated_preview: value, + }) + } + /> + + {/* DOPPLER ADDITION END */} ; features: Record;