From 8ffcfa1e39176b7daf226518487f55a5e03017a8 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Tue, 28 May 2024 21:13:10 +0500 Subject: [PATCH] Added a checkbox for random loadouts in tools menu --- .../content/resource/localization/en/beatrun.properties | 3 ++- .../content/resource/localization/ru/beatrun.properties | 3 ++- beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua | 3 +++ beatrun/gamemodes/beatrun/gamemode/sh/Deathmatch.lua | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/beatrun/gamemodes/beatrun/content/resource/localization/en/beatrun.properties b/beatrun/gamemodes/beatrun/content/resource/localization/en/beatrun.properties index adb8303..f69b02a 100644 --- a/beatrun/gamemodes/beatrun/content/resource/localization/en/beatrun.properties +++ b/beatrun/gamemodes/beatrun/content/resource/localization/en/beatrun.properties @@ -241,4 +241,5 @@ beatrun.infection.awardinfected=You were awarded 100 XP for spawning as an infec beatrun.infection.end=The game has ended!\nSurvivors: %s\nRestarting in 15s # Server ConVars -beatrun.randomloadouts.helptext=Toggles random MW Base loadouts in Deathmatch and DataTheft +beatrun.randommwloadouts=Random MW Base Loadouts +beatrun.randommwloadoutsdesc=Toggles random MW Base loadouts in Deathmatch and DataTheft diff --git a/beatrun/gamemodes/beatrun/content/resource/localization/ru/beatrun.properties b/beatrun/gamemodes/beatrun/content/resource/localization/ru/beatrun.properties index 1ab595b..11ab7a6 100644 --- a/beatrun/gamemodes/beatrun/content/resource/localization/ru/beatrun.properties +++ b/beatrun/gamemodes/beatrun/content/resource/localization/ru/beatrun.properties @@ -241,4 +241,5 @@ beatrun.infection.awardinfected=Вы получили 100 XP за спавн з beatrun.infection.end=Игра окончена!\nВыжившие: %s\nПерезапуск через 15 сек # Server ConVars -beatrun.randomloadouts.helptext=Переключает случайные наборы оружия MW Base в Deathmatch и DataTheft +beatrun.randommwloadouts=Случайные наборы оружия MW Base +beatrun.randommwloadoutsdesc=Переключает случайные наборы оружия MW Base в Deathmatch и DataTheft diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua b/beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua index 3814fda..c770a8c 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua @@ -334,6 +334,9 @@ hook.Add("PopulateToolMenu", "Beatrun_ToolMenu", function() end panel:AddItem(InfectionButton) + panel:CheckBox("#beatrun.randommwloadouts", "Beatrun_RandomMWLoadoutsqw") + panel:ControlHelp("#beatrun.randommwloadoutsdesc") + local DatatheftButton = vgui.Create("DButton", panel) DatatheftButton:SetText("#beatrun.toolsmenu.gamemodes.datatheft") DatatheftButton:SetSize(0, 20) diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Deathmatch.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Deathmatch.lua index e655cb2..038a127 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Deathmatch.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Deathmatch.lua @@ -2,7 +2,7 @@ if SERVER then util.AddNetworkString("Deathmatch_Start") util.AddNetworkString("Deathmatch_Sync") - CreateConVar("Beatrun_RandomMWLoadouts", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "#beatrun.randomloadouts.helptext") + CreateConVar("Beatrun_RandomMWLoadouts", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE}) function getRandomMGBaseWeapon() local allWep = weapons.GetList()