From 43163b08dea95cdfa6e040c7d2f540e2c039e752 Mon Sep 17 00:00:00 2001 From: naut Date: Thu, 1 Aug 2024 13:23:36 +0800 Subject: [PATCH 1/3] marine announce --- code/modules/admin/admin_verbs.dm | 1 + .../game_master/extra_buttons/marine_announce.dm | 14 ++++++++++++++ colonialmarines.dme | 1 + 3 files changed, 16 insertions(+) create mode 100644 code/modules/admin/game_master/extra_buttons/marine_announce.dm diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 6e47391fc1..f86da98614 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -333,6 +333,7 @@ var/list/roundstart_mod_verbs = list( add_verb(src, /client/proc/open_resin_panel) add_verb(src, /client/proc/open_sound_panel) add_verb(src, /client/proc/toggle_join_xeno) + add_verb(src, /client/proc/admin_marine_announcement) add_verb(src, /client/proc/game_master_rename_platoon) add_verb(src, /client/proc/toggle_vehicle_blockers) add_verb(src, /client/proc/toggle_rappel_menu) diff --git a/code/modules/admin/game_master/extra_buttons/marine_announce.dm b/code/modules/admin/game_master/extra_buttons/marine_announce.dm new file mode 100644 index 0000000000..c5094c9916 --- /dev/null +++ b/code/modules/admin/game_master/extra_buttons/marine_announce.dm @@ -0,0 +1,14 @@ +/client/proc/admin_marine_announcement() + set name = "Marine Announcement" + set category = "Game Master.Extras" + + if(!check_rights(R_ADMIN)) + return + + var/input = tgui_input_text(src, "Enter the text for the announcement.", title = "Make Marine Announcement", multiline = TRUE, encode = FALSE) + if(!input) + return + else + marine_announcement(input, "[MAIN_SHIP_NAME]") + message_admins("[key_name_admin(src)] has made an admin command announcement.") + log_admin("[key_name_admin(src)] made an admin command announcement: [input]") diff --git a/colonialmarines.dme b/colonialmarines.dme index 58cee33fcf..68c7eea8da 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -1390,6 +1390,7 @@ #include "code\modules\admin\game_master\game_master_submenu.dm" #include "code\modules\admin\game_master\resin_panel.dm" #include "code\modules\admin\game_master\sound_panel.dm" +#include "code\modules\admin\game_master\extra_buttons\marine_announce.dm" #include "code\modules\admin\game_master\extra_buttons\rappel_menu.dm" #include "code\modules\admin\game_master\extra_buttons\rename_platoon.dm" #include "code\modules\admin\game_master\extra_buttons\toggle_join_xeno.dm" From e035514272d0a03e41b34de1c2b90edcdd1e37bd Mon Sep 17 00:00:00 2001 From: naut Date: Thu, 1 Aug 2024 14:00:26 +0800 Subject: [PATCH 2/3] changes announcement title --- code/modules/admin/game_master/extra_buttons/marine_announce.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/admin/game_master/extra_buttons/marine_announce.dm b/code/modules/admin/game_master/extra_buttons/marine_announce.dm index c5094c9916..33f5723770 100644 --- a/code/modules/admin/game_master/extra_buttons/marine_announce.dm +++ b/code/modules/admin/game_master/extra_buttons/marine_announce.dm @@ -9,6 +9,6 @@ if(!input) return else - marine_announcement(input, "[MAIN_SHIP_NAME]") + marine_announcement(input, "[COMMAND_ANNOUNCE]") message_admins("[key_name_admin(src)] has made an admin command announcement.") log_admin("[key_name_admin(src)] made an admin command announcement: [input]") From d9bcca3dfb954d659ffbd69ba488d622e06b4198 Mon Sep 17 00:00:00 2001 From: naut Date: Tue, 13 Aug 2024 20:56:27 +0800 Subject: [PATCH 3/3] customizable title + conflict fix --- .../game_master/extra_buttons/marine_announce.dm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/code/modules/admin/game_master/extra_buttons/marine_announce.dm b/code/modules/admin/game_master/extra_buttons/marine_announce.dm index 33f5723770..6a0a903b8a 100644 --- a/code/modules/admin/game_master/extra_buttons/marine_announce.dm +++ b/code/modules/admin/game_master/extra_buttons/marine_announce.dm @@ -1,14 +1,16 @@ /client/proc/admin_marine_announcement() - set name = "Marine Announcement" + set name = "Command Announcement" set category = "Game Master.Extras" if(!check_rights(R_ADMIN)) return - var/input = tgui_input_text(src, "Enter the text for the announcement.", title = "Make Marine Announcement", multiline = TRUE, encode = FALSE) - if(!input) + var/body = tgui_input_text(src, "Enter the body text for the announcement.", title = "Announcement Body", multiline = TRUE, encode = FALSE) + if(!body) return - else - marine_announcement(input, "[COMMAND_ANNOUNCE]") - message_admins("[key_name_admin(src)] has made an admin command announcement.") - log_admin("[key_name_admin(src)] made an admin command announcement: [input]") + var/title = tgui_input_text(src, "Enter the title of the announcement. Leave blank for the default title.", title = "Announcement Title") + if(!title) + title = COMMAND_ANNOUNCE + marine_announcement(body, "[title]") + message_admins("[key_name_admin(src)] has made an admin command announcement.") + log_admin("[key_name_admin(src)] made an admin command announcement: [body]")