added support for changeling and improved support for cloud and juggler
@ -0,0 +1,62 @@
|
||||
package eu.jonahbauer.wizard.client.libgdx.actions.overlay;
|
||||
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||
import com.badlogic.gdx.scenes.scene2d.InputEvent;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroup;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Label;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.VerticalGroup;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
|
||||
import eu.jonahbauer.wizard.client.libgdx.actors.CardActor;
|
||||
import eu.jonahbauer.wizard.client.libgdx.screens.GameScreen;
|
||||
import eu.jonahbauer.wizard.common.model.Card;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.EnumMap;
|
||||
|
||||
public class PlayChangelingOverlay extends Overlay implements InteractionOverlay {
|
||||
public PlayChangelingOverlay(@NotNull GameScreen gameScreen, long timeout) {
|
||||
super(gameScreen, timeout);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Actor createContent() {
|
||||
var root = new VerticalGroup().columnCenter().space(10);
|
||||
|
||||
var prompt = new Label(messages.get("game.overlay.play_changeling.prompt"), skin);
|
||||
var cardGroup = new HorizontalGroup().space(20);
|
||||
|
||||
var wizard = new CardActor(Card.CHANGELING_WIZARD, atlas);
|
||||
var jester = new CardActor(Card.CHANGELING_JESTER, atlas);
|
||||
cardGroup.addActor(wizard);
|
||||
cardGroup.addActor(jester);
|
||||
|
||||
cardGroup.addListener(new ClickListener() {
|
||||
@Override
|
||||
public void clicked(InputEvent event, float x, float y) {
|
||||
if (isClosing()) return;
|
||||
var target = event.getTarget();
|
||||
if (target == wizard) {
|
||||
screen.onCardClicked(Card.CHANGELING_WIZARD);
|
||||
} else if (target == jester) {
|
||||
screen.onCardClicked(Card.CHANGELING_JESTER);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
root.addActor(prompt);
|
||||
root.addActor(cardGroup);
|
||||
|
||||
var cancel = new TextButton(messages.get("game.overlay.play_changeling.cancel"), skin, "simple");
|
||||
cancel.addListener(new ChangeListener() {
|
||||
@Override
|
||||
public void changed(ChangeEvent event, Actor actor) {
|
||||
close();
|
||||
}
|
||||
});
|
||||
root.addActor(cancel);
|
||||
|
||||
return root;
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 222 KiB |
Before Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 226 KiB |
Before Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 277 KiB |
Before Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 297 KiB |
Before Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 285 KiB |
Before Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 244 KiB |
Before Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 289 KiB |
Before Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 289 KiB |
Before Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 289 KiB |
Before Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 229 KiB |
Before Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 229 KiB |
Before Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 228 KiB |
Before Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 293 KiB |
Before Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 293 KiB |
Before Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 283 KiB |
Before Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 294 KiB |
Before Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 227 KiB |
Before Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 244 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 238 KiB |
After Width: | Height: | Size: 236 KiB |
After Width: | Height: | Size: 237 KiB |
Before Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 233 KiB |
After Width: | Height: | Size: 232 KiB |
After Width: | Height: | Size: 230 KiB |
After Width: | Height: | Size: 230 KiB |
After Width: | Height: | Size: 234 KiB |
Before Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 215 KiB |
Before Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 225 KiB |
Before Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 229 KiB |
Before Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 266 KiB |
Before Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 301 KiB |
Before Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 290 KiB |
Before Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 279 KiB |
Before Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 282 KiB |
Before Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 235 KiB |
Before Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 276 KiB |
Before Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 279 KiB |
Before Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 239 KiB |
Before Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 277 KiB |
Before Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 287 KiB |
Before Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 236 KiB |
Before Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 272 KiB |
Before Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 249 KiB |
Before Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 230 KiB |
After Width: | Height: | Size: 228 KiB |
After Width: | Height: | Size: 228 KiB |
After Width: | Height: | Size: 228 KiB |
After Width: | Height: | Size: 232 KiB |
Before Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 229 KiB |