Added close button for keyBindingDialog.

- fixed that you cannot bind the key you are using.

#story[1278] #pair[hyi25, zyt10]
This commit is contained in:
Zhi You Tan
2017-09-25 16:31:28 +13:00
parent 19db6668da
commit 191b818e38
7 changed files with 43 additions and 11 deletions
+2 -1
View File
@@ -53,7 +53,8 @@ public class GameKeyBind {
* @return true if successfully bind
*/
public boolean bindKeyToAction(KeyCode keyCode, KeyAction keyAction) {
if (instance.keyToActionMap.containsKey(keyCode)) {
if (instance.keyToActionMap.containsKey(keyCode) && !(instance.keyToActionMap.get(keyCode)
== keyAction)) {
// if the key has been bound to other action, return false
return false;
} else {