From 034d0e4cb1c62ac6b0b5046038e09f85b0b6da55 Mon Sep 17 00:00:00 2001
From: Casper3667 <8396443+Casper3667@users.noreply.github.com>
Date: Fri, 19 Dec 2025 21:21:33 +0100
Subject: [PATCH] Fixes the uniform hiding button in character setup (#21675)
The hide uniform, suit and hat buttons now work in character setup. I
changed it slightly so it will work regardless of it being a loadout or
job item in the specific slot, mainly because that was easier but also
because sometimes you want to change the uniform but the suit is in the
way.
---
code/game/jobs/job/job.dm | 12 +++---------
.../client/preference_setup/general/03_body.dm | 6 +++---
html/changelogs/CharSetupFix.yml | 6 ++++++
3 files changed, 12 insertions(+), 12 deletions(-)
create mode 100644 html/changelogs/CharSetupFix.yml
diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm
index 29be5996a42..558d7b78294 100644
--- a/code/game/jobs/job/job.dm
+++ b/code/game/jobs/job/job.dm
@@ -157,11 +157,6 @@
var/obj/outfit/O = new new_outfit
O.pre_equip(H, TRUE)
O.equip(H, TRUE)
- return
-
- var/pre_hat_ref = H.head ? REF(H.head) : null
- var/pre_uniform_ref = H.w_uniform ? REF(H.w_uniform) : null
- var/pre_suit_ref = H.wear_suit ? REF(H.wear_suit) : null
pre_equip(H, TRUE)
. = equip(H, TRUE, FALSE, alt_title=alt_title)
@@ -169,19 +164,18 @@
// slightly hacky, but effectively what we're doing here is checking whether we want this preview mob to actually have the uniform we're putting onto it
// if not, we drop it from the inventory into nullspace, and then deleting it
// i don't THINK this'll make performance that much worse, considering how much we already do to equip the mob in the first place
- // the reasoning for the ref checks is that we don't want to delete loadout uniforms, just the job ones, so we need to confirm the before and after
var/equip_preview_mob = prefs.equip_preview_mob
- if(!(equip_preview_mob & EQUIP_PREVIEW_JOB_HAT) && H.head && REF(H.head) != pre_hat_ref)
+ if(!(equip_preview_mob & EQUIP_PREVIEW_JOB_HAT) && H.head)
H.drop_from_inventory(H.head)
qdel(H.head)
- if(!(equip_preview_mob & EQUIP_PREVIEW_JOB_UNIFORM) && H.w_uniform && REF(H.w_uniform) != pre_uniform_ref)
+ if(!(equip_preview_mob & EQUIP_PREVIEW_JOB_UNIFORM) && H.w_uniform)
H.drop_from_inventory(H.w_uniform)
qdel(H.w_uniform)
- if(!(equip_preview_mob & EQUIP_PREVIEW_JOB_SUIT) && H.wear_suit && REF(H.wear_suit) != pre_suit_ref)
+ if(!(equip_preview_mob & EQUIP_PREVIEW_JOB_SUIT) && H.wear_suit)
H.drop_from_inventory(H.wear_suit)
qdel(H.wear_suit)
diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm
index 8e979582ae2..bb6e9e2237e 100644
--- a/code/modules/client/preference_setup/general/03_body.dm
+++ b/code/modules/client/preference_setup/general/03_body.dm
@@ -297,9 +297,9 @@ GLOBAL_LIST_INIT(valid_bloodtypes, list(
out += "
Set Preview Scale - [pref.scale_x] - [pref.scale_y]"
out += "
[pref.equip_preview_mob & EQUIP_PREVIEW_LOADOUT ? "Hide loadout" : "Show loadout"]"
out += "
[pref.equip_preview_mob & EQUIP_PREVIEW_JOB ? "Hide job gear" : "Show job gear"]"
- out += "
[pref.equip_preview_mob & EQUIP_PREVIEW_JOB_HAT ? "Hide job hat" : "Show job hat"]"
- out += "
[pref.equip_preview_mob & EQUIP_PREVIEW_JOB_UNIFORM ? "Hide job uniform" : "Show job uniform"]"
- out += "
[pref.equip_preview_mob & EQUIP_PREVIEW_JOB_SUIT ? "Hide job suit" : "Show job suit"]"
+ out += "
[pref.equip_preview_mob & EQUIP_PREVIEW_JOB_HAT ? "Hide hat" : "Show hat"]"
+ out += "
[pref.equip_preview_mob & EQUIP_PREVIEW_JOB_UNIFORM ? "Hide uniform" : "Show uniform"]"
+ out += "
[pref.equip_preview_mob & EQUIP_PREVIEW_JOB_SUIT ? "Hide suit" : "Show suit"]"
out += "
[pref.equip_preview_mob & EQUIP_PREVIEW_CUSTOM_ITEMS ? "Hide custom items" : "Show custom items"]"
out += ""
diff --git a/html/changelogs/CharSetupFix.yml b/html/changelogs/CharSetupFix.yml
new file mode 100644
index 00000000000..9b718d91e9e
--- /dev/null
+++ b/html/changelogs/CharSetupFix.yml
@@ -0,0 +1,6 @@
+author: TheGreyWolf
+
+delete-after: True
+
+changes:
+ - bugfix: "The buttons to hide hats, uniforms and suits in character setup work again."