16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-17 23:39:18 +02:00

Editor settings for New/Legacy camera controll

This commit is contained in:
2026-06-16 23:53:01 +02:00
parent 1aac9b4e76
commit 3bed2212d7
9 changed files with 178 additions and 12 deletions

View File

@@ -9,6 +9,7 @@ http://mozilla.org/MPL/2.0/.
#include "stdafx.h"
#include "input/editorkeyboardinput.h"
#include "editor/editorSettings.hpp"
bool
editorkeyboard_input::init() {
@@ -21,17 +22,36 @@ editorkeyboard_input::init() {
return true;
}
void
editorkeyboard_input::apply_scheme() {
default_bindings();
bind();
}
void
editorkeyboard_input::default_bindings() {
m_bindingsetups = {
{ user_command::moveleft, {GLFW_KEY_A, "Move left"} },
{ user_command::moveright, {GLFW_KEY_D, "Move right"} },
{ user_command::moveforward, {GLFW_KEY_W, "Move forwards"} },
{ user_command::moveback, {GLFW_KEY_S, "Move backwards"} },
{ user_command::moveup, {GLFW_KEY_E, "Move up"} },
{ user_command::movedown, {GLFW_KEY_Q, "Move down"} },
};
if (EditorSettings.movement() == editorSettings::movement_scheme::legacy) {
m_bindingsetups = {
{ user_command::moveleft, {GLFW_KEY_LEFT, "Move left"} },
{ user_command::moveright, {GLFW_KEY_RIGHT, "Move right"} },
{ user_command::moveforward, {GLFW_KEY_UP, "Move forwards"} },
{ user_command::moveback, {GLFW_KEY_DOWN, "Move backwards"} },
{ user_command::moveup, {GLFW_KEY_PAGE_UP, "Move up"} },
{ user_command::movedown, {GLFW_KEY_PAGE_DOWN, "Move down"} },
};
}
else {
m_bindingsetups = {
{ user_command::moveleft, {GLFW_KEY_A, "Move left"} },
{ user_command::moveright, {GLFW_KEY_D, "Move right"} },
{ user_command::moveforward, {GLFW_KEY_W, "Move forwards"} },
{ user_command::moveback, {GLFW_KEY_S, "Move backwards"} },
{ user_command::moveup, {GLFW_KEY_E, "Move up"} },
{ user_command::movedown, {GLFW_KEY_Q, "Move down"} },
};
}
}
//---------------------------------------------------------------------------

View File

@@ -17,6 +17,9 @@ public:
// methods
bool
init() override;
// re-applies default bindings for the current movement scheme (e.g. after a settings change)
void
apply_scheme();
protected:
// methods