From 0396e071820b802b0ae694cd68b72c27a9192068 Mon Sep 17 00:00:00 2001 From: Matt Atlas Date: Sat, 22 May 2021 00:54:06 +0200 Subject: [PATCH] Contractor uniforms now actually show in the preview. (#11939) --- code/game/jobs/job/job.dm | 13 +++++- .../abstract/new_player/preferences_setup.dm | 2 +- .../mattatlas-thisisshitcodehonestly.yml | 41 +++++++++++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 html/changelogs/mattatlas-thisisshitcodehonestly.yml diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 70aac935904..9ddf14f2b47 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -112,7 +112,18 @@ to_chat(H, "Your account number is: [M.account_number], your account pin is: [M.remote_access_pin]") // overrideable separately so AIs/borgs can have cardborg hats without unneccessary new()/del() -/datum/job/proc/equip_preview(mob/living/carbon/human/H, var/alt_title) +/datum/job/proc/equip_preview(mob/living/carbon/human/H, var/alt_title, var/faction_override) + if(faction_override) + var/faction = SSjobs.name_factions[faction_override] + if(faction) + var/datum/faction/F = faction + if(!F.is_default) + var/new_outfit = F.titles_to_loadout[title] + var/datum/outfit/O = new new_outfit + if(O) + O.pre_equip(H, TRUE) + O.equip(H, TRUE) + return pre_equip(H, TRUE) . = equip(H, TRUE, FALSE, alt_title=alt_title) diff --git a/code/modules/mob/abstract/new_player/preferences_setup.dm b/code/modules/mob/abstract/new_player/preferences_setup.dm index 3b2d9fccf85..90b2b844a7e 100644 --- a/code/modules/mob/abstract/new_player/preferences_setup.dm +++ b/code/modules/mob/abstract/new_player/preferences_setup.dm @@ -215,7 +215,7 @@ SSjobs.EquipCustom(mannequin, previewJob, src, leftovers, null, used_slots) if((equip_preview_mob & EQUIP_PREVIEW_JOB) && previewJob) - previewJob.equip_preview(mannequin, player_alt_titles[previewJob.title]) + previewJob.equip_preview(mannequin, player_alt_titles[previewJob.title], faction) if(equip_preview_mob & EQUIP_PREVIEW_LOADOUT && leftovers.len) SSjobs.EquipCustomDeferred(mannequin, src, leftovers, used_slots) diff --git a/html/changelogs/mattatlas-thisisshitcodehonestly.yml b/html/changelogs/mattatlas-thisisshitcodehonestly.yml new file mode 100644 index 00000000000..b0d32b87c58 --- /dev/null +++ b/html/changelogs/mattatlas-thisisshitcodehonestly.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: MattAtlas + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Contractor uniforms now actually display in the character preview."