Skip to content

Commit

Permalink
Change to TGUI using a fun menu as a base.
Browse files Browse the repository at this point in the history
  • Loading branch information
Coll6 committed Dec 15, 2024
1 parent c743e79 commit ea95b79
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 8 deletions.
10 changes: 2 additions & 8 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ GLOBAL_PROTECT(admin_verbs_default)
/client/proc/reload_admins,
/client/proc/requests,
/client/proc/secrets,
/client/proc/review_cassettes, /*monkestation addition Opens the Cassette Review menu*/
/client/proc/stop_sounds,
/client/proc/tag_datum_mapview,
)
Expand Down Expand Up @@ -92,7 +93,6 @@ GLOBAL_PROTECT(admin_verbs_admin)
/client/proc/list_signalers,
/client/proc/message_pda, /*send a message to somebody on PDA*/
/client/proc/respawn_character,
/client/proc/review_cassettes, /*Opens the Cassette Review menu*/
/client/proc/show_manifest,
/client/proc/toggle_AI_interact, /*toggle admin ability to interact with machines as an AI*/
/client/proc/toggle_combo_hud, /* toggle display of the combination pizza antag and taco sci/med/eng hud */
Expand Down Expand Up @@ -160,7 +160,7 @@ GLOBAL_LIST_INIT(admin_verbs_fun, list(
/client/proc/toggle_random_events,
))
GLOBAL_PROTECT(admin_verbs_fun)
GLOBAL_LIST_INIT(admin_verbs_spawn, list(/datum/admins/proc/spawn_atom, /datum/admins/proc/podspawn_atom, /datum/admins/proc/spawn_cargo, /datum/admins/proc/spawn_objasmob, /client/proc/respawn_character, /datum/admins/proc/beaker_panel, /client/proc/spawn_mixtape, /client/proc/review_cassettes,)) //Monkestation Addition: mixtape spawner and mixtape review menu
GLOBAL_LIST_INIT(admin_verbs_spawn, list(/datum/admins/proc/spawn_atom, /datum/admins/proc/podspawn_atom, /datum/admins/proc/spawn_cargo, /datum/admins/proc/spawn_objasmob, /client/proc/respawn_character, /datum/admins/proc/beaker_panel, /client/proc/spawn_mixtape,)) //Monkestation Addition: mixtape spawner
GLOBAL_PROTECT(admin_verbs_spawn)
GLOBAL_LIST_INIT(admin_verbs_server, world.AVerbsServer())
GLOBAL_PROTECT(admin_verbs_server)
Expand Down Expand Up @@ -403,12 +403,6 @@ GLOBAL_PROTECT(admin_verbs_poll)
mob.invisibility = INVISIBILITY_OBSERVER
to_chat(mob, span_adminnotice("<b>Invisimin on. You are now as invisible as a ghost.</b>"), confidential = TRUE)

/client/proc/review_cassettes()
set name = "Review Cassettes"
set category = "Admin.Game"
set desc = "Review this rounds cassettes."
/*Opening menu code*/

/client/proc/check_antagonists()
set name = "Check Antagonists"
set category = "Admin.Game"
Expand Down
42 changes: 42 additions & 0 deletions monkestation/code/modules/cassettes/cassette_approval.dm
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,45 @@ GLOBAL_LIST_INIT(cassette_reviews, list())
return GLOB.cassette_reviews[id]

#undef ADMIN_OPEN_REVIEW

// Handles UI to manage cassettes.
/client/proc/review_cassettes() //Creates a verb for admins to open up the ui
set name = "Review Cassettes"
set desc = "Review this rounds cassettes."
set category = "Admin.Game"
var/datum/review_cassettes/tgui = new(usr)//create the datum
tgui.ui_interact(usr)//datum has a tgui component, here we open the window

/datum/review_cassettes
var/client/holder //client of whoever is using this datum
var/is_funmin = FALSE
/datum/review_cassettes/New(user)//user can either be a client or a mob due to byondcode(tm)
if (istype(user, /client))
var/client/user_client = user
holder = user_client //if its a client, assign it to holder
else
var/mob/user_mob = user
holder = user_mob.client //if its a mob, assign the mob's client to holder

is_funmin = check_rights(R_FUN)

/datum/review_cassettes/ui_close()// Don't leave orphaned datums laying around. Hopefully this handles timeouts?
qdel(src)

/datum/review_cassettes/ui_interact(mob/user, datum/tgui/ui) // Open UI and update as it remains open.
if(is_funmin)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "CassetteManager")
ui.open()

/datum/review_cassettes/ui_data(mob/user)
var/list/data = list()

if(!GLOB.cassette_reviews || !GLOB.cassette_reviews.len)
return data

/datum/secrets_menu/ui_act(action, params)
. = ..()
if(.)
return

0 comments on commit ea95b79

Please sign in to comment.