Skip to content

Tgui Player & Options panel - Please Review Me #4846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/datums/keybinding/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
hotkey_keys = list("F6")
name = "player_panel_new"
full_name = "Player Panel New"
description = "Opens up the new player panel"
description = "Opens up the new TGUI player panel"
keybind_signal = COMSIG_KB_ADMIN_PLAYERPANELNEW_DOWN

/datum/keybinding/admin/player_panel_new/down(client/user)
. = ..()
if(.)
return
user.holder.player_panel_new()
user.holder.player_panel_veth()
return TRUE

/datum/keybinding/admin/toggle_buildmode_self
Expand Down
3 changes: 3 additions & 0 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ GLOBAL_PROTECT(admin_verbs_admin)
/datum/verbs/menu/Admin/verb/playerpanel, /* It isn't /datum/admin but it fits no less */
/datum/admins/proc/kick_player_by_ckey, //MONKESTATION ADDITION - kick a player by their ckey
/datum/admins/proc/change_shuttle_events, //allows us to change the shuttle events
/datum/admins/proc/player_panel_veth,
/datum/admins/proc/vuap_open_context,
/datum/admins/proc/vuap_open,
// Client procs
/client/proc/admin_call_shuttle, /*allows us to call the emergency shuttle*/
/client/proc/admin_cancel_shuttle, /*allows us to cancel the emergency shuttle, sending it back to centcom*/
Expand Down
8 changes: 6 additions & 2 deletions code/modules/admin/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,9 @@

else if(href_list["adminplayeropts"])
var/mob/M = locate(href_list["adminplayeropts"])
show_player_panel(M)
usr.client.VUAP_selected_mob = M
usr.client.selectedPlayerCkey = M.ckey
usr.client.holder.vuap_open()

else if(href_list["ppbyckey"])
var/target_ckey = href_list["ppbyckey"]
Expand All @@ -740,7 +742,9 @@
return

to_chat(usr, span_notice("Jumping to [target_ckey]'s new mob: [target_mob]!"))
show_player_panel(target_mob)
usr.client.VUAP_selected_mob = target_mob
usr.client.selectedPlayerCkey = target_mob.ckey
usr.client.holder.vuap_open()

else if(href_list["adminopendemo"])
usr.client << link("http://viewer.monkestation.com/?roundid=[GLOB.round_id]&password=[CONFIG_GET(string/replay_password)]#[world.time]") //opens current round at current time
Expand Down
4 changes: 3 additions & 1 deletion code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,9 @@
if(href_list[VV_HK_PLAYER_PANEL])
if(!check_rights(NONE))
return
usr.client.holder.show_player_panel(src)
usr.client.VUAP_selected_mob = src
usr.client.selectedPlayerCkey = src.ckey
usr.client.holder.vuap_open()
if(href_list[VV_HK_GODMODE])
if(!check_rights(R_ADMIN))
return
Expand Down
5 changes: 3 additions & 2 deletions code/modules/requests/request_manager.dm
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ GLOBAL_DATUM_INIT(requests, /datum/request_manager, new)

switch(action)
if ("pp")
var/mob/M = request.owner?.mob
usr.client.holder.show_player_panel(M)
usr.client.VUAP_selected_mob = request.owner?.mob
usr.client.selectedPlayerCkey = request.owner?.mob.ckey
usr.client.holder.vuap_open()
return TRUE
if ("vv")
var/mob/M = request.owner?.mob
Expand Down
4 changes: 3 additions & 1 deletion code/modules/wiremod/core/admin_panel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@
circuit.ui_interact(usr)
if ("open_player_panel")
var/datum/mind/inserter = circuit.inserter_mind?.resolve()
usr.client?.holder?.show_player_panel(inserter?.current)
usr.client.VUAP_selected_mob = inserter?.current
usr.client.selectedPlayerCkey = inserter?.current?.ckey
usr.client?.holder?.vuap_open()

return TRUE

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## Title: <!--Title of your addition-->

<!-- uppercase, underscore_connected name of your module, that you use to mark files-->
MODULE ID: TGUIPLAYERPANEL

### Description:
This PR adds a TGUI version of player panel. It should have all of the features of the current player panel, with some additional "most used" buttons on the main player panel. Ideally, if all goes well, I'd like to phase out the older player panel, but this will need extensive testing.

### Master file additions

- N/A
<!-- Any master file changes you've made to existing master files or if you've added a new master file. Please mark either as #NEW or #CHANGE -->

### Included files that are not contained in this module:

#NEW tgui/packages/tgui/interfaces/VUAP_personal.tsx
#NEW tgui/packages/tgui/interfaces/veth_player_panel.tsx
#CHANGE code/modules/admin/admin_verbs.dm


<!-- Likewise, be it a non-modular file or a modular one that's not contained within the folder belonging to this specific module, it should be mentioned here -->

### Credits:

<!-- Here go the credits to you, dear coder, and in case of collaborative work or ports, credits to the original source of the code -->
<!-- Original Coders -->
Made by Veth
Special thanks to Fleepy, Pooba & Absolucy for their help.

Loading
Loading