From 23294064d478a1d9720af9441f1eb3aca621c867 Mon Sep 17 00:00:00 2001 From: doom Date: Tue, 26 Sep 2023 20:54:06 -0700 Subject: [PATCH] fixed visor --- code/controllers/subsystem/minimap.dm | 3 ++- code/game/objects/items/devices/helmet_visors.dm | 6 +++--- code/modules/clothing/head/helmet.dm | 10 ++++++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/code/controllers/subsystem/minimap.dm b/code/controllers/subsystem/minimap.dm index c08e248f7afb..34a4f8311f93 100644 --- a/code/controllers/subsystem/minimap.dm +++ b/code/controllers/subsystem/minimap.dm @@ -381,7 +381,8 @@ SUBSYSTEM_DEF(minimaps) xeno = client_mob if(xeno.hivenumber == user_faction) faction_clients += client - else if(client_mob.faction == user_faction) + else if(client_mob.faction == user_faction) // TODO: not distributing properly, fix. + to_chat(user, SPAN_WARNING(client)) faction_clients += client COOLDOWN_START(src, flatten_map_cooldown, flatten_map_cooldown_time) var/flat_tacmap_png = icon2html(flat_map, faction_clients, sourceonly = TRUE) diff --git a/code/game/objects/items/devices/helmet_visors.dm b/code/game/objects/items/devices/helmet_visors.dm index 604acaa817a9..40242e679f43 100644 --- a/code/game/objects/items/devices/helmet_visors.dm +++ b/code/game/objects/items/devices/helmet_visors.dm @@ -97,14 +97,14 @@ user.update_tint() return TRUE -/obj/item/device/helmet_visor/tactical_map_visor/visor_function(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user, silent = FALSE) - if(attached_helmet == user.head && attached_helmet.active_visor == src) +/obj/item/device/helmet_visor/tactical_map_visor/visor_function(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user, silent = FALSE, toggle_type) + if(attached_helmet == user.head && attached_helmet.active_visor == src && toggle_type) GLOB.tacmap_datum.tgui_interact(user) if(!silent) to_chat(user, SPAN_NOTICE("You activate [src] on [attached_helmet].")) return TRUE - GLOB.tacmap_datum.ui_close(user) + SStgui.close_user_uis(user, GLOB.tacmap_datum) if(!silent) to_chat(user, SPAN_NOTICE("You deactivate [src] on [attached_helmet].")) return TRUE diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index 4dcefc21b3b6..f9c6f6f76e81 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -623,7 +623,10 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( return if(active_visor.can_toggle(user)) - active_visor.visor_function(src, user) + if(istype(active_visor, /obj/item/device/helmet_visor/tactical_map_visor)) + active_visor.visor_function(src, user, FALSE, TRUE) + else + active_visor.visor_function(src, user) playsound_client(user.client, active_visor.toggle_on_sound, null, 75) update_icon() @@ -634,7 +637,10 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( return if(current_visor.can_toggle(user)) - current_visor.visor_function(src, user) + if(istype(current_visor, /obj/item/device/helmet_visor/tactical_map_visor)) + current_visor.visor_function(src, user, sound, FALSE) + else + current_visor.visor_function(src, user) if(sound) playsound_client(user.client, current_visor.toggle_off_sound, null, 75)