add hotkey config values.

duplicate DlgInputConfig so that it can also do hotkey config.
also prevent from opening those config dialogs a billion times.
This commit is contained in:
StapleButter
2018-12-14 03:32:40 +01:00
parent cb1e6ce750
commit ff1e21733d
7 changed files with 203 additions and 93 deletions

View File

@ -33,6 +33,7 @@ void ApplyNewSettings();
namespace DlgEmuSettings
{
bool opened;
uiWindow* win;
uiCheckbox* cbDirectBoot;
@ -42,12 +43,14 @@ uiCheckbox* cbBindAnyAddr;
int OnCloseWindow(uiWindow* window, void* blarg)
{
opened = false;
return 1;
}
void OnCancel(uiButton* btn, void* blarg)
{
uiControlDestroy(uiControl(win));
opened = false;
}
void OnOk(uiButton* btn, void* blarg)
@ -59,12 +62,20 @@ void OnOk(uiButton* btn, void* blarg)
Config::Save();
uiControlDestroy(uiControl(win));
opened = false;
ApplyNewSettings();
}
void Open()
{
if (opened)
{
uiControlSetFocus(uiControl(win));
return;
}
opened = true;
win = uiNewWindow("Emu settings - melonDS", 300, 200, 0, 0);
uiWindowSetMargined(win, 1);
uiWindowOnClosing(win, OnCloseWindow, NULL);