F1 hud toggle + old worlds load fix
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user