mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
feat: go back in menu on Escape pressed
This commit is contained in:
parent
7b45b4083b
commit
c565e9897f
3 changed files with 13 additions and 2 deletions
|
|
@ -26,6 +26,7 @@
|
|||
#include "graphics/core/ImageData.hpp"
|
||||
#include "graphics/core/Shader.hpp"
|
||||
#include "graphics/ui/GUI.hpp"
|
||||
#include "graphics/ui/elements/Menu.hpp"
|
||||
#include "objects/rigging.hpp"
|
||||
#include "logic/EngineController.hpp"
|
||||
#include "logic/CommandsInterpreter.hpp"
|
||||
|
|
@ -154,6 +155,14 @@ void Engine::initializeClient() {
|
|||
},
|
||||
true
|
||||
));
|
||||
|
||||
keepAlive(this->input->addKeyCallback(Keycode::ESCAPE, [this]() {
|
||||
auto& menu = *gui->getMenu();
|
||||
if (menu.hasOpenPage() && menu.back()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}));
|
||||
}
|
||||
|
||||
void Engine::initialize(CoreParameters coreParameters) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue