-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/adding controls options #59
Feature/adding controls options #59
Conversation
3b2abe8
to
55b541b
Compare
Hi :), |
… into feature/adding-controls-options # Conflicts: # core/src/main/java/com/gdx/game/common/UtilityClass.java # core/src/main/java/com/gdx/game/screen/OptionScreen.java # core/src/main/resources/settings/keys.json
Those fix should have resolved the reported bug, I hope :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done overall !
You are almost there, only a few things left :)
I just commited small fixes on imports and typo so you don't have to bother with them.
optionTable = createTable(); | ||
handleControlButton(); | ||
if (gameState == null) handleControlButton(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i want to keep the possibility that the player can update his settings while playing, so no if condition :)
TextField quitText = new TextField( | ||
Input.Keys.toString(Integer.parseInt(playerControlsNew.get(InputComponent.Keys.QUIT.name()))), skin); | ||
|
||
playerControlsNew = mapInverter(playerControlsNew); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the use of this mapInverter and the one line 129?
do you need the two of them?
HashMap<String, String> controlMap; | ||
|
||
try { | ||
controlMap = json.fromJson(HashMap.class, Gdx.files.local(PARTIAL_CONTROLS_SETTINGS_PATH)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as you are loading the controls from a file you created in the same game session, the new controls are not activate unless you restart the game (that's probably why you added an if condition on the control settings page in game).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is not necessarily to restart application cause I've added the save of the json in the back button 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed it saves the changes, but my point is that the controls are not applied in the current play session it seems.
For example, if i have "W" to move forward and i rebind to "U", i then start or load a game, i will still have "W" as the key to move forward.
If i relaunch the app and start/load a game without touching the controls, i will have the "U" key bind to move forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have right, I'm sorry. I'll fix that asap :)
…at force to restart the game for apply controls changes
Well done ! |
Added the controls settings menu