mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Can now toggle loadout and job preview equipment separately.
This commit is contained in:
3
code/modules/client/preference_setup/_defines.dm
Normal file
3
code/modules/client/preference_setup/_defines.dm
Normal file
@@ -0,0 +1,3 @@
|
||||
#define EQUIP_PREVIEW_LOADOUT 1
|
||||
#define EQUIP_PREVIEW_JOB 2
|
||||
#define EQUIP_PREVIEW_ALL (EQUIP_PREVIEW_LOADOUT|EQUIP_PREVIEW_JOB)
|
||||
@@ -1,7 +1,7 @@
|
||||
var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-")
|
||||
|
||||
/datum/preferences
|
||||
var/dress_mob = TRUE
|
||||
var/equip_preview_mob = EQUIP_PREVIEW_ALL
|
||||
|
||||
/datum/category_item/player_setup_item/general/body
|
||||
name = "Body"
|
||||
@@ -226,8 +226,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
|
||||
. += "</td><td><b>Preview</b><br>"
|
||||
. += "<div class='statusDisplay'><center><img src=previewicon.png width=[pref.preview_icon.Width()] height=[pref.preview_icon.Height()]></center></div>"
|
||||
. += "<br><a href='?src=\ref[src];toggle_clothing=1'>[pref.dress_mob ? "Hide equipment" : "Show equipment"]</a>"
|
||||
|
||||
. += "<br><a href='?src=\ref[src];toggle_preview_value=[EQUIP_PREVIEW_LOADOUT]'>[pref.equip_preview_mob & EQUIP_PREVIEW_LOADOUT ? "Hide loadout" : "Show loadout"]</a>"
|
||||
. += "<br><a href='?src=\ref[src];toggle_preview_value=[EQUIP_PREVIEW_JOB]'>[pref.equip_preview_mob & EQUIP_PREVIEW_JOB ? "Hide job gear" : "Show job gear"]</a>"
|
||||
. += "</td></tr></table>"
|
||||
|
||||
. += "<b>Hair</b><br>"
|
||||
@@ -578,8 +578,8 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
pref.disabilities ^= disability_flag
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["toggle_clothing"])
|
||||
pref.dress_mob = !pref.dress_mob
|
||||
else if(href_list["toggle_preview_value"])
|
||||
pref.equip_preview_mob ^= text2num(href_list["toggle_preview_value"])
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
return ..()
|
||||
|
||||
@@ -160,10 +160,10 @@
|
||||
var/choice = input("Choose an title for [job.title].", "Choose Title", pref.GetPlayerAltTitle(job)) as anything in choices|null
|
||||
if(choice && CanUseTopic(user))
|
||||
SetPlayerAltTitle(job, choice)
|
||||
return (pref.dress_mob ? TOPIC_REFRESH_UPDATE_PREVIEW : TOPIC_REFRESH)
|
||||
return (pref.equip_preview_mob ? TOPIC_REFRESH_UPDATE_PREVIEW : TOPIC_REFRESH)
|
||||
|
||||
else if(href_list["set_job"])
|
||||
if(SetJob(user, href_list["set_job"])) return (pref.dress_mob ? TOPIC_REFRESH_UPDATE_PREVIEW : TOPIC_REFRESH)
|
||||
if(SetJob(user, href_list["set_job"])) return (pref.equip_preview_mob ? TOPIC_REFRESH_UPDATE_PREVIEW : TOPIC_REFRESH)
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -194,31 +194,31 @@
|
||||
b_skin = blue
|
||||
|
||||
/datum/preferences/proc/dress_preview_mob(var/mob/living/carbon/human/mannequin)
|
||||
copy_to(mannequin)
|
||||
if(!dress_mob)
|
||||
var/update_icon = FALSE
|
||||
copy_to(mannequin, TRUE)
|
||||
|
||||
var/datum/job/previewJob
|
||||
if(equip_preview_mob)
|
||||
// Determine what job is marked as 'High' priority, and dress them up as such.
|
||||
if(job_civilian_low & ASSISTANT)
|
||||
previewJob = job_master.GetJob("Assistant")
|
||||
else
|
||||
for(var/datum/job/job in job_master.occupations)
|
||||
var/job_flag
|
||||
switch(job.department_flag)
|
||||
if(CIVILIAN)
|
||||
job_flag = job_civilian_high
|
||||
if(MEDSCI)
|
||||
job_flag = job_medsci_high
|
||||
if(ENGSEC)
|
||||
job_flag = job_engsec_high
|
||||
if(job.flag == job_flag)
|
||||
previewJob = job
|
||||
break
|
||||
else
|
||||
return
|
||||
|
||||
// Determine what job is marked as 'High' priority, and dress them up as such.
|
||||
var/datum/job/previewJob
|
||||
if(job_civilian_low & ASSISTANT)
|
||||
previewJob = job_master.GetJob("Assistant")
|
||||
else
|
||||
for(var/datum/job/job in job_master.occupations)
|
||||
var/job_flag
|
||||
switch(job.department_flag)
|
||||
if(CIVILIAN)
|
||||
job_flag = job_civilian_high
|
||||
if(MEDSCI)
|
||||
job_flag = job_medsci_high
|
||||
if(ENGSEC)
|
||||
job_flag = job_engsec_high
|
||||
if(job.flag == job_flag)
|
||||
previewJob = job
|
||||
break
|
||||
|
||||
if(previewJob)
|
||||
mannequin.job = previewJob.title
|
||||
previewJob.equip_preview(mannequin, player_alt_titles[previewJob.title])
|
||||
if((equip_preview_mob & EQUIP_PREVIEW_LOADOUT) && !(previewJob && (equip_preview_mob & EQUIP_PREVIEW_JOB) && (previewJob.type == /datum/job/ai || previewJob.type == /datum/job/cyborg)))
|
||||
var/list/equipped_slots = list() //If more than one item takes the same slot only spawn the first
|
||||
for(var/thing in gear)
|
||||
var/datum/gear/G = gear_datums[thing]
|
||||
@@ -238,9 +238,17 @@
|
||||
continue
|
||||
|
||||
if(G.slot && !(G.slot in equipped_slots))
|
||||
equipped_slots += G.slot
|
||||
var/metadata = gear[G.display_name]
|
||||
mannequin.equip_to_slot_or_del(G.spawn_item(mannequin, metadata), G.slot)
|
||||
if(mannequin.equip_to_slot_or_del(G.spawn_item(mannequin, metadata), G.slot))
|
||||
equipped_slots += G.slot
|
||||
update_icon = TRUE
|
||||
|
||||
if((equip_preview_mob & EQUIP_PREVIEW_JOB) && previewJob)
|
||||
mannequin.job = previewJob.title
|
||||
previewJob.equip_preview(mannequin, player_alt_titles[previewJob.title])
|
||||
update_icon = TRUE
|
||||
|
||||
if(update_icon)
|
||||
mannequin.update_icons()
|
||||
|
||||
/datum/preferences/proc/update_preview_icon()
|
||||
|
||||
@@ -1117,6 +1117,7 @@
|
||||
#include "code\modules\client\preferences_spawnpoints.dm"
|
||||
#include "code\modules\client\preferences_toggle_procs.dm"
|
||||
#include "code\modules\client\ui_style.dm"
|
||||
#include "code\modules\client\preference_setup\_defines.dm"
|
||||
#include "code\modules\client\preference_setup\preference_setup.dm"
|
||||
#include "code\modules\client\preference_setup\antagonism\01_basic.dm"
|
||||
#include "code\modules\client\preference_setup\antagonism\02_candidacy.dm"
|
||||
|
||||
Reference in New Issue
Block a user