From df3c9f87cb557da3a1994d43484b661918df76c2 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 29 Sep 2020 12:31:56 +0200 Subject: [PATCH] [MIRROR] Restyles Stat Panel, Adds Subpanel Sub-Categories (#1044) * Restyles Stat Panel, Adds Subpanel Sub-Categories (#53947) I re-styled the CSS for the stat panel in hopes to make it look nice, and I also added the ability to use sub-categories (currently a single level) of verbs using a . (period), an example being Admin.Fun instead of the previous Admin - Fun. This now results in a sub-category being automagically generated in the stat panel. * Restyles Stat Panel, Adds Subpanel Sub-Categories Co-authored-by: Bobbahbrown --- code/controllers/subsystem/events.dm | 2 +- code/controllers/subsystem/mapping.dm | 2 +- code/modules/admin/admin.dm | 8 +- code/modules/admin/admin_investigate.dm | 2 +- code/modules/admin/admin_verbs.dm | 28 +- code/modules/admin/adminmenu.dm | 2 +- code/modules/admin/verbs/adminjump.dm | 16 +- code/modules/admin/verbs/anonymousnames.dm | 2 +- code/modules/admin/verbs/beakerpanel.dm | 2 +- code/modules/admin/verbs/borgpanel.dm | 2 +- code/modules/admin/verbs/cinematic.dm | 2 +- code/modules/admin/verbs/deadsay.dm | 2 +- code/modules/admin/verbs/debug.dm | 18 +- code/modules/admin/verbs/fix_air.dm | 2 +- .../admin/verbs/ghost_pool_protection.dm | 2 +- code/modules/admin/verbs/one_click_antag.dm | 2 +- code/modules/admin/verbs/playsound.dm | 10 +- code/modules/admin/verbs/randomverbs.dm | 58 +-- code/modules/admin/verbs/shuttlepanel.dm | 2 +- code/modules/admin/verbs/tripAI.dm | 2 +- code/modules/cargo/centcom_podlauncher.dm | 2 +- code/modules/client/preferences_toggles.dm | 16 +- html/statbrowser.html | 409 ++++++++++-------- 23 files changed, 324 insertions(+), 269 deletions(-) diff --git a/code/controllers/subsystem/events.dm b/code/controllers/subsystem/events.dm index 167d9130206..04fcb5d71c3 100644 --- a/code/controllers/subsystem/events.dm +++ b/code/controllers/subsystem/events.dm @@ -100,7 +100,7 @@ SUBSYSTEM_DEF(events) // Why the heck is this here! Took me so damn long to find! /client/proc/forceEvent() set name = "Trigger Event" - set category = "Admin - Events" + set category = "Admin.Events" if(!holder ||!check_rights(R_FUN)) return diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index 28ef539fb01..ef1a78e4cb0 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -445,7 +445,7 @@ GLOBAL_LIST_EMPTY(the_station_areas) //Manual loading of away missions. /client/proc/admin_away() set name = "Load Away Mission" - set category = "Admin - Events" + set category = "Admin.Events" if(!holder ||!check_rights(R_FUN)) return diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 7e6bc835aac..e9cf130d4c6 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -18,7 +18,7 @@ ///////////////////////////////////////////////////////////////////////////////////////////////Panels /datum/admins/proc/show_player_panel(mob/M in GLOB.mob_list) - set category = "Admin - Game" + set category = "Admin.Game" set name = "Show Player Panel" set desc="Edit player (respawn, ban, heal, etc)" @@ -205,7 +205,7 @@ /datum/admins/proc/access_news_network() //MARKER - set category = "Admin - Events" + set category = "Admin.Events" set name = "Access Newscaster Network" set desc = "Allows you to view, add and edit news feeds." @@ -752,7 +752,7 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Spawn Cargo") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/admins/proc/show_traitor_panel(mob/target_mob in GLOB.mob_list) - set category = "Admin - Game" + set category = "Admin.Game" set desc = "Edit mobs's memory and role" set name = "Show Traitor Panel" var/datum/mind/target_mind = target_mob.mind @@ -766,7 +766,7 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Traitor Panel") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/admins/proc/show_skill_panel(target) - set category = "Admin - Game" + set category = "Admin.Game" set desc = "Edit mobs's experience and skill levels" set name = "Show Skill Panel" var/datum/mind/target_mind diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm index e278d885c8e..b5a8304f432 100644 --- a/code/modules/admin/admin_investigate.dm +++ b/code/modules/admin/admin_investigate.dm @@ -6,7 +6,7 @@ /client/proc/investigate_show() set name = "Investigate" - set category = "Admin - Game" + set category = "Admin.Game" if(!holder) return diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index a108d21e6ee..7db3058e2b5 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -338,7 +338,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) /client/proc/admin_ghost() - set category = "Admin - Game" + set category = "Admin.Game" set name = "Aghost" if(!holder) return @@ -370,7 +370,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) /client/proc/invisimin() set name = "Invisimin" - set category = "Admin - Game" + set category = "Admin.Game" set desc = "Toggles ghost-like invisibility (Don't abuse this)" if(holder && mob) if(mob.invisibility == INVISIBILITY_OBSERVER) @@ -382,7 +382,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) /client/proc/check_antagonists() set name = "Check Antagonists" - set category = "Admin - Game" + set category = "Admin.Game" if(holder) holder.check_antagonists() log_admin("[key_name(usr)] checked antagonists.") //for tsar~ @@ -408,14 +408,14 @@ GLOBAL_PROTECT(admin_verbs_hideable) /client/proc/game_panel() set name = "Game Panel" - set category = "Admin - Game" + set category = "Admin.Game" if(holder) holder.Game() SSblackbox.record_feedback("tally", "admin_verb", 1, "Game Panel") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/secrets() set name = "Secrets" - set category = "Admin - Game" + set category = "Admin.Game" if (holder) holder.Secrets() SSblackbox.record_feedback("tally", "admin_verb", 1, "Secrets Panel") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -480,7 +480,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) SSblackbox.record_feedback("tally", "admin_verb", 1, "Stealth Mode") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/drop_bomb() - set category = "Fun" + set category = "Admin.Fun" set name = "Drop Bomb" set desc = "Cause an explosion of varying strength at your location." @@ -522,7 +522,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) SSblackbox.record_feedback("tally", "admin_verb", 1, "Drop Bomb") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/drop_dynex_bomb() - set category = "Fun" + set category = "Admin.Fun" set name = "Drop DynEx Bomb" set desc = "Cause an explosion of varying strength at your location." @@ -618,7 +618,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) printAllCards() /client/proc/give_spell(mob/T in GLOB.mob_list) - set category = "Fun" + set category = "Admin.Fun" set name = "Give Spell" set desc = "Gives a spell to a mob." @@ -642,7 +642,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) message_admins("Spells given to mindless mobs will not be transferred in mindswap or cloning!") /client/proc/remove_spell(mob/T in GLOB.mob_list) - set category = "Fun" + set category = "Admin.Fun" set name = "Remove Spell" set desc = "Remove a spell from the selected mob." @@ -655,7 +655,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) SSblackbox.record_feedback("tally", "admin_verb", 1, "Remove Spell") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/give_disease(mob/living/T in GLOB.mob_living_list) - set category = "Fun" + set category = "Admin.Fun" set name = "Give Disease" set desc = "Gives a Disease to a mob." if(!istype(T)) @@ -670,7 +670,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) message_admins("[key_name_admin(usr)] gave [key_name_admin(T)] the disease [D].") /client/proc/object_say(obj/O in world) - set category = "Admin - Events" + set category = "Admin.Events" set name = "OSay" set desc = "Makes an object say something." var/message = input(usr, "What do you want the message to be?", "Make Sound") as text | null @@ -682,7 +682,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) SSblackbox.record_feedback("tally", "admin_verb", 1, "Object Say") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/togglebuildmodeself() set name = "Toggle Build Mode Self" - set category = "Admin - Events" + set category = "Admin.Events" if (!(holder.rank.rights & R_BUILD)) return if(src.mob) @@ -691,7 +691,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) /client/proc/check_ai_laws() set name = "Check AI Laws" - set category = "Admin - Game" + set category = "Admin.Game" if(holder) src.holder.output_ai_laws() @@ -774,7 +774,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) /client/proc/toggle_AI_interact() set name = "Toggle Admin AI Interact" - set category = "Admin - Game" + set category = "Admin.Game" set desc = "Allows you to interact with most machines as an AI would as a ghost" AI_Interact = !AI_Interact diff --git a/code/modules/admin/adminmenu.dm b/code/modules/admin/adminmenu.dm index 7136de65fed..b7d85ccff51 100644 --- a/code/modules/admin/adminmenu.dm +++ b/code/modules/admin/adminmenu.dm @@ -5,7 +5,7 @@ /datum/verbs/menu/Admin/verb/playerpanel() set name = "Player Panel" set desc = "Player Panel" - set category = "Admin - Game" + set category = "Admin.Game" if(usr.client.holder) usr.client.holder.player_panel_new() SSblackbox.record_feedback("tally", "admin_verb", 1, "Player Panel New") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index a47c13c95ba..ef56b4cd2a6 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -1,7 +1,7 @@ /client/proc/jumptoarea(area/A in GLOB.sortedAreas) set name = "Jump to Area" set desc = "Area to jump to" - set category = "Admin - Game" + set category = "Admin.Game" if(!src.holder) to_chat(src, "Only administrators may use this command.", confidential = TRUE) return @@ -28,7 +28,7 @@ /client/proc/jumptoturf(turf/T in world) set name = "Jump to Turf" - set category = "Admin - Game" + set category = "Admin.Game" if(!src.holder) to_chat(src, "Only administrators may use this command.", confidential = TRUE) return @@ -40,7 +40,7 @@ return /client/proc/jumptomob(mob/M in GLOB.mob_list) - set category = "Admin - Game" + set category = "Admin.Game" set name = "Jump to Mob" if(!src.holder) @@ -59,7 +59,7 @@ to_chat(A, "This mob is not located in the game world.", confidential = TRUE) /client/proc/jumptocoord(tx as num, ty as num, tz as num) - set category = "Admin - Game" + set category = "Admin.Game" set name = "Jump to Coordinate" if (!holder) @@ -74,7 +74,7 @@ message_admins("[key_name_admin(usr)] jumped to coordinates [tx], [ty], [tz]") /client/proc/jumptokey() - set category = "Admin - Game" + set category = "Admin.Game" set name = "Jump to Key" if(!src.holder) @@ -97,7 +97,7 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Jump To Key") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/Getmob(mob/M in GLOB.mob_list - GLOB.dummy_mob_list) - set category = "Admin - Game" + set category = "Admin.Game" set name = "Get Mob" set desc = "Mob to teleport" if(!src.holder) @@ -113,7 +113,7 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Get Mob") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/Getkey() - set category = "Admin - Game" + set category = "Admin.Game" set name = "Get Key" set desc = "Key to teleport" @@ -141,7 +141,7 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Get Key") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/sendmob(mob/M in sortmobs()) - set category = "Admin - Game" + set category = "Admin.Game" set name = "Send Mob" if(!src.holder) to_chat(src, "Only administrators may use this command.", confidential = TRUE) diff --git a/code/modules/admin/verbs/anonymousnames.dm b/code/modules/admin/verbs/anonymousnames.dm index 9b36e887f01..448ef83e5e1 100644 --- a/code/modules/admin/verbs/anonymousnames.dm +++ b/code/modules/admin/verbs/anonymousnames.dm @@ -1,5 +1,5 @@ /client/proc/anon_names() - set category = "Admin - Events" + set category = "Admin.Events" set name = "Setup Anonymous Names" diff --git a/code/modules/admin/verbs/beakerpanel.dm b/code/modules/admin/verbs/beakerpanel.dm index d07049e1a4f..4cf16b60d14 100644 --- a/code/modules/admin/verbs/beakerpanel.dm +++ b/code/modules/admin/verbs/beakerpanel.dm @@ -61,7 +61,7 @@ return container /datum/admins/proc/beaker_panel() - set category = "Admin - Events" + set category = "Admin.Events" set name = "Spawn reagent container" if(!check_rights()) return diff --git a/code/modules/admin/verbs/borgpanel.dm b/code/modules/admin/verbs/borgpanel.dm index 90a7cc17066..3636c95d59a 100644 --- a/code/modules/admin/verbs/borgpanel.dm +++ b/code/modules/admin/verbs/borgpanel.dm @@ -1,5 +1,5 @@ /datum/admins/proc/open_borgopanel(borgo in GLOB.silicon_mobs) - set category = "Admin - Game" + set category = "Admin.Game" set name = "Show Borg Panel" set desc = "Show borg panel" diff --git a/code/modules/admin/verbs/cinematic.dm b/code/modules/admin/verbs/cinematic.dm index 8996d3b29f2..96a417e7b97 100644 --- a/code/modules/admin/verbs/cinematic.dm +++ b/code/modules/admin/verbs/cinematic.dm @@ -1,6 +1,6 @@ /client/proc/cinematic() set name = "Cinematic" - set category = "Fun" + set category = "Admin.Fun" set desc = "Shows a cinematic." // Intended for testing but I thought it might be nice for events on the rare occasion Feel free to comment it out if it's not wanted. set hidden = TRUE if(!SSticker) diff --git a/code/modules/admin/verbs/deadsay.dm b/code/modules/admin/verbs/deadsay.dm index 02bc6f2e9ee..ef0f314739a 100644 --- a/code/modules/admin/verbs/deadsay.dm +++ b/code/modules/admin/verbs/deadsay.dm @@ -1,5 +1,5 @@ /client/proc/dsay(msg as text) - set category = "Admin - Game" + set category = "Admin.Game" set name = "Dsay" set hidden = TRUE if(!holder) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 84902c9f8e3..84bf0073743 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -38,7 +38,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that SSblackbox.record_feedback("tally", "admin_verb", 1, "Air Status In Location") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_robotize(mob/M in GLOB.mob_list) - set category = "Fun" + set category = "Admin.Fun" set name = "Make Robot" if(!SSticker.HasRoundStarted()) @@ -53,7 +53,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that alert("Invalid mob") /client/proc/cmd_admin_blobize(mob/M in GLOB.mob_list) - set category = "Fun" + set category = "Admin.Fun" set name = "Make Blob" if(!SSticker.HasRoundStarted()) @@ -68,7 +68,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that /client/proc/cmd_admin_animalize(mob/M in GLOB.mob_list) - set category = "Fun" + set category = "Admin.Fun" set name = "Make Simple Animal" if(!SSticker.HasRoundStarted()) @@ -88,7 +88,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that /client/proc/makepAI(turf/T in GLOB.mob_list) - set category = "Fun" + set category = "Admin.Fun" set name = "Make pAI" set desc = "Specify a location to spawn a pAI device, then specify a key to play that pAI" @@ -121,7 +121,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that SSblackbox.record_feedback("tally", "admin_verb", 1, "Make pAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_alienize(mob/M in GLOB.mob_list) - set category = "Fun" + set category = "Admin.Fun" set name = "Make Alien" if(!SSticker.HasRoundStarted()) @@ -136,7 +136,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that alert("Invalid mob") /client/proc/cmd_admin_slimeize(mob/M in GLOB.mob_list) - set category = "Fun" + set category = "Admin.Fun" set name = "Make slime" if(!SSticker.HasRoundStarted()) @@ -227,7 +227,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that message_admins("[key_name_admin(usr)] has granted [M.key] full access.") /client/proc/cmd_assume_direct_control(mob/M in GLOB.mob_list) - set category = "Admin - Game" + set category = "Admin.Game" set name = "Assume direct control" set desc = "Direct intervention" @@ -249,7 +249,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that SSblackbox.record_feedback("tally", "admin_verb", 1, "Assume Direct Control") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_give_direct_control(mob/M in GLOB.mob_list) - set category = "Admin - Game" + set category = "Admin.Game" set name = "Give direct control" if(!M) @@ -494,7 +494,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that cmd_admin_areatest(FALSE) /client/proc/cmd_admin_dress(mob/M in GLOB.mob_list) - set category = "Admin - Events" + set category = "Admin.Events" set name = "Select equipment" if(!(ishuman(M) || isobserver(M))) alert("Invalid mob") diff --git a/code/modules/admin/verbs/fix_air.dm b/code/modules/admin/verbs/fix_air.dm index b2924c5aacc..d1f535cb0f6 100644 --- a/code/modules/admin/verbs/fix_air.dm +++ b/code/modules/admin/verbs/fix_air.dm @@ -1,7 +1,7 @@ // Proc taken from yogstation, credit to nichlas0010 for the original /client/proc/fix_air(turf/open/T in world) set name = "Fix Air" - set category = "Admin - Game" + set category = "Admin.Game" set desc = "Fixes air in specified radius." if(!holder) diff --git a/code/modules/admin/verbs/ghost_pool_protection.dm b/code/modules/admin/verbs/ghost_pool_protection.dm index 0ea6f6a9bde..7319e5ad16e 100644 --- a/code/modules/admin/verbs/ghost_pool_protection.dm +++ b/code/modules/admin/verbs/ghost_pool_protection.dm @@ -3,7 +3,7 @@ /client/proc/ghost_pool_protection() //Creates a verb for admins to open up the ui set name = "Ghost Pool Protection" set desc = "Choose which ways people can get into the round, or just clear it out completely for admin events." - set category = "Admin - Events" + set category = "Admin.Events" var/datum/ghost_pool_menu/tgui = new(usr)//create the datum tgui.ui_interact(usr)//datum has a tgui component, here we open the window diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index cef021f35c2..992bc0f05de 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -1,7 +1,7 @@ /client/proc/one_click_antag() set name = "Create Antagonist" set desc = "Auto-create an antagonist of your choice" - set category = "Admin - Events" + set category = "Admin.Events" if(holder) holder.one_click_antag() diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 6c992bdab85..319ff4a7d21 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -1,5 +1,5 @@ /client/proc/play_sound(S as sound) - set category = "Fun" + set category = "Admin.Fun" set name = "Play Global Sound" if(!check_rights(R_SOUND)) return @@ -40,7 +40,7 @@ /client/proc/play_local_sound(S as sound) - set category = "Fun" + set category = "Admin.Fun" set name = "Play Local Sound" if(!check_rights(R_SOUND)) return @@ -51,7 +51,7 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Play Local Sound") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/play_direct_mob_sound(S as sound, mob/M) - set category = "Fun" + set category = "Admin.Fun" set name = "Play Direct Mob Sound" if(!check_rights(R_SOUND)) return @@ -66,7 +66,7 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Play Direct Mob Sound") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/play_web_sound() - set category = "Fun" + set category = "Admin.Fun" set name = "Play Internet Sound" if(!check_rights(R_SOUND)) return @@ -150,7 +150,7 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Play Internet Sound") /client/proc/set_round_end_sound(S as sound) - set category = "Fun" + set category = "Admin.Fun" set name = "Set Round End Sound" if(!check_rights(R_SOUND)) return diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 787003c8892..04010ed9446 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -20,7 +20,7 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Drop Everything") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_subtle_message(mob/M in GLOB.mob_list) - set category = "Admin - Events" + set category = "Admin.Events" set name = "Subtle Message" if(!ismob(M)) @@ -46,7 +46,7 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Subtle Message") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_headset_message(mob/M in GLOB.mob_list) - set category = "Admin - Events" + set category = "Admin.Events" set name = "Headset Message" admin_headset_message(M) @@ -128,7 +128,7 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Modify Antagonist Reputation") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_world_narrate() - set category = "Admin - Events" + set category = "Admin.Events" set name = "Global Narrate" if(!check_rights(R_ADMIN)) @@ -144,7 +144,7 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Global Narrate") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_direct_narrate(mob/M) - set category = "Admin - Events" + set category = "Admin.Events" set name = "Direct Narrate" if(!check_rights(R_ADMIN)) @@ -169,7 +169,7 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Direct Narrate") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_local_narrate(atom/A) - set category = "Admin - Events" + set category = "Admin.Events" set name = "Local Narrate" if(!check_rights(R_ADMIN)) @@ -190,7 +190,7 @@ SSblackbox.record_feedback("tally", "admin_verb", 1, "Local Narrate") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_godmode(mob/M in GLOB.mob_list) - set category = "Admin - Game" + set category = "Admin.Game" set name = "Godmode" if(!check_rights(R_ADMIN)) return @@ -335,7 +335,7 @@ Works kind of like entering the game with a new character. Character receives a Traitors and the like can also be revived with the previous role mostly intact. /N */ /client/proc/respawn_character() - set category = "Admin - Game" + set category = "Admin.Game" set name = "Respawn Character" set desc = "Respawn a person that has been gibbed/dusted/killed. They must be a ghost for this to work and preferably should not have a body to go back into." if(!check_rights(R_ADMIN)) @@ -503,7 +503,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return new_character /client/proc/cmd_admin_add_freeform_ai_law() - set category = "Admin - Events" + set category = "Admin.Events" set name = "Add Custom AI law" if(!check_rights(R_ADMIN)) @@ -546,7 +546,7 @@ Traitors and the like can also be revived with the previous role mostly intact. SSblackbox.record_feedback("tally", "admin_verb", 1, "Rejuvenate") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_create_centcom_report() - set category = "Admin - Events" + set category = "Admin.Events" set name = "Create Command Report" if(!check_rights(R_ADMIN)) @@ -572,7 +572,7 @@ Traitors and the like can also be revived with the previous role mostly intact. SSblackbox.record_feedback("tally", "admin_verb", 1, "Create Command Report") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_change_command_name() - set category = "Admin - Events" + set category = "Admin.Events" set name = "Change Command Name" if(!check_rights(R_ADMIN)) @@ -595,7 +595,7 @@ Traitors and the like can also be revived with the previous role mostly intact. admin_delete(A) /client/proc/cmd_admin_list_open_jobs() - set category = "Admin - Game" + set category = "Admin.Game" set name = "Manage Job Slots" if(!check_rights(R_ADMIN)) @@ -604,7 +604,7 @@ Traitors and the like can also be revived with the previous role mostly intact. SSblackbox.record_feedback("tally", "admin_verb", 1, "Manage Job Slots") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_explosion(atom/O as obj|mob|turf in world) - set category = "Fun" + set category = "Admin.Fun" set name = "Explosion" if(!check_rights(R_ADMIN)) @@ -640,7 +640,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return /client/proc/cmd_admin_emp(atom/O as obj|mob|turf in world) - set category = "Fun" + set category = "Admin.Fun" set name = "EM Pulse" if(!check_rights(R_ADMIN)) @@ -665,7 +665,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return /client/proc/cmd_admin_gib(mob/M in GLOB.mob_list) - set category = "Fun" + set category = "Admin.Fun" set name = "Gib" if(!check_rights(R_ADMIN)) @@ -692,7 +692,7 @@ Traitors and the like can also be revived with the previous role mostly intact. /client/proc/cmd_admin_gib_self() set name = "Gibself" - set category = "Fun" + set category = "Admin.Fun" var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No") if(confirm == "Yes") @@ -711,7 +711,7 @@ Traitors and the like can also be revived with the previous role mostly intact. SSblackbox.record_feedback("tally", "admin_verb", 1, "Check Contents") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/toggle_view_range() - set category = "Admin - Game" + set category = "Admin.Game" set name = "Change View Range" set desc = "switches between 1x and custom views" @@ -726,7 +726,7 @@ Traitors and the like can also be revived with the previous role mostly intact. SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Change View Range", "[view]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/admin_call_shuttle() - set category = "Admin - Events" + set category = "Admin.Events" set name = "Call Shuttle" if(EMERGENCY_AT_LEAST_DOCKED) @@ -750,7 +750,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return /client/proc/admin_cancel_shuttle() - set category = "Admin - Events" + set category = "Admin.Events" set name = "Cancel Shuttle" if(!check_rights(0)) return @@ -771,7 +771,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return /client/proc/admin_disable_shuttle() - set category = "Admin - Events" + set category = "Admin.Events" set name = "Disable Shuttle" if(!check_rights(R_ADMIN)) @@ -794,7 +794,7 @@ Traitors and the like can also be revived with the previous role mostly intact. priority_announce("Warning: Emergency Shuttle uplink failure, shuttle disabled until further notice.", "Emergency Shuttle Uplink Alert", 'sound/misc/announce_dig.ogg') /client/proc/admin_enable_shuttle() - set category = "Admin - Events" + set category = "Admin.Events" set name = "Enable Shuttle" if(!check_rights(R_ADMIN)) @@ -820,7 +820,7 @@ Traitors and the like can also be revived with the previous role mostly intact. priority_announce("Warning: Emergency Shuttle uplink reestablished, shuttle enabled.", "Emergency Shuttle Uplink Alert", 'sound/misc/announce_dig.ogg') /client/proc/everyone_random() - set category = "Fun" + set category = "Admin.Fun" set name = "Make Everyone Random" set desc = "Make everyone have a random appearance. You can only use this before rounds!" @@ -868,7 +868,7 @@ Traitors and the like can also be revived with the previous role mostly intact. /client/proc/admin_change_sec_level() - set category = "Admin - Events" + set category = "Admin.Events" set name = "Set Security Level" set desc = "Changes the security level. Announcement only, i.e. setting to Delta won't activate nuke" @@ -885,7 +885,7 @@ Traitors and the like can also be revived with the previous role mostly intact. /client/proc/toggle_nuke(obj/machinery/nuclearbomb/N in GLOB.nuke_list) set name = "Toggle Nuke" - set category = "Admin - Events" + set category = "Admin.Events" set popup_menu = FALSE if(!check_rights(R_DEBUG)) return @@ -903,7 +903,7 @@ Traitors and the like can also be revived with the previous role mostly intact. SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Nuke", "[N.timing]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/toggle_combo_hud() - set category = "Admin - Game" + set category = "Admin.Game" set name = "Toggle Combo HUD" set desc = "Toggles the Admin Combo HUD (antag, sci, med, eng)" @@ -938,7 +938,7 @@ Traitors and the like can also be revived with the previous role mostly intact. /client/proc/run_weather() - set category = "Admin - Events" + set category = "Admin.Events" set name = "Run Weather" set desc = "Triggers a weather on the z-level you choose." @@ -961,7 +961,7 @@ Traitors and the like can also be revived with the previous role mostly intact. SSblackbox.record_feedback("tally", "admin_verb", 1, "Run Weather") /client/proc/mass_zombie_infection() - set category = "Fun" + set category = "Admin.Fun" set name = "Mass Zombie Infection" set desc = "Infects all humans with a latent organ that will zombify \ them on death." @@ -982,7 +982,7 @@ Traitors and the like can also be revived with the previous role mostly intact. SSblackbox.record_feedback("tally", "admin_verb", 1, "Mass Zombie Infection") /client/proc/mass_zombie_cure() - set category = "Fun" + set category = "Admin.Fun" set name = "Mass Zombie Cure" set desc = "Removes the zombie infection from all humans, returning them to normal." if(!check_rights(R_ADMIN)) @@ -1000,7 +1000,7 @@ Traitors and the like can also be revived with the previous role mostly intact. SSblackbox.record_feedback("tally", "admin_verb", 1, "Mass Zombie Cure") /client/proc/polymorph_all() - set category = "Fun" + set category = "Admin.Fun" set name = "Polymorph All" set desc = "Applies the effects of the bolt of change to every single mob." @@ -1105,7 +1105,7 @@ Traitors and the like can also be revived with the previous role mostly intact. /client/proc/smite(mob/living/target as mob) set name = "Smite" - set category = "Fun" + set category = "Admin.Fun" if(!check_rights(R_ADMIN) || !check_rights(R_FUN)) return diff --git a/code/modules/admin/verbs/shuttlepanel.dm b/code/modules/admin/verbs/shuttlepanel.dm index f90dc049ce6..7552936136e 100644 --- a/code/modules/admin/verbs/shuttlepanel.dm +++ b/code/modules/admin/verbs/shuttlepanel.dm @@ -1,5 +1,5 @@ /datum/admins/proc/open_shuttlepanel() - set category = "Admin - Events" + set category = "Admin.Events" set name = "Shuttle Manipulator" set desc = "Opens the shuttle manipulator UI." diff --git a/code/modules/admin/verbs/tripAI.dm b/code/modules/admin/verbs/tripAI.dm index 5efa306e317..58990187eeb 100644 --- a/code/modules/admin/verbs/tripAI.dm +++ b/code/modules/admin/verbs/tripAI.dm @@ -1,5 +1,5 @@ /client/proc/triple_ai() - set category = "Admin - Events" + set category = "Admin.Events" set name = "Toggle AI Triumvirate" if(SSticker.current_state > GAME_STATE_PREGAME) diff --git a/code/modules/cargo/centcom_podlauncher.dm b/code/modules/cargo/centcom_podlauncher.dm index 94ee980c0d1..ea7b56cd8b9 100644 --- a/code/modules/cargo/centcom_podlauncher.dm +++ b/code/modules/cargo/centcom_podlauncher.dm @@ -19,7 +19,7 @@ /client/proc/centcom_podlauncher() //Creates a verb for admins to open up the ui set name = "Config/Launch Supplypod" set desc = "Configure and launch a CentCom supplypod full of whatever your heart desires!" - set category = "Admin - Events" + set category = "Admin.Events" new /datum/centcom_podlauncher(usr)//create the datum //Variables declared to change how items in the launch bay are picked and launched. (Almost) all of these are changed in the ui_act proc diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index 65c453c3477..f2281b50dba 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -388,7 +388,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS //Admin Preferences /client/proc/toggleadminhelpsound() set name = "Hear/Silence Adminhelps" - set category = "Prefs - Admin" + set category = "Preferences.Admin" set desc = "Toggle hearing a notification when admin PMs are received" if(!holder) return @@ -399,7 +399,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS /client/proc/toggleannouncelogin() set name = "Do/Don't Announce Login" - set category = "Prefs - Admin" + set category = "Preferences.Admin" set desc = "Toggle if you want an announcement to admins when you login during a round" if(!holder) return @@ -410,7 +410,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS /client/proc/toggle_hear_radio() set name = "Show/Hide Radio Chatter" - set category = "Prefs - Admin" + set category = "Preferences.Admin" set desc = "Toggle seeing radiochatter from nearby radios and speakers" if(!holder) return @@ -421,7 +421,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS /client/proc/deadchat() set name = "Show/Hide Deadchat" - set category = "Prefs - Admin" + set category = "Preferences.Admin" set desc ="Toggles seeing deadchat" if(!holder) return @@ -432,7 +432,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS /client/proc/toggleprayers() set name = "Show/Hide Prayers" - set category = "Prefs - Admin" + set category = "Preferences.Admin" set desc = "Toggles seeing prayers" if(!holder) return @@ -443,7 +443,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS /client/proc/toggle_prayer_sound() set name = "Hear/Silence Prayer Sounds" - set category = "Prefs - Admin" + set category = "Preferences.Admin" set desc = "Hear Prayer Sounds" if(!holder) return @@ -454,7 +454,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS /client/proc/colorasay() set name = "Set Admin Say Color" - set category = "Prefs - Admin" + set category = "Preferences.Admin" set desc = "Set the color of your ASAY messages" if(!holder) return @@ -471,7 +471,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS /client/proc/resetasaycolor() set name = "Reset your Admin Say Color" set desc = "Returns your ASAY Color to default" - set category = "Prefs - Admin" + set category = "Preferences.Admin" if(!holder) return if(!CONFIG_GET(flag/allow_admin_asaycolor)) diff --git a/html/statbrowser.html b/html/statbrowser.html index b409161dad1..967ad07b841 100644 --- a/html/statbrowser.html +++ b/html/statbrowser.html @@ -7,149 +7,173 @@ @@ -267,9 +291,9 @@ if (window.location) { }); */ // Status panel implementation ------------------------------------------------ -var status_tab_parts = ["loading..."]; +var status_tab_parts = ["Loading..."]; var current_tab = null; -var mc_tab_parts = [["loading...", ""]]; +var mc_tab_parts = [["Loading...", ""]]; var href_token = null; var spells = []; var spell_tabs = []; @@ -288,6 +312,8 @@ var statcontentdiv = document.querySelector('#statcontent'); var storedimages = []; function createStatusTab(name) { + if (name.indexOf(".") != -1) + name = name.split(".")[0]; if(document.getElementById(name) || name.trim() == "") return; if(!verb_tabs.includes(name) && !permanent_tabs.includes(name)) @@ -302,12 +328,8 @@ function createStatusTab(name) { B.className = "button"; //ORDERING ALPHABETICALLY B.style.order = name.charCodeAt(0); - if(name == "Status" || name == "MC") { - if(name == "Status") - B.style.order = 1; - else - B.style.order = 2; - } + if(name == "Status" || name == "MC") + B.style.order = name == "Status" ? 1 : 2; //END ORDERING menu.appendChild(B); SendTabToByond(name); @@ -327,6 +349,19 @@ function removeStatusTab(name) { under_menu.style.height = menu.clientHeight + 'px'; } +function sortVerbs() { + verbs.sort(function (a, b) { + var selector = a[0] == b[0] ? 1 : 0; + if (a[selector].toUpperCase() < b[selector].toUpperCase()) { + return 1; + } + else if (a[selector].toUpperCase() > b[selector].toUpperCase()) { + return -1; + } + return 0; + }) +} + window.onresize = function () { under_menu.style.height = menu.clientHeight + 'px'; } @@ -365,19 +400,19 @@ function check_verbs() { for(var v = verb_tabs.length - 1; v >= 0; v--){ verbs_cat_check(verb_tabs[v]); } - //checkStatusTab(); // removes any empty status tabs } function verbs_cat_check(cat) { + var tabCat = cat.indexOf(".") != -1 ? cat.split(".")[0] : cat; var verbs_in_cat = 0; var verbcat = ""; - if(!verb_tabs.includes(cat)){ - removeStatusTab(cat); + if(!verb_tabs.includes(tabCat)){ + removeStatusTab(tabCat); return; } for(var v = 0; v < verbs.length; v++){ var part = verbs[v]; - verbcat = part[0]; + verbcat = part[0].indexOf(".") != -1 ? part[0].split(".") : part[0]; if(verbcat != cat || verbcat.trim() == ""){ continue; } @@ -387,8 +422,8 @@ function verbs_cat_check(cat) { } } if(verbs_in_cat != 1) { - removeStatusTab(cat); - if(current_tab == cat) + removeStatusTab(tabCat); + if(current_tab == tabCat) tab_change("Status"); } } @@ -411,17 +446,20 @@ function add_verb_list(v) { to_add.sort(); // sort what we're adding for(var i = 0; i < to_add.length; i++) { var part = to_add[i]; + if (!part[0]) + continue; + var category = part[0].indexOf(".") == -1 ? part[0] : part[0].split(".")[0] if(findVerbindex(part[1], verbs)) continue; - if(verb_tabs.includes(part[0])){ + if(verb_tabs.includes(category)){ verbs.push(part); - if(current_tab == part[0]) { - draw_verbs(part[0]); // redraw if we added a verb to the tab we're currently in + if(current_tab == category) { + draw_verbs(category); // redraw if we added a verb to the tab we're currently in } - } else if(part[0]) { - verb_tabs.push(part[0]); + } else if(category) { + verb_tabs.push(category); verbs.push(part); - createStatusTab(part[0]); + createStatusTab(category); } } } @@ -432,7 +470,7 @@ function remove_verb_list(v) { remove_verb(to_remove[i]); } check_verbs(); - verbs.sort(); + sortVerbs(); if(verb_tabs.includes(current_tab)) draw_verbs(current_tab); } @@ -455,7 +493,7 @@ function init_verbs(c, v) { } if(v) { add_verb_list(v); - verbs.sort(); // sort them + sortVerbs(); // sort them if(do_update) { draw_verbs(current_tab); } @@ -586,7 +624,7 @@ function tab_change(tab) { }else if(tab == turfname) { draw_listedturf(); } else { - statcontentdiv[textContentKey] = "loading..."; + statcontentdiv[textContentKey] = "Loading..."; } window.location.href = "byond://winset?statbrowser.is-visible=true"; } @@ -912,29 +950,46 @@ function draw_spells(cat) { function draw_verbs(cat){ statcontentdiv[textContentKey] = ""; - var table = document.createElement("newdiv"); + var table = document.createElement("div"); + var additions = {}; // additional sub-categories to be rendered table.className = "grid-container"; - var command = ""; // typecast name to string - verbs.sort(); + sortVerbs(); verbs.reverse(); // sort verbs backwards before we draw - for(var i = verbs.length - 1; i >= 0; i--) { - var part = verbs[i]; // should be a list containing category and command - if(!part[1]) continue; - if(part[0] != cat){ - continue; + for (var i = 0; i < verbs.length; ++i) { + var part = verbs[i]; + var name = part[0]; + var command = part[1]; + + if (command && name.lastIndexOf(cat, 0) != -1 && (name.length == cat.length || name.charAt(cat.length) == ".")) { + var subCat = name.lastIndexOf(".") != -1 ? name.split(".")[1] : null; + if (subCat && !additions[subCat]) { + var newTable = document.createElement("div"); + newTable.className = "grid-container"; + additions[subCat] = newTable; + } + + var a = document.createElement("a"); + a.href = "byond://winset?command=" + command.replace(/\s/g, "-"); + a[textContentKey] = command; + a.className = "grid-item"; + (subCat ? additions[subCat] : table).appendChild(a); + } + } + + // Append base table to view + var content = document.getElementById("statcontent"); + content.appendChild(table); + + // Append additional sub-categories if relevant + for (var cat in additions) { + if (additions.hasOwnProperty(cat)) { + // do addition here + var header = document.createElement("h3"); + header[textContentKey] = cat; + content.appendChild(header); + content.appendChild(additions[cat]); } - if(part[0].trim() == ""){ - verbs.splice(i, 1); - continue; - } - command = part[1]; - var a = document.createElement("a"); - a.href = "byond://winset?command=" + command.replace(/\s/g, "-"); - a[textContentKey] = command; - a.className = "grid-item"; - table.appendChild(a); } - document.getElementById("statcontent").appendChild(table); } function set_theme(which) {