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
|
* @return true if successfully bind
|
||||||
*/
|
*/
|
||||||
public boolean bindKeyToAction(KeyCode keyCode, KeyAction keyAction) {
|
public boolean bindKeyToAction(KeyCode keyCode, KeyAction keyAction) {
|
||||||
if (instance.keyToActionMap.containsKey(keyCode) && !(instance.keyToActionMap.get(keyCode)
|
if (instance.keyToActionMap.containsKey(keyCode)) {
|
||||||
== keyAction)) {
|
|
||||||
// if the key has been bound to other action, return false
|
// if the key has been bound to other action, return false
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ public class ViewManager {
|
|||||||
decorator.getStylesheets().remove(1);
|
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 BEGIN--------//
|
||||||
@FXML
|
@FXML
|
||||||
|
private Label keyBindingDialogHeader;
|
||||||
|
@FXML
|
||||||
private Label closeLabel;
|
private Label closeLabel;
|
||||||
@FXML
|
@FXML
|
||||||
private JFXButton zoomInbtn;
|
private JFXButton zoomInbtn;
|
||||||
@@ -77,6 +79,9 @@ public class KeyBindingDialogController implements Initializable {
|
|||||||
});
|
});
|
||||||
|
|
||||||
closeLabel.setOnMouseClicked(event -> ViewManager.getInstance().closeKeyBindingDialog());
|
closeLabel.setOnMouseClicked(event -> ViewManager.getInstance().closeKeyBindingDialog());
|
||||||
|
|
||||||
|
keyBindingDialogHeader.setFocusTraversable(true);
|
||||||
|
keyBindingDialogHeader.requestFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -153,14 +158,15 @@ public class KeyBindingDialogController implements Initializable {
|
|||||||
* @param button
|
* @param button
|
||||||
*/
|
*/
|
||||||
private void keyPressed(KeyEvent event, Button button) {
|
private void keyPressed(KeyEvent event, Button button) {
|
||||||
|
event.consume();
|
||||||
KeyAction buttonAction = buttonActionMap.get(button);
|
KeyAction buttonAction = buttonActionMap.get(button);
|
||||||
if (gameKeyBind.bindKeyToAction(event.getCode(), buttonAction)) {
|
if (gameKeyBind.bindKeyToAction(event.getCode(), buttonAction)) {
|
||||||
showSnackBar(button.getId() + " is set to " + event.getCode().getName(), false);
|
showSnackBar(button.getId() + " is set to " + event.getCode().getName(), false);
|
||||||
button.setText(gameKeyBind.getKeyCode(buttonAction).getName());
|
button.setText(gameKeyBind.getKeyCode(buttonAction).getName());
|
||||||
} else {
|
} else {
|
||||||
|
loadKeyBind();
|
||||||
showSnackBar(event.getCode().getName() + " is already in use", true);
|
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-text-fill: -fx-pp-theme-color;
|
||||||
-fx-font-size: 13px;
|
-fx-font-size: 13px;
|
||||||
-fx-pref-height: 35px;
|
-fx-pref-height: 35px;
|
||||||
|
-fx-focus-traversable: false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#chatSend:hover {
|
#chatSend:hover {
|
||||||
|
|||||||
Reference in New Issue
Block a user