diff --git a/code/datums/factions/clf.dm b/code/datums/factions/clf.dm index ce53b505b352..483938229c57 100644 --- a/code/datums/factions/clf.dm +++ b/code/datums/factions/clf.dm @@ -1,13 +1,16 @@ /datum/faction/clf name = "Colonial Liberation Front" faction_tag = FACTION_CLF + hud_icon_prefix = "clf_" -/datum/faction/clf/modify_hud_holder(image/holder, mob/living/carbon/human/human) +/datum/faction/clf/modify_hud_holder(image/holder, mob/living/carbon/human/current_human) var/hud_icon_state - var/obj/item/card/id/ID = human.get_idcard() + var/used_icon_file = hud_icon_file + var/used_icon_prefix = hud_icon_prefix + var/obj/item/card/id/ID = current_human.get_idcard() var/_role - if(human.mind) - _role = human.job + if(current_human.mind) + _role = current_human.job else if(ID) _role = ID.rank switch(_role) @@ -23,8 +26,15 @@ hud_icon_state = "synth" if(JOB_CLF_COMMANDER) hud_icon_state = "cellcom" + + if(current_human.rank_icon_file_override) + used_icon_file = current_human.rank_icon_file_override + if(current_human.rank_icon_state_override) + hud_icon_state = current_human.rank_icon_state_override + if(current_human.rank_icon_prefix_override) + used_icon_prefix = current_human.rank_icon_prefix_override if(hud_icon_state) - holder.overlays += image('icons/mob/hud/marine_hud.dmi', human, "clf_[hud_icon_state]") + holder.overlays += image(used_icon_file, current_human, "[used_icon_prefix][hud_icon_state]") /datum/faction/clf/get_antag_guns_snowflake_equipment() return list( diff --git a/code/datums/factions/faction.dm b/code/datums/factions/faction.dm index a6201da70467..34d3495b19c2 100644 --- a/code/datums/factions/faction.dm +++ b/code/datums/factions/faction.dm @@ -2,6 +2,8 @@ var/name = "Neutral Faction" var/faction_tag = FACTION_NEUTRAL var/hud_type = FACTION_HUD + var/hud_icon_prefix + var/hud_icon_file = 'icons/mob/hud/marine_hud.dmi' /datum/faction/proc/modify_hud_holder(image/holder, mob/living/carbon/human/H) return diff --git a/code/datums/factions/pmc.dm b/code/datums/factions/pmc.dm index c5b319a13c7b..7971a20a4ba7 100644 --- a/code/datums/factions/pmc.dm +++ b/code/datums/factions/pmc.dm @@ -1,13 +1,16 @@ /datum/faction/pmc name = "Private Military Company" faction_tag = FACTION_PMC + hud_icon_prefix = "pmc_" -/datum/faction/pmc/modify_hud_holder(image/holder, mob/living/carbon/human/H) +/datum/faction/pmc/modify_hud_holder(image/holder, mob/living/carbon/human/current_human) var/hud_icon_state - var/obj/item/card/id/ID = H.get_idcard() + var/used_icon_file = hud_icon_file + var/used_icon_prefix = hud_icon_prefix + var/obj/item/card/id/ID = current_human.get_idcard() var/_role - if(H.mind) - _role = H.job + if(current_human.mind) + _role = current_human.job else if(ID) _role = ID.rank switch(_role) @@ -23,8 +26,15 @@ hud_icon_state = "md" if(JOB_PMC_SYNTH) hud_icon_state = "syn" + + if(current_human.rank_icon_file_override) + used_icon_file = current_human.rank_icon_file_override + if(current_human.rank_icon_state_override) + hud_icon_state = current_human.rank_icon_state_override + if(current_human.rank_icon_prefix_override) + used_icon_prefix = current_human.rank_icon_prefix_override if(hud_icon_state) - holder.overlays += image('icons/mob/hud/marine_hud.dmi', H, "pmc_[hud_icon_state]") + holder.overlays += image(used_icon_file, current_human, "[used_icon_prefix][hud_icon_state]") /datum/faction/pmc/get_antag_guns_snowflake_equipment() return list( diff --git a/code/datums/factions/royalmarinescommando.dm b/code/datums/factions/royalmarinescommando.dm index 2fab0348bcfa..618f3b8e7675 100644 --- a/code/datums/factions/royalmarinescommando.dm +++ b/code/datums/factions/royalmarinescommando.dm @@ -1,13 +1,16 @@ /datum/faction/royal_marines_commando name = "Royal Marines Commando" faction_tag = FACTION_TWE + hud_icon_prefix = "rmc_" -/datum/faction/royal_marines_commando/modify_hud_holder(image/holder, mob/living/carbon/human/H) +/datum/faction/royal_marines_commando/modify_hud_holder(image/holder, mob/living/carbon/human/current_human) var/hud_icon_state - var/obj/item/card/id/dogtag/ID = H.get_idcard() + var/used_icon_file = hud_icon_file + var/used_icon_prefix = hud_icon_prefix + var/obj/item/card/id/dogtag/ID = current_human.get_idcard() var/_role - if(H.mind) - _role = H.job + if(current_human.mind) + _role = current_human.job else if(ID) _role = ID.rank switch(_role) @@ -23,8 +26,15 @@ hud_icon_state = "smartgunner" if(JOB_TWE_RMC_BREACHER) hud_icon_state = "breacher" + + if(current_human.rank_icon_file_override) + used_icon_file = current_human.rank_icon_file_override + if(current_human.rank_icon_state_override) + hud_icon_state = current_human.rank_icon_state_override + if(current_human.rank_icon_prefix_override) + used_icon_prefix = current_human.rank_icon_prefix_override if(hud_icon_state) - holder.overlays += image('icons/mob/hud/marine_hud.dmi', H, "rmc_[hud_icon_state]") + holder.overlays += image(used_icon_file, current_human, "[used_icon_prefix][hud_icon_state]") /datum/faction/royal_marines_commando/get_antag_guns_snowflake_equipment() return list( diff --git a/code/datums/factions/upp.dm b/code/datums/factions/upp.dm index 0506833f80c3..1a98f615175f 100644 --- a/code/datums/factions/upp.dm +++ b/code/datums/factions/upp.dm @@ -1,13 +1,16 @@ /datum/faction/upp name = "Union of Progressive Peoples" faction_tag = FACTION_UPP + hud_icon_prefix = "upp_" -/datum/faction/upp/modify_hud_holder(image/holder, mob/living/carbon/human/H) +/datum/faction/upp/modify_hud_holder(image/holder, mob/living/carbon/human/current_human) var/hud_icon_state - var/obj/item/card/id/ID = H.get_idcard() + var/used_icon_file = hud_icon_file + var/used_icon_prefix = hud_icon_prefix + var/obj/item/card/id/ID = current_human.get_idcard() var/_role - if(H.mind) - _role = H.job + if(current_human.mind) + _role = current_human.job else if(ID) _role = ID.rank switch(_role) @@ -57,8 +60,15 @@ hud_icon_state = "log" if(JOB_UPP_COMMISSAR) hud_icon_state = "commi" + + if(current_human.rank_icon_file_override) + used_icon_file = current_human.rank_icon_file_override + if(current_human.rank_icon_state_override) + hud_icon_state = current_human.rank_icon_state_override + if(current_human.rank_icon_prefix_override) + used_icon_prefix = current_human.rank_icon_prefix_override if(hud_icon_state) - holder.overlays += image('icons/mob/hud/marine_hud.dmi', H, "upp_[hud_icon_state]") + holder.overlays += image(used_icon_file, current_human, "[used_icon_prefix][hud_icon_state]") /datum/faction/upp/get_antag_guns_snowflake_equipment() return list( diff --git a/code/datums/factions/uscm.dm b/code/datums/factions/uscm.dm index 6a4b61289ea3..3ce0932b5914 100644 --- a/code/datums/factions/uscm.dm +++ b/code/datums/factions/uscm.dm @@ -1,18 +1,27 @@ /datum/faction/uscm name = "United States Colonial Marines" faction_tag = FACTION_MARINE + hud_icon_prefix = "hudsquad_" /datum/faction/uscm/modify_hud_holder(image/holder, mob/living/carbon/human/current_human) + var/marine_rk + var/used_icon_file = hud_icon_file + var/used_icon_prefix = hud_icon_prefix + var/squad_clr + + if(current_human.rank_icon_file_override) + used_icon_file = current_human.rank_icon_file_override + + var/obj/item/card/id/id_card = current_human.get_idcard() + var/_role + if(current_human.job) + _role = current_human.job + else if(id_card) + _role = id_card.rank + var/datum/squad/squad = current_human.assigned_squad if(istype(squad)) - var/squad_clr = current_human.assigned_squad.equipment_color - var/marine_rk - var/obj/item/card/id/I = current_human.get_idcard() - var/_role - if(current_human.job) - _role = current_human.job - else if(I) - _role = I.rank + squad_clr = current_human.assigned_squad.equipment_color switch(GET_DEFAULT_ROLE(_role)) if(JOB_SQUAD_ENGI) marine_rk = "engi" if(JOB_SQUAD_SPECIALIST) marine_rk = "spec" @@ -42,52 +51,30 @@ current_human.langchat_color = current_human.assigned_squad.chat_color - if(!marine_rk) marine_rk = current_human.rank_fallback - if(marine_rk) - var/image/IMG = image('icons/mob/hud/marine_hud.dmi', current_human, "hudsquad") - if(squad_clr) - IMG.color = squad_clr - else - IMG.color = "#5A934A" - holder.overlays += IMG - holder.overlays += image('icons/mob/hud/marine_hud.dmi', current_human, "hudsquad_[marine_rk]") + if(!marine_rk) + marine_rk = current_human.rank_icon_state_override if(current_human.assigned_squad && current_human.assigned_fireteam) - var/image/IMG2 = image('icons/mob/hud/marine_hud.dmi', current_human, "hudsquad_[current_human.assigned_fireteam]") + var/image/IMG2 = image(used_icon_file, current_human, "[used_icon_prefix][current_human.assigned_fireteam]") IMG2.color = squad_clr holder.overlays += IMG2 if(current_human.assigned_squad.fireteam_leaders[current_human.assigned_fireteam] == current_human) - var/image/IMG3 = image('icons/mob/hud/marine_hud.dmi', current_human, "hudsquad_ftl") + var/image/IMG3 = image(used_icon_file, current_human, "[used_icon_prefix]ftl") IMG3.color = squad_clr holder.overlays += IMG3 else - var/marine_rk - var/border_rk - var/icon_prefix = "hudsquad_" - var/obj/item/card/id/ID = current_human.get_idcard() - var/_role - if(current_human.mind) - _role = current_human.job - else if(ID) - _role = ID.rank switch(_role) if(JOB_XO) marine_rk = "xo" - border_rk = "command" if(JOB_CO) marine_rk = "co" - border_rk = "command" if(JOB_USCM_OBSV) marine_rk = "vo" - border_rk = "command" if(JOB_SO) marine_rk = "so" - border_rk = "command" if(JOB_AUXILIARY_OFFICER) marine_rk = "aso" - border_rk = "command" if(JOB_GENERAL, JOB_COLONEL, JOB_ACMC, JOB_CMC) marine_rk = "general" - border_rk = "command" if(JOB_PLT_MED) marine_rk = "med" if(JOB_PLT_SL) @@ -104,39 +91,32 @@ marine_rk = "dcc" if(JOB_CHIEF_POLICE) marine_rk = "cmp" - border_rk = "command" if(JOB_POLICE) marine_rk = "mp" if(JOB_TANK_CREW) marine_rk = "tc" if(JOB_WARDEN) marine_rk = "warden" - border_rk = "command" if(JOB_CHIEF_REQUISITION) marine_rk = "ro" if(JOB_CARGO_TECH) marine_rk = "ct" if(JOB_CHIEF_ENGINEER) marine_rk = "ce" - border_rk = "command" if(JOB_MAINT_TECH) marine_rk = "mt" if(JOB_ORDNANCE_TECH) marine_rk = "ot" if(JOB_CMO) marine_rk = "cmo" - border_rk = "command" if(JOB_DOCTOR) marine_rk = "doctor" - border_rk = "command" if(JOB_RESEARCHER) marine_rk = "researcher" - border_rk = "command" if(JOB_NURSE) marine_rk = "nurse" if(JOB_SEA) marine_rk = "sea" - border_rk = "command" if(JOB_SYNTH) marine_rk = "syn" if(JOB_MESS_SERGEANT) @@ -148,22 +128,16 @@ marine_rk = "pvtml" if(JOB_PROVOST_INSPECTOR) marine_rk = "pvi" - border_rk = "command" if(JOB_PROVOST_UNDERCOVER) marine_rk = "pvuc" - border_rk = "command" if(JOB_PROVOST_CINSPECTOR) marine_rk = "pvci" - border_rk = "command" if(JOB_PROVOST_ADVISOR) marine_rk = "pva" - border_rk = "command" if(JOB_PROVOST_DMARSHAL) marine_rk = "pvdm" - border_rk = "command" if(JOB_PROVOST_MARSHAL, JOB_PROVOST_CMARSHAL, JOB_PROVOST_SMARSHAL) marine_rk = "pvm" - border_rk = "command" // TIS if(JOB_TIS_IO) marine_rk = "tisio" @@ -200,19 +174,19 @@ // Colonial Marshals if(JOB_CMB_TL) marine_rk = "mar" - icon_prefix = "cmb_" + used_icon_prefix = "cmb_" if(JOB_CMB) marine_rk = "dep" - icon_prefix = "cmb_" + used_icon_prefix = "cmb_" if(JOB_CMB_SYN) marine_rk = "syn" - icon_prefix = "cmb_" + used_icon_prefix = "cmb_" if(JOB_CMB_ICC) marine_rk = "icc" - icon_prefix = "cmb_" + used_icon_prefix = "cmb_" if(JOB_CMB_OBS) marine_rk = "obs" - icon_prefix = "cmb_" + used_icon_prefix = "cmb_" // Check squad marines here too, for the unique ones if(JOB_SQUAD_ENGI) marine_rk = "engi" @@ -227,10 +201,17 @@ if(JOB_SQUAD_LEADER) marine_rk = "leader" - if(marine_rk) - var/image/I = image('icons/mob/hud/marine_hud.dmi', current_human, "hudsquad") - I.color = "#5A934A" - holder.overlays += I - holder.overlays += image('icons/mob/hud/marine_hud.dmi', current_human, "[icon_prefix][marine_rk]") - if(border_rk) - holder.overlays += image('icons/mob/hud/marine_hud.dmi', current_human, "hudmarineborder[border_rk]") + + if(current_human.rank_icon_state_override) + marine_rk = current_human.rank_icon_state_override + if(current_human.rank_icon_prefix_override) + used_icon_prefix = current_human.rank_icon_prefix_override + + if(marine_rk) + var/image/underlay = image(used_icon_file, current_human, "hudsquad") + if(squad_clr) + underlay.color = squad_clr + else + underlay.color = "#5A934A" + holder.overlays += underlay + holder.overlays += image(used_icon_file, current_human, "[used_icon_prefix][marine_rk]") diff --git a/code/game/jobs/job/marine/squad_info.dm b/code/game/jobs/job/marine/squad_info.dm index 406263115196..7b5c512fd22f 100644 --- a/code/game/jobs/job/marine/squad_info.dm +++ b/code/game/jobs/job/marine/squad_info.dm @@ -252,8 +252,8 @@ rank = "SL" else rank = "" - if(H.rank_fallback) - rank = H.rank_fallback + if(H.rank_icon_state_override) + rank = H.rank_icon_state_override mar[H.real_name] += list("rank" = rank) else mar[H.real_name] += list("paygrade" = "N/A") diff --git a/code/game/objects/items/pamphlets.dm b/code/game/objects/items/pamphlets.dm index d8bbb2a01432..a053f7a4858a 100644 --- a/code/game/objects/items/pamphlets.dm +++ b/code/game/objects/items/pamphlets.dm @@ -92,7 +92,7 @@ /obj/item/pamphlet/skill/spotter/on_use(mob/living/carbon/human/user) . = ..() - user.rank_fallback = "ass" + user.rank_icon_state_override = "ass" user.hud_set_squad() var/obj/item/card/id/ID = user.get_idcard() diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 37533e9c1a57..c796a3984422 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -114,7 +114,13 @@ var/shield_slowdown = 0 // Slowdown from readying shields var/datum/equipment_preset/assigned_equipment_preset - var/rank_fallback + + /// Variable used to override the icon file the job HUD is drawn from. + var/rank_icon_file_override + /// Variable used to override the first part of the icon state for job HUD. + var/rank_icon_prefix_override + /// Variable used to override the second part of the icon state for job HUD. + var/rank_icon_state_override var/datum/squad/assigned_squad //the squad this human is assigned to var/assigned_fireteam = 0 //the fireteam this human is assigned to