diff options
author | Andrei Karas <akaras@inbox.ru> | 2009-10-09 23:27:51 +0300 |
---|---|---|
committer | Blue <bluesansdouze@gmail.com> | 2010-01-08 23:24:04 +0100 |
commit | 104266da0f92ab2a765598dde59bf2e7f6426484 (patch) | |
tree | ab3f08a5b362b9a77978513bbea75081afdfb5c5 /src | |
parent | c1ddf4c0840bb15016dc69af4a4751d09908393f (diff) | |
download | mana-client-104266da0f92ab2a765598dde59bf2e7f6426484.tar.gz mana-client-104266da0f92ab2a765598dde59bf2e7f6426484.tar.bz2 mana-client-104266da0f92ab2a765598dde59bf2e7f6426484.tar.xz mana-client-104266da0f92ab2a765598dde59bf2e7f6426484.zip |
Show first key binding conflict
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/setup_keyboard.cpp | 5 | ||||
-rw-r--r-- | src/keyboardconfig.cpp | 5 | ||||
-rw-r--r-- | src/keyboardconfig.h | 5 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/gui/setup_keyboard.cpp b/src/gui/setup_keyboard.cpp index d9117b8a..0f92d066 100644 --- a/src/gui/setup_keyboard.cpp +++ b/src/gui/setup_keyboard.cpp @@ -116,9 +116,8 @@ void Setup_Keyboard::apply() if (keyboard.hasConflicts()) { - new OkDialog(_("Key Conflict(s) Detected"), - _("Resolve them, or gameplay may result in strange " - "behaviour.")); + new OkDialog(_("Key Conflict(s) Detected."), + keyboard.getBindError()); } keyboard.setEnabled(true); keyboard.store(); diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index 8e021aa6..8dc2f0c5 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -165,10 +165,15 @@ bool KeyboardConfig::hasConflicts() (mKey[i].value == mKey[j].value) ) { + mBindError = strprintf(_("Conflict \"%s\" and \"%s\" keys. " + "Resolve them, or gameplay may result" + " in strange behaviour."), + mKey[i].caption.c_str(), mKey[j].caption.c_str()); return true; } } } + mBindError = ""; return false; } diff --git a/src/keyboardconfig.h b/src/keyboardconfig.h index b6a07f16..c6d0b723 100644 --- a/src/keyboardconfig.h +++ b/src/keyboardconfig.h @@ -139,6 +139,9 @@ class KeyboardConfig */ void refreshActiveKeys(); + std::string getBindError() + { return mBindError; } + /** * All the key functions. * KEY_NO_VALUE is used in initialization, and should be unchanged. @@ -225,6 +228,8 @@ class KeyboardConfig KeyFunction mKey[KEY_TOTAL]; /**< Pointer to all the key data */ Uint8 *mActiveKeys; /**< Stores a list of all the keys */ + + std::string mBindError; }; extern KeyboardConfig keyboard; |