From 0e63a828143e152f1bb162748075a050ea382e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laure=CE=B7t?= Date: Thu, 27 May 2021 12:03:52 +0200 Subject: [PATCH] fix: shootArrowButton did not work --- core/src/sagittarius/view/SettingsScreen.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/src/sagittarius/view/SettingsScreen.java b/core/src/sagittarius/view/SettingsScreen.java index 5503f6b..d840e0a 100644 --- a/core/src/sagittarius/view/SettingsScreen.java +++ b/core/src/sagittarius/view/SettingsScreen.java @@ -72,7 +72,7 @@ public class SettingsScreen extends BaseScreen { }); // Control buttons - VisTextButton shootArrow = new VisTextButton("mouse" + SagittariusGame.shootArrowButton);; + VisTextButton shootArrow = new VisTextButton(String.valueOf(SagittariusGame.shootArrowButton));; VisTextButton moveLeft = new VisTextButton(Keys.toString(SagittariusGame.moveLeftKey)); VisTextButton moveRight = new VisTextButton(Keys.toString(SagittariusGame.moveRightKey)); VisTextButton zoomIn = new VisTextButton(Keys.toString(SagittariusGame.zoomInKey)); @@ -93,7 +93,7 @@ public class SettingsScreen extends BaseScreen { zoomOut.setDisabled(true); } else if (!shootArrow.isDisabled() && capturing) { capturing = false; - shootArrow.setText("mouse" + button); + shootArrow.setText(String.valueOf(button)); moveLeft.setDisabled(false); moveRight.setDisabled(false); zoomIn.setDisabled(false); @@ -127,9 +127,7 @@ public class SettingsScreen extends BaseScreen { SagittariusGame.moveRightKey = Keys.valueOf(moveRight.getText().toString()); SagittariusGame.zoomInKey = Keys.valueOf(zoomIn.getText().toString()); SagittariusGame.zoomOutKey = Keys.valueOf(zoomOut.getText().toString()); - SagittariusGame.shootArrowButton = - Keys.valueOf(shootArrow.getText().toString().substring(5)); - + SagittariusGame.shootArrowButton = Integer.parseInt(shootArrow.getText().toString()); // Deactivate music or not if (disableMusic.isChecked() && SagittariusGame.music.isPlaying()) { SagittariusGame.music.stop();