summaryrefslogtreecommitdiffstats
path: root/game/client/toggles.cc
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-09-11 13:48:31 +0500
committeruntodesu <kirill@untode.su>2025-09-11 13:48:31 +0500
commitaaed751bf4430bf4b9b30cef532b8753b9f639ce (patch)
tree16bc751c272ba27ad53ec48dbdd3a6d9e6a8d4c2 /game/client/toggles.cc
parent96bd73ae020ecca1f94698744c77498a89ad19f7 (diff)
downloadvoxelius-aaed751bf4430bf4b9b30cef532b8753b9f639ce.tar.bz2
voxelius-aaed751bf4430bf4b9b30cef532b8753b9f639ce.zip
Replace most of C strings with string_view
Diffstat (limited to 'game/client/toggles.cc')
-rw-r--r--game/client/toggles.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/game/client/toggles.cc b/game/client/toggles.cc
index 96c4ae4..e6ffc26 100644
--- a/game/client/toggles.cc
+++ b/game/client/toggles.cc
@@ -13,7 +13,7 @@
#include "client/globals.hh"
struct ToggleInfo final {
- const char* description;
+ std::string_view description;
int glfw_keycode;
bool is_enabled;
};
@@ -24,7 +24,7 @@ static ToggleInfo toggle_infos[TOGGLE_COUNT];
static void print_toggle_state(const ToggleInfo& info)
{
- if(info.description) {
+ if(info.description.size()) {
if(info.is_enabled) {
gui::client_chat::print(std::format("[toggles] {} ON", info.description));
}
@@ -102,7 +102,7 @@ void toggles::init(void)
toggle_infos[TOGGLE_CHUNK_AABB].glfw_keycode = GLFW_KEY_G;
toggle_infos[TOGGLE_CHUNK_AABB].is_enabled = false;
- toggle_infos[TOGGLE_METRICS_UI].description = nullptr;
+ toggle_infos[TOGGLE_METRICS_UI].description = std::string_view();
toggle_infos[TOGGLE_METRICS_UI].glfw_keycode = GLFW_KEY_V;
toggle_infos[TOGGLE_METRICS_UI].is_enabled = false;
@@ -114,10 +114,6 @@ void toggles::init(void)
toggle_infos[TOGGLE_PM_FLIGHT].glfw_keycode = GLFW_KEY_F;
toggle_infos[TOGGLE_PM_FLIGHT].is_enabled = false;
-#ifndef NDEBUG
- toggle_infos[TOGGLE_WIREFRAME].is_enabled = true;
-#endif
-
globals::dispatcher.sink<io::GlfwKeyEvent>().connect<&on_glfw_key>();
}