Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
feat: fix crash when clicking on button in settings panel
Browse files Browse the repository at this point in the history
  • Loading branch information
LPkkjHD committed Jun 18, 2024
1 parent 9af1846 commit e10894c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion game/core/src/main/de/dhbw/tinf22b6/ui/menu/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ public void clicked(InputEvent event, float x, float y) {
currentEntry.setText(Input.Keys.toString(lastKeyCode));
}

currentEntry = (TextButton) event.getTarget().getParent();
if (event.getTarget().getParent() instanceof Table) currentEntry = (TextButton) event.getTarget();
else currentEntry = (TextButton) event.getTarget().getParent();
lastKeyCode = Input.Keys.valueOf(currentEntry.getText().toString());
currentEntry.setText("Press a Button");
super.clicked(event, x, y);
Expand Down

0 comments on commit e10894c

Please sign in to comment.