fix: input F1..F25 key codes & add binding 'chunks.reload'

This commit is contained in:
MihailRis
2024-06-05 19:29:35 +03:00
parent d316a5f818
commit ad62b759fb
8 changed files with 18 additions and 4 deletions
+4 -3
View File
@@ -1,5 +1,6 @@
#include "LevelScreen.hpp"
#include "../../core_defs.hpp"
#include "../hud.hpp"
#include "../LevelFrontend.hpp"
#include "../../audio/audio.hpp"
@@ -47,6 +48,9 @@ LevelScreen::LevelScreen(Engine* engine, std::unique_ptr<Level> level)
keepAlive(settings.camera.fov.observe([=](double value) {
controller->getPlayer()->camera->setFov(glm::radians(value));
}));
keepAlive(Events::getBinding(BIND_CHUNKS_RELOAD).onactived.add([=](){
controller->getLevel()->chunks->saveAndClear();
}));
animator = std::make_unique<TextureAnimator>();
animator->addAnimations(assets->getAnimations());
@@ -114,9 +118,6 @@ void LevelScreen::updateHotkeys() {
if (Events::jpressed(keycode::F3)) {
controller->getPlayer()->debug = !controller->getPlayer()->debug;
}
if (Events::jpressed(keycode::F5)) {
controller->getLevel()->chunks->saveAndClear();
}
}
void LevelScreen::update(float delta) {