mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
Forenkler jobben til skjermer som implementerer InteractiveScreen
InteractiveScreen legger seg selv til input multiplekseren
This commit is contained in:
parent
4e44d44be7
commit
4b9eadc9f2
@ -55,7 +55,6 @@ public class BoardActiveScreen extends InteractiveScreen {
|
||||
@Override
|
||||
public void show() {
|
||||
super.show();
|
||||
inputMultiplexer.addProcessor(this);
|
||||
resetCamera();
|
||||
}
|
||||
|
||||
|
@ -58,8 +58,6 @@ public class CardChoiceScreen extends InteractiveScreen implements Screen {
|
||||
shapeRenderer = new ShapeRenderer();
|
||||
shapeRenderer.setAutoShapeType(true);
|
||||
|
||||
inputMultiplexer = new InputMultiplexer();
|
||||
|
||||
generateCards(deck);
|
||||
this.chosenCards = new ArrayList<>();
|
||||
|
||||
@ -70,8 +68,6 @@ public class CardChoiceScreen extends InteractiveScreen implements Screen {
|
||||
|
||||
confirmCards.addListener(getConfirmListener());
|
||||
stage.setViewport(viewport);
|
||||
inputMultiplexer.addProcessor(this);
|
||||
inputMultiplexer.addProcessor(stage);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -144,7 +140,6 @@ public class CardChoiceScreen extends InteractiveScreen implements Screen {
|
||||
@Override
|
||||
public void show() {
|
||||
super.show();
|
||||
Gdx.input.setInputProcessor(inputMultiplexer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,6 +6,12 @@ import com.badlogic.gdx.InputProcessor;
|
||||
* This class overrides all InputProcessor methods to make cleaner abstract screens with input processors
|
||||
*/
|
||||
public abstract class InteractiveScreen extends AbstractScreen implements InputProcessor {
|
||||
@Override
|
||||
public void show() {
|
||||
super.show();
|
||||
inputMultiplexer.addProcessor(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean keyDown(int i) {
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user