Skip to content

Commit

Permalink
integrated convar into UI
Browse files Browse the repository at this point in the history
  • Loading branch information
TimGoll committed Oct 10, 2023
1 parent 8e4be42 commit 2ba7ba7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
9 changes: 0 additions & 9 deletions gamemodes/terrortown/gamemode/shared/sh_cvar_handler.lua
Original file line number Diff line number Diff line change
@@ -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})

Expand Down
15 changes: 14 additions & 1 deletion lua/terrortown/lang/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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.]]
16 changes: 8 additions & 8 deletions lua/terrortown/menus/gamemode/administration/roundsetup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 2ba7ba7

Please sign in to comment.