diff options
| author | untodesu <kirill@untode.su> | 2025-03-21 18:16:40 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-03-21 18:16:40 +0500 |
| commit | 9f80a278a6f188c8e9131df0684bad14a07491ee (patch) | |
| tree | 067c6ad4b892a34c3c03e3ecdbe312453bd46ea4 /game/client/game.cc | |
| parent | fddd7f761176bb45cfdd41eeccaeadac22d33ddf (diff) | |
| download | voxelius-9f80a278a6f188c8e9131df0684bad14a07491ee.tar.bz2 voxelius-9f80a278a6f188c8e9131df0684bad14a07491ee.zip | |
Toggles system rework, added flight pmove mode
- Reworked toggles to use a constant-styled enumerations
- Added TOGGLE_PM_FLIGHT and an according movement mode. Now server-side
just doesn't simulate gravity altogether for players, instead relying
on whatever the client provides which works fine for now. Closes #12
Diffstat (limited to 'game/client/game.cc')
| -rw-r--r-- | game/client/game.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/game/client/game.cc b/game/client/game.cc index 72e1dc5..af6fba6 100644 --- a/game/client/game.cc +++ b/game/client/game.cc @@ -354,6 +354,8 @@ void client_game::init(void) void client_game::init_late(void) { + toggles::init_late(); + sound::init_late(); language::init_late(); @@ -498,7 +500,14 @@ void client_game::fixed_update_late(void) void client_game::update(void) { + if(session::is_ingame()) { + if(toggles::get(TOGGLE_PM_FLIGHT)) + globals::dimension->entities.remove<GravityComponent>(globals::player); + else globals::dimension->entities.emplace_or_replace<GravityComponent>(globals::player); + } + sound::update(); + listener::update(); interpolation::update(); @@ -616,7 +625,7 @@ void client_game::layout(void) } if(!globals::gui_screen || (globals::gui_screen == GUI_CHAT)) { - if(toggles::draw_metrics && !client_game::hide_hud) { + if(toggles::get(TOGGLE_METRICS_UI) && !client_game::hide_hud) { // This contains Minecraft-esque debug information // about the hardware, world state and other // things that might be uesful |
