diff options
author | Bertram <bertram@cegetel.net> | 2010-03-03 23:38:18 +0100 |
---|---|---|
committer | Bertram <bertram@cegetel.net> | 2010-03-03 23:38:18 +0100 |
commit | 1e52781e7d425cffcc6a5319b4cb5bf5eebe2ea9 (patch) | |
tree | 596305e9bfd4ad8448efd477a43f86490b1974c5 /src/keyboardconfig.cpp | |
parent | 8cc31b582f372238ce6bd2c86888d312cf1fe5b2 (diff) | |
parent | f5f7a7d5990d1133f714b6cd431aecf6a332fbd5 (diff) | |
download | mana-1e52781e7d425cffcc6a5319b4cb5bf5eebe2ea9.tar.gz mana-1e52781e7d425cffcc6a5319b4cb5bf5eebe2ea9.tar.bz2 mana-1e52781e7d425cffcc6a5319b4cb5bf5eebe2ea9.tar.xz mana-1e52781e7d425cffcc6a5319b4cb5bf5eebe2ea9.zip |
Merge branch 'master' of gitorious.org:mana/mana
Diffstat (limited to 'src/keyboardconfig.cpp')
-rw-r--r-- | src/keyboardconfig.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index 8d1f0bcd..7b462c25 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -156,15 +156,24 @@ bool KeyboardConfig::hasConflicts() { for (j = i, j++; j < KEY_TOTAL; j++) { - // Allow for item shortcut and emote keys to overlap - // as well as emote and ignore keys, but no other keys - if (!((((i >= KEY_SHORTCUT_1) && (i <= KEY_SHORTCUT_12)) && - ((j >= KEY_EMOTE_1) && (j <= KEY_EMOTE_12))) || - ((i == KEY_TOGGLE_CHAT) && (j == KEY_OK)) || - ((i == KEY_EMOTE) && - (j == KEY_IGNORE_INPUT_1 || j == KEY_IGNORE_INPUT_2))) && - (mKey[i].value == mKey[j].value) - ) + // Allow collisions between shortcut and emote keys + if ((i >= KEY_SHORTCUT_1 && i <= KEY_SHORTCUT_12) && (j >= KEY_EMOTE_1 && j <= KEY_EMOTE_12)) + continue; + + // Why? + if (i == KEY_TOGGLE_CHAT && j == KEY_OK) + continue; + + // Ignore keys can collide with anything. + if (j == KEY_IGNORE_INPUT_1 || j == KEY_IGNORE_INPUT_2) + continue; + + // If the one of the keys is not set, then no conflict can happen. + if (mKey[i].value == -1 || mKey[j].value == -1) + continue; + + // Finally test to see if a conflict DOES exist. + if (mKey[i].value == mKey[j].value) { mBindError = strprintf(_("Conflict \"%s\" and \"%s\" keys. " "Resolve them, or gameplay may result" |