Skip to content

Commit

Permalink
Add a new binding to stop the emulation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arignir committed Mar 8, 2024
1 parent eb2aea1 commit 4bd7759
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/app/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ enum bind_actions {
BIND_EMULATOR_QUICKSAVE,
BIND_EMULATOR_QUICKLOAD,
BIND_EMULATOR_PAUSE,
BIND_EMULATOR_STOP,
BIND_EMULATOR_RESET,

BIND_MAX,
Expand Down
1 change: 1 addition & 0 deletions source/app/bindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ app_bindings_handle(
case BIND_EMULATOR_QUICKSAVE: app_emulator_quicksave(app, 0); break;
case BIND_EMULATOR_QUICKLOAD: app_emulator_quickload(app, 0); break;
case BIND_EMULATOR_PAUSE: app->emulation.is_running ? app_emulator_pause(app) : app_emulator_run(app); break;
case BIND_EMULATOR_STOP: app_emulator_stop(app); break;
case BIND_EMULATOR_RESET: app_emulator_reset(app); break;
default: break;
}
Expand Down
4 changes: 2 additions & 2 deletions source/app/windows/menubar.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <cimgui.h>
#include <nfd.h>
#include <stdio.h>
#include <float.h>
#include "hades.h"
#include "app/app.h"
#include "compat.h"
Expand Down Expand Up @@ -194,7 +193,8 @@ app_win_menubar_emulation(
}
}

if (igMenuItem_Bool("Stop", NULL, false, app->emulation.is_started)) {
bind = SDL_GetKeyName(app->binds.keyboard[BIND_EMULATOR_STOP]);
if (igMenuItem_Bool("Stop", bind ?: "", false, app->emulation.is_started)) {
app_emulator_stop(app);
}

Expand Down
2 changes: 2 additions & 0 deletions source/app/windows/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ char const * const binds_pretty_name[] = {
[BIND_EMULATOR_QUICKSAVE] = "Quicksave",
[BIND_EMULATOR_QUICKLOAD] = "Quickload",
[BIND_EMULATOR_PAUSE] = "Pause",
[BIND_EMULATOR_STOP] = "Stop",
[BIND_EMULATOR_RESET] = "Reset",
};

Expand All @@ -107,6 +108,7 @@ char const * const binds_slug[] = {
[BIND_EMULATOR_QUICKSAVE] = "quicksave",
[BIND_EMULATOR_QUICKLOAD] = "quickload",
[BIND_EMULATOR_PAUSE] = "pause",
[BIND_EMULATOR_STOP] = "stop",
[BIND_EMULATOR_RESET] = "reset",
};

Expand Down

0 comments on commit 4bd7759

Please sign in to comment.