Skip to content

admin: Несколько PM qol-ов #6497

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 3 commits into from
Jan 31, 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/modules/admin/verbs/adminhelp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ GLOBAL_LIST_INIT(adminhelp_ignored_words, list("unknown", "the", "a", "an", "of"

var/msg
var/list/type = list("Mentorhelp", "Adminhelp")
var/selected_type = input("Pick a category.", "Admin Help") as null|anything in type
var/selected_type = tgui_input_list(src, "Pick a category.", "Admin Help", type)
if(selected_type)
msg = clean_input("Please enter your message.", selected_type)
msg = tgui_input_text(src, "Please enter your message.", selected_type, multiline = TRUE, encode = FALSE)

if(!msg)
return
Expand Down
8 changes: 4 additions & 4 deletions code/modules/admin/verbs/adminpm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
//get message text, limit it's length.and clean/escape html
if(!msg)
set_typing(C, TRUE)
msg = clean_input("Message:", "Private message to [holder ? key_name(C, FALSE) : key_name_hidden(C, FALSE)]", , src)
msg = tgui_input_text(src, "Message:", "Private message to [holder ? key_name(C, FALSE) : key_name_hidden(C, FALSE)]", multiline = TRUE, encode = FALSE)
msg = handleDiscordEmojis(msg)
set_typing(C, FALSE)

Expand Down Expand Up @@ -150,7 +150,7 @@
spawn(0) //so we don't hold the caller proc up
var/sender = src
var/sendername = key
var/reply = clean_input(msg,"[recieve_pm_type] [type] from-[sendername]", "", C) //show message and await a reply
var/reply = tgui_input_text(C, msg,"[recieve_pm_type] [type] from-[sendername]", multiline = TRUE, encode = FALSE) //show message and await a reply
if(C && reply)
if(sender)
C.cmd_admin_pm(sender,reply) //sender is still about, let's reply to them
Expand Down Expand Up @@ -226,7 +226,7 @@
// We only allow PMs once every 10 seconds, othewrise the channel can get spammed very quickly
last_discord_pm_time = world.time + 10 SECONDS

var/msg = clean_input("Message:", "Private message to admins on Discord / 400 character limit", , src)
var/msg = tgui_input_text(src, "Message:", "Private message to admins on Discord / 400 character limit", multiline = TRUE, encode = FALSE)

if(!msg)
return
Expand All @@ -251,7 +251,7 @@

/client/verb/open_pms_ui()
set name = "My PMs"
set category = "OOC"
set category = "Admin.Admin Tickets"
pm_tracker.show_ui(usr)

/client/proc/set_typing(client/target, value)
Expand Down
6 changes: 3 additions & 3 deletions code/modules/admin/verbs/randomverbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
if(!check_rights(R_EVENT))
return

var/msg = clean_input("Message:", text("Subtle PM to [M.key]"))
var/msg = tgui_input_text(src, "Message:", text("Subtle PM to [M.key]"), multiline = TRUE, encode = FALSE)

if(!msg)
return
Expand Down Expand Up @@ -175,12 +175,12 @@
return

if(!sender)
sender = input("Who is the message from?", "Sender") as null|anything in list("Centcomm", "Syndicate")
sender = tgui_input_list(src, "Who is the message from?", "Sender", list("Centcomm", "Syndicate"))
if(!sender)
return

message_admins("[key_name_admin(src)] has started answering [key_name_admin(H)]'s [sender] request.")
var/input = clean_input("Please enter a message to reply to [key_name(H)] via their headset.", "Outgoing message from [sender]", "")
var/input = tgui_input_text(src, "Please enter a message to reply to [key_name(H)] via their headset.", "Outgoing message from [sender]", multiline = TRUE, encode = FALSE)
if(!input)
message_admins("[key_name_admin(src)] decided not to answer [key_name_admin(H)]'s [sender] request.")
return
Expand Down