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

Commit

Permalink
feat: add sprint to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
LPkkjHD committed Jun 18, 2024
1 parent e10894c commit d28c595
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions game/core/src/main/de/dhbw/tinf22b6/ui/menu/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ public void changed(ChangeEvent event, Actor actor) {
btnDodge.addListener(new OptionsClickHandler());
contentTable.add(btnDodge).row();

contentTable.add(new Label("Inventory", skin));
TextButton btnInventory = new TextButton(Input.Keys.toString(preferences.getInteger("inventory")), skin);
contentTable.add(new Label("Run", skin));
TextButton btnInventory = new TextButton(Input.Keys.toString(preferences.getInteger("run")), skin);
btnInventory.addListener(new OptionsClickHandler());
contentTable.add(btnInventory).row();

contentTable.add(new Label("Interact", skin));
TextButton btnInteract = new TextButton(Input.Keys.toString(preferences.getInteger("interact")), skin);
btnInventory.addListener(new OptionsClickHandler());
btnInteract.addListener(new OptionsClickHandler());
contentTable.add(btnInteract).row();

Button btnBack = new Button(skin);
Expand All @@ -117,8 +117,8 @@ public void clicked(InputEvent event, float x, float y) {
currentEntry.setText(Input.Keys.toString(lastKeyCode));
}

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

0 comments on commit d28c595

Please sign in to comment.