From a9365d38e155b2be08ab927e1559b20c77b27486 Mon Sep 17 00:00:00 2001 From: "baloh.matevz@gmail.com" Date: Mon, 30 Apr 2012 03:13:04 +0000 Subject: [PATCH] - Redesigned the options panel (show player panel verb) to be less terrible. Screenshot: http://www.kamletos.si/options%20panel.PNG - Made some changes to admin verbs: - Rejuvenate verb removed from mobs, is now in the options panel above (heal). - Drop everything verb moved into view variables, added a confirmation message. - Mute verb removed from mobs, use the options panel. - Warn verb removed from mobs, use the options panel. - Grant full access moved to debug verbs. - Rejuvanate as a verb also still exists in debug verbs. These changes were made to make right clicking a mob not show a million unneeded verbs. They were moved based on the statistics gathered via feedback logging: http://www.kamletos.si/tgdb/latest_stats.html#adminverbs Please post any additional feedback on the admin forum. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3532 316c924e-a436-60f5-8080-3fe189b3f50e --- code/datums/datumvars.dm | 17 ++- code/defines/procs/helpers.dm | 9 +- code/modules/admin/admin.dm | 133 +++++++++++++++--------- code/modules/admin/admin_verbs.dm | 26 +++-- code/modules/admin/verbs/mapping.dm | 2 + code/modules/admin/verbs/randomverbs.dm | 31 +++--- 6 files changed, 135 insertions(+), 83 deletions(-) diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 84e1a7ba5ba..64767dc7ff0 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -170,7 +170,7 @@ client body += "[D]" if(A.dir) body += "
<< [dir2text(A.dir)] >>" - if(istype(A,/mob)) + if(ismob(A)) var/mob/M = A body += "
[M.ckey ? M.ckey : "No ckey"] / [M.real_name ? M.real_name : "No real name"]" body += {" @@ -240,6 +240,7 @@ client body += "" body += "" body += "" + body += "" if(ishuman(D)) body += "" body += "" @@ -497,6 +498,20 @@ client togglebuildmode(MOB) href_list["datumrefresh"] = href_list["build_mode"] + else if (href_list["drop_everything"]) + if(!href_list["drop_everything"]) + return + var/mob/MOB = locate(href_list["drop_everything"]) + if(!MOB) + return + if(!ismob(MOB)) + return + if(!src.holder) + return + + if(usr.client) + usr.client.cmd_admin_drop_everything(MOB) + else if (href_list["direct_control"]) if(!href_list["direct_control"]) return diff --git a/code/defines/procs/helpers.dm b/code/defines/procs/helpers.dm index 1991a70ee94..be5a226f694 100644 --- a/code/defines/procs/helpers.dm +++ b/code/defines/procs/helpers.dm @@ -1768,4 +1768,11 @@ proc/oview_or_orange(distance = world.view , center = usr , type) var/a = copytext(text,i,i+1) if(a == character) count++ - return count \ No newline at end of file + return count + +proc/get_mob_with_client_list() + var/list/mobs = list() + for(var/mob/M in world) + if (M.client) + mobs += M + return mobs \ No newline at end of file diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 54cca53f44c..9fa33a2efef 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -2083,6 +2083,7 @@ var/global/BSACooldown = 0 set category = "Admin" set name = "Show Player Panel" set desc="Edit player (respawn, ban, heal, etc)" + if(!M) usr << "You seem to be selecting a mob that doesn't exist anymore." return @@ -2091,59 +2092,95 @@ var/global/BSACooldown = 0 if (!istype(src,/obj/admins)) usr << "Error: you are not an admin!" return - var/dat = "Options for [M.key]" - var/foo = "\[ " - if (ismob(M) && M.client) -// if(!M.client.authenticated && !M.client.authenticating) -// foo += text("Authorize | ") -// else -// foo += text("Authorized | ") - foo += text("Promote/Demote | ") + + var/body = "Options for [M.key]" + body += "Options panel for [M]" + if(M.client) + body += " played by [M.client] " + if(M.client.holder) + body += "\[[M.client.holder.rank]\]" + else + body += "\[Player\]" + + if(istype(M, /mob/new_player)) + body += " Hasn't Entered Game " + else + body += " \[Heal\] " + + body += "

\[ " + body += "VV - " + body += "TP - " + body += "PM - " + body += "SM - " + body += "JMP\]
" + + body += "Mob type = [M.type]

" + + body += "Kick | " + body += "Ban | " + body += "Jobban " + + if(M.client) + body += "| Prison | " + body += "Mute: " + if(M.client.muted_complete) + body += "Completely Muted: (Allow adminhelp)" + else + if(M.client.muted) + body += "Soft Mute: (Unmute) (Mute adminhelps)" + else + body += "Voiced: (Mute)" + + body += "

" + body += "Jump to | " + body += "Get" + + body += "

" + body += "Traitor panel | " + body += "Narrate to | " + body += "Subtle message" + + if (M.client) if(!istype(M, /mob/new_player)) - if(!ismonkey(M)) - foo += text("Monkeyize | ") + body += "

" + body += "Transformations:" + body += "
" + + //Monkey + if(ismonkey(M)) + body += "Monkeyized | " else - foo += text("Monkeyized | ") - if(!iscorgi(M)) - foo += text("Corgize | ") + body += "Monkeyize | " + + //Corgi + if(iscorgi(M)) + body += "Corgized | " else - foo += text("Corgized | ") + body += "Corgize | " + + //AI / Cyborg if(isAI(M)) - foo += text("Is an AI | ") + body += "Is an AI " else if(ishuman(M)) - foo += text("Make AI | ") - foo += text("Make Robot | ") - foo += text("Make Alien | ") - foo += text("Make Metroid | ") - foo += text("Thunderdome 1 | ") - foo += text("Thunderdome 2 | ") - foo += text("Thunderdome Admin | ") - foo += text("Thunderdome Observer | ") - foo += text("Prison | ") - // foo += text("Maze | ") - foo += text("Heal/Revive | ") - else - foo += text("Hasn't Entered Game | ") - foo += text("Forcesay | ") - if(M.client) - foo += text("Mute: [(M.client.muted ? "Muted" : "Voiced")] | ") - foo += text("Complete mute: [(M.client.muted ? "Completely Muted" : "Voiced")] | ") - else - foo += "Mute unavailable - no client" - foo += text("Boot") - foo += text("
") - foo += text("Jump to | ") - foo += text("Get | ") - foo += text("Send") - foo += text("
") - foo += text("Edit mind | ") - foo += text("Narrate to | ") - foo += text("Subtle message") - foo += text("
") - foo += text("Ban | ") - foo += text("Jobban") - dat += text("[foo]") - usr << browse(dat, "window=adminplayeropts;size=480x150") + body += "Make AI | " + body += "Make Robot | " + body += "Make Alien | " + body += "Make Metroid " + + if (M.client) + body += "

" + body += "Other actions:" + body += "
" + body += "Forcesay | " + body += "Thunderdome 1 | " + body += "Thunderdome 2 | " + body += "Thunderdome Admin | " + body += "Thunderdome Observer | " + + body += "
" + body += "" + + usr << browse(body, "window=adminplayeropts;size=550x375") feedback_add_details("admin_verb","SPP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 1e855e0c026..1dfb3d2dad9 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -63,8 +63,8 @@ verbs += /client/proc/jumptocoord verbs += /client/proc/cmd_admin_delete verbs += /client/proc/cmd_admin_add_freeform_ai_law - verbs += /client/proc/cmd_admin_rejuvenate - verbs += /client/proc/cmd_admin_drop_everything + //verbs += /client/proc/cmd_admin_rejuvenate --Merged with player panel + //verbs += /client/proc/cmd_admin_drop_everything --Merged with view variables //verbs += /client/proc/cmd_modify_object_variables --Merged with view variables if ("Admin Candidate") @@ -121,11 +121,11 @@ verbs += /obj/admins/proc/votekill verbs += /obj/admins/proc/show_player_panel verbs += /client/proc/deadchat //toggles deadchat - verbs += /client/proc/cmd_admin_mute + //verbs += /client/proc/cmd_admin_mute --was never used (according to stats trackind) - use show player panel --erro verbs += /client/proc/cmd_admin_pm_context verbs += /client/proc/cmd_admin_pm_panel verbs += /client/proc/cmd_admin_subtle_message - verbs += /client/proc/warn + //verbs += /client/proc/warn - was never used verbs += /client/proc/dsay verbs += /client/proc/admin_play verbs += /client/proc/admin_observe @@ -209,7 +209,7 @@ verbs += /client/proc/cmd_admin_delete verbs += /client/proc/cmd_admin_add_freeform_ai_law verbs += /client/proc/cmd_admin_add_random_ai_law - verbs += /client/proc/cmd_admin_rejuvenate + //verbs += /client/proc/cmd_admin_rejuvenate --merged with player panel verbs += /client/proc/hide_most_verbs verbs += /client/proc/jumptocoord verbs += /client/proc/deadmin_self @@ -234,9 +234,8 @@ verbs += /client/proc/mapload verbs += /client/proc/check_words verbs += /client/proc/drop_bomb - verbs += /client/proc/cmd_admin_grantfullaccess verbs += /client/proc/kill_airgroup - verbs += /client/proc/cmd_admin_drop_everything + //verbs += /client/proc/cmd_admin_drop_everything --Merged with view variables verbs += /client/proc/make_sound verbs += /client/proc/play_local_sound verbs += /client/proc/send_space_ninja @@ -326,8 +325,7 @@ verbs -= /client/proc/mapload verbs -= /client/proc/check_words verbs -= /client/proc/drop_bomb - verbs -= /client/proc/cmd_admin_grantfullaccess - verbs -= /client/proc/cmd_admin_drop_everything + //verbs -= /client/proc/cmd_admin_drop_everything --merged with view variables verbs -= /client/proc/make_sound verbs -= /client/proc/only_one verbs -= /client/proc/send_space_ninja @@ -344,7 +342,7 @@ verbs -= /client/proc/jumptoturf verbs -= /client/proc/cmd_admin_add_freeform_ai_law verbs -= /client/proc/cmd_admin_add_random_ai_law - verbs -= /client/proc/cmd_admin_rejuvenate + //verbs -= /client/proc/cmd_admin_rejuvenate --merged with player panel verbs -= /client/proc/cmd_admin_delete verbs -= /client/proc/toggleadminhelpsound verbs -= /client/proc/cmd_admin_remove_plasma @@ -361,12 +359,12 @@ verbs -= /client/proc/cmd_admin_check_contents verbs -= /client/proc/cmd_admin_create_centcom_report verbs -= /client/proc/deadchat //toggles deadchat - verbs -= /client/proc/cmd_admin_mute + //verbs -= /client/proc/cmd_admin_mute --was never used (according to stats trackind) - use show player panel --erro verbs -= /client/proc/cmd_admin_pm_context verbs -= /client/proc/cmd_admin_pm_panel verbs -= /client/proc/cmd_admin_say verbs -= /client/proc/cmd_admin_subtle_message - verbs -= /client/proc/warn + //verbs -= /client/proc/warn verbs -= /client/proc/dsay verbs -= /client/proc/admin_play verbs -= /client/proc/admin_observe @@ -567,9 +565,9 @@ #define AUTOBATIME 10 /client/proc/warn(var/mob/M in world) - set category = "Special Verbs" + /*set category = "Special Verbs" set name = "Warn" - set desc = "Warn a player" + set desc = "Warn a player"*/ //Based on the information I gathered via stat logging this verb was not used. Use the show player panel alternative. --erro if(!holder) src << "Only administrators may use this command." return diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 732381600c2..e8de55c307b 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -140,6 +140,8 @@ var/intercom_range_display_status = 0 src.verbs += /client/proc/jump_to_dead_group src.verbs += /client/proc/startSinglo src.verbs += /client/proc/ticklag //allows you to set the ticklag. + src.verbs += /client/proc/cmd_admin_grantfullaccess + src.verbs += /client/proc/cmd_admin_rejuvenate feedback_add_details("admin_verb","mDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 517f4b68827..f6f0167af93 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -4,6 +4,11 @@ if(!holder) src << "Only administrators may use this command." return + + var/confirm = alert(src, "Make [M] drop everything?", "Message", "Yes", "No") + if(confirm != "Yes") + return + for(var/obj/item/W in M) M.drop_from_slot(W) @@ -77,13 +82,18 @@ message_admins("\blue \bold GlobalNarrate: [key_name_admin(usr)] : [msg]
", 1) feedback_add_details("admin_verb","GLN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_direct_narrate(mob/M as mob in world) // Targetted narrate -- TLE +/client/proc/cmd_admin_direct_narrate() // Targetted narrate -- TLE set category = "Special Verbs" set name = "Direct Narrate" if(!holder) src << "Only administrators may use this command." return + + var/mob/M = input("Direct narrate to who?", "Active Players") as null|anything in get_mob_with_client_list() + if(M == null) + return + var/msg = input("Message:", text("Enter the text you wish to appear to your target:")) as text M << msg log_admin("DirectNarrate: [key_name(usr)] to ([M.name]/[M.key]): [msg]") @@ -473,24 +483,7 @@ Traitors and the like can also be revived with the previous role mostly intact. alert("Cannot revive a ghost") return if(config.allow_admin_rev) - //M.fireloss = 0 - M.setToxLoss(0) - //M.bruteloss = 0 - M.setOxyLoss(0) - M.SetParalysis(0) - M.SetStunned(0) - M.SetWeakened(0) - M.radiation = 0 - //M.health = 100 - M.nutrition = 400 - M.bodytemperature = 310 - M.heal_overall_damage(1000, 1000) - //M.updatehealth() - M.buckled = initial(M.buckled) - M.handcuffed = initial(M.handcuffed) - if (M.stat > 1) - M.stat=0 - ..() + M.revive() log_admin("[key_name(usr)] healed / revived [key_name(M)]") message_admins("\red Admin [key_name_admin(usr)] healed / revived [key_name_admin(M)]!", 1)