Skip to content

Commit

Permalink
added new form for derandomization
Browse files Browse the repository at this point in the history
  • Loading branch information
TimGoll committed Aug 15, 2024
1 parent 79cc46f commit 37e6e23
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
2 changes: 2 additions & 0 deletions lua/terrortown/lang/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2307,6 +2307,8 @@ L.loadingscreen_round_restart_subtitle = "you're playing on {map}"
L.loadingscreen_round_restart_subtitle_limits = "you're playing on {map} for another {rounds} round(s) or {time}"

-- 2024-06-23
L.header_roles_derandomize = "Role Derandomization"

L.help_roles_derandomize = [[
Role derandomization can be used to make role distribution feel more fair over the course of a session.
Expand Down
38 changes: 20 additions & 18 deletions lua/terrortown/menus/gamemode/administration/roles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ function CLGAMEMODESUBMENU:Populate(parent)
master = masterEnb,
})

form:MakeHelp({
local form2 = vgui.CreateTTT2Form(parent, "header_roles_derandomize")

form2:MakeHelp({
label = "help_roles_derandomize",
})

local masterDerand = form:MakeComboBox({
local masterDerand = form2:MakeComboBox({
serverConvar = "ttt_role_derandomize_mode",
label = "label_roles_derandomize_mode",
choices = {
Expand All @@ -91,12 +93,12 @@ function CLGAMEMODESUBMENU:Populate(parent)
},
})

form:MakeHelp({
form2:MakeHelp({
label = "help_roles_derandomize_min_weight",
master = masterDerand,
})

form:MakeSlider({
form2:MakeSlider({
serverConvar = "ttt_role_derandomize_min_weight",
label = "label_roles_derandomize_min_weight",
master = masterDerand,
Expand All @@ -105,69 +107,69 @@ function CLGAMEMODESUBMENU:Populate(parent)
decimal = 0,
})

local form2 = vgui.CreateTTT2Form(parent, "header_roles_reward_credits")
local form3 = vgui.CreateTTT2Form(parent, "header_roles_reward_credits")

form2:MakeHelp({
form3:MakeHelp({
label = "help_roles_award_info",
})

form2:MakeSlider({
form3:MakeSlider({
serverConvar = "ttt_credits_award_size",
label = "label_roles_credits_award_size",
min = 0,
max = 5,
decimal = 0,
})

form2:MakeHelp({
form3:MakeHelp({
label = "help_roles_award_pct",
})

form2:MakeSlider({
form3:MakeSlider({
serverConvar = "ttt_credits_award_pct",
label = "label_roles_credits_award_pct",
min = 0,
max = 1,
decimal = 2,
})

form2:MakeHelp({
form3:MakeHelp({
label = "help_roles_award_repeat",
})

form2:MakeCheckBox({
form3:MakeCheckBox({
serverConvar = "ttt_credits_award_repeat",
label = "label_roles_credits_award_repeat",
})

form2:MakeHelp({
form3:MakeHelp({
label = "help_roles_credits_award_kill",
})

form2:MakeSlider({
form3:MakeSlider({
serverConvar = "ttt_credits_award_kill",
label = "label_roles_credits_award_kill",
min = 0,
max = 10,
decimal = 0,
})

local form3 = vgui.CreateTTT2Form(parent, "header_roles_special_settings")
local form4 = vgui.CreateTTT2Form(parent, "header_roles_special_settings")

form3:MakeHelp({
form4:MakeHelp({
label = "help_detective_hats",
})

form3:MakeCheckBox({
form4:MakeCheckBox({
serverConvar = "ttt_detective_hats",
label = "label_detective_hats",
})

form3:MakeHelp({
form4:MakeHelp({
label = "help_inspect_credits_always",
})

form3:MakeCheckBox({
form4:MakeCheckBox({
serverConvar = "ttt2_inspect_credits_always_visible",
label = "label_inspect_credits_always",
})
Expand Down

0 comments on commit 37e6e23

Please sign in to comment.