mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
F1 hud toggle + old worlds load fix
This commit is contained in:
parent
d75d75eeb8
commit
3e98526a24
3 changed files with 14 additions and 6 deletions
|
|
@ -125,6 +125,9 @@ void LevelScreen::updateHotkeys() {
|
|||
if (Events::jpressed(keycode::O)) {
|
||||
settings.graphics.frustumCulling = !settings.graphics.frustumCulling;
|
||||
}
|
||||
if (Events::jpressed(keycode::F1)) {
|
||||
hudVisible = !hudVisible;
|
||||
}
|
||||
if (Events::jpressed(keycode::F3)) {
|
||||
level->player->debug = !level->player->debug;
|
||||
}
|
||||
|
|
@ -172,7 +175,8 @@ void LevelScreen::update(float delta) {
|
|||
level->world->updateTimers(delta);
|
||||
}
|
||||
controller->update(delta, !inputLocked, hud->isPause());
|
||||
hud->update();
|
||||
if (hudVisible)
|
||||
hud->update();
|
||||
}
|
||||
|
||||
void LevelScreen::draw(float delta) {
|
||||
|
|
@ -182,8 +186,11 @@ void LevelScreen::draw(float delta) {
|
|||
GfxContext ctx(nullptr, viewport, nullptr);
|
||||
|
||||
worldRenderer->draw(ctx, camera);
|
||||
hud->draw(ctx);
|
||||
if (level->player->debug) {
|
||||
hud->drawDebug(1 / delta);
|
||||
|
||||
if (hudVisible) {
|
||||
hud->draw(ctx);
|
||||
if (level->player->debug) {
|
||||
hud->drawDebug(1 / delta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue