Skip to content

Commit

Permalink
fix: fix permanently disabled tutorial button when starting with cont…
Browse files Browse the repository at this point in the history
…roller controls
  • Loading branch information
BenjaminAmos committed Nov 5, 2021
1 parent 9a3facd commit 4c6b1bd
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
public class MainMenuScreen extends NUIScreenLayer {
@In
private SolApplication solApplication;
private UIButton tutorialButton;

@Override
public void initialise() {
Expand All @@ -40,8 +41,7 @@ public void initialise() {
musicManager.playMusic(OggMusicManager.MENU_MUSIC_SET, solApplication.getOptions());
}

UIButton tutorialButton = find("tutorialButton", UIButton.class);
tutorialButton.setEnabled(solApplication.getOptions().controlType != GameOptions.ControlType.CONTROLLER);
tutorialButton = find("tutorialButton", UIButton.class);
tutorialButton.subscribe(button -> {
solApplication.getMenuScreens().loading.setMode(true, "Imperial Small", true, new WorldConfig());
nuiManager.pushScreen(solApplication.getMenuScreens().loading);
Expand Down Expand Up @@ -76,6 +76,11 @@ public void initialise() {
});
}

@Override
public void onAdded() {
tutorialButton.setEnabled(solApplication.getOptions().controlType != GameOptions.ControlType.CONTROLLER);
}

@Override
public void update(float delta) {
super.update(delta);
Expand Down

0 comments on commit 4c6b1bd

Please sign in to comment.