Anleitungsscreen(#18)

main
Johannes Hochwart 3 years ago
parent ecf6f6fdec
commit 50eb22219b

@ -16,7 +16,7 @@ import eu.jonahbauer.wizard.common.model.Card;
public class InstructionScreen extends MenuScreen { public class InstructionScreen extends MenuScreen {
private static final int MAX_PAGE = 3; private static final int MAX_PAGE = 3;
private TextButton buttonOK; private TextButton buttonBack;
private VerticalGroup content; private VerticalGroup content;
private ScrollPane scrollPane; private ScrollPane scrollPane;
private TextButton nextPageButton; private TextButton nextPageButton;
@ -29,7 +29,7 @@ public class InstructionScreen extends MenuScreen {
private final ChangeListener listener = new ChangeListener() { private final ChangeListener listener = new ChangeListener() {
@Override @Override
public void changed(ChangeEvent event, Actor actor) { public void changed(ChangeEvent event, Actor actor) {
if (actor == buttonOK) { if (actor == buttonBack) {
game.getClient().execute(Menu.class, Menu::showMenuScreen); game.getClient().execute(Menu.class, Menu::showMenuScreen);
sfxClick(); sfxClick();
} else if (actor == nextPageButton) { } else if (actor == nextPageButton) {
@ -70,9 +70,9 @@ public class InstructionScreen extends MenuScreen {
previousPageButton.addListener(listener); previousPageButton.addListener(listener);
getButtonGroup().addActor(previousPageButton); getButtonGroup().addActor(previousPageButton);
buttonOK = new TextButton(messages.get("menu.instruction.back"), skin); buttonBack = new TextButton(messages.get("menu.instruction.back"), skin);
buttonOK.addListener(listener); buttonBack.addListener(listener);
getButtonGroup().addActor(buttonOK); getButtonGroup().addActor(buttonBack);
nextPageButton = new TextButton(messages.get("menu.instruction.nextPageButton"), skin); nextPageButton = new TextButton(messages.get("menu.instruction.nextPageButton"), skin);
nextPageButton.addListener(listener); nextPageButton.addListener(listener);
@ -83,7 +83,7 @@ public class InstructionScreen extends MenuScreen {
scrollPane.setSize(0.65f * WizardGame.WIDTH, 400 + 0.1f * WizardGame.HEIGHT + 80); scrollPane.setSize(0.65f * WizardGame.WIDTH, 400 + 0.1f * WizardGame.HEIGHT + 80);
stage.addActor(scrollPane); stage.addActor(scrollPane);
stage.addCaptureListener(new KeyboardFocusManager(scrollPane, previousPageButton, buttonOK, nextPageButton)); stage.addCaptureListener(new KeyboardFocusManager(scrollPane, previousPageButton, buttonBack, nextPageButton));
showFirstPage(); showFirstPage();
} }
@ -166,9 +166,8 @@ public class InstructionScreen extends MenuScreen {
reset(); reset();
startSection("menu.instruction.variant.title"); startSection("menu.instruction.variant.title");
addParagraph("menu.instruction.variant.intro");
Label variantsIntro = new Label(messages.get("menu.instruction.variant.intro"), skin);
content.addActor(variantsIntro);
Table table = new Table(skin).padTop(10); Table table = new Table(skin).padTop(10);
table.defaults().space(10.0f).left().top(); table.defaults().space(10.0f).left().top();
table.columnDefaults(1).grow(); table.columnDefaults(1).grow();

Loading…
Cancel
Save