mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
fix: input F1..F25 key codes & add binding 'chunks.reload'
This commit is contained in:
parent
d316a5f818
commit
ad62b759fb
8 changed files with 18 additions and 4 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue