Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(map): Streamline behaviour for the ttt2_enable_map_prefix_ convars #1669

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- Updated targetID to use `Vehicle:GetDriver` instead of the `ttt_driver` NWEntity (by @Histalek)
- Updated Russian and English localization files (by @Satton2)
- Updated old TTT HUD to show name of spectated player (by @somefnfplayerlol)
- Changes to the enabled map prefixes will not be announced to players anymore (by @Histalek)
- By default only `ttt` and `ttt2` map prefixes are enabled (by @Histalek)

## [v0.14.0b](https://github.com/TTT-2/TTT2/tree/v0.14.0b) (2024-09-20)

Expand Down
23 changes: 18 additions & 5 deletions lua/ttt2/libraries/map.lua
Original file line number Diff line number Diff line change
Expand Up @@ -502,19 +502,32 @@ local mapsPrefixes = {}
local mapsWSIDs = {}

if SERVER then
-- by default cs, de and test maps should be hidden
-- by default cs, de, gm and test maps should be hidden
-- while ttt and ttt2 maps should be shown

---
-- @realm server
CreateConVar("ttt2_enable_map_prefix_cs", "0", { FCVAR_ARCHIVE, FCVAR_NOTIFY })
CreateConVar("ttt2_enable_map_prefix_cs", "0", { FCVAR_ARCHIVE })

---
-- @realm server
CreateConVar("ttt2_enable_map_prefix_de", "0", { FCVAR_ARCHIVE, FCVAR_NOTIFY })
CreateConVar("ttt2_enable_map_prefix_de", "0", { FCVAR_ARCHIVE })

---
-- @realm server
CreateConVar("ttt2_enable_map_prefix_test", "0", { FCVAR_ARCHIVE, FCVAR_NOTIFY })
CreateConVar("ttt2_enable_map_prefix_gm", "0", { FCVAR_ARCHIVE })

---
-- @realm server
CreateConVar("ttt2_enable_map_prefix_test", "0", { FCVAR_ARCHIVE })

---
-- @realm server
CreateConVar("ttt2_enable_map_prefix_ttt", "1", { FCVAR_ARCHIVE })

---
-- @realm server
CreateConVar("ttt2_enable_map_prefix_ttt2", "1", { FCVAR_ARCHIVE })

---
-- Initializes the map list. Searches the file system for available maps, scans those maps
Expand Down Expand Up @@ -570,7 +583,7 @@ if SERVER then

---
-- @realm server
CreateConVar(convarName, "1", { FCVAR_ARCHIVE, FCVAR_NOTIFY })
CreateConVar(convarName, "0", { FCVAR_ARCHIVE })

-- because these convars are generated dynamically, replicated convars do not work here
SetGlobalBool(convarName, GetConVar(convarName):GetBool())
Expand Down
Loading