Skip to content

Commit

Permalink
fixed visor
Browse files Browse the repository at this point in the history
  • Loading branch information
doom committed Sep 27, 2023
1 parent 37a4b6d commit 2329406
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion code/controllers/subsystem/minimap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/items/devices/helmet_visors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions code/modules/clothing/head/helmet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down

0 comments on commit 2329406

Please sign in to comment.