mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Fixed send button traversable issue.
- removed sensitive characters. #story[1278] #pair[hyi25, zyt10]
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+7
-1
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user