diff options
author | Tarek Soliman | 2012-02-09 02:10:19 -0600 |
---|---|---|
committer | Tarek Soliman | 2012-02-09 02:15:35 -0600 |
commit | 38dea529e8bfa3ae88011751f6c35c02dfe61668 (patch) | |
tree | 87ce538495f7bc9fc28b2b52ffb20b17682e330e | |
parent | 0d6b4df0141fb85d56d8083bdae81b06660e5947 (diff) | |
download | scummvm-rg350-38dea529e8bfa3ae88011751f6c35c02dfe61668.tar.gz scummvm-rg350-38dea529e8bfa3ae88011751f6c35c02dfe61668.tar.bz2 scummvm-rg350-38dea529e8bfa3ae88011751f6c35c02dfe61668.zip |
KEYMAPPER: Display active keymap stack in remap dialog popup list
This should make it clear what keymaps are on the stack and in
what order.
Also renamed the label of the top "special" entry in the list to
"(Effective)" since it displays the top keymap's action and also
displays reachable mapped actions from other active keymaps.
-rw-r--r-- | backends/keymapper/remap-dialog.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp index 8f187778d8..bf4144a59f 100644 --- a/backends/keymapper/remap-dialog.cpp +++ b/backends/keymapper/remap-dialog.cpp @@ -61,7 +61,7 @@ void RemapDialog::open() { const Stack<Keymapper::MapRecord> &activeKeymaps = _keymapper->getActiveStack(); if (activeKeymaps.size() > 0) { - _kmPopUp->appendEntry(activeKeymaps.top().keymap->getName() + _(" (Active)")); + _kmPopUp->appendEntry(activeKeymaps.top().keymap->getName() + _(" (Effective)")); divider = true; } @@ -84,6 +84,10 @@ void RemapDialog::open() { keymapCount += _gameKeymaps->size(); } + if (activeKeymaps.size() > 1) { + keymapCount += activeKeymaps.size() - 1; + } + debug(3, "RemapDialog::open keymaps: %d", keymapCount); _keymapTable = (Keymap **)malloc(sizeof(Keymap*) * keymapCount); @@ -91,6 +95,18 @@ void RemapDialog::open() { Keymapper::Domain::iterator it; uint32 idx = 0; + if (activeKeymaps.size() > 1) { + if (divider) + _kmPopUp->appendEntry(""); + int topIndex = activeKeymaps.size() - 1; + for (int i = topIndex - 1; i >= 0; --i) { + Keymapper::MapRecord mr = activeKeymaps[i]; + _kmPopUp->appendEntry(mr.keymap->getName() + _(" (Active)"), idx); + _keymapTable[idx++] = mr.keymap; + } + divider = true; + } + if (_globalKeymaps) { if (divider) _kmPopUp->appendEntry(""); @@ -108,6 +124,7 @@ void RemapDialog::open() { _kmPopUp->appendEntry(it->_value->getName() + _(" (Game)"), idx); _keymapTable[idx++] = it->_value; } + divider = true; } _changes = false; |