From 2676f8cd29c69a25e7a938ea69144a942bacbbaa Mon Sep 17 00:00:00 2001 From: Vaxry Date: Thu, 3 Oct 2024 19:20:43 +0100 Subject: [PATCH] update config value code --- pages/Contributing and Debugging/PR-Guidelines.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/Contributing and Debugging/PR-Guidelines.md b/pages/Contributing and Debugging/PR-Guidelines.md index c02bb44..4af1bd3 100644 --- a/pages/Contributing and Debugging/PR-Guidelines.md +++ b/pages/Contributing and Debugging/PR-Guidelines.md @@ -22,7 +22,10 @@ Every variable from the config needs to be found in a hashmap. To limit the amount of hashmap searches, getting a config option looks like this: ```cpp -static auto* const PFOLLOWMOUSE = &g_pConfigManager->getConfigValuePtr("input:follow_mouse")->intValue; +static const auto PVARIABLE = CConfigValue("name"); + +// e.g. +static const auto PBORDERSIZE = CConfigValue("general:border_size"); ``` Since the hashmap _cannot_ be mutated during runtime, this pointer will always