Introduce F1 menu to reconfigure key bindings at runtime
This commit is contained in:
parent
af145c3a01
commit
dd73db2e9d
17 changed files with 1837 additions and 136 deletions
src
10
src/main.cpp
10
src/main.cpp
|
@ -238,7 +238,7 @@ int main(int argc, char *argv[])
|
|||
SDL_SetHint("SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS", "0");
|
||||
|
||||
SDL_Window *win;
|
||||
Uint32 winFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN;
|
||||
Uint32 winFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_INPUT_FOCUS;
|
||||
|
||||
if (conf.winResizable)
|
||||
winFlags |= SDL_WINDOW_RESIZABLE;
|
||||
|
@ -268,6 +268,9 @@ int main(int argc, char *argv[])
|
|||
EventThread eventThread;
|
||||
RGSSThreadData rtData(&eventThread, argv[0], win, conf);
|
||||
|
||||
/* Load and post key bindings */
|
||||
rtData.bindingUpdateMsg.post(loadBindings(conf));
|
||||
|
||||
/* Start RGSS thread */
|
||||
SDL_Thread *rgssThread =
|
||||
SDL_CreateThread(rgssThreadFun, "rgss", &rtData);
|
||||
|
@ -310,6 +313,11 @@ int main(int argc, char *argv[])
|
|||
/* Clean up any remainin events */
|
||||
eventThread.cleanup();
|
||||
|
||||
/* Store key bindings */
|
||||
BDescVec keyBinds;
|
||||
rtData.bindingUpdateMsg.get(keyBinds);
|
||||
storeBindings(keyBinds, rtData.config);
|
||||
|
||||
Debug() << "Shutting down.";
|
||||
|
||||
SDL_DestroyWindow(win);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue