From 86ebb489e567d718f1303f00ed31461d57e5fef3 Mon Sep 17 00:00:00 2001
From: Nerevar <12636964+Nerev4r@users.noreply.github.com>
Date: Sun, 29 Sep 2024 18:07:41 -0600
Subject: [PATCH 1/2] always been cold i was born in the winter
---
.../__DEFINES/~doppler_defines/preferences.dm | 5 ++
code/modules/client/preferences.dm | 4 ++
.../mob/dead/new_player/preferences_setup.dm | 2 +
.../preferences/preferences.dm | 4 ++
.../preferences/preferences_setup.dm | 48 +++++++++++++++++++
tgstation.dme | 2 +
.../interfaces/PreferencesMenu/MainPage.tsx | 16 ++++++-
.../tgui/interfaces/PreferencesMenu/data.ts | 3 ++
8 files changed, 83 insertions(+), 1 deletion(-)
create mode 100644 modular_doppler/modular_customization/preferences/preferences.dm
create mode 100644 modular_doppler/modular_customization/preferences/preferences_setup.dm
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..bf10f3d65296a 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
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 15915e1924c05..95e791ccecdf7 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -6766,6 +6766,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..55c85a7939a41 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;
@@ -585,6 +586,19 @@ export const MainPage = (props: { openSpecies: () => void }) => {
/>
+
+
+ act('update_preview', {
+ updated_preview: value,
+ })
+ }
+ />
+
+
;
features: Record;
From d69891d558e7755b279575d3ad72a8fdad3f5b48 Mon Sep 17 00:00:00 2001
From: "Lila S."
Date: Tue, 1 Oct 2024 14:42:53 +0200
Subject: [PATCH 2/2] when things work its good
---
code/modules/client/preferences.dm | 5 +++++
tgui/packages/tgui/interfaces/PreferencesMenu/MainPage.tsx | 6 +++---
tgui/packages/tgui/interfaces/PreferencesMenu/data.ts | 4 ++--
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index bf10f3d65296a..7204e1892c634 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -272,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/tgui/packages/tgui/interfaces/PreferencesMenu/MainPage.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/MainPage.tsx
index 55c85a7939a41..08d65723eb721 100644
--- a/tgui/packages/tgui/interfaces/PreferencesMenu/MainPage.tsx
+++ b/tgui/packages/tgui/interfaces/PreferencesMenu/MainPage.tsx
@@ -579,13 +579,13 @@ export const MainPage = (props: { openSpecies: () => void }) => {
/>
-
+
-
+ {/* DOPPLER ADDITION START */}
void }) => {
}
/>
-
+ {/* DOPPLER ADDITION END */}
;