UI: Allow overriding dialog logic on finish.

This seems cleaner.
This commit is contained in:
Unknown W. Brackets committed 2017-03-19 17:43:03 -07:00
1 parent d8600229f4
commit 073e056369
12 files changed
+37 -31

No files matched your search

+4 -4
View File
@@ -310,7 +310,7 @@ bool KeyMappingNewKeyDialog::key(const KeyInput &key) {
mapped_ = true;
KeyDef kdf(key.deviceId, key.keyCode);
screenManager()->finishDialog(this, DR_OK);
TriggerFinish(DR_OK);
if (callback_)
callback_(kdf);
}
@@ -347,7 +347,7 @@ bool KeyMappingNewKeyDialog::axis(const AxisInput &axis) {
if (axis.value > AXIS_BIND_THRESHOLD) {
mapped_ = true;
KeyDef kdf(axis.deviceId, KeyMap::TranslateKeyCodeFromAxis(axis.axisId, 1));
screenManager()->finishDialog(this, DR_OK);
TriggerFinish(DR_OK);
if (callback_)
callback_(kdf);
}
@@ -355,7 +355,7 @@ bool KeyMappingNewKeyDialog::axis(const AxisInput &axis) {
if (axis.value < -AXIS_BIND_THRESHOLD) {
mapped_ = true;
KeyDef kdf(axis.deviceId, KeyMap::TranslateKeyCodeFromAxis(axis.axisId, -1));
screenManager()->finishDialog(this, DR_OK);
TriggerFinish(DR_OK);
if (callback_)
callback_(kdf);
}
@@ -437,7 +437,7 @@ void JoystickHistoryView::Update() {
bool AnalogTestScreen::key(const KeyInput &key) {
bool retval = true;
if (UI::IsEscapeKey(key)) {
screenManager()->finishDialog(this, DR_BACK);
TriggerFinish(DR_BACK);
return true;
}