From 2ba7ba74e2a52a4f5a95d3fa332381af0183ceed Mon Sep 17 00:00:00 2001 From: Tim Goll Date: Tue, 10 Oct 2023 16:46:25 +0200 Subject: [PATCH] integrated convar into UI --- .../gamemode/shared/sh_cvar_handler.lua | 9 --------- lua/terrortown/lang/en.lua | 15 ++++++++++++++- .../menus/gamemode/administration/roundsetup.lua | 16 ++++++++-------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/gamemodes/terrortown/gamemode/shared/sh_cvar_handler.lua b/gamemodes/terrortown/gamemode/shared/sh_cvar_handler.lua index 4b39d1331..845d1e4c2 100644 --- a/gamemodes/terrortown/gamemode/shared/sh_cvar_handler.lua +++ b/gamemodes/terrortown/gamemode/shared/sh_cvar_handler.lua @@ -1,15 +1,6 @@ --- -- All replicated convars are handled in this file ---- --- @realm shared -CreateConVar("ttt2_confirm_detective_only", "0", {FCVAR_NOTIFY, FCVAR_ARCHIVE, FCVAR_REPLICATED}) - ---- --- @realm shared -CreateConVar("ttt2_inspect_detective_only", "0", {FCVAR_NOTIFY, FCVAR_ARCHIVE, FCVAR_REPLICATED}) - ---- -- @realm shared CreateConVar("ttt2_radar_charge_time", "30", {FCVAR_NOTIFY, FCVAR_ARCHIVE, FCVAR_REPLICATED}) diff --git a/lua/terrortown/lang/en.lua b/lua/terrortown/lang/en.lua index 83b0415d3..84bcad83e 100644 --- a/lua/terrortown/lang/en.lua +++ b/lua/terrortown/lang/en.lua @@ -1724,7 +1724,7 @@ L.label_session_limits_enabled = "Enable session limits" L.label_spectator_chat = "Enable spectators chatting with everybody" L.label_lastwords_chatprint = "Print last words to chat if killed while typing" L.label_identify_body_woconfirm = "Identify corpse without pressing the 'confirm' button" -L.label_announce_body_found = "Announce that a body was found" +L.label_announce_body_found = "Announce that a body was found when the body was confirmed"--! L.label_confirm_killlist = "Announce kill list of confirmed corpse" L.label_inspect_detective_only = "Limit corpse search to policing roles only" L.label_confirm_detective_only = "Limit corpse confirmation to policing roles only" @@ -1988,3 +1988,16 @@ L.corpse_hint_no_inspect_details = "Only public policing roles can find informat L.corpse_hint_inspect_only_details = "Only public policing roles can confirm the body." L.corpse_hint_spec = "Press [{usekey}] to view corpse UI" L.corpse_hint_public_policing_searched = "Press [{usekey}] to view search results from public policing role" + +L.label_inspect_confirm_mode = "Select body search mode" +L.choice_inspect_confirm_mode_0 = "mode 0: standard TTT" +L.choice_inspect_confirm_mode_0 = "mode 1: limited confirm" +L.choice_inspect_confirm_mode_0 = "mode 2: limited search" +L.help_inspect_confirm_mode = [[ +There are three different body search/confirm modes in this gamemode. The selection of this mode has huge influences to the importance of public policing roles like the detective. + +mode 0: This is standard TTT behavior. Everyone can search and confirm bodies. To report a body or to take the credits from it, the body first has to be confirmed. This makes it a bit harder for shopping roles to sneakily steal credits. However innocent players that want to report the body to call a public policing player need to confirm first as well. + +mode 1: This mode increases the importance of public policing roles by limiting the confirmation option to them. This also means that taking credits and reporting bodies is now also possible before confirming a body. Everybody can still search dead bodies and find the information, but they are unable to announce the found information. + +mode 2: This mode is yet a bit more strict than mode 1. In this mode the search ability is removed as well from normal players. This means that reporting a dead body to a public policing player is now the only way to get any information from dead bodies.]] diff --git a/lua/terrortown/menus/gamemode/administration/roundsetup.lua b/lua/terrortown/menus/gamemode/administration/roundsetup.lua index 27f614bc9..aeed7d4bd 100644 --- a/lua/terrortown/menus/gamemode/administration/roundsetup.lua +++ b/lua/terrortown/menus/gamemode/administration/roundsetup.lua @@ -24,18 +24,18 @@ function CLGAMEMODESUBMENU:Populate(parent) }) form:MakeCheckBox({ - serverConvar = "ttt2_inspect_detective_only", - label = "label_inspect_detective_only" + serverConvar = "ttt_dyingshot", + label = "label_dyingshot" }) - form:MakeCheckBox({ - serverConvar = "ttt2_confirm_detective_only", - label = "label_confirm_detective_only" + form:MakeHelp({ + label = "help_inspect_confirm_mode" }) - form:MakeCheckBox({ - serverConvar = "ttt_dyingshot", - label = "label_dyingshot" + form:MakeComboBox({ + label = "label_inspect_confirm_mode", + serverConvar = "ttt2_inspect_confirm_mode", + choices = {"choice_inspect_confirm_mode_0", "choice_inspect_confirm_mode_1" ,"choice_inspect_confirm_mode_2"} }) local form2 = vgui.CreateTTT2Form(parent, "header_round_setup_prep")