diff --git a/code/__defines/js_snippets.dm b/code/__defines/js_snippets.dm new file mode 100644 index 0000000000..9b089c54d2 --- /dev/null +++ b/code/__defines/js_snippets.dm @@ -0,0 +1,81 @@ +#define PLAYER_HTML5_HTML "\n \ +\n \ +\n \ +\n \ +\n \ +\n \ +\n \ + \n \ +\n \ +\n" + +#define JS_BYJAX "function replaceContent() {\n \ + var args = Array.prototype.slice.call(arguments);\n \ + var id = args\[0\];\n \ + var content = args\[1\];\n \ + var callback = null;\n \ + if(args\[2\]){\n \ + callback = args\[2\];\n \ + if(args\[3\]){\n \ + args = args.slice(3);\n \ + }\n \ + }\n \ + var parent = document.getElementById(id);\n \ + if(typeof(parent)!=='undefined' && parent!=null){\n \ + parent.innerHTML = content?content:'';\n \ + }\n \ + if(callback && window\[callback\]){\n \ + window\[callback\].apply(null,args);\n \ + }\n \ +}" + +#define JS_DROPDOWN "function dropdowns() {\n \ + var divs = document.getElementsByTagName('div');\n \ + var headers = new Array();\n \ + var links = new Array();\n \ + for(var i=0;i=0) {\n \ + elem.className = elem.className.replace('visible','hidden');\n \ + this.className = this.className.replace('open','closed');\n \ + this.innerHTML = this.innerHTML.replace('-','+');\n \ + }\n \ + else {\n \ + elem.className = elem.className.replace('hidden','visible');\n \ + this.className = this.className.replace('closed','open');\n \ + this.innerHTML = this.innerHTML.replace('+','-');\n \ + }\n \ + return false;\n \ + }\n \ + })(links\[i\]);\n \ + }\n \ + }\n \ +}" diff --git a/code/_helpers/global_lists.dm b/code/_helpers/global_lists.dm index 5812f20a61..864f2488ea 100644 --- a/code/_helpers/global_lists.dm +++ b/code/_helpers/global_lists.dm @@ -19,8 +19,8 @@ GLOBAL_LIST_EMPTY(surgery_steps) //list of all surgery steps |BS12 GLOBAL_LIST_EMPTY(joblist) //list of all jobstypes, minus borg and AI GLOBAL_LIST_EMPTY(mechas_list) //list of all mechs. Used by hostile mobs target tracking. -var/global/list/obj/item/pda/PDAs = list() -var/global/list/obj/item/communicator/all_communicators = list() +GLOBAL_LIST_EMPTY_TYPED(PDAs, /obj/item/pda) +GLOBAL_LIST_EMPTY_TYPED(all_communicators, /obj/item/communicator) // Those networks can only be accessed by pre-existing terminals. AIs and new terminals can't use them. GLOBAL_LIST_INIT(restricted_camera_networks, list(NETWORK_ERT,NETWORK_MERCENARY,"Secret", NETWORK_COMMUNICATORS)) @@ -275,11 +275,17 @@ GLOBAL_LIST_EMPTY(mannequins) GLOB.wing_styles_list[path] = instance paths = typesof(/datum/digest_mode) - for(var/T in paths) - var/datum/digest_mode/DM = new T + for(var/path in paths) + var/datum/digest_mode/DM = new path GLOB.digest_modes[DM.id] = DM init_crafting_recipes(GLOB.crafting_recipes) + paths = subtypesof(/datum/ai_laws) + for(var/path in paths) + var/datum/ai_laws/laws = new path + GLOB.admin_laws += laws + if(laws.selectable) + GLOB.player_laws += laws /* // Custom species traits paths = subtypesof(/datum/trait) @@ -613,10 +619,10 @@ GLOBAL_LIST_INIT(changeling_fabricated_clothing, list( // This is to make some of the more OP superpowers a larger PITA to activate, // and to tell our new DNA datum which values to set in order to turn something // on or off. -var/global/list/dna_activity_bounds[DNA_SE_LENGTH] +GLOBAL_ALIST_EMPTY(dna_activity_bounds) // Used to determine what each block means (admin hax and species stuff on /vg/, mostly) -var/global/list/assigned_blocks[DNA_SE_LENGTH] +GLOBAL_ALIST_EMPTY(assigned_blocks) GLOBAL_LIST_EMPTY(gear_distributed_to) GLOBAL_LIST_EMPTY(overlay_cache) //cache recent overlays @@ -1399,8 +1405,8 @@ GLOBAL_LIST_INIT(finds_as_strings, list( //tgui law manager -var/global/list/datum/ai_laws/admin_laws -var/global/list/datum/ai_laws/player_laws +GLOBAL_LIST_EMPTY_TYPED(admin_laws, /datum/ai_laws) +GLOBAL_LIST_EMPTY_TYPED(player_laws, /datum/ai_laws) //shield_gen/external GLOBAL_LIST_INIT(external_shield_gen_blockedturfs, list( diff --git a/code/controllers/subsystems/events.dm b/code/controllers/subsystems/events.dm index 4269abdd0c..0efcf5573e 100644 --- a/code/controllers/subsystems/events.dm +++ b/code/controllers/subsystems/events.dm @@ -22,8 +22,8 @@ SUBSYSTEM_DEF(events) /*EVENT_LEVEL_MODERATE = */ new/datum/event_container/moderate, /*EVENT_LEVEL_MAJOR = */ new/datum/event_container/major ) - if(global.using_map.use_overmap) - GLOB.overmap_event_handler.create_events(global.using_map.overmap_z, global.using_map.overmap_size, global.using_map.overmap_event_areas) + if(using_map.use_overmap) + GLOB.overmap_event_handler.create_events(using_map.overmap_z, using_map.overmap_size, using_map.overmap_event_areas) return SS_INIT_SUCCESS /datum/controller/subsystem/events/fire(resumed) diff --git a/code/controllers/subsystems/skybox.dm b/code/controllers/subsystems/skybox.dm index ce0ad8d3da..a515855825 100644 --- a/code/controllers/subsystems/skybox.dm +++ b/code/controllers/subsystems/skybox.dm @@ -96,7 +96,7 @@ SUBSYSTEM_DEF(skybox) return skybox_cache["[z]"] /datum/controller/subsystem/skybox/proc/generate_skybox(z) - var/datum/skybox_settings/settings = global.using_map.get_skybox_datum(z) + var/datum/skybox_settings/settings = using_map.get_skybox_datum(z) var/new_overlays = list() @@ -113,7 +113,7 @@ SUBSYSTEM_DEF(skybox) new_overlays += base - if(global.using_map.use_overmap && settings.use_overmap_details) + if(using_map.use_overmap && settings.use_overmap_details) var/obj/effect/overmap/visitable/O = get_overmap_sector(z) if(istype(O)) var/image/self_image = O.generate_skybox(z) diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm index 950808873d..32e7685509 100644 --- a/code/game/dna/dna2_helpers.dm +++ b/code/game/dna/dna2_helpers.dm @@ -15,10 +15,10 @@ // DNA Gene activation boundaries, see dna2.dm. // Returns a list object with 4 numbers. /proc/GetDNABounds(var/block) - var/list/BOUNDS=dna_activity_bounds[block] - if(!istype(BOUNDS)) + var/list/bounds = GLOB.dna_activity_bounds[block] + if(!istype(bounds)) return DNA_DEFAULT_BOUNDS - return BOUNDS + return bounds // Give Random Bad Mutation to M /proc/randmutb(var/mob/living/M) diff --git a/code/game/gamemodes/events/clang.dm b/code/game/gamemodes/events/clang.dm index 3e43aa761f..47fb4255a8 100644 --- a/code/game/gamemodes/events/clang.dm +++ b/code/game/gamemodes/events/clang.dm @@ -12,7 +12,7 @@ GLOB.command_announcement.Announce("What the fuck was that?!", "General Alert") /datum/event/clang/start() - affecting_z = global.using_map.station_levels + affecting_z = using_map.station_levels var/startz = pick(affecting_z) var/startx = 0 diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index 5e3293703a..c50ce6f8fe 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -10,7 +10,7 @@ var/I = 0 while(++I < DNA_SE_LENGTH) blocks_remaining.Add(I) - assigned_blocks[I] = "" // setup a clean list + GLOB.assigned_blocks[I] = "" // setup a clean list for(var/TI in trait_list) var/datum/trait/T = trait_list[TI] if(T.is_genetrait) @@ -23,10 +23,10 @@ G.name = "[copytext(tex,1,min( 8, length(tex)+1 ))]:[G.block]" T.linked_gene = G G.linked_trait = T - dna_activity_bounds[G.block]=T.activity_bounds + GLOB.dna_activity_bounds[G.block] = T.activity_bounds // Handle global block data log_world("DNA2: Assigned [G.name] - Linked to trait [T.name].") - assigned_blocks[G.block]=G.name + GLOB.assigned_blocks[G.block] = G.name GLOB.trait_to_dna_genes[T.type] = G GLOB.dna_genes.Add(G) blocks_remaining.Remove(G.block) diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 0c3b490338..939a13b8fb 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -14,7 +14,7 @@ /obj/structure/AIcore/Initialize(mapload) . = ..() if(mapload) - laws = new global.using_map.default_law_type + laws = new using_map.default_law_type // VOREstation edit end /obj/structure/AIcore/attackby(obj/item/P as obj, mob/user as mob) diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index 9d98a42637..4d829ef643 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -136,7 +136,7 @@ //Get out list of viable PDAs var/list/obj/item/pda/sendPDAs = list() - for(var/obj/item/pda/P in PDAs) + for(var/obj/item/pda/P in GLOB.PDAs) if(!P.owner || P.hidden) continue var/datum/data/pda/app/messenger/M = P.find_program(/datum/data/pda/app/messenger) @@ -299,7 +299,7 @@ return TRUE var/obj/item/pda/PDARec = null - for(var/obj/item/pda/P in PDAs) + for(var/obj/item/pda/P in GLOB.PDAs) if(!P.owner || P.hidden) continue var/datum/data/pda/app/messenger/M = P.find_program(/datum/data/pda/app/messenger) diff --git a/code/game/mecha/equipment/tools/sleeper.dm b/code/game/mecha/equipment/tools/sleeper.dm index ea2964306c..e25a834be6 100644 --- a/code/game/mecha/equipment/tools/sleeper.dm +++ b/code/game/mecha/equipment/tools/sleeper.dm @@ -104,7 +104,7 @@ [occupant] statistics - - - - - -"} diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 3a69ca3723..1721e03df1 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -4,7 +4,7 @@ //Prime this list if we need it. if(has_huds) // Note, this should be refactored to drop priority overlays - add_overlay(backplane,TRUE) //Strap this on here, to block HUDs from appearing in rightclick menus: http://www.byond.com/forum/?post=2336679 + add_overlay(GLOB.backplane,TRUE) //Strap this on here, to block HUDs from appearing in rightclick menus: http://www.byond.com/forum/?post=2336679 hud_list = list() hud_list.len = TOTAL_HUDS make_hud_overlays() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 5d37310fd7..5b4fdb6de1 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -254,7 +254,7 @@ /mob/living/silicon/robot/proc/init() aiCamera = new/obj/item/camera/siliconcam/robot_camera(src) - laws = new global.using_map.default_law_type //use map's default + laws = new using_map.default_law_type //use map's default additional_law_channels["Binary"] = "#b" var/new_ai = select_active_ai_with_fewest_borgs() if(new_ai) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index b024451d59..3940132fdc 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -729,15 +729,16 @@ GLOBAL_LIST_INIT(organ_rel_size, list( //Icon is used to occlude things like huds from the faulty byond context menu. // http://www.byond.com/forum/?post=2336679 -var/global/image/backplane -/hook/startup/proc/generate_backplane() +GLOBAL_DATUM_INIT(backplane, /image, generate_backplane()) +/proc/generate_backplane() + var/image/backplane backplane = image('icons/misc/win32.dmi') backplane.alpha = 0 backplane.plane = -100 backplane.layer = MOB_LAYER-0.1 backplane.mouse_opacity = 0 - return TRUE + return backplane /mob/proc/get_sound_env(var/pressure_factor) if (pressure_factor < 0.5) diff --git a/code/modules/overmap/overmap_object.dm b/code/modules/overmap/overmap_object.dm index a31303fb9e..30489e83fb 100644 --- a/code/modules/overmap/overmap_object.dm +++ b/code/modules/overmap/overmap_object.dm @@ -37,7 +37,7 @@ /obj/effect/overmap/Initialize(mapload) . = ..() - if(!global.using_map.use_overmap) + if(!using_map.use_overmap) return INITIALIZE_HINT_QDEL if(render_map) // Initialize map objects diff --git a/code/modules/overmap/sectors.dm b/code/modules/overmap/sectors.dm index ee4cace804..a3b6840f9d 100644 --- a/code/modules/overmap/sectors.dm +++ b/code/modules/overmap/sectors.dm @@ -59,13 +59,13 @@ find_z_levels() // This populates map_z and assigns z levels to the ship. register_z_levels() // This makes external calls to update global z level information. - if(!global.using_map.overmap_z) + if(!using_map.overmap_z) build_overmap() - start_x = start_x || rand(OVERMAP_EDGE, global.using_map.overmap_size - OVERMAP_EDGE) - start_y = start_y || rand(OVERMAP_EDGE, global.using_map.overmap_size - OVERMAP_EDGE) + start_x = start_x || rand(OVERMAP_EDGE, using_map.overmap_size - OVERMAP_EDGE) + start_y = start_y || rand(OVERMAP_EDGE, using_map.overmap_size - OVERMAP_EDGE) - forceMove(locate(start_x, start_y, global.using_map.overmap_z)) + forceMove(locate(start_x, start_y, using_map.overmap_z)) // CHOMPAdd Start if(dyn_poi) @@ -166,27 +166,27 @@ for(var/zlevel in map_z) GLOB.map_sectors["[zlevel]"] = src - global.using_map.player_levels |= map_z + using_map.player_levels |= map_z if(!in_space) - global.using_map.sealed_levels |= map_z + using_map.sealed_levels |= map_z /* VOREStation Removal - We have a map system that does this already. if(base) - global.using_map.station_levels |= map_z - global.using_map.contact_levels |= map_z - global.using_map.map_levels |= map_z + using_map.station_levels |= map_z + using_map.contact_levels |= map_z + using_map.map_levels |= map_z */ /obj/effect/overmap/visitable/proc/unregister_z_levels() GLOB.map_sectors -= map_z - global.using_map.player_levels -= map_z + using_map.player_levels -= map_z if(!in_space) - global.using_map.sealed_levels -= map_z + using_map.sealed_levels -= map_z /* VOREStation Removal - We have a map system that does this already. if(base) - global.using_map.station_levels -= map_z - global.using_map.contact_levels -= map_z - global.using_map.map_levels -= map_z + using_map.station_levels -= map_z + using_map.contact_levels -= map_z + using_map.map_levels -= map_z */ /obj/effect/overmap/visitable/get_scan_data() @@ -308,23 +308,23 @@ GLOB.priority_announcement.Announce(message, new_title = "Automated Distress Signal", new_sound = 'sound/AI/sos_ch.ogg', zlevel = zlevel) //CHOMPedit, changed sound /proc/build_overmap() - if(!global.using_map.use_overmap) + if(!using_map.use_overmap) return 1 testing("Building overmap...") world.increment_max_z() - global.using_map.overmap_z = world.maxz + using_map.overmap_z = world.maxz - testing("Putting overmap on [global.using_map.overmap_z]") + testing("Putting overmap on [using_map.overmap_z]") var/area/overmap/A = new - for(var/turf/T as anything in block(locate(1,1,global.using_map.overmap_z), locate(global.using_map.overmap_size,global.using_map.overmap_size,global.using_map.overmap_z))) - if(T.x == 1 || T.y == 1 || T.x == global.using_map.overmap_size || T.y == global.using_map.overmap_size) + for(var/turf/T as anything in block(locate(1,1,using_map.overmap_z), locate(using_map.overmap_size,using_map.overmap_size,using_map.overmap_z))) + if(T.x == 1 || T.y == 1 || T.x == using_map.overmap_size || T.y == using_map.overmap_size) T = T.ChangeTurf(/turf/unsimulated/map/edge) else T = T.ChangeTurf(/turf/unsimulated/map) ChangeArea(T, A) - global.using_map.sealed_levels |= global.using_map.overmap_z + using_map.sealed_levels |= using_map.overmap_z if(!GLOB.dynamic_sector_master) //CHOMPedit: hook dynamic sector generation into overmap gen new /obj/effect/overmap/visitable/dynamic // CHOMPedit, glob var assignment is handled in the object. diff --git a/code/modules/overmap/ships/computers/helm.dm b/code/modules/overmap/ships/computers/helm.dm index 473595a1b7..85c172fbac 100644 --- a/code/modules/overmap/ships/computers/helm.dm +++ b/code/modules/overmap/ships/computers/helm.dm @@ -56,7 +56,7 @@ GLOBAL_LIST_EMPTY(all_waypoints) /obj/machinery/computer/ship/helm/process() ..() if(autopilot && dx && dy && !autopilot_disabled) - var/turf/T = locate(dx,dy,global.using_map.overmap_z) + var/turf/T = locate(dx,dy,using_map.overmap_z) if(linked.loc == T) if(linked.is_still()) autopilot = 0 diff --git a/code/modules/overmap/spacetravel.dm b/code/modules/overmap/spacetravel.dm index f780f4dd6c..65fbad27d2 100644 --- a/code/modules/overmap/spacetravel.dm +++ b/code/modules/overmap/spacetravel.dm @@ -12,7 +12,7 @@ start_x = loc.x start_y = loc.y // But pick an empty z level to use - map_z += global.using_map.get_empty_zlevel() + map_z += using_map.get_empty_zlevel() . = ..() if(!map_z[1]) log_and_message_admins("Could not create empty sector at [x], [y]. No available z levels to allocate.") @@ -26,7 +26,7 @@ return ..() /obj/effect/overmap/visitable/sector/temporary/find_z_levels() - LAZYADD(map_z, global.using_map.get_empty_zlevel()) + LAZYADD(map_z, using_map.get_empty_zlevel()) /obj/effect/overmap/visitable/sector/temporary/proc/is_empty(var/mob/observer) if(!LAZYLEN(map_z)) @@ -44,7 +44,7 @@ qdel(src) /proc/get_deepspace(x,y) - var/turf/unsimulated/map/overmap_turf = locate(x,y,global.using_map.overmap_z) + var/turf/unsimulated/map/overmap_turf = locate(x,y,using_map.overmap_z) if(!istype(overmap_turf)) CRASH("Attempt to get deepspace at ([x],[y]) which is not on overmap: [overmap_turf]") var/obj/effect/overmap/visitable/sector/temporary/res = locate() in overmap_turf @@ -133,7 +133,7 @@ testing("[A] spacemoving from [M] ([M.x], [M.y]).") - var/turf/map = locate(M.x,M.y,global.using_map.overmap_z) + var/turf/map = locate(M.x,M.y,using_map.overmap_z) var/obj/effect/overmap/visitable/TM for(var/obj/effect/overmap/visitable/O in map) if(O != M && O.in_space && prob(50)) diff --git a/code/modules/overmap/turfs.dm b/code/modules/overmap/turfs.dm index 9d4f36bc99..498bf8bfd4 100644 --- a/code/modules/overmap/turfs.dm +++ b/code/modules/overmap/turfs.dm @@ -56,11 +56,11 @@ GLOBAL_LIST_EMPTY(map_sectors) name = "[x]-[y]" var/list/numbers = list() - if(x == 1 || x == global.using_map.overmap_size) + if(x == 1 || x == using_map.overmap_size) numbers += list("[round(y/10)]","[round(y%10)]") - if(y == 1 || y == global.using_map.overmap_size) + if(y == 1 || y == using_map.overmap_size) numbers += "-" - if(y == 1 || y == global.using_map.overmap_size) + if(y == 1 || y == using_map.overmap_size) numbers += list("[round(x/10)]","[round(x%10)]") for(var/i = 1 to numbers.len) @@ -70,12 +70,12 @@ GLOBAL_LIST_EMPTY(map_sectors) if(y == 1) I.pixel_y = 3 I.pixel_x = 5*i + 4 - if(y == global.using_map.overmap_size) + if(y == using_map.overmap_size) I.pixel_y = world.icon_size - 9 I.pixel_x = 5*i + 4 if(x == 1) I.pixel_x = 5*i - 2 - if(x == global.using_map.overmap_size) + if(x == using_map.overmap_size) I.pixel_x = 5*i + 2 add_overlay(I) AddElement(/datum/element/turf_z_transparency) diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 2049b5ef2f..af92623090 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -35,7 +35,7 @@ GLOBAL_LIST_EMPTY(adminfaxes) //cache for faxes that have been sent to admins if( !(("[department]" in GLOB.alldepartments) || ("[department]" in GLOB.admin_departments)) ) GLOB.alldepartments |= department -/obj/machinery/photocopier/faxmachine/attack_hand(mob/user as mob) +/obj/machinery/photocopier/faxmachine/attack_hand(mob/user) if(issilicon(user)) //CHOMPEdit Start this allows borgs to use fax machines, meant for the Unity and Clerical modules. authenticated = user.name tgui_interact(user) diff --git a/code/modules/pda/messenger.dm b/code/modules/pda/messenger.dm index 81df5c6e9c..fe821da3c1 100644 --- a/code/modules/pda/messenger.dm +++ b/code/modules/pda/messenger.dm @@ -33,9 +33,9 @@ data["convo_job"] = sanitize(c["job"]) break else - var/convopdas[0] - var/pdas[0] - for(var/obj/item/pda/P as anything in PDAs) + var/list/convopdas = list() + var/list/pdas = list() + for(var/obj/item/pda/P as anything in GLOB.PDAs) var/datum/data/pda/app/messenger/PM = P.find_program(/datum/data/pda/app/messenger) if(!P.owner || PM.toff || P == pda || PM.m_hidden) @@ -194,7 +194,7 @@ to_chat(usr, "Turn on your receiver in order to send messages.") return - for(var/obj/item/pda/P as anything in PDAs) + for(var/obj/item/pda/P as anything in GLOB.PDAs) var/datum/data/pda/app/messenger/PM = P.find_program(/datum/data/pda/app/messenger) if(!P.owner || !PM || PM.hidden || P == pda || PM.toff) @@ -237,7 +237,7 @@ modified_message["target"] = "\ref[M]" var/list/targets = list() - for(var/obj/item/pda/pda in PDAs) + for(var/obj/item/pda/pda in GLOB.PDAs) if(pda.cartridge && pda.owner && is_type_in_list(pda.cartridge, M.cartridges_to_send_to)) targets |= pda if(targets.len) diff --git a/code/modules/pda/pda.dm b/code/modules/pda/pda.dm index 2380a4ad10..4f6d364304 100644 --- a/code/modules/pda/pda.dm +++ b/code/modules/pda/pda.dm @@ -108,8 +108,7 @@ /obj/item/pda/Initialize(mapload) . = ..() - PDAs += src - PDAs = sort_names(PDAs) + GLOB.PDAs += src update_programs() if(default_cartridge) cartridge = new default_cartridge(src) @@ -474,7 +473,7 @@ return /obj/item/pda/Destroy() - PDAs -= src + GLOB.PDAs -= src if (id && !delete_id && id.loc == src) id.forceMove(get_turf(loc)) else diff --git a/code/modules/shuttles/shuttle_autodock.dm b/code/modules/shuttles/shuttle_autodock.dm index 132548f238..530ff676e7 100644 --- a/code/modules/shuttles/shuttle_autodock.dm +++ b/code/modules/shuttles/shuttle_autodock.dm @@ -27,7 +27,7 @@ update_docking_target(current_location) if(active_docking_controller) set_docking_codes(active_docking_controller.docking_codes) - else if(global.using_map.use_overmap) + else if(using_map.use_overmap) var/obj/effect/overmap/visitable/location = get_overmap_sector(get_z(current_location)) if(location && location.docking_codes) set_docking_codes(location.docking_codes) diff --git a/code/modules/shuttles/shuttle_specops.dm b/code/modules/shuttles/shuttle_specops.dm index 69709afd8e..75b9c9b3e1 100644 --- a/code/modules/shuttles/shuttle_specops.dm +++ b/code/modules/shuttles/shuttle_specops.dm @@ -36,7 +36,7 @@ var/obj/machinery/computer/C = user if(world.time <= reset_time) - C.visible_message(span_notice("[global.using_map.boss_name] will not allow the Special Operations shuttle to launch yet.")) + C.visible_message(span_notice("[using_map.boss_name] will not allow the Special Operations shuttle to launch yet.")) if (((world.time - reset_time)/10) > 60) C.visible_message(span_notice("[-((world.time - reset_time)/10)/60] minutes remain!")) else diff --git a/code/modules/tgui/modules/law_manager.dm b/code/modules/tgui/modules/law_manager.dm index 00d5d970e7..fced7398df 100644 --- a/code/modules/tgui/modules/law_manager.dm +++ b/code/modules/tgui/modules/law_manager.dm @@ -13,17 +13,6 @@ owner = S - if(!admin_laws) - admin_laws = new() - player_laws = new() - - init_subtypes(/datum/ai_laws, admin_laws) - admin_laws = dd_sortedObjectList(admin_laws) - - for(var/datum/ai_laws/laws in admin_laws) - if(laws.selectable) - player_laws += laws - /datum/tgui_module/law_manager/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state) if(..()) return TRUE @@ -113,14 +102,14 @@ return TRUE if("state_law_set") - var/datum/ai_laws/ALs = locate(params["state_law_set"]) in (is_admin(ui.user) ? admin_laws : player_laws) + var/datum/ai_laws/ALs = locate(params["state_law_set"]) in (is_admin(ui.user) ? GLOB.admin_laws : GLOB.player_laws) if(ALs) owner.statelaws(ALs) return TRUE if("transfer_laws") if(is_malf(ui.user)) - var/datum/ai_laws/ALs = locate(params["transfer_laws"]) in (is_admin(ui.user) ? admin_laws : player_laws) + var/datum/ai_laws/ALs = locate(params["transfer_laws"]) in (is_admin(ui.user) ? GLOB.admin_laws : GLOB.player_laws) if(ALs) log_and_message_admins("has transfered the [ALs.name] laws to [owner].") ALs.sync(owner, 0) @@ -165,7 +154,7 @@ channels[++channels.len] = list("channel" = ch_name) data["channel"] = owner.lawchannel data["channels"] = channels - data["law_sets"] = package_multiple_laws(data["isAdmin"] ? admin_laws : player_laws) + data["law_sets"] = package_multiple_laws(data["isAdmin"] ? GLOB.admin_laws : GLOB.player_laws) return data diff --git a/maps/~map_system/maps.dm b/maps/~map_system/maps.dm index 5748d769ee..f62247c81d 100644 --- a/maps/~map_system/maps.dm +++ b/maps/~map_system/maps.dm @@ -1,4 +1,3 @@ - var/datum/map/using_map = new USING_MAP_DATUM GLOBAL_LIST_EMPTY(all_maps) diff --git a/tgui/packages/tgui/interfaces/LawManager.tsx b/tgui/packages/tgui/interfaces/LawManager.tsx index 465c020ec8..2e1e4b236a 100644 --- a/tgui/packages/tgui/interfaces/LawManager.tsx +++ b/tgui/packages/tgui/interfaces/LawManager.tsx @@ -493,71 +493,73 @@ export const LawManagerLawSets = (props: { onChange={(value: string) => onSearchLawName(value)} /> {law_sets.length - ? prepareSearch(law_sets, searchLawName).map((laws) => ( -
- - - - - - - - } - > - {laws.laws.has_ion_laws ? ( - - ) : ( - '' - )} - {laws.laws.has_zeroth_laws || laws.laws.has_inherent_laws ? ( - - ) : ( - '' - )} - {laws.laws.has_supplied_laws ? ( - - ) : ( - '' - )} -
- )) + ? prepareSearch(law_sets, searchLawName) + .sort((a, b) => a.name.localeCompare(b.name)) + .map((laws) => ( +
+ + + + + + + + } + > + {laws.laws.has_ion_laws ? ( + + ) : ( + '' + )} + {laws.laws.has_zeroth_laws || laws.laws.has_inherent_laws ? ( + + ) : ( + '' + )} + {laws.laws.has_supplied_laws ? ( + + ) : ( + '' + )} +
+ )) : ''} ); diff --git a/tgui/packages/tgui/interfaces/MessageMonitor/MessageMonitorTabs.tsx b/tgui/packages/tgui/interfaces/MessageMonitor/MessageMonitorTabs.tsx index 547c854d64..764eccab9a 100644 --- a/tgui/packages/tgui/interfaces/MessageMonitor/MessageMonitorTabs.tsx +++ b/tgui/packages/tgui/interfaces/MessageMonitor/MessageMonitorTabs.tsx @@ -152,7 +152,9 @@ export const MessageMonitorAdmin = (props) => { custommessage, } = data; - const recipientOptions = Object.keys(possibleRecipients); + const recipientOptions = Object.keys(possibleRecipients).sort((a, b) => + a.localeCompare(b), + ); return (
diff --git a/tgui/packages/tgui/interfaces/Pda/pda_screens/pda_messenger.tsx b/tgui/packages/tgui/interfaces/Pda/pda_screens/pda_messenger.tsx index 1215f37e55..0735eb84e0 100644 --- a/tgui/packages/tgui/interfaces/Pda/pda_screens/pda_messenger.tsx +++ b/tgui/packages/tgui/interfaces/Pda/pda_screens/pda_messenger.tsx @@ -152,7 +152,7 @@ const MessengerList = (props) => { ); }; -const PDAList = (props) => { +const PDAList = (props: { pdas: pda[]; title: string; msgAct: string }) => { const { act, data } = useBackend(); const { pdas, title, msgAct } = props; @@ -165,31 +165,33 @@ const PDAList = (props) => { return (
- {pdas.map((pda) => ( - - - {!!charges && - plugins.map((plugin) => ( - - ))} - - ))} + {pdas + .sort((a, b) => a.Name.localeCompare(b.Name)) + .map((pda) => ( + + + {!!charges && + plugins.map((plugin) => ( + + ))} + + ))}
); }; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/bay_prefs/loadout/SubtabLoadout.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/bay_prefs/loadout/SubtabLoadout.tsx index 4c5a53f332..3bf21b6f54 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/bay_prefs/loadout/SubtabLoadout.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/bay_prefs/loadout/SubtabLoadout.tsx @@ -48,17 +48,19 @@ export const SubtabLoadout = (props: { - {Object.keys(categories).map((key) => ( - - ))} + {Object.keys(categories) + .sort((a, b) => a.localeCompare(b)) + .map((key) => ( + + ))} @@ -70,59 +72,63 @@ export const SubtabLoadout = (props: {
- {activeCategoryItems.map((item) => ( - - - - - - {item.cost} - - {item.desc} - - - {item.show_roles && item.allowed_roles?.length ? ( + {activeCategoryItems + .sort((a, b) => a.name.localeCompare(b.name)) + .map((item) => ( + - - Allowed Roles: + + - {item.allowed_roles.join(',')} - - ) : null} - {item.name in gear_tweaks ? ( - - - {gear_tweaks[item.name].map((tweak) => ( - - - - ))} + {item.cost} + + {item.desc} - ) : null} - - ))} + {item.show_roles && item.allowed_roles?.length ? ( + + + Allowed Roles: + + {item.allowed_roles.join(',')} + + ) : null} + {item.name in gear_tweaks ? ( + + + {gear_tweaks[item.name].map((tweak) => ( + + + + ))} + + + ) : null} + + ))}
diff --git a/vorestation.dme b/vorestation.dme index 0b4ac06847..dbe329bc1c 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -115,6 +115,7 @@ #include "code\__defines\items_clothing.dm" #include "code\__defines\job_controller.dm" #include "code\__defines\jobs.dm" +#include "code\__defines\js_snippets.dm" #include "code\__defines\jukebox.dm" #include "code\__defines\life.dm" #include "code\__defines\lighting.dm" @@ -2256,7 +2257,6 @@ #include "code\game\turfs\unsimulated\sky_vr.dm" #include "code\game\turfs\unsimulated\walls.dm" #include "code\js\byjax.dm" -#include "code\js\menus.dm" #include "code\matrices\color_matrix.dm" #include "code\modules\admin\admin.dm" #include "code\modules\admin\admin_attack_log.dm" @@ -3404,7 +3404,6 @@ #include "code\modules\materials\sheets\organic\tanning\tanning_rack.dm" #include "code\modules\media\juke_remote.dm" #include "code\modules\media\media_machinery.dm" -#include "code\modules\media\media_player_html5.dm" #include "code\modules\media\media_tracks.dm" #include "code\modules\media\mediamanager.dm" #include "code\modules\media\walkpod.dm"