mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
port ADMIN_VERB and friends (#30646)
* port ADMIN_VERB and friends * some renaming * dumb * one more rename * never search and replace this codebase * fix TM issues, more renaming * add a static analysis to shore up user verbs * fix double message on roundstart * remove macro we're not using yet * convert remaining playsounds verbs * convert more verbs i missed somehow * why is this a completely different signature than everything else * fix ui_interact arg * fix logging view and others * buncha issues caught in TM * fix mentor tickets ui * fix bug report viewing * moron
This commit is contained in:
@@ -137,15 +137,12 @@
|
||||
var/datum/ui_module/colour_matrix_tester/CMT = new(target=src)
|
||||
CMT.ui_interact(usr)
|
||||
|
||||
USER_CONTEXT_MENU(debug_variables, R_ADMIN|R_VIEWRUNTIMES, "\[Admin\] View Variables", datum/thing in world)
|
||||
client.debug_variables(thing)
|
||||
|
||||
/client/proc/debug_variables(datum/D in world)
|
||||
set name = "\[Admin\] View Variables"
|
||||
|
||||
var/static/cookieoffset = rand(1, 9999) //to force cookies to reset after the round.
|
||||
|
||||
if(!check_rights(R_ADMIN|R_VIEWRUNTIMES))
|
||||
to_chat(usr, "<span class='warning'>You need to be an administrator to access this.</span>")
|
||||
return
|
||||
|
||||
if(!D)
|
||||
return
|
||||
|
||||
@@ -724,14 +721,7 @@
|
||||
debug_variables(locate(href_list["listrefresh"]))
|
||||
return TRUE
|
||||
|
||||
/client/proc/debug_global_variables(var_search as text)
|
||||
set category = "Debug"
|
||||
set name = "Debug Global Variables"
|
||||
|
||||
if(!check_rights(R_ADMIN|R_VIEWRUNTIMES))
|
||||
to_chat(usr, "<span class='warning'>You need to be an administrator to access this.</span>")
|
||||
return
|
||||
|
||||
USER_VERB(debug_global_variables, R_ADMIN|R_VIEWRUNTIMES, "Debug Global Variables", "Debug Global Variables", VERB_CATEGORY_DEBUG, var_search as text)
|
||||
var_search = trim(var_search)
|
||||
if(!var_search)
|
||||
return
|
||||
@@ -741,13 +731,13 @@
|
||||
if("vars")
|
||||
return FALSE
|
||||
if(!(var_search in GLOB.vars))
|
||||
to_chat(src, "<span class='debug'>GLOB.[var_search] does not exist.</span>")
|
||||
to_chat(client, "<span class='debug'>GLOB.[var_search] does not exist.</span>")
|
||||
return
|
||||
log_and_message_admins("is debugging the Global Variables controller with the search term \"[var_search]\"")
|
||||
var/result = GLOB.vars[var_search]
|
||||
if(islist(result) || isclient(result) || istype(result, /datum))
|
||||
to_chat(src, "<span class='debug'>Now showing GLOB.[var_search].</span>")
|
||||
return debug_variables(result)
|
||||
to_chat(src, "<span class='debug'>GLOB.[var_search] returned [result].</span>")
|
||||
to_chat(client, "<span class='debug'>Now showing GLOB.[var_search].</span>")
|
||||
return client.debug_variables(result)
|
||||
to_chat(client, "<span class='debug'>GLOB.[var_search] returned [result].</span>")
|
||||
|
||||
#undef VV_HTML_ENCODE
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
/datum/keybinding/admin/aghost/down(client/C)
|
||||
. = ..()
|
||||
C.admin_ghost()
|
||||
SSuser_verbs.invoke_verb(C, /datum/user_verb/admin_ghost)
|
||||
|
||||
/datum/keybinding/admin/player_panel
|
||||
name = "Player Panel"
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
/datum/keybinding/admin/apm/down(client/C)
|
||||
. = ..()
|
||||
C.cmd_admin_pm_panel()
|
||||
SSuser_verbs.invoke_verb(C, /datum/user_verb/admin_pm_panel)
|
||||
|
||||
/datum/keybinding/admin/invisimin
|
||||
name = "Invisimin"
|
||||
@@ -51,4 +51,4 @@
|
||||
|
||||
/datum/keybinding/admin/invisimin/down(client/C)
|
||||
. = ..()
|
||||
C.invisimin()
|
||||
SSuser_verbs.invoke_verb(C, /datum/user_verb/invisimin)
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
/// Opens the station traits admin panel
|
||||
/datum/admins/proc/station_traits_panel()
|
||||
set name = "Modify Station Traits"
|
||||
set category = "Event"
|
||||
|
||||
USER_VERB(modify_station_traits, R_ADMIN, "Modify Station Traits", "Open the station traits panel.", VERB_CATEGORY_EVENT)
|
||||
var/static/datum/ui_module/station_traits_panel/station_traits_panel = new
|
||||
station_traits_panel.ui_interact(usr)
|
||||
station_traits_panel.ui_interact(client.mob)
|
||||
|
||||
/datum/ui_module/station_traits_panel
|
||||
var/static/list/future_traits
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
GENERAL_PROTECT_DATUM(/datum/user_verb)
|
||||
|
||||
/**
|
||||
* This is the user verb datum. It is used to store the verb's information and handle the verb's functionality.
|
||||
* All of this is setup for you, and you should not be defining this manually.
|
||||
* That means you reader.
|
||||
*/
|
||||
/datum/user_verb
|
||||
var/name //! The name of the verb.
|
||||
var/description //! The description of the verb.
|
||||
var/category //! The category of the verb.
|
||||
var/permissions //! The permissions required to use the verb.
|
||||
var/visibility_flag //! The flag that determines if the verb is visible.
|
||||
VAR_PROTECTED/verb_path //! The path to the verb proc.
|
||||
|
||||
/datum/user_verb/Destroy(force)
|
||||
if(!force)
|
||||
return QDEL_HINT_LETMELIVE
|
||||
return ..()
|
||||
|
||||
/// Assigns the verb to the user.
|
||||
/datum/user_verb/proc/assign_to_client(client/user)
|
||||
add_verb(user, verb_path)
|
||||
|
||||
/// Unassigns the verb from the user.
|
||||
/datum/user_verb/proc/unassign_from_client(client/user)
|
||||
remove_verb(user, verb_path)
|
||||
@@ -3,12 +3,9 @@
|
||||
/// from [/datum/proc/vv_do_topic] for that reason.
|
||||
/client/proc/vv_core_topics(datum/target, href_list)
|
||||
if(href_list[VV_HK_JUMP_TO])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(target)
|
||||
if(T)
|
||||
jumptoturf(T)
|
||||
SSuser_verbs.invoke_verb(usr, /datum/user_verb/jump_to_turf, T)
|
||||
href_list["datumrefresh"] = target.UID()
|
||||
if(href_list["varnameedit"] && href_list["datumedit"])
|
||||
if(!check_rights(R_ADMIN | R_VAREDIT)) return
|
||||
@@ -59,7 +56,8 @@
|
||||
return
|
||||
|
||||
if(target)
|
||||
callproc_datum(target)
|
||||
SSuser_verbs.invoke_verb(usr, /datum/user_verb/call_proc_datum, target)
|
||||
|
||||
if(href_list[VV_HK_ADDCOMPONENT])
|
||||
if(!check_rights(NONE))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user