Skip to content

Commit

Permalink
fix skin buttons not working for interviewees (let them read the rule…
Browse files Browse the repository at this point in the history
…s) (#2282)
  • Loading branch information
ZephyrTFA authored Aug 13, 2023
1 parent 5c0d1e0 commit 3012052
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
14 changes: 11 additions & 3 deletions code/__DEFINES/statpanel.dm
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
/// Bare minimum required verbs for stat panel operation
GLOBAL_LIST_INIT(stat_panel_verbs, list(
/// Bare minimum required verbs for client functionality
GLOBAL_LIST_INIT(client_verbs_required, list(
// Stat panel internal verbs
/client/verb/set_tab,
/client/verb/send_tabs,
/client/verb/remove_tabs,
/client/verb/reset_tabs,
/client/verb/panel_ready
/client/verb/panel_ready,
// Skin buttons that should always work
/client/verb/rules,
/client/verb/forum,
/client/verb/github,
/client/verb/joindiscord,
// Admin help
/client/verb/adminhelp,
))
5 changes: 5 additions & 0 deletions code/__HELPERS/verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
var/list/verbs_list = list()
if(!islist(verb_or_list_to_remove))
verbs_list += verb_or_list_to_remove
if(verb_or_list_to_remove in GLOB.client_verbs_required)
CRASH("attempted to remove verb ([element_or_list]) that is required for the client to function")

Check failure on line 73 in code/__HELPERS/verbs.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "element_or_list"
else
var/list/verb_listref = verb_or_list_to_remove
var/list/elements_to_process = verb_listref.Copy()
Expand All @@ -78,6 +80,9 @@
if(islist(element_or_list))
elements_to_process += element_or_list //list/a += list/b adds the contents of b into a, not the reference to the list itself
else
if(element_or_list in GLOB.client_verbs_required)
stack_trace("attempted to remove a verb ([element_or_list]) that is required for the client to function")
continue
verbs_list += element_or_list

if(mob_target)
Expand Down
16 changes: 4 additions & 12 deletions code/modules/mob/dead/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -477,21 +477,13 @@
*/
/mob/dead/new_player/proc/register_for_interview()
// First we detain them by removing all the verbs they have on client
for (var/v in client.verbs)
var/procpath/verb_path = v
if (!(verb_path in GLOB.stat_panel_verbs))
remove_verb(client, verb_path)

// Then remove those on their mob as well
for (var/v in verbs)
var/procpath/verb_path = v
if (!(verb_path in GLOB.stat_panel_verbs))
remove_verb(src, verb_path)
for (var/procpath/client_verb as anything in client.verbs)
if(!(client_verb in GLOB.client_verbs_required))
remove_verb(client, client_verb)

// Then we create the interview form and show it to the client
var/datum/interview/I = GLOB.interviews.interview_for_client(client)
if (I)
I.ui_interact(src)
I?.ui_interact(src)

// Add verb for re-opening the interview panel, and re-init the verbs for the stat panel
add_verb(src, /mob/dead/new_player/proc/open_interview)

0 comments on commit 3012052

Please sign in to comment.