diff --git a/code/controllers/subsystem/minimap.dm b/code/controllers/subsystem/minimap.dm index 590eece61f7e..e659c70137c6 100644 --- a/code/controllers/subsystem/minimap.dm +++ b/code/controllers/subsystem/minimap.dm @@ -357,6 +357,7 @@ SUBSYSTEM_DEF(minimaps) else map_list = GLOB.uscm_svg_overlay + if(map_list.len == 0) return @@ -390,6 +391,7 @@ SUBSYSTEM_DEF(minimaps) if(xeno.hivenumber == user_faction) faction_clients += client 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) @@ -407,19 +409,14 @@ SUBSYSTEM_DEF(minimaps) * * svg_coords: an array of coordinates corresponding to an svg. */ /datum/tacmap/proc/store_current_svg_coords(mob/user, svg_coords) - if(!svg_coords) - to_chat(user, SPAN_WARNING("The tacmap filckers and then shuts off, a critical error has occured")) // tf2heavy: "Oh, this is bad!" - return FALSE - - var/datum/svg_overlay/svg_overlay = new(svg_coords) + var/datum/svg_overlay/svg_store_overlay = new(svg_coords) if(isxeno(user)) - GLOB.xeno_svg_overlay += svg_overlay + GLOB.xeno_svg_overlay += svg_store_overlay else - GLOB.uscm_svg_overlay += svg_overlay + GLOB.uscm_svg_overlay += svg_store_overlay - qdel(svg_overlay) - return TRUE + qdel(svg_store_overlay) /datum/controller/subsystem/minimaps/proc/fetch_tacmap_datum(zlevel, flags) @@ -551,7 +548,7 @@ SUBSYSTEM_DEF(minimaps) var/updated_canvas = FALSE var/datum/flattend_tacmap_png/current_map = new - + var/datum/svg_overlay/current_svg = new /datum/tacmap/New(atom/source, minimap_type) allowed_flags = minimap_type @@ -574,7 +571,8 @@ SUBSYSTEM_DEF(minimaps) current_map = get_current_tacmap_data(user, TRUE) if(!current_map) distribute_current_map_png(user) - current_map.flat_tacmap = get_current_tacmap_data(user, TRUE).flat_tacmap + current_map = get_current_tacmap_data(user, TRUE) + user.client.register_map_obj(map_holder.map) ui = new(user, src, "TacticalMap") @@ -582,11 +580,13 @@ SUBSYSTEM_DEF(minimaps) /datum/tacmap/ui_data(mob/user) var/list/data = list() - data["svgData"] = null data["flatImage"] = current_map.flat_tacmap - if(current_map) - data["svgData"] = get_current_tacmap_data(user, FALSE).svg_data + + data["svgData"] = null + + if(current_svg) + data["svgData"] = current_svg.svg_data data["mapRef"] = map_holder.map_ref data["toolbarColorSelection"] = toolbar_color_selection @@ -667,11 +667,15 @@ SUBSYSTEM_DEF(minimaps) . = TRUE if ("selectAnnouncement") + + if(!params["image"]) + return var/outgoing_message = stripped_multiline_input(user, "Optional message to announce with the tactical map", "Tactical Map Announcement", "") if(!outgoing_message) return - if(!store_current_svg_coords(params["image"])) - return + store_current_svg_coords(user, params["image"]) + + current_svg = get_current_tacmap_data(user, FALSE) var/signed var/mob/living/carbon/xenomorph/xeno diff --git a/code/game/objects/items/devices/helmet_visors.dm b/code/game/objects/items/devices/helmet_visors.dm index 40242e679f43..fbeba4d2d66a 100644 --- a/code/game/objects/items/devices/helmet_visors.dm +++ b/code/game/objects/items/devices/helmet_visors.dm @@ -70,13 +70,6 @@ action_icon_string = "blank_hud_sight_down" helmet_overlay = "weld_visor" -/obj/item/device/helmet_visor/tactical_map_visor - name = "map visor" - icon_state = "meson_sight" - hud_type = null - action_icon_string = "meson_sight_down" - helmet_overlay = "tacmap_visor" - /obj/item/device/helmet_visor/welding_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) attached_helmet.vision_impair = VISION_IMPAIR_MAX @@ -97,18 +90,6 @@ 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, 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 - - SStgui.close_user_uis(user, GLOB.tacmap_datum) - if(!silent) - to_chat(user, SPAN_NOTICE("You deactivate [src] on [attached_helmet].")) - return TRUE - /obj/item/device/helmet_visor/welding_visor/mercenary helmet_overlay = "" diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index b9ad4a96b315..dda517cf1f9f 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -378,7 +378,7 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( var/helmet_overlay_icon = 'icons/mob/humans/onmob/head_1.dmi' ///Any visors built into the helmet - var/list/built_in_visors = list(new /obj/item/device/helmet_visor, new /obj/item/device/helmet_visor/tactical_map_visor) + var/list/built_in_visors = list(new /obj/item/device/helmet_visor) ///Any visors that have been added into the helmet var/list/inserted_visors = list() @@ -623,10 +623,7 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( return if(active_visor.can_toggle(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) + active_visor.visor_function(src, user) playsound_client(user.client, active_visor.toggle_on_sound, null, 75) update_icon() @@ -637,10 +634,7 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( return if(current_visor.can_toggle(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) + current_visor.visor_function(src, user) if(sound) playsound_client(user.client, current_visor.toggle_off_sound, null, 75) @@ -722,7 +716,7 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( desc = "A modified M10 marine helmet for ComTechs. Features a toggleable welding screen for eye protection." icon_state = "tech_helmet" specialty = "M10 technician" - built_in_visors = list(new /obj/item/device/helmet_visor, new /obj/item/device/helmet_visor/welding_visor, new /obj/item/device/helmet_visor/tactical_map_visor) + built_in_visors = list(new /obj/item/device/helmet_visor, new /obj/item/device/helmet_visor/welding_visor) /obj/item/clothing/head/helmet/marine/grey desc = "A standard M10 Pattern Helmet. This one has not had a camouflage pattern applied to it yet. There is a built-in camera on the right side." @@ -741,14 +735,14 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( flags_inventory = BLOCKSHARPOBJ flags_inv_hide = HIDEEARS|HIDETOPHAIR specialty = "M50 tanker" - built_in_visors = list(new /obj/item/device/helmet_visor, new /obj/item/device/helmet_visor/welding_visor/tanker, new /obj/item/device/helmet_visor/tactical_map_visor) + built_in_visors = list(new /obj/item/device/helmet_visor, new /obj/item/device/helmet_visor/welding_visor/tanker) /obj/item/clothing/head/helmet/marine/medic name = "\improper M10 corpsman helmet" desc = "An M10 marine helmet version worn by marine hospital corpsmen. Has red cross painted on its front." icon_state = "med_helmet" specialty = "M10 pattern medic" - built_in_visors = list(new /obj/item/device/helmet_visor, new /obj/item/device/helmet_visor/medical/advanced, new /obj/item/device/helmet_visor/tactical_map_visor) + built_in_visors = list(new /obj/item/device/helmet_visor, new /obj/item/device/helmet_visor/medical/advanced) start_down_visor_type = /obj/item/device/helmet_visor/medical/advanced /obj/item/clothing/head/helmet/marine/covert @@ -891,7 +885,7 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( armor_bio = CLOTHING_ARMOR_MEDIUMHIGH specialty = "M10 pattern captain" flags_atom = NO_SNOW_TYPE - built_in_visors = list(new /obj/item/device/helmet_visor, new /obj/item/device/helmet_visor/medical/advanced, new /obj/item/device/helmet_visor/security, new /obj/item/device/helmet_visor/tactical_map_visor) + built_in_visors = list(new /obj/item/device/helmet_visor, new /obj/item/device/helmet_visor/medical/advanced, new /obj/item/device/helmet_visor/security) /obj/item/clothing/head/helmet/marine/MP name = "\improper M10 pattern MP helmet" @@ -915,7 +909,7 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( icon_state = "helmet" item_state = "helmet" specialty = "M10 pattern officer" - built_in_visors = list(new /obj/item/device/helmet_visor, new /obj/item/device/helmet_visor/medical/advanced, new /obj/item/device/helmet_visor/tactical_map_visor) + built_in_visors = list(new /obj/item/device/helmet_visor, new /obj/item/device/helmet_visor/medical/advanced) /obj/item/clothing/head/helmet/marine/mp/provost/marshal name = "\improper Provost Marshal Cap"