From af87be88ffd453547ce5308729ac935561d957d1 Mon Sep 17 00:00:00 2001 From: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Wed, 23 Aug 2023 00:12:27 +0000 Subject: [PATCH 01/36] Automatic changelog compile [ci skip] --- html/changelog.html | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/html/changelog.html b/html/changelog.html index b4e2c3b1c55..a0cb561c267 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -278,22 +278,6 @@

Bokkiewokkie updated:

  • scanned anomalies are now stored per overmap instead of per astrometrics console
  • anomalies now store their current system in a variable like ships, and can be located with find_system()
  • - -

    21 June 2023

    -

    4310V343k updated:

    - -

    ExcessiveUseOfCobblestone, Mothblocks updated:

    - -

    someone543 updated:

    - GoonStation 13 Development Team From 68c608146abb0b261ed5f85379cb790d09e0d00a Mon Sep 17 00:00:00 2001 From: Bobbanz1 <59128051+Bobbanz1@users.noreply.github.com> Date: Fri, 25 Aug 2023 18:50:54 +0200 Subject: [PATCH 02/36] [PORT] Navbeacon Refactor (#2484) --- _maps/map_files/Aetherwhisp/Aetherwhisp1.dmm | 25 +- _maps/map_files/Aetherwhisp/Aetherwhisp2.dmm | 17 +- _maps/map_files/Atlas/atlas.dmm | 7 +- _maps/map_files/Atlas/atlas2.dmm | 10 +- _maps/map_files/Galactica/Galactica1.dmm | 5 +- _maps/map_files/Galactica/Galactica2.dmm | 35 +- _maps/map_files/Snake/snake_lower.dmm | 11 - _maps/map_files/Snake/snake_upper.dmm | 1 - _maps/map_files/Tycoon/Tycoon2.dmm | 31 +- code/__DEFINES/radio.dm | 2 +- code/__DEFINES/robots.dm | 8 + code/game/machinery/navbeacon.dm | 314 ++++++++++-------- .../mob/living/simple_animal/bot/bot.dm | 10 +- .../mob/living/simple_animal/bot/mulebot.dm | 6 +- code/modules/research/techweb/all_nodes.dm | 2 +- code/modules/shuttle/on_move.dm | 4 +- .../game/objects/items/nsv_circuitboards.dm | 6 + .../designs/nsv_circuitboard_designs.dm | 9 + tgui/packages/tgui/interfaces/NavBeacon.tsx | 144 ++++++++ 19 files changed, 401 insertions(+), 246 deletions(-) create mode 100644 tgui/packages/tgui/interfaces/NavBeacon.tsx diff --git a/_maps/map_files/Aetherwhisp/Aetherwhisp1.dmm b/_maps/map_files/Aetherwhisp/Aetherwhisp1.dmm index 26970b86082..37630b2560d 100644 --- a/_maps/map_files/Aetherwhisp/Aetherwhisp1.dmm +++ b/_maps/map_files/Aetherwhisp/Aetherwhisp1.dmm @@ -2436,9 +2436,8 @@ /obj/structure/plasticflaps/opaque, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=4"; - dir = 4; - freq = 1400; - location = "Kitchen" + location = "Kitchen"; + name = "navigation beacon (Kitchen Delivery)" }, /obj/machinery/door/window/northleft{ dir = 8; @@ -4037,9 +4036,8 @@ }, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=4"; - dir = 4; - freq = 1400; - location = "Bar" + location = "Bar"; + name = "navigation beacon (Bar Delivery)" }, /turf/open/floor/wood, /area/crew_quarters/bar) @@ -4790,9 +4788,8 @@ }, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=4"; - dir = 4; - freq = 1400; - location = "Security" + location = "Security"; + name = "navigation beacon (Security Delivery)" }, /turf/open/floor/plating, /area/maintenance/department/medical) @@ -11145,9 +11142,8 @@ "hll" = ( /obj/machinery/navbeacon{ codes_txt = "delivery;dir=4"; - dir = 4; - freq = 1400; - location = "Medbay" + location = "Medbay"; + name = "navigation beacon (Medbay Delivery)" }, /turf/open/floor/carpet/ship/blue, /area/medical/medbay/lobby) @@ -30705,9 +30701,8 @@ "tYz" = ( /obj/machinery/navbeacon{ codes_txt = "delivery;dir=4"; - dir = 4; - freq = 1400; - location = "Engineering" + location = "Engineering"; + name = "navigation beacon (Engineering Delivery)" }, /obj/structure/plasticflaps/opaque, /obj/machinery/door/window/eastleft{ diff --git a/_maps/map_files/Aetherwhisp/Aetherwhisp2.dmm b/_maps/map_files/Aetherwhisp/Aetherwhisp2.dmm index 8a9224af6f9..675e4bad9ad 100644 --- a/_maps/map_files/Aetherwhisp/Aetherwhisp2.dmm +++ b/_maps/map_files/Aetherwhisp/Aetherwhisp2.dmm @@ -4182,9 +4182,8 @@ "cLa" = ( /obj/machinery/navbeacon{ codes_txt = "delivery;dir=4"; - dir = 4; - freq = 1400; - location = "Bridge" + location = "Bridge"; + name = "navigation beacon (Bridge Delivery)" }, /turf/open/floor/carpet/ship, /area/hallway/nsv/deck2/forward) @@ -10715,8 +10714,6 @@ /obj/effect/turf_decal/bot, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=8"; - dir = 8; - freq = 1400; location = "QM #2" }, /mob/living/simple_animal/bot/mulebot{ @@ -12356,9 +12353,8 @@ }, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=4"; - dir = 4; - freq = 1400; - location = "Munitions" + location = "Munitions"; + name = "navigation beacon (Munitions Delivery)" }, /turf/open/floor/plating, /area/maintenance/nsv/bridge) @@ -28140,9 +28136,8 @@ "sUe" = ( /obj/machinery/navbeacon{ codes_txt = "delivery;dir=4"; - dir = 4; - freq = 1400; - location = "Science" + location = "Science"; + name = "navigation beacon (Science Delivery)" }, /turf/open/floor/carpet/ship/purple_carpet, /area/science/computer_lab) diff --git a/_maps/map_files/Atlas/atlas.dmm b/_maps/map_files/Atlas/atlas.dmm index a09d4b7a0fd..913204384ff 100644 --- a/_maps/map_files/Atlas/atlas.dmm +++ b/_maps/map_files/Atlas/atlas.dmm @@ -2837,8 +2837,6 @@ }, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=8"; - dir = 8; - freq = 1400; location = "QM #2" }, /mob/living/simple_animal/bot/mulebot{ @@ -9002,9 +9000,8 @@ /obj/structure/disposalpipe/segment, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=4"; - dir = 4; - freq = 1400; - location = "Munitions" + location = "Munitions"; + name = "navigation beacon (Munitions Delivery)" }, /turf/open/floor/monotile/steel, /area/nsv/weapons) diff --git a/_maps/map_files/Atlas/atlas2.dmm b/_maps/map_files/Atlas/atlas2.dmm index 8a423762128..32d7538cf04 100644 --- a/_maps/map_files/Atlas/atlas2.dmm +++ b/_maps/map_files/Atlas/atlas2.dmm @@ -568,9 +568,8 @@ /obj/structure/disposalpipe/segment, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=4"; - dir = 4; - freq = 1400; - location = "Service" + location = "Service"; + name = "navigation beacon (Service Delivery)" }, /turf/open/floor/monotile/steel, /area/crew_quarters/bar/mess_hall) @@ -2916,9 +2915,8 @@ }, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=4"; - dir = 4; - freq = 1400; - location = "Medbay" + location = "Medbay"; + name = "navigation beacon (Medbay Delivery)" }, /turf/open/floor/durasteel/alt, /area/medical/medbay) diff --git a/_maps/map_files/Galactica/Galactica1.dmm b/_maps/map_files/Galactica/Galactica1.dmm index 6101a9cafea..36b51b319d9 100644 --- a/_maps/map_files/Galactica/Galactica1.dmm +++ b/_maps/map_files/Galactica/Galactica1.dmm @@ -6657,9 +6657,8 @@ /obj/structure/lattice/catwalk/over/ship, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=8"; - dir = 4; - freq = 1400; - location = "Engineering Lobby" + location = "Engineering Lobby"; + name = "navigation beacon (Engineering Lobby Delivery)" }, /turf/open/floor/engine, /area/hallway/nsv/deck1/frame1/central) diff --git a/_maps/map_files/Galactica/Galactica2.dmm b/_maps/map_files/Galactica/Galactica2.dmm index cd872131666..d64ad646494 100644 --- a/_maps/map_files/Galactica/Galactica2.dmm +++ b/_maps/map_files/Galactica/Galactica2.dmm @@ -7499,9 +7499,8 @@ /obj/structure/disposalpipe/segment, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=8"; - dir = 4; - freq = 1400; - location = "Prison" + location = "Prison"; + name = "navigation beacon (Prison Delivery)" }, /turf/open/floor/monotile/dark, /area/hallway/nsv/deck2/primary) @@ -11839,9 +11838,8 @@ /obj/structure/plasticflaps/opaque, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=8"; - dir = 4; - freq = 1400; - location = "Hydroponics" + location = "Hydroponics"; + name = "navigation beacon (Hydroponics Delivery)" }, /turf/open/floor/plating, /area/hydroponics) @@ -23105,9 +23103,8 @@ /obj/effect/turf_decal/tile/ship/full/blue, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=8"; - dir = 4; - freq = 1400; - location = "Munitions" + location = "Munitions"; + name = "navigation beacon (Munitions Delivery)" }, /turf/open/floor/monotile/steel, /area/hallway/nsv/deck2/primary) @@ -32597,9 +32594,8 @@ "ryx" = ( /obj/machinery/navbeacon{ codes_txt = "delivery;dir=8"; - dir = 4; - freq = 1400; - location = "Medbay" + location = "Medbay"; + name = "navigation beacon (Medbay Delivery)" }, /obj/structure/plasticflaps/opaque, /turf/open/floor/plating, @@ -34842,9 +34838,8 @@ /obj/structure/plasticflaps/opaque, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=1"; - dir = 8; - freq = 1400; - location = "Science" + location = "Science"; + name = "navigation beacon (Science Delivery)" }, /turf/open/floor/plating, /area/science/nsv/astronomy) @@ -37705,9 +37700,8 @@ /obj/structure/plasticflaps/opaque, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=1"; - dir = 8; - freq = 1400; - location = "Bar" + location = "Bar"; + name = "navigation beacon (Bar Delivery)" }, /turf/open/floor/plating, /area/crew_quarters/bar{ @@ -39452,9 +39446,8 @@ }, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=8"; - dir = 4; - freq = 1400; - location = "Kitchen" + location = "Kitchen"; + name = "navigation beacon (Kitchen Delivery)" }, /turf/open/floor/monotile/dark, /area/crew_quarters/bar{ diff --git a/_maps/map_files/Snake/snake_lower.dmm b/_maps/map_files/Snake/snake_lower.dmm index a822d13651b..8f23ef89e58 100644 --- a/_maps/map_files/Snake/snake_lower.dmm +++ b/_maps/map_files/Snake/snake_lower.dmm @@ -1069,8 +1069,6 @@ /obj/structure/disposalpipe/segment, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=8"; - dir = 4; - freq = 1400; location = "Security"; name = "Delivery Security" }, @@ -2754,8 +2752,6 @@ "jW" = ( /obj/machinery/navbeacon{ codes_txt = "delivery;dir=8"; - dir = 4; - freq = 1400; location = "Engineering"; name = "Delivery Engineering" }, @@ -7780,8 +7776,6 @@ "BI" = ( /obj/machinery/navbeacon{ codes_txt = "delivery;dir=1"; - dir = 1; - freq = 1400; location = "KItchen"; name = "Delivery Kitchen" }, @@ -10865,8 +10859,6 @@ /obj/structure/disposalpipe/segment, /obj/machinery/navbeacon{ codes_txt = "delivery;dir="; - dir = 4; - freq = 1400; location = "Medbay"; name = "Delivery Medbay" }, @@ -13381,7 +13373,6 @@ }, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=1"; - freq = 1400; location = "Munitions"; name = "Delivery Munitions" }, @@ -14675,8 +14666,6 @@ "YU" = ( /obj/machinery/navbeacon{ codes_txt = "delivery;dir=8"; - dir = 4; - freq = 1400; location = "Bar"; name = "Delivery Bar" }, diff --git a/_maps/map_files/Snake/snake_upper.dmm b/_maps/map_files/Snake/snake_upper.dmm index b973f11a1e0..526d1ec8dfc 100644 --- a/_maps/map_files/Snake/snake_upper.dmm +++ b/_maps/map_files/Snake/snake_upper.dmm @@ -1401,7 +1401,6 @@ /obj/structure/disposalpipe/segment, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=1"; - freq = 1400; location = "Hangar"; name = "Delivery Hangar" }, diff --git a/_maps/map_files/Tycoon/Tycoon2.dmm b/_maps/map_files/Tycoon/Tycoon2.dmm index 7565d61ffe5..4d99ee10e2a 100644 --- a/_maps/map_files/Tycoon/Tycoon2.dmm +++ b/_maps/map_files/Tycoon/Tycoon2.dmm @@ -7114,9 +7114,8 @@ /obj/effect/turf_decal/bot, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=4"; - dir = 4; - freq = 1400; - location = "Engineering" + location = "Engineering"; + name = "navigation beacon (Engineering Delivery)" }, /turf/open/floor/monotile/dark, /area/engine/break_room) @@ -40309,8 +40308,8 @@ /obj/effect/turf_decal/bot, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=1"; - freq = 1400; - location = "Research Division" + location = "Research Division"; + name = "navigation beacon (Research Delivery)" }, /turf/open/floor/monotile/dark, /area/science) @@ -40900,9 +40899,8 @@ /obj/effect/turf_decal/bot, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=8"; - dir = 8; - freq = 1400; - location = "Munitions" + location = "Munitions"; + name = "navigation beacon (Munitions Delivery)" }, /obj/machinery/door/window/brigdoor/westright{ req_access_txt = "69" @@ -42879,9 +42877,8 @@ "gIQ" = ( /obj/machinery/navbeacon{ codes_txt = "delivery;dir=8"; - dir = 8; - freq = 1400; - location = "Security" + location = "Security"; + name = "navigation beacon (Security Delivery)" }, /obj/effect/turf_decal/bot, /obj/machinery/door/window/brigdoor/westright{ @@ -43449,9 +43446,8 @@ /obj/effect/turf_decal/bot, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=1"; - dir = 1; - freq = 1400; - location = "Kitchen" + location = "Kitchen"; + name = "navigation beacon (Kitchen Delivery)" }, /obj/machinery/door/window/eastright{ dir = 1; @@ -46818,9 +46814,8 @@ /obj/effect/turf_decal/bot, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=4"; - dir = 4; - freq = 1400; - location = "Medbay" + location = "Medbay"; + name = "navigation beacon (Medbay Delivery)" }, /turf/open/floor/monotile/light, /area/medical/medbay/lobby) @@ -49234,8 +49229,6 @@ }, /obj/machinery/navbeacon{ codes_txt = "delivery;dir=8"; - dir = 8; - freq = 1400; location = "QM #2" }, /mob/living/simple_animal/bot/mulebot{ diff --git a/code/__DEFINES/radio.dm b/code/__DEFINES/radio.dm index adce3cc051d..de64aa18d8b 100644 --- a/code/__DEFINES/radio.dm +++ b/code/__DEFINES/radio.dm @@ -99,7 +99,7 @@ // This represents 1/8th of the available spectrum. #define FREQ_ATMOS_STORAGE 1441 -#define FREQ_NAV_BEACON 1445 +// #define FREQ_NAV_BEACON 1445 - NSV13 - Removed during the Murder of Navbeacons #define FREQ_AI_PRIVATE 1447 //! AI private comms frequency, magenta #define FREQ_PRESSURE_PLATE 1447 #define FREQ_AIRLOCK_CONTROL 1449 diff --git a/code/__DEFINES/robots.dm b/code/__DEFINES/robots.dm index 598913d1ebe..5b72a067a01 100644 --- a/code/__DEFINES/robots.dm +++ b/code/__DEFINES/robots.dm @@ -69,3 +69,11 @@ GLOBAL_LIST_EMPTY(cyborg_all_modules_icon_list) #define ASSEMBLY_THIRD_STEP 2 #define ASSEMBLY_FOURTH_STEP 3 #define ASSEMBLY_FIFTH_STEP 4 + +//NSV13 - Start - Navbeacon Refactor +//bot navigation beacon defines +#define NAVBEACON_PATROL_MODE "patrol" +#define NAVBEACON_PATROL_NEXT "next_patrol" +#define NAVBEACON_DELIVERY_MODE "delivery" +#define NAVBEACON_DELIVERY_DIRECTION "dir" +//NSV13 - End diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 05204158fe6..20f5882b93b 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -4,7 +4,7 @@ /obj/machinery/navbeacon icon = 'icons/obj/objects.dmi' - icon_state = "navbeacon0-f" + icon_state = "navbeacon0" //NSV13 - Navbeacon Refactor name = "navigation beacon" desc = "A radio beacon used for bot navigation." level = 1 // underfloor @@ -12,32 +12,37 @@ max_integrity = 500 armor = list("melee" = 70, "bullet" = 70, "laser" = 70, "energy" = 70, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 80, "stamina" = 0) - var/open = FALSE // true if cover is open - var/locked = TRUE // true if controls are locked - var/freq = FREQ_NAV_BEACON - var/location = "" // location response text - var/list/codes // assoc. list of transponder codes - var/codes_txt = "" // codes as set on map: "tag1;tag2" or "tag1=value;tag2=value" + //NSV13 - Start + circuit = /obj/item/circuitboard/machine/navbeacon + /// true if controls are locked + var/controls_locked = TRUE + /// true if cover is locked + var/cover_locked = TRUE + /// location response text + var/location = "" + /// original location name, to allow resets + var/original_location = "" + /// associative list of transponder codes + var/list/codes + /// codes as set on map: "tag1;tag2" or "tag1=value;tag2=value" + var/codes_txt = "" var/obj/structure/overmap/linked //NSV13 - DIFFERENCE BETWEEN CODEBASE + //NSV13 - Stop req_one_access = list(ACCESS_ENGINE, ACCESS_ROBOTICS) /obj/machinery/navbeacon/Initialize(mapload) . = ..() + original_location = location //NSV13 - Navbeacon Refactor set_codes() var/turf/T = loc hide(T.intact) - if(codes?["patrol"]) - if(!GLOB.navbeacons["[z]"]) - GLOB.navbeacons["[z]"] = list() - GLOB.navbeacons["[z]"] += src //Register with the patrol list! - if(codes?["delivery"]) - GLOB.deliverybeacons += src - GLOB.deliverybeacontags += location + //NSV13 - Start - Navbeacon Refactor + glob_lists_register(init=TRUE) - return INITIALIZE_HINT_LATELOAD //NSV13 start - Overmap ship compatibility + return INITIALIZE_HINT_LATELOAD /obj/machinery/navbeacon/LateInitialize() has_overmap() @@ -54,10 +59,9 @@ /obj/machinery/navbeacon/Destroy() if (linked.beacons_in_ship) - linked.beacons_in_ship -= src //NSV13 end - if (GLOB.navbeacons["[z]"]) - GLOB.navbeacons["[z]"] -= src //Remove from beacon list, if in one. - GLOB.deliverybeacons -= src + linked.beacons_in_ship -= src + glob_lists_deregister() + //NSV13 - Navbeacon Refactor - Stop return ..() /obj/machinery/navbeacon/onTransitZ(old_z, new_z) @@ -67,24 +71,81 @@ GLOB.navbeacons["[new_z]"] += src ..() -// set the transponder codes assoc list from codes_txt +//NSV13 - Navbeacon Refactor - Start +/obj/machinery/navbeacon/on_construction(mob/user) + var/turf/our_turf = loc + if(!isfloorturf(our_turf)) + return + var/turf/open/floor/floor = our_turf + floor.remove_tile(null, silent = TRUE, make_tile = TRUE) + + +///Set the transponder codes assoc list from codes_txt during initialization, or during reset /obj/machinery/navbeacon/proc/set_codes() + codes = list() if(!codes_txt) return - codes = new() - - var/list/entries = splittext(codes_txt, ";") // entries are separated by semicolons + var/list/entries = splittext(codes_txt, ";") // entries are separated by semicolons - for(var/e in entries) - var/index = findtext(e, "=") // format is "key=value" + for(var/entry in entries) + var/index = findtext(entry, "=") // format is "key=value" if(index) - var/key = copytext(e, 1, index) - var/val = copytext(e, index + length(e[index])) + var/key = copytext(entry, 1, index) + var/val = copytext(entry, index + length(entry[index])) codes[key] = val else - codes[e] = "1" + codes[entry] = "[TRUE]" + +//NSV13 - Navbeacon Refactor - Start +///Removes the nav beacon from the global beacon lists +/obj/machinery/navbeacon/proc/glob_lists_deregister() + if (GLOB.navbeacons["[z]"]) + GLOB.navbeacons["[z]"] -= src //Remove from beacon list, if in one. + GLOB.deliverybeacons -= src + GLOB.deliverybeacontags -= location + +///Registers the navbeacon to the global beacon lists +/obj/machinery/navbeacon/proc/glob_lists_register(var/init=FALSE) + if(!init) + glob_lists_deregister() + if(codes?[NAVBEACON_PATROL_MODE]) + if(!GLOB.navbeacons["[z]"]) + GLOB.navbeacons["[z]"] = list() + GLOB.navbeacons["[z]"] += src //Register with the patrol list! + if(codes?[NAVBEACON_DELIVERY_MODE]) + GLOB.deliverybeacons += src + GLOB.deliverybeacontags += location + +/obj/machinery/navbeacon/crowbar_act(mob/living/user, obj/item/I) + if(default_deconstruction_crowbar(I)) + return TRUE + +/obj/machinery/navbeacon/screwdriver_act(mob/living/user, obj/item/tool) + if(!panel_open && cover_locked) + balloon_alert(user, "hatch locked!") + return TRUE + return default_deconstruction_screwdriver(user, "navbeacon1","navbeacon0",tool) + +/obj/machinery/navbeacon/attackby(obj/item/attacking_item, mob/user, params) + var/turf/our_turf = loc + if(our_turf.intact) + return // prevent intraction when T-scanner revealed + + if(attacking_item.GetID()) + if(!panel_open) + if (allowed(user)) + controls_locked = !controls_locked + balloon_alert(user, "controls [controls_locked ? "locked" : "unlocked"]") + SStgui.update_uis(src) + else + balloon_alert(user, "access denied") + else + balloon_alert(user, "panel open!") + return + return ..() +//NSV13 - Navbeacon Refactor - Stop // called when turf state changes // hide the object if turf is intact @@ -92,141 +153,106 @@ invisibility = intact ? INVISIBILITY_MAXIMUM : 0 update_icon() -// update the icon_state -/obj/machinery/navbeacon/update_icon() - var/state="navbeacon[open]" - - if(invisibility) - icon_state = "[state]-f" // if invisible, set icon to faded version - // in case revealed by T-scanner - else - icon_state = "[state]" - -/obj/machinery/navbeacon/attackby(obj/item/I, mob/user, params) - var/turf/T = loc - if(T.intact) - return // prevent intraction when T-scanner revealed - - if(I.tool_behaviour == TOOL_SCREWDRIVER) - open = !open - - user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.") - - update_icon() - - else if (istype(I, /obj/item/card/id) || istype(I, /obj/item/modular_computer/tablet)) - if(open) - if (src.allowed(user)) - src.locked = !src.locked - to_chat(user, "Controls are now [src.locked ? "locked" : "unlocked"].") - else - to_chat(user, "Access denied.") - updateDialog() - else - to_chat(user, "You must open the cover first!") - else - return ..() /obj/machinery/navbeacon/attack_ai(mob/user) - interact(user, 1) + interact(user) //NSV13 - Navbeacon Refactor /obj/machinery/navbeacon/attack_paw() return -/obj/machinery/navbeacon/ui_interact(mob/user) +//NSV13 - Navbeacon Refactor - Start +/obj/machinery/navbeacon/ui_interact(mob/user, datum/tgui/ui) . = ..() - var/ai = isAI(user) - var/turf/T = loc - if(T.intact) - return // prevent intraction when T-scanner revealed - - if(!open && !ai) // can't alter controls if not open, unless you're an AI - to_chat(user, "The beacon's control cover is closed!") - return + var/turf/our_turf = loc + if(our_turf.intact) + return // prevent intraction when T-scanner revealed + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "NavBeacon") + ui.set_autoupdate(FALSE) + ui.open() - var/t +/obj/machinery/navbeacon/ui_data(mob/user) + var/list/data = list() + var/list/controls = list() - if(locked && !ai) - t = {"Navigation Beacon

    -(swipe card to unlock controls)
    -Location: [location ? location : "(none)"]
    -Transponder Codes: