tecla 9 per entrar i eixir del editor
This commit is contained in:
@@ -141,3 +141,5 @@ game:
|
||||
cheat_jail_open: "JAIL OBERTA"
|
||||
debug_enabled: "DEBUG ACTIVAT"
|
||||
debug_disabled: "DEBUG DESACTIVAT"
|
||||
editor_enabled: "EDITOR ACTIVAT"
|
||||
editor_disabled: "EDITOR DESACTIVAT"
|
||||
|
||||
@@ -141,3 +141,5 @@ game:
|
||||
cheat_jail_open: "JAIL IS OPEN"
|
||||
debug_enabled: "DEBUG ENABLED"
|
||||
debug_disabled: "DEBUG DISABLED"
|
||||
editor_enabled: "EDITOR ENABLED"
|
||||
editor_disabled: "EDITOR DISABLED"
|
||||
|
||||
@@ -3,15 +3,15 @@ enemies:
|
||||
animation: code.yaml
|
||||
boundaries:
|
||||
position1:
|
||||
x: 5
|
||||
y: 13
|
||||
x: 3
|
||||
y: 2
|
||||
position2:
|
||||
x: 16
|
||||
y: 13
|
||||
x: 20
|
||||
y: 2
|
||||
color: yellow
|
||||
position:
|
||||
x: 11
|
||||
y: 13
|
||||
x: 8
|
||||
y: 2
|
||||
velocity:
|
||||
x: 24.0
|
||||
y: 0
|
||||
|
||||
@@ -168,7 +168,16 @@ void Game::handleEvents() {
|
||||
GlobalEvents::handle(event);
|
||||
#ifdef _DEBUG
|
||||
if (!Console::get()->isActive()) {
|
||||
// Tecla 9: toggle editor (funciona tanto dentro como fuera del editor)
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_9 && static_cast<int>(event.key.repeat) == 0) {
|
||||
if (MapEditor::get()->isActive()) {
|
||||
GameControl::exit_editor();
|
||||
Notifier::get()->show({Locale::get()->get("game.editor_disabled")}); // NOLINT(readability-static-accessed-through-instance)
|
||||
} else {
|
||||
GameControl::enter_editor();
|
||||
Notifier::get()->show({Locale::get()->get("game.editor_enabled")}); // NOLINT(readability-static-accessed-through-instance)
|
||||
}
|
||||
} else if (MapEditor::get()->isActive()) {
|
||||
MapEditor::get()->handleEvent(event);
|
||||
} else {
|
||||
handleDebugEvents(event);
|
||||
|
||||
Reference in New Issue
Block a user