Fixed send button traversable issue.

- removed sensitive characters.

#story[1278] #pair[hyi25, zyt10]
This commit is contained in:
Zhi You Tan
2017-09-25 17:06:36 +13:00
parent 191b818e38
commit 0e93be7b36
4 changed files with 10 additions and 4 deletions
+1 -2
View File
@@ -53,8 +53,7 @@ public class GameKeyBind {
* @return true if successfully bind
*/
public boolean bindKeyToAction(KeyCode keyCode, KeyAction keyAction) {
if (instance.keyToActionMap.containsKey(keyCode) && !(instance.keyToActionMap.get(keyCode)
== keyAction)) {
if (instance.keyToActionMap.containsKey(keyCode)) {
// if the key has been bound to other action, return false
return false;
} else {
@@ -243,7 +243,7 @@ public class ViewManager {
decorator.getStylesheets().remove(1);
}
}
jfxSnackbar.show(snackbarText, "fuck", 1500);
jfxSnackbar.show(snackbarText, 1500);
}
/**
@@ -23,6 +23,8 @@ public class KeyBindingDialogController implements Initializable {
//--------FXML BEGIN--------//
@FXML
private Label keyBindingDialogHeader;
@FXML
private Label closeLabel;
@FXML
private JFXButton zoomInbtn;
@@ -77,6 +79,9 @@ public class KeyBindingDialogController implements Initializable {
});
closeLabel.setOnMouseClicked(event -> ViewManager.getInstance().closeKeyBindingDialog());
keyBindingDialogHeader.setFocusTraversable(true);
keyBindingDialogHeader.requestFocus();
}
/**
@@ -153,14 +158,15 @@ public class KeyBindingDialogController implements Initializable {
* @param button
*/
private void keyPressed(KeyEvent event, Button button) {
event.consume();
KeyAction buttonAction = buttonActionMap.get(button);
if (gameKeyBind.bindKeyToAction(event.getCode(), buttonAction)) {
showSnackBar(button.getId() + " is set to " + event.getCode().getName(), false);
button.setText(gameKeyBind.getKeyCode(buttonAction).getName());
} else {
loadKeyBind();
showSnackBar(event.getCode().getName() + " is already in use", true);
}
event.consume();
}
/**
+1
View File
@@ -48,6 +48,7 @@ GridPane .timer * {
-fx-text-fill: -fx-pp-theme-color;
-fx-font-size: 13px;
-fx-pref-height: 35px;
-fx-focus-traversable: false;
}
#chatSend:hover {