From f0f8e4cd405a502c2823f014c31d9413961292f8 Mon Sep 17 00:00:00 2001 From: BeagleGaming1 <56142455+BeagleGaming1@users.noreply.github.com> Date: Mon, 24 Jul 2023 18:52:00 -0400 Subject: [PATCH] Changes to squad color code (#3908) # About the pull request Changes the squad text and equipment colors from a list into a variable that can be edited # Explain why it's good for the game This allows the squad information to be edited much easier mid-round, allowing the creation of new squads with new colors, and edits to pre-existing squads. # Changelog :cl: code: Changed squad color code from a list to a variable /:cl: --- code/datums/factions/uscm.dm | 46 ++++---- code/game/jobs/job/marine/marine.dm | 10 +- code/game/jobs/job/marine/squad_info.dm | 2 +- code/game/jobs/job/marine/squads.dm | 100 ++++++++++++------ code/game/supplyshuttle.dm | 8 +- code/game/world.dm | 1 - code/modules/asset_cache/asset_list_items.dm | 7 +- code/modules/clothing/gloves/marine_gloves.dm | 12 ++- code/modules/clothing/head/helmet.dm | 6 +- code/modules/clothing/suits/marine_armor.dm | 43 +------- code/modules/cm_marines/marines_consoles.dm | 8 +- code/modules/mob/dead/observer/orbit.dm | 2 +- .../mob/living/carbon/human/update_icons.dm | 34 +++--- tgui/packages/tgui/interfaces/SquadMod.js | 3 +- 14 files changed, 143 insertions(+), 139 deletions(-) diff --git a/code/datums/factions/uscm.dm b/code/datums/factions/uscm.dm index 1fb1df278ab0..4d13e7d285ca 100644 --- a/code/datums/factions/uscm.dm +++ b/code/datums/factions/uscm.dm @@ -2,15 +2,15 @@ name = "United States Colonial Marines" faction_tag = FACTION_MARINE -/datum/faction/uscm/modify_hud_holder(image/holder, mob/living/carbon/human/H) - var/datum/squad/squad = H.assigned_squad +/datum/faction/uscm/modify_hud_holder(image/holder, mob/living/carbon/human/current_human) + var/datum/squad/squad = current_human.assigned_squad if(istype(squad)) - var/squad_clr = squad_colors[H.assigned_squad.color] + var/squad_clr = current_human.assigned_squad.equipment_color var/marine_rk - var/obj/item/card/id/I = H.get_idcard() + var/obj/item/card/id/I = current_human.get_idcard() var/_role - if(H.job) - _role = H.job + if(current_human.job) + _role = current_human.job else if(I) _role = I.rank switch(GET_DEFAULT_ROLE(_role)) @@ -29,42 +29,42 @@ if(JOB_MARINE_RAIDER) marine_rk = "soc" if(JOB_MARINE_RAIDER_SL) marine_rk = "soctl" if(JOB_MARINE_RAIDER_CMD) marine_rk = "soccmd" - if(squad.squad_leader == H) + if(squad.squad_leader == current_human) switch(squad.squad_type) if("Squad") marine_rk = "leader_a" if("Team") marine_rk = "soctl_a" - H.langchat_styles = "langchat_bolded" // bold text for bold leaders + current_human.langchat_styles = "langchat_bolded" // bold text for bold leaders else - H.langchat_styles = initial(H.langchat_styles) + current_human.langchat_styles = initial(current_human.langchat_styles) - H.langchat_color = squad_colors_chat[H.assigned_squad.color] + current_human.langchat_color = current_human.assigned_squad.chat_color - if(!marine_rk) marine_rk = H.rank_fallback + if(!marine_rk) marine_rk = current_human.rank_fallback if(marine_rk) - var/image/IMG = image('icons/mob/hud/marine_hud.dmi', H, "hudsquad") + 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', H, "hudsquad_[marine_rk]") - if(H.assigned_squad && H.assigned_fireteam) - var/image/IMG2 = image('icons/mob/hud/marine_hud.dmi', H, "hudsquad_[H.assigned_fireteam]") + holder.overlays += image('icons/mob/hud/marine_hud.dmi', current_human, "hudsquad_[marine_rk]") + 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]") IMG2.color = squad_clr holder.overlays += IMG2 - if(H.assigned_squad.fireteam_leaders[H.assigned_fireteam] == H) - var/image/IMG3 = image('icons/mob/hud/marine_hud.dmi', H, "hudsquad_ftl") + 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") IMG3.color = squad_clr holder.overlays += IMG3 else var/marine_rk var/border_rk var/icon_prefix = "hudsquad_" - var/obj/item/card/id/ID = H.get_idcard() + 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) @@ -188,9 +188,9 @@ icon_prefix = "cmb_" if(marine_rk) - var/image/I = image('icons/mob/hud/marine_hud.dmi', H, "hudsquad") + 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', H, "[icon_prefix][marine_rk]") + 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', H, "hudmarineborder[border_rk]") + holder.overlays += image('icons/mob/hud/marine_hud.dmi', current_human, "hudmarineborder[border_rk]") diff --git a/code/game/jobs/job/marine/marine.dm b/code/game/jobs/job/marine/marine.dm index a64701b8bfc7..e07c1edd3138 100644 --- a/code/game/jobs/job/marine/marine.dm +++ b/code/game/jobs/job/marine/marine.dm @@ -5,15 +5,15 @@ spawn_positions = 8 allow_additional = 1 -/datum/job/marine/generate_entry_message(mob/living/carbon/human/H) - if(H.assigned_squad) - entry_message_intro = "You are a [title]!
You have been assigned to: [lowertext(H.assigned_squad.name)] squad.[Check_WO() ? "" : " Make your way to the cafeteria for some post-cryosleep chow, and then get equipped in your squad's prep room." ]" +/datum/job/marine/generate_entry_message(mob/living/carbon/human/current_human) + if(current_human.assigned_squad) + entry_message_intro = "You are a [title]!
You have been assigned to: [lowertext(current_human.assigned_squad.name)] squad.[Check_WO() ? "" : " Make your way to the cafeteria for some post-cryosleep chow, and then get equipped in your squad's prep room." ]" return ..() -/datum/job/marine/generate_entry_conditions(mob/living/carbon/human/H) +/datum/job/marine/generate_entry_conditions(mob/living/carbon/human/current_human) ..() if(!Check_WO()) - H.nutrition = rand(NUTRITION_VERYLOW, NUTRITION_LOW) //Start hungry for the default marine. + current_human.nutrition = rand(NUTRITION_VERYLOW, NUTRITION_LOW) //Start hungry for the default marine. /datum/timelock/squad name = "Squad Roles" diff --git a/code/game/jobs/job/marine/squad_info.dm b/code/game/jobs/job/marine/squad_info.dm index 1dc4ad7181cd..7e7dfcc0229a 100644 --- a/code/game/jobs/job/marine/squad_info.dm +++ b/code/game/jobs/job/marine/squad_info.dm @@ -17,7 +17,7 @@ update_squad_leader() var/list/data = squad_info_data.Copy() data["squad"] = name - data["squad_color"] = squad_colors[color] + data["squad_color"] = equipment_color data["is_lead"] = get_leadership(user) data["objective"] = list( "primary" = primary_objective, diff --git a/code/game/jobs/job/marine/squads.dm b/code/game/jobs/job/marine/squads.dm index 9f4068e8450f..fb85be012d30 100644 --- a/code/game/jobs/job/marine/squads.dm +++ b/code/game/jobs/job/marine/squads.dm @@ -25,29 +25,51 @@ sub_leader = "Strike Leader" /datum/squad - var/name //Name of the squad + /// Name of the squad + var/name + /// Squads ID that is set on New() var/tracking_id = null //Used for the tracking subsystem - var/max_positions = -1 //Maximum number allowed in a squad. Defaults to infinite - var/color = 0 //Color for helmets, etc. - var/list/access = list() //Which special access do we grant them - var/omni_squad_vendor = FALSE /// Can use any squad vendor regardless of squad connection - var/max_engineers = 3 //maximum # of engineers allowed in squad - var/max_medics = 4 //Ditto, squad medics + /// Maximum number allowed in a squad. Defaults to infinite + var/max_positions = -1 + /// Color for the squad marines gear overlays + var/equipment_color = "#FFFFFF" + /// The alpha for the armor overlay used by equipment color + var/armor_alpha = 125 + /// Color for the squad marines langchat + var/chat_color = "#FFFFFF" + /// Which special access do we grant them + var/list/access = list() + /// Can use any squad vendor regardless of squad connection + var/omni_squad_vendor = FALSE + /// maximum # of engineers allowed in the squad + var/max_engineers = 3 + /// maximum # of squad medics allowed in the squad + var/max_medics = 4 + /// maximum # of specs allowed in the squad var/max_specialists = 1 + /// maximum # of fireteam leaders allowed in the suqad var/max_tl = 2 + /// maximum # of smartgunners allowed in the squad var/max_smartgun = 1 + /// maximum # of squad leaders allowed in the squad var/max_leaders = 1 - var/radio_freq = 1461 //Squad radio headset frequency. - - ///Variables for showing up in various places - var/usable = FALSE //Is it used in-game? - var/roundstart = TRUE /// Whether this squad can be picked at roundstart - var/locked = FALSE //Is it available for squad management? - var/active = FALSE //Is it visible in overwatch? - var/faction = FACTION_MARINE //What faction runs the squad? - - ///Squad Type Specifics + /// Squad headsets default radio frequency + var/radio_freq = 1461 + + /// Whether this squad can be used by marines + var/usable = FALSE + /// Whether this squad can be picked at roundstart + var/roundstart = TRUE + // Whether the squad is available for squad management + var/locked = FALSE + /// Whether it is visible in overwatch + var/active = FALSE + /// Which faction the squad is in + var/faction = FACTION_MARINE + + /// What will the assistant squad leader be called var/squad_type = "Squad" //Referenced for aSL details. Squad/Team/Cell etc. + /// Squad leaders icon var/lead_icon //Referenced for SL's 'L' icon. If nulled, won't override icon for aSLs. //vvv Do not set these in squad defines @@ -96,35 +118,40 @@ /datum/squad/marine/alpha name = SQUAD_MARINE_1 - color = 1 + equipment_color = "#e61919" + chat_color = "#e67d7d" access = list(ACCESS_MARINE_ALPHA) radio_freq = ALPHA_FREQ minimap_color = MINIMAP_SQUAD_ALPHA /datum/squad/marine/bravo name = SQUAD_MARINE_2 - color = 2 + equipment_color = "#ffc32d" + chat_color = "#ffe650" access = list(ACCESS_MARINE_BRAVO) radio_freq = BRAVO_FREQ minimap_color = MINIMAP_SQUAD_BRAVO /datum/squad/marine/charlie name = SQUAD_MARINE_3 - color = 3 + equipment_color = "#c864c8" + chat_color = "#ff96ff" access = list(ACCESS_MARINE_CHARLIE) radio_freq = CHARLIE_FREQ minimap_color = MINIMAP_SQUAD_CHARLIE /datum/squad/marine/delta name = SQUAD_MARINE_4 - color = 4 + equipment_color = "#4148c8" + chat_color = "#828cff" access = list(ACCESS_MARINE_DELTA) radio_freq = DELTA_FREQ minimap_color = MINIMAP_SQUAD_DELTA /datum/squad/marine/echo name = SQUAD_MARINE_5 - color = 5 + equipment_color = "#67d692" + chat_color = "#67d692" access = list(ACCESS_MARINE_ALPHA, ACCESS_MARINE_BRAVO, ACCESS_MARINE_CHARLIE, ACCESS_MARINE_DELTA) radio_freq = ECHO_FREQ omni_squad_vendor = TRUE @@ -136,7 +163,8 @@ /datum/squad/marine/cryo name = SQUAD_MARINE_CRYO - color = 6 + equipment_color = "#c47a50" + chat_color = "#c47a50" access = list(ACCESS_MARINE_ALPHA, ACCESS_MARINE_BRAVO, ACCESS_MARINE_CHARLIE, ACCESS_MARINE_DELTA) minimap_color = MINIMAP_SQUAD_FOXTROT @@ -149,7 +177,8 @@ /datum/squad/marine/sof name = SQUAD_SOF - color = 7 + equipment_color = "#400000" + chat_color = "#400000" radio_freq = SOF_FREQ squad_type = "Team" lead_icon = "soctl" @@ -168,23 +197,28 @@ /datum/squad/upp/one name = "UPPS1" - color = 1 + equipment_color = "#e61919" + chat_color = "#e67d7d" /datum/squad/upp/twp name = "UPPS2" - color = 2 + equipment_color = "#ffc32d" + chat_color = "#ffe650" /datum/squad/upp/three name = "UPPS3" - color = 3 + equipment_color = "#c864c8" + chat_color = "#ff96ff" /datum/squad/upp/four name = "UPPS4" - color = 4 + equipment_color = "#4148c8" + chat_color = "#828cff" /datum/squad/upp/kdo name = "UPPKdo" - color = 6 + equipment_color = "#c47a50" + chat_color = "#c47a50" squad_type = "Team" locked = TRUE //############################### @@ -197,11 +231,13 @@ /datum/squad/pmc/one name = "Team Upsilon" - color = 3 + equipment_color = "#c864c8" + chat_color = "#ff96ff" /datum/squad/pmc/two name = "Team Gamma" - color = 6 + equipment_color = "#c47a50" + chat_color = "#c47a50" /datum/squad/pmc/wo name = "Taskforce White" @@ -331,7 +367,7 @@ /// Displays a message to squad members directly on the game map /datum/squad/proc/send_maptext(text = "", title_text = "", only_leader = 0) - var/message_colour = squad_colors_chat[color] + var/message_colour = chat_color if(only_leader) if(squad_leader) var/mob/living/carbon/human/SL = squad_leader diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index b760340004f5..350d6047b2a4 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -191,11 +191,11 @@ var/datum/controller/supply/supply_controller = new() var/list/data = list() var/list/squad_list = list() - for(var/datum/squad/S in RoleAuthority.squads) - if(S.active && S.faction == faction && S.color) + for(var/datum/squad/current_squad in RoleAuthority.squads) + if(current_squad.active && current_squad.faction == faction && current_squad.equipment_color) squad_list += list(list( - "squad_name" = S.name, - "squad_color" = squad_colors[S.color] + "squad_name" = current_squad.name, + "squad_color" = current_squad.equipment_color )) data["can_pick_squad"] = can_pick_squad diff --git a/code/game/world.dm b/code/game/world.dm index d6ddd1fa41f6..25cd609646da 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -39,7 +39,6 @@ var/list/reboot_sfx = file2list("config/reboot_sfx.txt") GLOB.changelog_hash = fexists(latest_changelog) ? md5(latest_changelog) : 0 //for telling if the changelog has changed recently initialize_tgs() - initialize_marine_armor() #ifdef UNIT_TESTS GLOB.test_log = "data/logs/tests.log" diff --git a/code/modules/asset_cache/asset_list_items.dm b/code/modules/asset_cache/asset_list_items.dm index 4ca05fe8a93c..e00f4a2d1263 100644 --- a/code/modules/asset_cache/asset_list_items.dm +++ b/code/modules/asset_cache/asset_list_items.dm @@ -271,7 +271,6 @@ /datum/asset/spritesheet/ranks/register() var/icon_file = 'icons/mob/hud/marine_hud.dmi' - var/list/squads = list("Alpha", "Bravo", "Charlie", "Delta", "Foxtrot", "Cryo") var/list/icon_data = list( list("Mar", null), @@ -284,10 +283,8 @@ list("SL", "hudsquad_leader"), ) - var/i - for(i = 1; i < length(squads); i++) - var/squad = squads[i] - var/color = squad_colors[i] + for(var/datum/squad/marine/squad in RoleAuthority.squads) + var/color = squad.equipment_color for(var/iref in icon_data) var/list/iconref = iref var/icon/background = icon('icons/mob/hud/marine_hud.dmi', "hudsquad", SOUTH) diff --git a/code/modules/clothing/gloves/marine_gloves.dm b/code/modules/clothing/gloves/marine_gloves.dm index bbddc1f10bb7..04d0b2f1c0cb 100644 --- a/code/modules/clothing/gloves/marine_gloves.dm +++ b/code/modules/clothing/gloves/marine_gloves.dm @@ -22,11 +22,17 @@ armor_rad = CLOTHING_ARMOR_NONE armor_internaldamage = CLOTHING_ARMOR_LOW var/adopts_squad_color = TRUE + /// The dmi where the grayscale squad overlays are contained + var/squad_overlay_icon = 'icons/mob/humans/onmob/hands_garb.dmi' -/obj/item/clothing/gloves/marine/get_mob_overlay(mob/living/carbon/human/H, slot) +/obj/item/clothing/gloves/marine/get_mob_overlay(mob/living/carbon/human/current_human, slot) var/image/ret = ..() - if(adopts_squad_color && slot == WEAR_HANDS && istype(H) && H.assigned_squad) - ret.overlays += glovemarkings[H.assigned_squad.color] + if(!adopts_squad_color || !(current_human.assigned_squad && current_human.assigned_squad.equipment_color)) + return ret + var/image/glove_overlay = image(squad_overlay_icon, icon_state = "std-gloves") + glove_overlay.alpha = current_human.assigned_squad.armor_alpha + glove_overlay.color = current_human.assigned_squad.equipment_color + ret.overlays += glove_overlay return ret /obj/item/clothing/gloves/marine/insulated diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index 1b66d3e1bf5f..0181d239c574 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -360,7 +360,7 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( var/flags_marine_helmet = HELMET_SQUAD_OVERLAY|HELMET_GARB_OVERLAY|HELMET_DAMAGE_OVERLAY var/helmet_bash_cooldown = 0 - var/specialty = "M10 pattern marine" //Give them a specialty var so that they show up correctly in vendors. + var/specialty = "M10 pattern marine" //Give them a specialty var so that they show up correctly in vendors. speciality does NOTHING if you have NO_NAME_OVERRIDE. valid_accessory_slots = list(ACCESSORY_SLOT_HELM_C) restricted_accessory_slots = list(ACCESSORY_SLOT_HELM_C) item_icons = list( @@ -372,8 +372,8 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( var/storage_slots_reserved_for_garb = 1 var/storage_max_w_class = SIZE_TINY // can hold tiny items only, EXCEPT for glasses & metal flask. var/storage_max_storage_space = 4 - - //speciality does NOTHING if you have NO_NAME_OVERRIDE + /// The dmi where the grayscale squad overlays are contained + var/helmet_overlay_icon = 'icons/mob/humans/onmob/head_1.dmi' /obj/item/clothing/head/helmet/marine/New(loc, new_protection[] = list(MAP_ICE_COLONY = ICE_PLANET_MIN_COLD_PROT)) diff --git a/code/modules/clothing/suits/marine_armor.dm b/code/modules/clothing/suits/marine_armor.dm index c6a2f7fcc32b..c78e6782a833 100644 --- a/code/modules/clothing/suits/marine_armor.dm +++ b/code/modules/clothing/suits/marine_armor.dm @@ -28,44 +28,6 @@ #define SOF 7 #define NOSQUAD 8 -var/list/armormarkings = list() -var/list/armormarkings_sql = list() -var/list/helmetmarkings = list() -var/list/helmetmarkings_sql = list() -var/list/glovemarkings = list() -var/list/squad_colors = list(rgb(230,25,25), rgb(255,195,45), rgb(200,100,200), rgb(65,72,200), rgb(103,214,146), rgb(196, 122, 80), rgb(64, 0, 0)) -var/list/squad_colors_chat = list(rgb(230,125,125), rgb(255,230,80), rgb(255,150,255), rgb(130,140,255), rgb(103,214,146), rgb(196, 122, 80), rgb(64, 0, 0)) - -/proc/initialize_marine_armor() - var/i - for(i=1, i<(length(squad_colors) + 1), i++) - var/squad_color = squad_colors[i] - var/armor_color = rgb(hex2num(copytext(squad_color, 2, 4)), hex2num(copytext(squad_color, 4, 6)), hex2num(copytext(squad_color, 6, 8)), 125) - - var/image/armor - var/image/helmet - var/image/glove - - armor = image('icons/mob/humans/onmob/suit_1.dmi',icon_state = "std-armor") - armor.color = armor_color - armormarkings += armor - armor = image('icons/mob/humans/onmob/suit_1.dmi',icon_state = "sql-armor") - armor.color = armor_color - armormarkings_sql += armor - - helmet = image('icons/mob/humans/onmob/head_1.dmi',icon_state = "std-helmet") - helmet.color = armor_color - helmetmarkings += helmet - helmet = image('icons/mob/humans/onmob/head_1.dmi',icon_state = "sql-helmet") - helmet.color = armor_color - helmetmarkings_sql += helmet - - glove = image('icons/mob/humans/onmob/hands_garb.dmi',icon_state = "std-gloves") - glove.color = armor_color - glovemarkings += glove - - - // MARINE STORAGE ARMOR /obj/item/clothing/suit/storage/marine @@ -122,7 +84,7 @@ var/list/squad_colors_chat = list(rgb(230,125,125), rgb(255,230,80), rgb(255,150 var/armor_overlays[] actions_types = list(/datum/action/item_action/toggle) var/flags_marine_armor = ARMOR_SQUAD_OVERLAY|ARMOR_LAMP_OVERLAY - var/specialty = "M3 pattern marine" //Same thing here. Give them a specialty so that they show up correctly in vendors. + var/specialty = "M3 pattern marine" //Same thing here. Give them a specialty so that they show up correctly in vendors. speciality does NOTHING if you have NO_NAME_OVERRIDE w_class = SIZE_HUGE uniform_restricted = list(/obj/item/clothing/under/marine) sprite_sheets = list(SPECIES_MONKEY = 'icons/mob/humans/species/monkeys/onmob/suit_monkey_1.dmi') @@ -132,7 +94,8 @@ var/list/squad_colors_chat = list(rgb(230,125,125), rgb(255,230,80), rgb(255,150 drop_sound = "armorequip" equip_sounds = list('sound/handling/putting_on_armor1.ogg') var/armor_variation = 0 - //speciality does NOTHING if you have NO_NAME_OVERRIDE + /// The dmi where the grayscale squad overlays are contained + var/squad_overlay_icon = 'icons/mob/humans/onmob/suit_1.dmi' /obj/item/clothing/suit/storage/marine/Initialize(mapload) . = ..() diff --git a/code/modules/cm_marines/marines_consoles.dm b/code/modules/cm_marines/marines_consoles.dm index 3539a43e6c15..36535a0b5141 100644 --- a/code/modules/cm_marines/marines_consoles.dm +++ b/code/modules/cm_marines/marines_consoles.dm @@ -594,11 +594,11 @@ /obj/structure/machinery/computer/squad_changer/ui_static_data(mob/user) var/list/data = list() var/list/squads = list() - for(var/datum/squad/S in RoleAuthority.squads) - if(S.name != "Root" && !S.locked && S.active && S.faction == faction) + for(var/datum/squad/current_squad in RoleAuthority.squads) + if(current_squad.name != "Root" && !current_squad.locked && current_squad.active && current_squad.faction == faction) var/list/squad = list(list( - "name" = S.name, - "color" = S.color-1 + "name" = current_squad.name, + "color" = current_squad.equipment_color )) squads += squad data["squads"] = squads diff --git a/code/modules/mob/dead/observer/orbit.dm b/code/modules/mob/dead/observer/orbit.dm index 94d1203493da..a77138668d72 100644 --- a/code/modules/mob/dead/observer/orbit.dm +++ b/code/modules/mob/dead/observer/orbit.dm @@ -134,7 +134,7 @@ serialized["icon"] = icon ? icon : "private" if(human.assigned_squad) - serialized["background_color"] = human.assigned_squad.color ? squad_colors[human.assigned_squad.color] : human.assigned_squad.minimap_color + serialized["background_color"] = human.assigned_squad.equipment_color ? human.assigned_squad.equipment_color : human.assigned_squad.minimap_color else serialized["background_color"] = human.assigned_equipment_preset?.minimap_background diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index f74b65c2606d..6ee249a6333e 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -367,7 +367,6 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, overlays_standing[GLOVES_LAYER] = I apply_overlay(GLOVES_LAYER) - /mob/living/carbon/human/update_inv_glasses() remove_overlay(GLASSES_LAYER) if(glasses) @@ -458,12 +457,15 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, if(istype(head, /obj/item/clothing/head/helmet/marine)) var/obj/item/clothing/head/helmet/marine/marine_helmet = head if(assigned_squad && marine_helmet.flags_marine_helmet & HELMET_SQUAD_OVERLAY) - var/datum/squad/S = assigned_squad - var/leader = S.squad_leader == src - if(S.color <= helmetmarkings.len) - var/image/J = leader? helmetmarkings_sql[S.color] : helmetmarkings[S.color] - J.layer = -HEAD_SQUAD_LAYER - overlays_standing[HEAD_SQUAD_LAYER] = J + if(assigned_squad && assigned_squad.equipment_color) + var/leader = assigned_squad.squad_leader + var/image/helmet_overlay = image(marine_helmet.helmet_overlay_icon, icon_state = "std-helmet") + if(leader == src) + helmet_overlay = image(marine_helmet.helmet_overlay_icon, icon_state = "sql-helmet") + helmet_overlay.layer = -HEAD_SQUAD_LAYER + helmet_overlay.alpha = assigned_squad.armor_alpha + helmet_overlay.color = assigned_squad.equipment_color + overlays_standing[HEAD_SQUAD_LAYER] = helmet_overlay apply_overlay(HEAD_SQUAD_LAYER) var/num_helmet_overlays = 0 @@ -517,14 +519,16 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, if(istype(wear_suit, /obj/item/clothing/suit/storage/marine)) var/obj/item/clothing/suit/storage/marine/marine_armor = wear_suit if(marine_armor.flags_marine_armor & ARMOR_SQUAD_OVERLAY) - if(assigned_squad) - var/datum/squad/S = assigned_squad - var/leader = S.squad_leader == src - if(S.color <= helmetmarkings.len) - var/image/J = leader? armormarkings_sql[S.color] : armormarkings[S.color] - J.layer = -SUIT_SQUAD_LAYER - overlays_standing[SUIT_SQUAD_LAYER] = J - apply_overlay(SUIT_SQUAD_LAYER) + if(assigned_squad && assigned_squad.equipment_color) + var/leader = assigned_squad.squad_leader + var/image/squad_overlay = image(marine_armor.squad_overlay_icon, icon_state = "std-armor") + if(leader == src) + squad_overlay = image(marine_armor.squad_overlay_icon, icon_state = "sql-armor") + squad_overlay.layer = -SUIT_SQUAD_LAYER + squad_overlay.alpha = assigned_squad.armor_alpha + squad_overlay.color = assigned_squad.equipment_color + overlays_standing[SUIT_SQUAD_LAYER] = squad_overlay + apply_overlay(SUIT_SQUAD_LAYER) if(marine_armor.armor_overlays.len) var/image/K diff --git a/tgui/packages/tgui/interfaces/SquadMod.js b/tgui/packages/tgui/interfaces/SquadMod.js index 85ff237d3aac..15ce727a5341 100644 --- a/tgui/packages/tgui/interfaces/SquadMod.js +++ b/tgui/packages/tgui/interfaces/SquadMod.js @@ -5,7 +5,6 @@ import { Window } from '../layouts'; export const SquadMod = (props, context) => { const { act, data } = useBackend(context); const { squads = [], human, id_name, has_id } = data; - const COLORS_SPECTRUM = ['red', 'yellow', 'purple', 'teal', 'brown', 'grey']; return ( @@ -47,7 +46,7 @@ export const SquadMod = (props, context) => { key={entry.name} fluid content={entry.name} - color={COLORS_SPECTRUM[entry.color]} + backgroundColor={entry.color} onClick={() => act('PRG_squad', { name: entry.name,