mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
[Mobile] Update Adventure Layout and Fix Player name
This commit is contained in:
@@ -17,8 +17,10 @@ import com.badlogic.gdx.utils.Array;
|
|||||||
import com.badlogic.gdx.utils.Clipboard;
|
import com.badlogic.gdx.utils.Clipboard;
|
||||||
import com.badlogic.gdx.utils.ScreenUtils;
|
import com.badlogic.gdx.utils.ScreenUtils;
|
||||||
import forge.adventure.scene.ForgeScene;
|
import forge.adventure.scene.ForgeScene;
|
||||||
|
import forge.adventure.scene.GameScene;
|
||||||
import forge.adventure.scene.Scene;
|
import forge.adventure.scene.Scene;
|
||||||
import forge.adventure.scene.SceneType;
|
import forge.adventure.scene.SceneType;
|
||||||
|
import forge.adventure.stage.MapStage;
|
||||||
import forge.adventure.util.Config;
|
import forge.adventure.util.Config;
|
||||||
import forge.animation.ForgeAnimation;
|
import forge.animation.ForgeAnimation;
|
||||||
import forge.assets.AssetsDownloader;
|
import forge.assets.AssetsDownloader;
|
||||||
@@ -887,7 +889,6 @@ public class Forge implements ApplicationListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean switchScene(Scene newScene) {
|
public static boolean switchScene(Scene newScene) {
|
||||||
|
|
||||||
if (currentScene != null) {
|
if (currentScene != null) {
|
||||||
if (!currentScene.leave())
|
if (!currentScene.leave())
|
||||||
return false;
|
return false;
|
||||||
@@ -895,6 +896,8 @@ public class Forge implements ApplicationListener {
|
|||||||
}
|
}
|
||||||
storeScreen();
|
storeScreen();
|
||||||
sceneWasSwapped =true;
|
sceneWasSwapped =true;
|
||||||
|
if (newScene instanceof GameScene)
|
||||||
|
MapStage.getInstance().clearIsInMap();
|
||||||
currentScene = newScene;
|
currentScene = newScene;
|
||||||
currentScene.enter();
|
currentScene.enter();
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ import java.util.Map;
|
|||||||
private static ItemPool<InventoryItem> decksUsingMyCards=new ItemPool<>(InventoryItem.class);
|
private static ItemPool<InventoryItem> decksUsingMyCards=new ItemPool<>(InventoryItem.class);
|
||||||
public static void leave() {
|
public static void leave() {
|
||||||
AdventurePlayer.current().getNewCards().clear();
|
AdventurePlayer.current().getNewCards().clear();
|
||||||
Forge.switchScene(SceneType.DeckSelectScene.instance);
|
|
||||||
Forge.clearCurrentScreen();
|
Forge.clearCurrentScreen();
|
||||||
|
Forge.switchToLast();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import forge.Forge;
|
|||||||
import forge.adventure.player.AdventurePlayer;
|
import forge.adventure.player.AdventurePlayer;
|
||||||
import forge.adventure.util.Controls;
|
import forge.adventure.util.Controls;
|
||||||
import forge.adventure.util.Current;
|
import forge.adventure.util.Current;
|
||||||
|
import forge.gui.GuiBase;
|
||||||
|
|
||||||
public class DeckSelectScene extends UIScene {
|
public class DeckSelectScene extends UIScene {
|
||||||
private final IntMap<TextButton> buttons = new IntMap<>();
|
private final IntMap<TextButton> buttons = new IntMap<>();
|
||||||
@@ -27,19 +28,16 @@ public class DeckSelectScene extends UIScene {
|
|||||||
int currentSlot = 0;
|
int currentSlot = 0;
|
||||||
|
|
||||||
public DeckSelectScene() {
|
public DeckSelectScene() {
|
||||||
super("ui/deck_selector.json");
|
super(GuiBase.isAndroid() ? "ui/deck_selector_mobile.json" : "ui/deck_selector.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private TextButton addDeckSlot(String name, int i) {
|
private TextButton addDeckSlot(String name, int i) {
|
||||||
TextButton button = Controls.newTextButton("-");
|
TextButton button = Controls.newTextButton("-");
|
||||||
button.addListener(new ClickListener() {
|
button.addListener(new ClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void clicked(InputEvent event, float x, float y) {
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
try {
|
try {
|
||||||
if(!button.isDisabled())
|
if (!button.isDisabled())
|
||||||
select(i);
|
select(i);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -47,22 +45,21 @@ public class DeckSelectScene extends UIScene {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
layout.add(Controls.newLabel(name)).expandX();
|
layout.add(Controls.newLabel(name)).expandX().pad(2);
|
||||||
layout.add(button).expandX();
|
layout.add(button).expandX().pad(2);
|
||||||
buttons.put(i, button);
|
buttons.put(i, button);
|
||||||
layout.row();
|
layout.row();
|
||||||
return button;
|
return button;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void back() {
|
public void back() {
|
||||||
Forge.switchScene(SceneType.GameScene.instance);
|
Forge.switchToLast();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean select(int slot) {
|
public boolean select(int slot) {
|
||||||
currentSlot = slot;
|
currentSlot = slot;
|
||||||
|
|
||||||
for (IntMap.Entry<TextButton> butt : new IntMap.Entries<TextButton> (buttons)) {
|
for (IntMap.Entry<TextButton> butt : new IntMap.Entries<TextButton>(buttons)) {
|
||||||
butt.value.setColor(defColor);
|
butt.value.setColor(defColor);
|
||||||
}
|
}
|
||||||
if (buttons.containsKey(slot)) {
|
if (buttons.containsKey(slot)) {
|
||||||
@@ -75,23 +72,19 @@ public class DeckSelectScene extends UIScene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean keyPressed(int keycode)
|
public boolean keyPressed(int keycode) {
|
||||||
{
|
if (keycode == Input.Keys.ESCAPE) {
|
||||||
if (keycode == Input.Keys.ESCAPE)
|
|
||||||
{
|
|
||||||
back();
|
back();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enter() {
|
public void enter() {
|
||||||
select(Current.player().getSelectedDeckIndex());
|
select(Current.player().getSelectedDeckIndex());
|
||||||
for(int i=0;i<AdventurePlayer.NUMBER_OF_DECKS;i++)
|
for (int i = 0; i < AdventurePlayer.NUMBER_OF_DECKS; i++) {
|
||||||
{
|
if (buttons.containsKey(i)) {
|
||||||
if(buttons.containsKey(i))
|
|
||||||
{
|
|
||||||
buttons.get(i).setText(Current.player().getDeck(i).getName());
|
buttons.get(i).setText(Current.player().getDeck(i).getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,15 +95,13 @@ public class DeckSelectScene extends UIScene {
|
|||||||
public void resLoaded() {
|
public void resLoaded() {
|
||||||
super.resLoaded();
|
super.resLoaded();
|
||||||
layout = new Table();
|
layout = new Table();
|
||||||
layout.setFillParent(true);
|
|
||||||
stage.addActor(layout);
|
stage.addActor(layout);
|
||||||
|
|
||||||
header = Controls.newLabel("Select your Deck");
|
header = Controls.newLabel("Select your Deck");
|
||||||
header.setHeight(header.getHeight() * 2);
|
layout.add(header).colspan(2).align(Align.center).pad(2, 5, 2, 5);
|
||||||
layout.add(header).colspan(2).align(Align.center);
|
|
||||||
layout.row();
|
layout.row();
|
||||||
for (int i = 0; i < AdventurePlayer.NUMBER_OF_DECKS; i++)
|
for (int i = 0; i < AdventurePlayer.NUMBER_OF_DECKS; i++)
|
||||||
addDeckSlot("Deck:" + (i+1), i);
|
addDeckSlot("Deck:" + (i + 1), i);
|
||||||
|
|
||||||
dialog = Controls.newDialog("Save");
|
dialog = Controls.newDialog("Save");
|
||||||
textInput = Controls.newTextField("");
|
textInput = Controls.newTextField("");
|
||||||
@@ -154,19 +145,18 @@ public class DeckSelectScene extends UIScene {
|
|||||||
});
|
});
|
||||||
defColor = ui.findActor("return").getColor();
|
defColor = ui.findActor("return").getColor();
|
||||||
|
|
||||||
|
|
||||||
ScrollPane scrollPane = ui.findActor("deckSlots");
|
ScrollPane scrollPane = ui.findActor("deckSlots");
|
||||||
scrollPane.setActor(layout);
|
scrollPane.setActor(layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void rename() {
|
private void rename() {
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
String text=textInput.getText();
|
String text = textInput.getText();
|
||||||
Current.player().renameDeck(text);
|
Current.player().renameDeck(text);
|
||||||
buttons.get(currentSlot).setText(Current.player().getDeck(currentSlot).getName());
|
buttons.get(currentSlot).setText(Current.player().getDeck(currentSlot).getName());
|
||||||
}
|
}
|
||||||
private void edit() {
|
|
||||||
|
|
||||||
|
private void edit() {
|
||||||
Forge.switchScene(SceneType.DeckEditScene.instance);
|
Forge.switchScene(SceneType.DeckEditScene.instance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,12 @@ package forge.adventure.scene;
|
|||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.graphics.GL20;
|
import com.badlogic.gdx.graphics.GL20;
|
||||||
import com.badlogic.gdx.utils.ScreenUtils;
|
|
||||||
import forge.Forge;
|
import forge.Forge;
|
||||||
import forge.animation.ForgeAnimation;
|
import forge.animation.ForgeAnimation;
|
||||||
import forge.assets.ImageCache;
|
import forge.assets.ImageCache;
|
||||||
import forge.gamemodes.match.LobbySlotType;
|
import forge.gamemodes.match.LobbySlotType;
|
||||||
import forge.interfaces.IUpdateable;
|
import forge.interfaces.IUpdateable;
|
||||||
import forge.screens.FScreen;
|
import forge.screens.FScreen;
|
||||||
import forge.screens.TransitionScreen;
|
|
||||||
import forge.toolbox.FDisplayObject;
|
import forge.toolbox.FDisplayObject;
|
||||||
import forge.toolbox.FOverlay;
|
import forge.toolbox.FOverlay;
|
||||||
|
|
||||||
@@ -68,21 +66,8 @@ public abstract class ForgeScene extends Scene implements IUpdateable {
|
|||||||
if(getScreen()!=null)
|
if(getScreen()!=null)
|
||||||
getScreen().setSize(Forge.getScreenWidth(), Forge.getScreenHeight());
|
getScreen().setSize(Forge.getScreenWidth(), Forge.getScreenHeight());
|
||||||
|
|
||||||
if (this instanceof DuelScene) {
|
Forge.openScreen(getScreen());
|
||||||
Runnable runnable = new Runnable() {
|
Gdx.input.setInputProcessor(Forge.getInputProcessor());
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Forge.clearTransitionScreen();
|
|
||||||
Forge.openScreen(getScreen());
|
|
||||||
Forge.setCursor(null, Forge.magnifyToggle ? "1" : "2");
|
|
||||||
Gdx.input.setInputProcessor(Forge.getInputProcessor());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Forge.setTransitionScreen(new TransitionScreen(runnable, ScreenUtils.getFrameBufferTexture(), true, false));
|
|
||||||
} else {
|
|
||||||
Forge.openScreen(getScreen());
|
|
||||||
Gdx.input.setInputProcessor(Forge.getInputProcessor());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public abstract FScreen getScreen();
|
public abstract FScreen getScreen();
|
||||||
|
|
||||||
|
|||||||
@@ -50,5 +50,6 @@ public class GameScene extends HudScene {
|
|||||||
Forge.clearCurrentScreen();
|
Forge.clearCurrentScreen();
|
||||||
super.enter();
|
super.enter();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,30 +8,27 @@ import forge.adventure.util.Current;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Scene for the Inn in towns
|
* Scene for the Inn in towns
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class InnScene extends UIScene {
|
public class InnScene extends UIScene {
|
||||||
|
|
||||||
public InnScene()
|
public InnScene() {
|
||||||
{
|
|
||||||
super("ui/inn.json");
|
super("ui/inn.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void done()
|
public void done() {
|
||||||
{
|
|
||||||
GameHUD.getInstance().getTouchpad().setVisible(false);
|
GameHUD.getInstance().getTouchpad().setVisible(false);
|
||||||
Forge.switchToLast();
|
Forge.switchToLast();
|
||||||
}
|
}
|
||||||
public void heal()
|
|
||||||
{
|
public void heal() {
|
||||||
Current.player().heal();
|
Current.player().heal();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void act(float delta) {
|
public void act(float delta) {
|
||||||
|
|
||||||
stage.act(delta);
|
stage.act(delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resLoaded() {
|
public void resLoaded() {
|
||||||
super.resLoaded();
|
super.resLoaded();
|
||||||
@@ -61,10 +58,8 @@ public class InnScene extends UIScene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean keyPressed(int keycode)
|
public boolean keyPressed(int keycode) {
|
||||||
{
|
if (keycode == Input.Keys.ESCAPE) {
|
||||||
if (keycode == Input.Keys.ESCAPE)
|
|
||||||
{
|
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import forge.adventure.util.Config;
|
|||||||
import forge.adventure.util.Selector;
|
import forge.adventure.util.Selector;
|
||||||
import forge.adventure.world.WorldSave;
|
import forge.adventure.world.WorldSave;
|
||||||
import forge.deck.Deck;
|
import forge.deck.Deck;
|
||||||
|
import forge.gui.GuiBase;
|
||||||
import forge.localinstance.properties.ForgePreferences;
|
import forge.localinstance.properties.ForgePreferences;
|
||||||
import forge.model.FModel;
|
import forge.model.FModel;
|
||||||
import forge.player.GamePlayerUtil;
|
import forge.player.GamePlayerUtil;
|
||||||
@@ -36,10 +37,13 @@ public class NewGameScene extends UIScene {
|
|||||||
private Selector difficulty;
|
private Selector difficulty;
|
||||||
|
|
||||||
public NewGameScene() {
|
public NewGameScene() {
|
||||||
super("ui/new_game.json");
|
super(GuiBase.isAndroid() ? "ui/new_game_mobile.json" : "ui/new_game.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean start() {
|
public boolean start() {
|
||||||
|
if (selectedName.getText().isEmpty()) {
|
||||||
|
selectedName.setText(NameGenerator.getRandomName("Any", "Any", ""));
|
||||||
|
}
|
||||||
Runnable runnable = new Runnable() {
|
Runnable runnable = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -49,7 +53,7 @@ public class NewGameScene extends UIScene {
|
|||||||
race.getCurrentIndex(),
|
race.getCurrentIndex(),
|
||||||
avatarIndex,
|
avatarIndex,
|
||||||
deck.getCurrentIndex(),
|
deck.getCurrentIndex(),
|
||||||
Config.instance().getConfigData().difficulties[difficulty.getCurrentIndex()],0);
|
Config.instance().getConfigData().difficulties[difficulty.getCurrentIndex()], 0);
|
||||||
GamePlayerUtil.getGuiPlayer().setName(selectedName.getText());
|
GamePlayerUtil.getGuiPlayer().setName(selectedName.getText());
|
||||||
Forge.clearTransitionScreen();
|
Forge.clearTransitionScreen();
|
||||||
Forge.switchScene(SceneType.GameScene.instance);
|
Forge.switchScene(SceneType.GameScene.instance);
|
||||||
@@ -78,7 +82,7 @@ public class NewGameScene extends UIScene {
|
|||||||
return NewGameScene.this.updateAvatar();
|
return NewGameScene.this.updateAvatar();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Random rand=new Random();
|
Random rand = new Random();
|
||||||
|
|
||||||
deck = ui.findActor("deck");
|
deck = ui.findActor("deck");
|
||||||
|
|
||||||
@@ -100,18 +104,17 @@ public class NewGameScene extends UIScene {
|
|||||||
difficulty = ui.findActor("difficulty");
|
difficulty = ui.findActor("difficulty");
|
||||||
|
|
||||||
Array<String> diffList = new Array<>(starterDeck.length);
|
Array<String> diffList = new Array<>(starterDeck.length);
|
||||||
int i=0;
|
int i = 0;
|
||||||
int startingDifficulty=0;
|
int startingDifficulty = 0;
|
||||||
for (DifficultyData diff : Config.instance().getConfigData().difficulties)
|
for (DifficultyData diff : Config.instance().getConfigData().difficulties) {
|
||||||
{
|
if (diff.startingDifficulty)
|
||||||
if(diff.startingDifficulty)
|
startingDifficulty = i;
|
||||||
startingDifficulty=i;
|
|
||||||
diffList.add(diff.name);
|
diffList.add(diff.name);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
difficulty.setTextList(diffList);
|
difficulty.setTextList(diffList);
|
||||||
difficulty.setCurrentIndex(startingDifficulty);
|
difficulty.setCurrentIndex(startingDifficulty);
|
||||||
avatarIndex=rand.nextInt();
|
avatarIndex = rand.nextInt();
|
||||||
gender.setCurrentIndex(rand.nextInt());
|
gender.setCurrentIndex(rand.nextInt());
|
||||||
deck.setCurrentIndex(rand.nextInt());
|
deck.setCurrentIndex(rand.nextInt());
|
||||||
race.setCurrentIndex(rand.nextInt());
|
race.setCurrentIndex(rand.nextInt());
|
||||||
|
|||||||
@@ -11,19 +11,22 @@ import forge.Forge;
|
|||||||
import forge.adventure.character.EnemySprite;
|
import forge.adventure.character.EnemySprite;
|
||||||
import forge.adventure.data.EnemyData;
|
import forge.adventure.data.EnemyData;
|
||||||
import forge.adventure.data.WorldData;
|
import forge.adventure.data.WorldData;
|
||||||
|
import forge.adventure.stage.GameHUD;
|
||||||
import forge.adventure.util.Controls;
|
import forge.adventure.util.Controls;
|
||||||
import forge.adventure.util.Current;
|
import forge.adventure.util.Current;
|
||||||
|
import forge.player.GamePlayerUtil;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class PlayerStatisticScene extends UIScene {
|
public class PlayerStatisticScene extends UIScene {
|
||||||
|
|
||||||
|
|
||||||
Image avatar;
|
Image avatar;
|
||||||
Label totalWins;
|
Label totalWins;
|
||||||
Label totalLoss;
|
Label totalLoss;
|
||||||
Label lossWinRatio;
|
Label lossWinRatio;
|
||||||
|
Label playerName;
|
||||||
private Table enemiesGroup;
|
private Table enemiesGroup;
|
||||||
|
|
||||||
public PlayerStatisticScene() {
|
public PlayerStatisticScene() {
|
||||||
@@ -37,64 +40,64 @@ public class PlayerStatisticScene extends UIScene {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean keyPressed(int keycode)
|
public boolean keyPressed(int keycode) {
|
||||||
{
|
if (keycode == Input.Keys.ESCAPE) {
|
||||||
if (keycode == Input.Keys.ESCAPE)
|
|
||||||
{
|
|
||||||
back();
|
back();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean back() {
|
public boolean back() {
|
||||||
|
GameHUD.getInstance().getTouchpad().setVisible(false);
|
||||||
Forge.switchToLast();
|
Forge.switchToLast();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enter() {
|
public void enter() {
|
||||||
super.enter();
|
super.enter();
|
||||||
enemiesGroup.clear();
|
enemiesGroup.clear();
|
||||||
|
|
||||||
enemiesGroup.add("Avatar").align(Align.center).space(3,10,3,10);
|
enemiesGroup.add("Avatar").align(Align.center).space(3, 10, 3, 10);
|
||||||
enemiesGroup.add("Name").fillX().align(Align.center).fillX().space(3,10,3,60);
|
enemiesGroup.add("Name").fillX().align(Align.center).fillX().space(3, 10, 3, 60);
|
||||||
enemiesGroup.add(("Win")).align(Align.center).space(3,5,3,5);
|
enemiesGroup.add(("Win")).align(Align.center).space(3, 5, 3, 5);
|
||||||
enemiesGroup.add(("/")).align(Align.center).space(3,5,3,5);
|
enemiesGroup.add(("/")).align(Align.center).space(3, 5, 3, 5);
|
||||||
enemiesGroup.add("Loss").align(Align.center).space(3,5,3,5);
|
enemiesGroup.add("Loss").align(Align.center).space(3, 5, 3, 5);
|
||||||
enemiesGroup.row().space(8);
|
enemiesGroup.row().space(8);
|
||||||
|
|
||||||
if(avatar!=null)
|
if (playerName != null) {
|
||||||
{
|
playerName.setText(GamePlayerUtil.getGuiPlayer().getName());
|
||||||
|
}
|
||||||
|
if (avatar != null) {
|
||||||
avatar.setDrawable(new TextureRegionDrawable(Current.player().avatar()));
|
avatar.setDrawable(new TextureRegionDrawable(Current.player().avatar()));
|
||||||
}
|
}
|
||||||
if(totalWins!=null)
|
if (totalWins != null) {
|
||||||
{
|
|
||||||
totalWins.setText(Current.player().getStatistic().totalWins());
|
totalWins.setText(Current.player().getStatistic().totalWins());
|
||||||
}
|
}
|
||||||
if(totalLoss!=null)
|
if (totalLoss != null) {
|
||||||
{
|
|
||||||
totalLoss.setText(Current.player().getStatistic().totalLoss());
|
totalLoss.setText(Current.player().getStatistic().totalLoss());
|
||||||
}
|
}
|
||||||
if(lossWinRatio!=null)
|
if (lossWinRatio != null) {
|
||||||
{
|
|
||||||
lossWinRatio.setText(Float.toString(Current.player().getStatistic().winLossRatio()));
|
lossWinRatio.setText(Float.toString(Current.player().getStatistic().winLossRatio()));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Map.Entry<String, Pair<Integer,Integer>> entry : Current.player().getStatistic().getWinLossRecord().entrySet())
|
for (Map.Entry<String, Pair<Integer, Integer>> entry : Current.player().getStatistic().getWinLossRecord().entrySet()) {
|
||||||
{
|
EnemyData data = WorldData.getEnemy(entry.getKey());
|
||||||
EnemyData data=WorldData.getEnemy(entry.getKey());
|
if (data == null) continue;
|
||||||
if(data==null)continue;
|
Image enemyImage = new Image();
|
||||||
Image enemyImage=new Image();
|
|
||||||
enemyImage.setDrawable(new TextureRegionDrawable(new EnemySprite(data).getAvatar()));
|
enemyImage.setDrawable(new TextureRegionDrawable(new EnemySprite(data).getAvatar()));
|
||||||
enemyImage.setSize(8,8);
|
enemyImage.setSize(8, 8);
|
||||||
|
|
||||||
enemiesGroup.add(enemyImage).align(Align.center).space(3,10,3,10);
|
enemiesGroup.add(enemyImage).align(Align.center).space(3, 10, 3, 10);
|
||||||
enemiesGroup.add((data.name)).fillX().align(Align.center).fillX().space(3,10,3,10);
|
enemiesGroup.add((data.name)).fillX().align(Align.center).fillX().space(3, 10, 3, 10);
|
||||||
enemiesGroup.add((entry.getValue().getLeft().toString())).space(3,2,3,2);
|
enemiesGroup.add((entry.getValue().getLeft().toString())).space(3, 2, 3, 2);
|
||||||
enemiesGroup.add(("/")).align(Align.center).space(3,2,3,2);
|
enemiesGroup.add(("/")).align(Align.center).space(3, 2, 3, 2);
|
||||||
enemiesGroup.add((entry.getValue().getRight().toString())).align(Align.center).space(0,2,0,2);
|
enemiesGroup.add((entry.getValue().getRight().toString())).align(Align.center).space(0, 2, 0, 2);
|
||||||
enemiesGroup.row().space(8);
|
enemiesGroup.row().space(8);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resLoaded() {
|
public void resLoaded() {
|
||||||
super.resLoaded();
|
super.resLoaded();
|
||||||
@@ -107,11 +110,12 @@ public class PlayerStatisticScene extends UIScene {
|
|||||||
PlayerStatisticScene.this.back();
|
PlayerStatisticScene.this.back();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
avatar=ui.findActor("avatar");
|
avatar = ui.findActor("avatar");
|
||||||
|
playerName = ui.findActor("playerName");
|
||||||
|
|
||||||
totalWins=ui.findActor("totalWins");
|
totalWins = ui.findActor("totalWins");
|
||||||
totalLoss=ui.findActor("totalLoss");
|
totalLoss = ui.findActor("totalLoss");
|
||||||
lossWinRatio=ui.findActor("lossWinRatio");
|
lossWinRatio = ui.findActor("lossWinRatio");
|
||||||
|
|
||||||
ScrollPane scrollPane = ui.findActor("enemies");
|
ScrollPane scrollPane = ui.findActor("enemies");
|
||||||
scrollPane.setActor(enemiesGroup);
|
scrollPane.setActor(enemiesGroup);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import forge.Forge;
|
|||||||
import forge.adventure.util.Controls;
|
import forge.adventure.util.Controls;
|
||||||
import forge.adventure.world.WorldSave;
|
import forge.adventure.world.WorldSave;
|
||||||
import forge.adventure.world.WorldSaveHeader;
|
import forge.adventure.world.WorldSaveHeader;
|
||||||
|
import forge.gui.GuiBase;
|
||||||
import forge.screens.TransitionScreen;
|
import forge.screens.TransitionScreen;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -30,7 +31,6 @@ import java.util.zip.InflaterInputStream;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Scene to load and save the game.
|
* Scene to load and save the game.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class SaveLoadScene extends UIScene {
|
public class SaveLoadScene extends UIScene {
|
||||||
private final IntMap<TextButton> buttons = new IntMap<>();
|
private final IntMap<TextButton> buttons = new IntMap<>();
|
||||||
@@ -43,20 +43,18 @@ public class SaveLoadScene extends UIScene {
|
|||||||
Label header;
|
Label header;
|
||||||
int currentSlot = -3;
|
int currentSlot = -3;
|
||||||
Image previewImage;
|
Image previewImage;
|
||||||
|
Image previewBorder;
|
||||||
TextButton saveLoadButton;
|
TextButton saveLoadButton;
|
||||||
TextButton quickSave;
|
TextButton quickSave;
|
||||||
TextButton autoSave;
|
TextButton autoSave;
|
||||||
|
|
||||||
public SaveLoadScene() {
|
public SaveLoadScene() {
|
||||||
super("ui/save_load.json");
|
super(GuiBase.isAndroid() ? "ui/save_load_mobile.json" : "ui/save_load.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private TextButton addSaveSlot(String name, int i) {
|
private TextButton addSaveSlot(String name, int i) {
|
||||||
layout.add(Controls.newLabel(name)).colspan(1).align(Align.right).expandX();
|
layout.add(Controls.newLabel(name)).align(Align.left).pad(4, 10, 4, 15);
|
||||||
layout.add(Controls.newLabel(" "));
|
|
||||||
TextButton button = Controls.newTextButton("...");
|
TextButton button = Controls.newTextButton("...");
|
||||||
button.addListener(new ClickListener() {
|
button.addListener(new ClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -69,7 +67,7 @@ public class SaveLoadScene extends UIScene {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
layout.add(button).colspan(2).align(Align.left).expandX();
|
layout.add(button).align(Align.left).expandX();
|
||||||
buttons.put(i, button);
|
buttons.put(i, button);
|
||||||
layout.row();
|
layout.row();
|
||||||
return button;
|
return button;
|
||||||
@@ -88,9 +86,13 @@ public class SaveLoadScene extends UIScene {
|
|||||||
if (header.preview != null) {
|
if (header.preview != null) {
|
||||||
previewImage.setDrawable(new TextureRegionDrawable(new Texture(header.preview)));
|
previewImage.setDrawable(new TextureRegionDrawable(new Texture(header.preview)));
|
||||||
previewImage.layout();
|
previewImage.layout();
|
||||||
|
previewImage.setVisible(true);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (previewImage != null)
|
||||||
|
previewImage.setVisible(false);
|
||||||
}
|
}
|
||||||
for (IntMap.Entry<TextButton> butt : new IntMap.Entries<TextButton> (buttons)) {
|
for (IntMap.Entry<TextButton> butt : new IntMap.Entries<TextButton>(buttons)) {
|
||||||
butt.value.setColor(defColor);
|
butt.value.setColor(defColor);
|
||||||
}
|
}
|
||||||
if (buttons.containsKey(slot)) {
|
if (buttons.containsKey(slot)) {
|
||||||
@@ -123,18 +125,16 @@ public class SaveLoadScene extends UIScene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean keyPressed(int keycode)
|
public boolean keyPressed(int keycode) {
|
||||||
{
|
if (keycode == Input.Keys.ESCAPE) {
|
||||||
if (keycode == Input.Keys.ESCAPE)
|
back();
|
||||||
{
|
|
||||||
back();
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save() {
|
public void save() {
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
if( WorldSave.getCurrentSave().save(textInput.getText(), currentSlot))
|
if (WorldSave.getCurrentSave().save(textInput.getText(), currentSlot)) {
|
||||||
{
|
|
||||||
updateFiles();
|
updateFiles();
|
||||||
Forge.switchScene(SceneType.GameScene.instance);
|
Forge.switchScene(SceneType.GameScene.instance);
|
||||||
}
|
}
|
||||||
@@ -147,7 +147,7 @@ public class SaveLoadScene extends UIScene {
|
|||||||
File f = new File(WorldSave.getSaveDir());
|
File f = new File(WorldSave.getSaveDir());
|
||||||
f.mkdirs();
|
f.mkdirs();
|
||||||
File[] names = f.listFiles();
|
File[] names = f.listFiles();
|
||||||
if(names==null)
|
if (names == null)
|
||||||
throw new RuntimeException("Can not find save directory");
|
throw new RuntimeException("Can not find save directory");
|
||||||
previews.clear();
|
previews.clear();
|
||||||
for (File name : names) {
|
for (File name : names) {
|
||||||
@@ -159,7 +159,7 @@ public class SaveLoadScene extends UIScene {
|
|||||||
ObjectInputStream oos = new ObjectInputStream(inf)) {
|
ObjectInputStream oos = new ObjectInputStream(inf)) {
|
||||||
|
|
||||||
|
|
||||||
int slot=WorldSave.filenameToSlot(name.getName());
|
int slot = WorldSave.filenameToSlot(name.getName());
|
||||||
WorldSaveHeader header = (WorldSaveHeader) oos.readObject();
|
WorldSaveHeader header = (WorldSaveHeader) oos.readObject();
|
||||||
buttons.get(slot).setText(header.name);
|
buttons.get(slot).setText(header.name);
|
||||||
previews.put(slot, header);
|
previews.put(slot, header);
|
||||||
@@ -222,12 +222,14 @@ public class SaveLoadScene extends UIScene {
|
|||||||
})).align(Align.left);
|
})).align(Align.left);
|
||||||
|
|
||||||
previewImage = ui.findActor("preview");
|
previewImage = ui.findActor("preview");
|
||||||
|
previewBorder = ui.findActor("preview_border");
|
||||||
header = Controls.newLabel("Save");
|
header = Controls.newLabel("Save");
|
||||||
header.setHeight(header.getHeight() * 2);
|
header.setHeight(header.getHeight() * 2);
|
||||||
layout.add(header).colspan(3).align(Align.center).expand();
|
header.setAlignment(Align.center);
|
||||||
|
layout.add(header).pad(2).colspan(4).align(Align.center).expand();
|
||||||
layout.row();
|
layout.row();
|
||||||
autoSave=addSaveSlot("Auto save", WorldSave.AUTO_SAVE_SLOT);
|
autoSave = addSaveSlot("Auto save", WorldSave.AUTO_SAVE_SLOT);
|
||||||
quickSave=addSaveSlot("Quick save", WorldSave.QUICK_SAVE_SLOT);
|
quickSave = addSaveSlot("Quick save", WorldSave.QUICK_SAVE_SLOT);
|
||||||
for (int i = 1; i < 11; i++)
|
for (int i = 1; i < 11; i++)
|
||||||
addSaveSlot("Slot:" + i, i);
|
addSaveSlot("Slot:" + i, i);
|
||||||
|
|
||||||
@@ -244,8 +246,8 @@ public class SaveLoadScene extends UIScene {
|
|||||||
SaveLoadScene.this.back();
|
SaveLoadScene.this.back();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
defColor = saveLoadButton.getColor();
|
|
||||||
|
|
||||||
|
defColor = saveLoadButton.getColor();
|
||||||
|
|
||||||
ScrollPane scrollPane = ui.findActor("saveSlots");
|
ScrollPane scrollPane = ui.findActor("saveSlots");
|
||||||
scrollPane.setActor(layout);
|
scrollPane.setActor(layout);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Table;
|
|||||||
import com.badlogic.gdx.scenes.scene2d.ui.TextField;
|
import com.badlogic.gdx.scenes.scene2d.ui.TextField;
|
||||||
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
|
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
|
||||||
import com.badlogic.gdx.utils.Align;
|
import com.badlogic.gdx.utils.Align;
|
||||||
|
import com.badlogic.gdx.utils.Scaling;
|
||||||
import forge.Forge;
|
import forge.Forge;
|
||||||
import forge.adventure.util.Config;
|
import forge.adventure.util.Config;
|
||||||
import forge.adventure.util.Controls;
|
import forge.adventure.util.Controls;
|
||||||
@@ -37,7 +38,7 @@ public class SettingsScene extends UIScene {
|
|||||||
private Table settingGroup;
|
private Table settingGroup;
|
||||||
|
|
||||||
public SettingsScene() {
|
public SettingsScene() {
|
||||||
super("ui/settings.json");
|
super(GuiBase.isAndroid() ? "ui/settings_mobile.json" : "ui/settings.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -63,18 +64,18 @@ public class SettingsScene extends UIScene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean keyPressed(int keycode)
|
public boolean keyPressed(int keycode) {
|
||||||
{
|
if (keycode == Input.Keys.ESCAPE) {
|
||||||
if (keycode == Input.Keys.ESCAPE)
|
|
||||||
{
|
|
||||||
back();
|
back();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean back() {
|
public boolean back() {
|
||||||
Forge.switchToLast();
|
Forge.switchToLast();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addInputField(String name, ForgePreferences.FPref pref) {
|
private void addInputField(String name, ForgePreferences.FPref pref) {
|
||||||
|
|
||||||
|
|
||||||
@@ -91,10 +92,14 @@ public class SettingsScene extends UIScene {
|
|||||||
addLabel(name);
|
addLabel(name);
|
||||||
settingGroup.add(box).align(Align.right);
|
settingGroup.add(box).align(Align.right);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addCheckBox(String name, ForgePreferences.FPref pref) {
|
private void addCheckBox(String name, ForgePreferences.FPref pref) {
|
||||||
|
|
||||||
|
|
||||||
CheckBox box = Controls.newCheckBox("");
|
CheckBox box = Controls.newCheckBox("");
|
||||||
|
if (GuiBase.isAndroid()) {
|
||||||
|
box.getImage().setScaling(Scaling.fill);
|
||||||
|
box.getImageCell().size(12, 12);
|
||||||
|
box.getImageCell().pad(2, 2, 2, 10);
|
||||||
|
}
|
||||||
box.setChecked(Preference.getPrefBoolean(pref));
|
box.setChecked(Preference.getPrefBoolean(pref));
|
||||||
box.addListener(new ChangeListener() {
|
box.addListener(new ChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -107,9 +112,9 @@ public class SettingsScene extends UIScene {
|
|||||||
addLabel(name);
|
addLabel(name);
|
||||||
settingGroup.add(box).align(Align.right);
|
settingGroup.add(box).align(Align.right);
|
||||||
}
|
}
|
||||||
private void addSettingSlider(String name, ForgePreferences.FPref pref, int min,int max) {
|
|
||||||
|
|
||||||
Slider slide = Controls.newSlider(min,max, 1, false);
|
private void addSettingSlider(String name, ForgePreferences.FPref pref, int min, int max) {
|
||||||
|
Slider slide = Controls.newSlider(min, max, 1, false);
|
||||||
slide.setValue(Preference.getPrefInt(pref));
|
slide.setValue(Preference.getPrefInt(pref));
|
||||||
slide.addListener(new ChangeListener() {
|
slide.addListener(new ChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -121,17 +126,22 @@ public class SettingsScene extends UIScene {
|
|||||||
addLabel(name);
|
addLabel(name);
|
||||||
settingGroup.add(slide).align(Align.right);
|
settingGroup.add(slide).align(Align.right);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addSettingField(String name, boolean value, ChangeListener change) {
|
private void addSettingField(String name, boolean value, ChangeListener change) {
|
||||||
|
|
||||||
CheckBox box = Controls.newCheckBox("");
|
CheckBox box = Controls.newCheckBox("");
|
||||||
|
if (GuiBase.isAndroid()) {
|
||||||
|
box.getImage().setScaling(Scaling.fill);
|
||||||
|
box.getImageCell().size(12, 12);
|
||||||
|
box.getImageCell().pad(2, 2, 2, 10);
|
||||||
|
}
|
||||||
box.setChecked(value);
|
box.setChecked(value);
|
||||||
box.addListener(change);
|
box.addListener(change);
|
||||||
addLabel(name);
|
addLabel(name);
|
||||||
settingGroup.add(box).align(Align.right);
|
settingGroup.add(box).align(Align.right);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addSettingField(String name, int value, ChangeListener change) {
|
private void addSettingField(String name, int value, ChangeListener change) {
|
||||||
|
|
||||||
|
|
||||||
TextField text = Controls.newTextField(String.valueOf(value));
|
TextField text = Controls.newTextField(String.valueOf(value));
|
||||||
text.setTextFieldFilter(new TextField.TextFieldFilter() {
|
text.setTextFieldFilter(new TextField.TextFieldFilter() {
|
||||||
@Override
|
@Override
|
||||||
@@ -140,19 +150,16 @@ public class SettingsScene extends UIScene {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
text.addListener(change);
|
text.addListener(change);
|
||||||
|
|
||||||
|
|
||||||
addLabel(name);
|
addLabel(name);
|
||||||
settingGroup.add(text).align(Align.right);
|
settingGroup.add(text).align(Align.right);
|
||||||
}
|
}
|
||||||
void addLabel( String name)
|
|
||||||
{
|
|
||||||
|
|
||||||
Label label = new Label(name, Controls.GetSkin().get("white",Label.LabelStyle.class));
|
|
||||||
|
|
||||||
|
void addLabel(String name) {
|
||||||
|
Label label = new Label(name, Controls.GetSkin().get("white", Label.LabelStyle.class));
|
||||||
settingGroup.row().space(5);
|
settingGroup.row().space(5);
|
||||||
settingGroup.add(label).align(Align.left).fillX();
|
settingGroup.add(label).align(Align.left).pad(2,2, 2, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resLoaded() {
|
public void resLoaded() {
|
||||||
super.resLoaded();
|
super.resLoaded();
|
||||||
@@ -165,19 +172,19 @@ public class SettingsScene extends UIScene {
|
|||||||
SelectBox plane = Controls.newComboBox(Config.instance().getAllAdventures(), Config.instance().getSettingData().plane, new Function<Object, Void>() {
|
SelectBox plane = Controls.newComboBox(Config.instance().getAllAdventures(), Config.instance().getSettingData().plane, new Function<Object, Void>() {
|
||||||
@Override
|
@Override
|
||||||
public Void apply(Object o) {
|
public Void apply(Object o) {
|
||||||
Config.instance().getSettingData().plane= (String) o;
|
Config.instance().getSettingData().plane = (String) o;
|
||||||
Config.instance().saveSettings();
|
Config.instance().saveSettings();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
addLabel("Plane");
|
addLabel("Plane");
|
||||||
settingGroup.add(plane).align(Align.right);
|
settingGroup.add(plane).align(Align.right).pad(2);
|
||||||
|
|
||||||
if (!GuiBase.isAndroid()) {
|
if (!GuiBase.isAndroid()) {
|
||||||
SelectBox videomode = Controls.newComboBox(new String[]{"720p", "768p", "900p", "1080p"}, Config.instance().getSettingData().videomode, new Function<Object, Void>() {
|
SelectBox videomode = Controls.newComboBox(new String[]{"720p", "768p", "900p", "1080p"}, Config.instance().getSettingData().videomode, new Function<Object, Void>() {
|
||||||
@Override
|
@Override
|
||||||
public Void apply(Object o) {
|
public Void apply(Object o) {
|
||||||
String mode = (String)o;
|
String mode = (String) o;
|
||||||
if (mode == null)
|
if (mode == null)
|
||||||
mode = "720p";
|
mode = "720p";
|
||||||
Config.instance().getSettingData().videomode = mode;
|
Config.instance().getSettingData().videomode = mode;
|
||||||
@@ -204,12 +211,12 @@ public class SettingsScene extends UIScene {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
addLabel("Video Mode (Restart to apply)");
|
addLabel("Video Mode (Restart to apply)");
|
||||||
settingGroup.add(videomode).align(Align.right);
|
settingGroup.add(videomode).align(Align.right).pad(2);
|
||||||
addSettingField("Fullscreen", Config.instance().getSettingData().fullScreen, new ChangeListener() {
|
addSettingField("Fullscreen", Config.instance().getSettingData().fullScreen, new ChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void changed(ChangeEvent event, Actor actor) {
|
public void changed(ChangeEvent event, Actor actor) {
|
||||||
boolean value = ((CheckBox) actor).isChecked();
|
boolean value = ((CheckBox) actor).isChecked();
|
||||||
Config.instance().getSettingData().fullScreen=value;
|
Config.instance().getSettingData().fullScreen = value;
|
||||||
Config.instance().saveSettings();
|
Config.instance().saveSettings();
|
||||||
//update
|
//update
|
||||||
if (FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_FULLSCREEN_MODE) != value) {
|
if (FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_FULLSCREEN_MODE) != value) {
|
||||||
@@ -220,10 +227,10 @@ public class SettingsScene extends UIScene {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
addCheckBox(localizer.getMessage("lblCardName"), ForgePreferences.FPref.UI_OVERLAY_CARD_NAME);
|
addCheckBox(localizer.getMessage("lblCardName"), ForgePreferences.FPref.UI_OVERLAY_CARD_NAME);
|
||||||
addSettingSlider(localizer.getMessage("cbAdjustMusicVolume"), ForgePreferences.FPref.UI_VOL_MUSIC,0,100);
|
addSettingSlider(localizer.getMessage("cbAdjustMusicVolume"), ForgePreferences.FPref.UI_VOL_MUSIC, 0, 100);
|
||||||
addSettingSlider(localizer.getMessage("cbAdjustSoundsVolume"), ForgePreferences.FPref.UI_VOL_SOUNDS, 0,100);
|
addSettingSlider(localizer.getMessage("cbAdjustSoundsVolume"), ForgePreferences.FPref.UI_VOL_SOUNDS, 0, 100);
|
||||||
addCheckBox(localizer.getMessage("lblManaCost"), ForgePreferences.FPref.UI_OVERLAY_CARD_MANA_COST);
|
addCheckBox(localizer.getMessage("lblManaCost"), ForgePreferences.FPref.UI_OVERLAY_CARD_MANA_COST);
|
||||||
addCheckBox(localizer.getMessage("lblPowerOrToughness"), ForgePreferences.FPref.UI_OVERLAY_CARD_POWER);
|
addCheckBox(localizer.getMessage("lblPowerOrToughness"), ForgePreferences.FPref.UI_OVERLAY_CARD_POWER);
|
||||||
addCheckBox(localizer.getMessage("lblCardID"), ForgePreferences.FPref.UI_OVERLAY_CARD_ID);
|
addCheckBox(localizer.getMessage("lblCardID"), ForgePreferences.FPref.UI_OVERLAY_CARD_ID);
|
||||||
addCheckBox(localizer.getMessage("lblAbilityIcon"), ForgePreferences.FPref.UI_OVERLAY_ABILITY_ICONS);
|
addCheckBox(localizer.getMessage("lblAbilityIcon"), ForgePreferences.FPref.UI_OVERLAY_ABILITY_ICONS);
|
||||||
addCheckBox(localizer.getMessage("cbImageFetcher"), ForgePreferences.FPref.UI_ENABLE_ONLINE_IMAGE_FETCHER);
|
addCheckBox(localizer.getMessage("cbImageFetcher"), ForgePreferences.FPref.UI_ENABLE_ONLINE_IMAGE_FETCHER);
|
||||||
@@ -245,6 +252,7 @@ public class SettingsScene extends UIScene {
|
|||||||
|
|
||||||
|
|
||||||
settingGroup.row();
|
settingGroup.row();
|
||||||
|
|
||||||
ui.onButtonPress("return", new Runnable() {
|
ui.onButtonPress("return", new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ import com.badlogic.gdx.Gdx;
|
|||||||
import com.badlogic.gdx.Input;
|
import com.badlogic.gdx.Input;
|
||||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||||
import forge.Forge;
|
import forge.Forge;
|
||||||
|
import forge.adventure.stage.GameHUD;
|
||||||
import forge.adventure.world.WorldSave;
|
import forge.adventure.world.WorldSave;
|
||||||
|
import forge.gui.GuiBase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* First scene after the splash screen
|
* First scene after the splash screen
|
||||||
@@ -16,7 +18,7 @@ public class StartScene extends UIScene {
|
|||||||
|
|
||||||
public StartScene()
|
public StartScene()
|
||||||
{
|
{
|
||||||
super("ui/start_menu.json");
|
super(GuiBase.isAndroid() ? "ui/start_menu_mobile.json" : "ui/start_menu.json");
|
||||||
|
|
||||||
}
|
}
|
||||||
public boolean NewGame() {
|
public boolean NewGame() {
|
||||||
@@ -38,6 +40,7 @@ public class StartScene extends UIScene {
|
|||||||
|
|
||||||
public boolean Resume() {
|
public boolean Resume() {
|
||||||
Forge.switchToLast();
|
Forge.switchToLast();
|
||||||
|
GameHUD.getInstance().getTouchpad().setVisible(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ import com.badlogic.gdx.scenes.scene2d.ui.Touchpad.TouchpadStyle;
|
|||||||
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
|
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
|
||||||
import com.badlogic.gdx.scenes.scene2d.utils.Drawable;
|
import com.badlogic.gdx.scenes.scene2d.utils.Drawable;
|
||||||
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
|
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
|
||||||
import com.badlogic.gdx.utils.viewport.FitViewport;
|
import com.badlogic.gdx.utils.Scaling;
|
||||||
|
import com.badlogic.gdx.utils.viewport.ScalingViewport;
|
||||||
import forge.Forge;
|
import forge.Forge;
|
||||||
import forge.adventure.player.AdventurePlayer;
|
import forge.adventure.player.AdventurePlayer;
|
||||||
import forge.adventure.scene.Scene;
|
|
||||||
import forge.adventure.scene.SceneType;
|
import forge.adventure.scene.SceneType;
|
||||||
import forge.adventure.util.Config;
|
import forge.adventure.util.Config;
|
||||||
import forge.adventure.util.Current;
|
import forge.adventure.util.Current;
|
||||||
@@ -46,7 +46,7 @@ public class GameHUD extends Stage {
|
|||||||
float TOUCHPAD_KNOB_MIN_WIDTH = 40f;
|
float TOUCHPAD_KNOB_MIN_WIDTH = 40f;
|
||||||
|
|
||||||
private GameHUD(GameStage gameStage) {
|
private GameHUD(GameStage gameStage) {
|
||||||
super(new FitViewport(Scene.GetIntendedWidth(), Scene.GetIntendedHeight()), gameStage.getBatch());
|
super(new ScalingViewport(Scaling.fillX, 480f, 270f), gameStage.getBatch());
|
||||||
instance = this;
|
instance = this;
|
||||||
this.gameStage = gameStage;
|
this.gameStage = gameStage;
|
||||||
|
|
||||||
@@ -193,10 +193,11 @@ public class GameHUD extends Stage {
|
|||||||
float deckY = ui.findActor("deck").getY();
|
float deckY = ui.findActor("deck").getY();
|
||||||
float deckR = ui.findActor("deck").getRight();
|
float deckR = ui.findActor("deck").getRight();
|
||||||
float deckT = ui.findActor("deck").getTop();
|
float deckT = ui.findActor("deck").getTop();
|
||||||
|
float deckOriginX = ui.findActor("deck").getOriginX();
|
||||||
//deck button bounds
|
//deck button bounds
|
||||||
if (c.x>=deckX&&c.x<=deckR&&c.y>=deckY&&c.y<=deckT) {
|
if (c.x>=deckX&&c.x<=deckR&&c.y>=deckY&&c.y<=deckT) {
|
||||||
openDeck();
|
openDeck();
|
||||||
stageToScreenCoordinates(c2.set(deckX, deckY));
|
stageToScreenCoordinates(c2.set(deckOriginX, deckY));
|
||||||
return super.touchDown((int)c2.x, (int)c2.y, pointer, button);
|
return super.touchDown((int)c2.x, (int)c2.y, pointer, button);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,10 +205,11 @@ public class GameHUD extends Stage {
|
|||||||
float menuY = ui.findActor("menu").getY();
|
float menuY = ui.findActor("menu").getY();
|
||||||
float menuR = ui.findActor("menu").getRight();
|
float menuR = ui.findActor("menu").getRight();
|
||||||
float menuT = ui.findActor("menu").getTop();
|
float menuT = ui.findActor("menu").getTop();
|
||||||
|
float menuOriginX = ui.findActor("menu").getOriginX();
|
||||||
//menu button bounds
|
//menu button bounds
|
||||||
if (c.x>=menuX&&c.x<=menuR&&c.y>=menuY&&c.y<=menuT) {
|
if (c.x>=menuX&&c.x<=menuR&&c.y>=menuY&&c.y<=menuT) {
|
||||||
menu();
|
menu();
|
||||||
stageToScreenCoordinates(c2.set(menuX, menuY));
|
stageToScreenCoordinates(c2.set(menuOriginX, menuY));
|
||||||
return super.touchDown((int)c2.x, (int)c2.y, pointer, button);
|
return super.touchDown((int)c2.x, (int)c2.y, pointer, button);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,10 +217,11 @@ public class GameHUD extends Stage {
|
|||||||
float statsY = ui.findActor("statistic").getY();
|
float statsY = ui.findActor("statistic").getY();
|
||||||
float statsR = ui.findActor("statistic").getRight();
|
float statsR = ui.findActor("statistic").getRight();
|
||||||
float statsT = ui.findActor("statistic").getTop();
|
float statsT = ui.findActor("statistic").getTop();
|
||||||
|
float statsOriginX = ui.findActor("statistic").getOriginX();
|
||||||
//stats button bounds
|
//stats button bounds
|
||||||
if (c.x>=statsX&&c.x<=statsR&&c.y>=statsY&&c.y<=statsT) {
|
if (c.x>=statsX&&c.x<=statsR&&c.y>=statsY&&c.y<=statsT) {
|
||||||
statistic();
|
statistic();
|
||||||
stageToScreenCoordinates(c2.set(statsX, statsY));
|
stageToScreenCoordinates(c2.set(statsOriginX, statsY));
|
||||||
return super.touchDown((int)c2.x, (int)c2.y, pointer, button);
|
return super.touchDown((int)c2.x, (int)c2.y, pointer, button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ public class MapStage extends GameStage {
|
|||||||
private final Vector2 oldPosition3=new Vector2();
|
private final Vector2 oldPosition3=new Vector2();
|
||||||
private final Vector2 oldPosition4=new Vector2();
|
private final Vector2 oldPosition4=new Vector2();
|
||||||
|
|
||||||
|
public void clearIsInMap() {
|
||||||
|
isInMap = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public MapLayer getSpriteLayer()
|
public MapLayer getSpriteLayer()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package forge.adventure.stage;
|
package forge.adventure.stage;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.math.Rectangle;
|
import com.badlogic.gdx.math.Rectangle;
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||||
|
import com.badlogic.gdx.utils.ScreenUtils;
|
||||||
import com.badlogic.gdx.utils.viewport.Viewport;
|
import com.badlogic.gdx.utils.viewport.Viewport;
|
||||||
import forge.Forge;
|
import forge.Forge;
|
||||||
import forge.adventure.character.CharacterSprite;
|
import forge.adventure.character.CharacterSprite;
|
||||||
@@ -20,6 +22,7 @@ import forge.adventure.util.SaveFileContent;
|
|||||||
import forge.adventure.util.SaveFileData;
|
import forge.adventure.util.SaveFileData;
|
||||||
import forge.adventure.world.World;
|
import forge.adventure.world.World;
|
||||||
import forge.adventure.world.WorldSave;
|
import forge.adventure.world.WorldSave;
|
||||||
|
import forge.screens.TransitionScreen;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -76,10 +79,17 @@ public class WorldStage extends GameStage implements SaveFileContent {
|
|||||||
if (player.collideWith(mob)) {
|
if (player.collideWith(mob)) {
|
||||||
player.setAnimation(CharacterSprite.AnimationTypes.Attack);
|
player.setAnimation(CharacterSprite.AnimationTypes.Attack);
|
||||||
mob.setAnimation(CharacterSprite.AnimationTypes.Attack);
|
mob.setAnimation(CharacterSprite.AnimationTypes.Attack);
|
||||||
|
Gdx.input.vibrate(50);
|
||||||
|
Forge.setCursor(null, Forge.magnifyToggle ? "1" : "2");
|
||||||
|
Forge.setTransitionScreen(new TransitionScreen(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Forge.clearTransitionScreen();
|
||||||
|
}
|
||||||
|
}, ScreenUtils.getFrameBufferTexture(), true, false));
|
||||||
startPause(1, new Runnable() {
|
startPause(1, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
((DuelScene) SceneType.DuelScene.instance).setEnemy(currentMob);
|
((DuelScene) SceneType.DuelScene.instance).setEnemy(currentMob);
|
||||||
((DuelScene) SceneType.DuelScene.instance).setPlayer(player);
|
((DuelScene) SceneType.DuelScene.instance).setPlayer(player);
|
||||||
Forge.switchScene(SceneType.DuelScene.instance);
|
Forge.switchScene(SceneType.DuelScene.instance);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
|
|||||||
import com.badlogic.gdx.scenes.scene2d.ui.TextField;
|
import com.badlogic.gdx.scenes.scene2d.ui.TextField;
|
||||||
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
|
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
|
||||||
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
|
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
|
||||||
|
import com.badlogic.gdx.utils.Align;
|
||||||
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
@@ -30,8 +31,8 @@ public class Controls {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static public SelectBox newComboBox(String[] text, String item, Function<Object, Void> func) {
|
static public SelectBox newComboBox(String[] text, String item, Function<Object, Void> func) {
|
||||||
|
|
||||||
SelectBox ret = new SelectBox<String>(GetSkin());
|
SelectBox ret = new SelectBox<String>(GetSkin());
|
||||||
|
ret.getStyle().listStyle.selection.setTopHeight(4);
|
||||||
ret.setItems(text);
|
ret.setItems(text);
|
||||||
ret.addListener(new ChangeListener() {
|
ret.addListener(new ChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -44,8 +45,9 @@ public class Controls {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
func.apply(item);
|
func.apply(item);
|
||||||
|
ret.getList().setAlignment(Align.center);
|
||||||
ret.setSelected(item);
|
ret.setSelected(item);
|
||||||
|
ret.setAlignment(Align.right);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,6 +137,9 @@ public class UIActor extends Group {
|
|||||||
case "text":
|
case "text":
|
||||||
newActor.setText(property.value.toString());
|
newActor.setText(property.value.toString());
|
||||||
break;
|
break;
|
||||||
|
case "align":
|
||||||
|
newActor.setAlignment(((Float) property.value).intValue());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import forge.adventure.util.SaveFileData;
|
|||||||
import forge.adventure.util.SignalList;
|
import forge.adventure.util.SignalList;
|
||||||
import forge.deck.Deck;
|
import forge.deck.Deck;
|
||||||
import forge.localinstance.properties.ForgeProfileProperties;
|
import forge.localinstance.properties.ForgeProfileProperties;
|
||||||
|
import forge.player.GamePlayerUtil;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
@@ -69,6 +70,7 @@ public class WorldSave {
|
|||||||
currentSave.header = (WorldSaveHeader) oos.readObject();
|
currentSave.header = (WorldSaveHeader) oos.readObject();
|
||||||
SaveFileData mainData=(SaveFileData)oos.readObject();
|
SaveFileData mainData=(SaveFileData)oos.readObject();
|
||||||
currentSave.player.load(mainData.readSubData("player"));
|
currentSave.player.load(mainData.readSubData("player"));
|
||||||
|
GamePlayerUtil.getGuiPlayer().setName(currentSave.player.getName());
|
||||||
currentSave.world.load(mainData.readSubData("world"));
|
currentSave.world.load(mainData.readSubData("world"));
|
||||||
WorldStage.getInstance().load(mainData.readSubData("worldStage"));
|
WorldStage.getInstance().load(mainData.readSubData("worldStage"));
|
||||||
|
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ public class CardZoom extends FOverlay {
|
|||||||
cardHeight = FCardPanel.ASPECT_RATIO * cardWidth;
|
cardHeight = FCardPanel.ASPECT_RATIO * cardWidth;
|
||||||
|
|
||||||
boolean rotateSplit = FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ROTATE_SPLIT_CARDS);
|
boolean rotateSplit = FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ROTATE_SPLIT_CARDS);
|
||||||
if (currentCard.isSplitCard() && rotateSplit) {
|
if (currentCard != null && currentCard.isSplitCard() && rotateSplit) {
|
||||||
// card will be rotated. Make sure that the height does not exceed the width of the view
|
// card will be rotated. Make sure that the height does not exceed the width of the view
|
||||||
if (cardHeight > Gdx.graphics.getWidth())
|
if (cardHeight > Gdx.graphics.getWidth())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import forge.card.CardEdition;
|
|||||||
import forge.deck.io.DeckPreferences;
|
import forge.deck.io.DeckPreferences;
|
||||||
import forge.gamemodes.limited.BoosterDraft;
|
import forge.gamemodes.limited.BoosterDraft;
|
||||||
import forge.gamemodes.planarconquest.ConquestUtil;
|
import forge.gamemodes.planarconquest.ConquestUtil;
|
||||||
import forge.gui.FThreads;
|
|
||||||
import forge.gui.GuiBase;
|
import forge.gui.GuiBase;
|
||||||
import forge.gui.card.CardPreferences;
|
import forge.gui.card.CardPreferences;
|
||||||
import forge.item.PaperCard;
|
import forge.item.PaperCard;
|
||||||
@@ -32,7 +31,6 @@ import forge.menu.FMenuItem;
|
|||||||
import forge.menu.FPopupMenu;
|
import forge.menu.FPopupMenu;
|
||||||
import forge.model.FModel;
|
import forge.model.FModel;
|
||||||
import forge.screens.FScreen;
|
import forge.screens.FScreen;
|
||||||
import forge.screens.LoadingOverlay;
|
|
||||||
import forge.screens.TabPageScreen;
|
import forge.screens.TabPageScreen;
|
||||||
import forge.toolbox.*;
|
import forge.toolbox.*;
|
||||||
import forge.toolbox.FEvent.FEventHandler;
|
import forge.toolbox.FEvent.FEventHandler;
|
||||||
@@ -1134,97 +1132,87 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void refresh() {
|
public void refresh() {
|
||||||
FThreads.invokeInEdtLater(new Runnable() {
|
Predicate<PaperCard> additionalFilter = null;
|
||||||
@Override
|
final EditorType editorType = parentScreen.getEditorType();
|
||||||
public void run() {
|
final Localizer localizer = Localizer.getInstance();
|
||||||
LoadingOverlay.show(Localizer.getInstance().getMessage("lblLoading"), new Runnable() {
|
switch (editorType) {
|
||||||
@Override
|
case Archenemy:
|
||||||
public void run() {
|
cardManager.setPool(FModel.getArchenemyCards(), true);
|
||||||
Predicate<PaperCard> additionalFilter = null;
|
break;
|
||||||
final EditorType editorType = parentScreen.getEditorType();
|
case Planechase:
|
||||||
final Localizer localizer = Localizer.getInstance();
|
cardManager.setPool(FModel.getPlanechaseCards(), true);
|
||||||
switch (editorType) {
|
break;
|
||||||
case Archenemy:
|
case Quest:
|
||||||
cardManager.setPool(FModel.getArchenemyCards(), true);
|
final ItemPool<PaperCard> questPool = new ItemPool<>(PaperCard.class);
|
||||||
break;
|
questPool.addAll(FModel.getQuest().getCards().getCardpool());
|
||||||
case Planechase:
|
// remove bottom cards that are in the deck from the card pool
|
||||||
cardManager.setPool(FModel.getPlanechaseCards(), true);
|
questPool.removeAll(parentScreen.getDeck().getMain());
|
||||||
break;
|
// remove sideboard cards from the catalog
|
||||||
case Quest:
|
questPool.removeAll(parentScreen.getDeck().getOrCreate(DeckSection.Sideboard));
|
||||||
final ItemPool<PaperCard> questPool = new ItemPool<>(PaperCard.class);
|
cardManager.setPool(questPool);
|
||||||
questPool.addAll(FModel.getQuest().getCards().getCardpool());
|
break;
|
||||||
// remove bottom cards that are in the deck from the card pool
|
case PlanarConquest:
|
||||||
questPool.removeAll(parentScreen.getDeck().getMain());
|
cardManager.setPool(ConquestUtil.getAvailablePool(parentScreen.getDeck()));
|
||||||
// remove sideboard cards from the catalog
|
break;
|
||||||
questPool.removeAll(parentScreen.getDeck().getOrCreate(DeckSection.Sideboard));
|
case QuestCommander:
|
||||||
cardManager.setPool(questPool);
|
case Commander:
|
||||||
break;
|
case Oathbreaker:
|
||||||
case PlanarConquest:
|
case TinyLeaders:
|
||||||
cardManager.setPool(ConquestUtil.getAvailablePool(parentScreen.getDeck()));
|
case Brawl:
|
||||||
break;
|
final List<PaperCard> commanders = parentScreen.getDeck().getCommanders();
|
||||||
case QuestCommander:
|
if (commanders.isEmpty()) {
|
||||||
case Commander:
|
//if no commander set for deck, only show valid commanders
|
||||||
case Oathbreaker:
|
switch (editorType) {
|
||||||
case TinyLeaders:
|
case Commander:
|
||||||
case Brawl:
|
case QuestCommander:
|
||||||
final List<PaperCard> commanders = parentScreen.getDeck().getCommanders();
|
additionalFilter = DeckFormat.Commander.isLegalCommanderPredicate();
|
||||||
if (commanders.isEmpty()) {
|
cardManager.setCaption(localizer.getMessage("lblCommanders"));
|
||||||
//if no commander set for deck, only show valid commanders
|
break;
|
||||||
switch (editorType) {
|
case Oathbreaker:
|
||||||
case Commander:
|
additionalFilter = DeckFormat.Oathbreaker.isLegalCommanderPredicate();
|
||||||
case QuestCommander:
|
cardManager.setCaption(localizer.getMessage("lblOathbreakers"));
|
||||||
additionalFilter = DeckFormat.Commander.isLegalCommanderPredicate();
|
break;
|
||||||
cardManager.setCaption(localizer.getMessage("lblCommanders"));
|
case TinyLeaders:
|
||||||
break;
|
additionalFilter = DeckFormat.TinyLeaders.isLegalCommanderPredicate();
|
||||||
case Oathbreaker:
|
cardManager.setCaption(localizer.getMessage("lblCommanders"));
|
||||||
additionalFilter = DeckFormat.Oathbreaker.isLegalCommanderPredicate();
|
break;
|
||||||
cardManager.setCaption(localizer.getMessage("lblOathbreakers"));
|
case Brawl:
|
||||||
break;
|
additionalFilter = DeckFormat.Brawl.isLegalCommanderPredicate();
|
||||||
case TinyLeaders:
|
cardManager.setCaption(localizer.getMessage("lblCommanders"));
|
||||||
additionalFilter = DeckFormat.TinyLeaders.isLegalCommanderPredicate();
|
break;
|
||||||
cardManager.setCaption(localizer.getMessage("lblCommanders"));
|
default:
|
||||||
break;
|
// Do nothing
|
||||||
case Brawl:
|
|
||||||
additionalFilter = DeckFormat.Brawl.isLegalCommanderPredicate();
|
|
||||||
cardManager.setCaption(localizer.getMessage("lblCommanders"));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
// Do nothing
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//if a commander has been set, only show cards that match its color identity
|
|
||||||
switch (editorType) {
|
|
||||||
case Commander:
|
|
||||||
case QuestCommander:
|
|
||||||
additionalFilter = DeckFormat.Commander.isLegalCardForCommanderPredicate(commanders);
|
|
||||||
break;
|
|
||||||
case Oathbreaker:
|
|
||||||
additionalFilter = DeckFormat.Oathbreaker.isLegalCardForCommanderPredicate(commanders);
|
|
||||||
break;
|
|
||||||
case TinyLeaders:
|
|
||||||
additionalFilter = DeckFormat.TinyLeaders.isLegalCardForCommanderPredicate(commanders);
|
|
||||||
break;
|
|
||||||
case Brawl:
|
|
||||||
additionalFilter = DeckFormat.Brawl.isLegalCardForCommanderPredicate(commanders);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
// Do nothing
|
|
||||||
}
|
|
||||||
cardManager.setCaption(localizer.getMessage("lblCards"));
|
|
||||||
}
|
|
||||||
// fall through to below
|
|
||||||
default:
|
|
||||||
if (cardManager.getWantUnique()) {
|
|
||||||
cardManager.setPool(editorType.applyCardFilter(FModel.getUniqueCardsNoAlt(), additionalFilter), true);
|
|
||||||
} else {
|
|
||||||
cardManager.setPool(editorType.applyCardFilter(FModel.getAllCardsNoAlt(), additionalFilter), true);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
} else {
|
||||||
}
|
//if a commander has been set, only show cards that match its color identity
|
||||||
});
|
switch (editorType) {
|
||||||
|
case Commander:
|
||||||
|
case QuestCommander:
|
||||||
|
additionalFilter = DeckFormat.Commander.isLegalCardForCommanderPredicate(commanders);
|
||||||
|
break;
|
||||||
|
case Oathbreaker:
|
||||||
|
additionalFilter = DeckFormat.Oathbreaker.isLegalCardForCommanderPredicate(commanders);
|
||||||
|
break;
|
||||||
|
case TinyLeaders:
|
||||||
|
additionalFilter = DeckFormat.TinyLeaders.isLegalCardForCommanderPredicate(commanders);
|
||||||
|
break;
|
||||||
|
case Brawl:
|
||||||
|
additionalFilter = DeckFormat.Brawl.isLegalCardForCommanderPredicate(commanders);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
cardManager.setCaption(localizer.getMessage("lblCards"));
|
||||||
|
}
|
||||||
|
// fall through to below
|
||||||
|
default:
|
||||||
|
if (cardManager.getWantUnique()) {
|
||||||
|
cardManager.setPool(editorType.applyCardFilter(FModel.getUniqueCardsNoAlt(), additionalFilter), true);
|
||||||
|
} else {
|
||||||
|
cardManager.setPool(editorType.applyCardFilter(FModel.getAllCardsNoAlt(), additionalFilter), true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import forge.player.GamePlayerUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
@@ -326,6 +327,9 @@ public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
|
|||||||
|
|
||||||
//TODO: Investigate why AI names cannot be overriden?
|
//TODO: Investigate why AI names cannot be overriden?
|
||||||
updateName(i, getPlayerName(i));
|
updateName(i, getPlayerName(i));
|
||||||
|
if(i == 0 && Forge.isMobileAdventureMode) {
|
||||||
|
updateName(0, GamePlayerUtil.getGuiPlayer().getName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
FThreads.invokeInBackgroundThread(new Runnable() { //must call startGame in background thread in case there are alerts
|
FThreads.invokeInBackgroundThread(new Runnable() { //must call startGame in background thread in case there are alerts
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -312,10 +312,10 @@ public class MatchController extends AbstractGuiGame {
|
|||||||
public void run() {
|
public void run() {
|
||||||
Forge.clearTransitionScreen();
|
Forge.clearTransitionScreen();
|
||||||
Forge.clearCurrentScreen();
|
Forge.clearCurrentScreen();
|
||||||
Forge.setCursor(null, "0");
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Forge.setTransitionScreen(new TransitionScreen(runnable, ScreenUtils.getFrameBufferTexture(), false, false));
|
Forge.setTransitionScreen(new TransitionScreen(runnable, ScreenUtils.getFrameBufferTexture(), false, false));
|
||||||
|
Forge.setCursor(null, "0");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (hasLocalPlayers() || getGameView().isMatchOver()) {
|
if (hasLocalPlayers() || getGameView().isMatchOver()) {
|
||||||
|
|||||||
BIN
forge-gui/res/adventure/Shandalar/ui/blank.png
Normal file
BIN
forge-gui/res/adventure/Shandalar/ui/blank.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -1,51 +1,48 @@
|
|||||||
{
|
{
|
||||||
"width": 480,
|
"width": 480,
|
||||||
"height": 270,
|
"height": 270,
|
||||||
"yDown": true,
|
"yDown": true,
|
||||||
"elements":[
|
"elements": [
|
||||||
{
|
{
|
||||||
"type" : "Image",
|
"type": "Image",
|
||||||
"image":"ui/title_bg.png",
|
"image": "ui/title_bg.png",
|
||||||
"width": 480,
|
"width": 480,
|
||||||
"height": 270
|
"height": 270
|
||||||
} ,
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"type" : "Scroll",
|
"type": "Scroll",
|
||||||
"name": "deckSlots",
|
"name": "deckSlots",
|
||||||
"x": 10,
|
"x": 10,
|
||||||
"y": 10 ,
|
"y": 10,
|
||||||
"width": 344,
|
"width": 344,
|
||||||
"height": 235
|
"height": 235
|
||||||
} ,
|
},
|
||||||
{
|
{
|
||||||
"type" : "TextButton",
|
"type": "TextButton",
|
||||||
"name" : "return" ,
|
"name": "return",
|
||||||
"text" : "Back" ,
|
"text": "Back",
|
||||||
"width": 96,
|
"width": 96,
|
||||||
"height": 16,
|
"height": 16,
|
||||||
"x": 15,
|
"x": 15,
|
||||||
"y": 250
|
"y": 250
|
||||||
} ,
|
},
|
||||||
{
|
{
|
||||||
"type" : "TextButton",
|
"type": "TextButton",
|
||||||
"name" : "rename" ,
|
"name": "rename",
|
||||||
"text" : "Rename Deck" ,
|
"text": "Rename Deck",
|
||||||
"width": 96,
|
"width": 96,
|
||||||
"height": 16,
|
"height": 16,
|
||||||
"x": 115,
|
"x": 115,
|
||||||
"y": 250
|
"y": 250
|
||||||
} ,
|
},
|
||||||
{
|
{
|
||||||
"type" : "TextButton",
|
"type": "TextButton",
|
||||||
"name" : "edit" ,
|
"name": "edit",
|
||||||
"text" : "Edit Deck" ,
|
"text": "Edit Deck",
|
||||||
"width": 96,
|
"width": 96,
|
||||||
"height": 16,
|
"height": 16,
|
||||||
"x": 215,
|
"x": 215,
|
||||||
"y": 250
|
"y": 250
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"width": 480,
|
||||||
|
"height": 270,
|
||||||
|
"yDown": true,
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"type": "Image",
|
||||||
|
"image": "ui/title_bg.png",
|
||||||
|
"width": 480,
|
||||||
|
"height": 270
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Scroll",
|
||||||
|
"name": "deckSlots",
|
||||||
|
"x": 15,
|
||||||
|
"y": 18,
|
||||||
|
"width": 330,
|
||||||
|
"height": 235
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "return",
|
||||||
|
"text": "Back",
|
||||||
|
"width": 100,
|
||||||
|
"height": 30,
|
||||||
|
"x": 365,
|
||||||
|
"y": 60
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "rename",
|
||||||
|
"text": "Rename Deck",
|
||||||
|
"width": 100,
|
||||||
|
"height": 30,
|
||||||
|
"x": 365,
|
||||||
|
"y": 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "edit",
|
||||||
|
"text": "Edit Deck",
|
||||||
|
"width": 100,
|
||||||
|
"height": 30,
|
||||||
|
"x": 365,
|
||||||
|
"y": 180
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
forge-gui/res/adventure/Shandalar/ui/heal.png
Normal file
BIN
forge-gui/res/adventure/Shandalar/ui/heal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -9,32 +9,56 @@
|
|||||||
"width": 480,
|
"width": 480,
|
||||||
"height": 270
|
"height": 270
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "Image",
|
||||||
|
"image": "ui/heal.png",
|
||||||
|
"x": 60,
|
||||||
|
"y": 85,
|
||||||
|
"width": 100,
|
||||||
|
"height": 100
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "TextButton",
|
"type": "TextButton",
|
||||||
"name": "heal",
|
"name": "heal",
|
||||||
"text": "Heal",
|
"text": "Heal",
|
||||||
"width": 48,
|
"width": 100,
|
||||||
"height": 16,
|
"height": 30,
|
||||||
"x": 420,
|
"x": 60,
|
||||||
"y": 10
|
"y": 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Image",
|
||||||
|
"image": "ui/sell.png",
|
||||||
|
"x": 190,
|
||||||
|
"y": 85,
|
||||||
|
"width": 100,
|
||||||
|
"height": 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "TextButton",
|
"type": "TextButton",
|
||||||
"name": "sell",
|
"name": "sell",
|
||||||
"text": "Sell cards",
|
"text": "Sell cards",
|
||||||
"width": 48,
|
"width": 100,
|
||||||
"height": 16,
|
"height": 30,
|
||||||
"x": 420,
|
"x": 190,
|
||||||
"y": 34
|
"y": 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Image",
|
||||||
|
"image": "ui/leave.png",
|
||||||
|
"x": 320,
|
||||||
|
"y": 85,
|
||||||
|
"width": 100,
|
||||||
|
"height": 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "TextButton",
|
"type": "TextButton",
|
||||||
"name": "done",
|
"name": "done",
|
||||||
"text": "Leave",
|
"text": "Leave",
|
||||||
"width": 48,
|
"width": 100,
|
||||||
"height": 16,
|
"height": 30,
|
||||||
"x": 420,
|
"x": 320,
|
||||||
"y": 58
|
"y": 200
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
BIN
forge-gui/res/adventure/Shandalar/ui/leave.png
Normal file
BIN
forge-gui/res/adventure/Shandalar/ui/leave.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
163
forge-gui/res/adventure/Shandalar/ui/new_game_mobile.json
Normal file
163
forge-gui/res/adventure/Shandalar/ui/new_game_mobile.json
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
{
|
||||||
|
"width": 480,
|
||||||
|
"height": 270,
|
||||||
|
"yDown": true,
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"type": "Image",
|
||||||
|
"image": "ui/title_bg.png",
|
||||||
|
"width": 480,
|
||||||
|
"height": 270
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Scroll",
|
||||||
|
"style": "paper",
|
||||||
|
"x": 56,
|
||||||
|
"y": 10,
|
||||||
|
"width": 256,
|
||||||
|
"height": 250
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Label",
|
||||||
|
"text": "Create a Character",
|
||||||
|
"width": 128,
|
||||||
|
"height": 32,
|
||||||
|
"font": "blackbig",
|
||||||
|
"x": 104,
|
||||||
|
"y": 16
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Label",
|
||||||
|
"text": "Avatar:",
|
||||||
|
"width": 128,
|
||||||
|
"height": 32,
|
||||||
|
"x": 104,
|
||||||
|
"y": 58
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Label",
|
||||||
|
"text": "Name:",
|
||||||
|
"width": 128,
|
||||||
|
"height": 32,
|
||||||
|
"x": 104,
|
||||||
|
"y": 90
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Label",
|
||||||
|
"text": "Race:",
|
||||||
|
"width": 128,
|
||||||
|
"height": 32,
|
||||||
|
"x": 104,
|
||||||
|
"y": 124
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Label",
|
||||||
|
"text": "Gender:",
|
||||||
|
"width": 128,
|
||||||
|
"height": 32,
|
||||||
|
"x": 104,
|
||||||
|
"y": 154
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Label",
|
||||||
|
"text": "Difficulty:",
|
||||||
|
"width": 128,
|
||||||
|
"height": 32,
|
||||||
|
"x": 104,
|
||||||
|
"y": 186
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Label",
|
||||||
|
"text": "Deck:",
|
||||||
|
"width": 128,
|
||||||
|
"height": 32,
|
||||||
|
"x": 104,
|
||||||
|
"y": 218
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "ImageButton",
|
||||||
|
"name": "leftAvatar",
|
||||||
|
"style": "leftarrow",
|
||||||
|
"width": 16,
|
||||||
|
"height": 16,
|
||||||
|
"x": 164,
|
||||||
|
"y": 64
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Image",
|
||||||
|
"name": "avatarPreview",
|
||||||
|
"width": 48,
|
||||||
|
"height": 48,
|
||||||
|
"x": 196,
|
||||||
|
"y": 48
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "ImageButton",
|
||||||
|
"name": "rightAvatar",
|
||||||
|
"style": "rightarrow",
|
||||||
|
"width": 16,
|
||||||
|
"height": 16,
|
||||||
|
"x": 260,
|
||||||
|
"y": 64
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextField",
|
||||||
|
"name": "nameField",
|
||||||
|
"align": 1,
|
||||||
|
"width": 112,
|
||||||
|
"height": 16,
|
||||||
|
"x": 164,
|
||||||
|
"y": 96
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Selector",
|
||||||
|
"name": "race",
|
||||||
|
"width": 112,
|
||||||
|
"height": 16,
|
||||||
|
"x": 164,
|
||||||
|
"y": 128
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Selector",
|
||||||
|
"name": "gender",
|
||||||
|
"width": 112,
|
||||||
|
"height": 16,
|
||||||
|
"x": 164,
|
||||||
|
"y": 160
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Selector",
|
||||||
|
"name": "difficulty",
|
||||||
|
"width": 112,
|
||||||
|
"height": 16,
|
||||||
|
"x": 164,
|
||||||
|
"y": 192
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Selector",
|
||||||
|
"name": "deck",
|
||||||
|
"width": 112,
|
||||||
|
"height": 16,
|
||||||
|
"x": 164,
|
||||||
|
"y": 224
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "back",
|
||||||
|
"text": "Back",
|
||||||
|
"width": 100,
|
||||||
|
"height": 30,
|
||||||
|
"x": 348,
|
||||||
|
"y": 85
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "start",
|
||||||
|
"text": "Start",
|
||||||
|
"width": 100,
|
||||||
|
"height": 30,
|
||||||
|
"x": 348,
|
||||||
|
"y": 155
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
68
forge-gui/res/adventure/Shandalar/ui/save_load_mobile.json
Normal file
68
forge-gui/res/adventure/Shandalar/ui/save_load_mobile.json
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
{
|
||||||
|
"width": 480,
|
||||||
|
"height": 270,
|
||||||
|
"yDown": true,
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"type": "Image",
|
||||||
|
"image": "ui/title_bg.png",
|
||||||
|
"width": 480,
|
||||||
|
"height": 270
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Scroll",
|
||||||
|
"name": "saveSlots",
|
||||||
|
"x": 15,
|
||||||
|
"y": 18,
|
||||||
|
"width": 332,
|
||||||
|
"height": 235
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Image",
|
||||||
|
"image": "ui/blank.png",
|
||||||
|
"width": 96,
|
||||||
|
"height": 54,
|
||||||
|
"x": 370,
|
||||||
|
"y": 30
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Image",
|
||||||
|
"name" : "preview_border",
|
||||||
|
"image": "ui/avatarhud.png",
|
||||||
|
"width": 96,
|
||||||
|
"height": 54,
|
||||||
|
"x": 370,
|
||||||
|
"y": 30
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Image",
|
||||||
|
"name": "preview",
|
||||||
|
"width": 86,
|
||||||
|
"height": 48,
|
||||||
|
"x": 376,
|
||||||
|
"y": 33
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "return",
|
||||||
|
"text": "Back",
|
||||||
|
"width": 100,
|
||||||
|
"height": 30,
|
||||||
|
"x": 368,
|
||||||
|
"y": 125
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "save",
|
||||||
|
"text": "saveLoad",
|
||||||
|
"width": 100,
|
||||||
|
"height": 30,
|
||||||
|
"x": 368,
|
||||||
|
"y": 195
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Table",
|
||||||
|
"font": "default"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
forge-gui/res/adventure/Shandalar/ui/sell.png
Normal file
BIN
forge-gui/res/adventure/Shandalar/ui/sell.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
30
forge-gui/res/adventure/Shandalar/ui/settings_mobile.json
Normal file
30
forge-gui/res/adventure/Shandalar/ui/settings_mobile.json
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"width": 480,
|
||||||
|
"height": 270,
|
||||||
|
"yDown": true,
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"type": "Image",
|
||||||
|
"image": "ui/title_bg.png",
|
||||||
|
"width": 480,
|
||||||
|
"height": 270
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Scroll",
|
||||||
|
"name": "settings",
|
||||||
|
"x": 15,
|
||||||
|
"y": 18,
|
||||||
|
"width": 382,
|
||||||
|
"height": 235
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "return",
|
||||||
|
"text": "Back",
|
||||||
|
"width": 52,
|
||||||
|
"height": 30,
|
||||||
|
"x": 415,
|
||||||
|
"y": 120
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,70 +1,67 @@
|
|||||||
{
|
{
|
||||||
"width": 480,
|
"width": 480,
|
||||||
"height": 270,
|
"height": 270,
|
||||||
"yDown": true,
|
"yDown": true,
|
||||||
"elements":[
|
"elements": [
|
||||||
{
|
{
|
||||||
"type" : "Image",
|
"type": "Image",
|
||||||
"image":"ui/title_bg.png",
|
"image": "ui/title_bg.png",
|
||||||
"width": 480,
|
"width": 480,
|
||||||
"height": 270
|
"height": 270
|
||||||
}
|
|
||||||
,
|
|
||||||
{
|
|
||||||
"type" : "TextButton",
|
|
||||||
"name" : "Start" ,
|
|
||||||
"text" : "New Game",
|
|
||||||
"width": 120,
|
|
||||||
"height": 30,
|
|
||||||
"x": 20,
|
|
||||||
"y": 20
|
|
||||||
} ,
|
|
||||||
{
|
|
||||||
"type" : "TextButton",
|
|
||||||
"name" : "Load" ,
|
|
||||||
"text" : "Load",
|
|
||||||
"width": 120,
|
|
||||||
"height": 30,
|
|
||||||
"x": 20,
|
|
||||||
"y": 60
|
|
||||||
} ,
|
|
||||||
{
|
|
||||||
"type" : "TextButton",
|
|
||||||
"name" : "Save" ,
|
|
||||||
"text" : "Save",
|
|
||||||
"width": 120,
|
|
||||||
"height": 30,
|
|
||||||
"x": 20,
|
|
||||||
"y": 100
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type" : "TextButton",
|
"type": "TextButton",
|
||||||
"name" : "Resume" ,
|
"name": "Start",
|
||||||
"text" : "Resume",
|
"text": "New Game",
|
||||||
"width": 120,
|
"width": 120,
|
||||||
"height": 30,
|
"height": 30,
|
||||||
"x": 20,
|
"x": 20,
|
||||||
"y": 140
|
"y": 20
|
||||||
} ,
|
},
|
||||||
{
|
{
|
||||||
"type" : "TextButton",
|
"type": "TextButton",
|
||||||
"name" : "Settings" ,
|
"name": "Load",
|
||||||
"text" : "Settings",
|
"text": "Load",
|
||||||
"width": 120,
|
"width": 120,
|
||||||
"height": 30,
|
"height": 30,
|
||||||
"x": 20,
|
"x": 20,
|
||||||
"y": 180
|
"y": 60
|
||||||
} ,
|
},
|
||||||
{
|
{
|
||||||
"type" : "TextButton",
|
"type": "TextButton",
|
||||||
"name" : "Exit" ,
|
"name": "Save",
|
||||||
"text" : "Exit",
|
"text": "Save",
|
||||||
"width": 120,
|
"width": 120,
|
||||||
"height": 30,
|
"height": 30,
|
||||||
"x": 20,
|
"x": 20,
|
||||||
"y": 220
|
"y": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "Resume",
|
||||||
|
"text": "Resume",
|
||||||
|
"width": 120,
|
||||||
|
"height": 30,
|
||||||
|
"x": 20,
|
||||||
|
"y": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "Settings",
|
||||||
|
"text": "Settings",
|
||||||
|
"width": 120,
|
||||||
|
"height": 30,
|
||||||
|
"x": 20,
|
||||||
|
"y": 180
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "Exit",
|
||||||
|
"text": "Exit",
|
||||||
|
"width": 120,
|
||||||
|
"height": 30,
|
||||||
|
"x": 20,
|
||||||
|
"y": 220
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
67
forge-gui/res/adventure/Shandalar/ui/start_menu_mobile.json
Normal file
67
forge-gui/res/adventure/Shandalar/ui/start_menu_mobile.json
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
"width": 480,
|
||||||
|
"height": 270,
|
||||||
|
"yDown": true,
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"type": "Image",
|
||||||
|
"image": "ui/title_bg.png",
|
||||||
|
"width": 480,
|
||||||
|
"height": 270
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "Start",
|
||||||
|
"text": "New Game",
|
||||||
|
"width": 160,
|
||||||
|
"height": 30,
|
||||||
|
"x": 160,
|
||||||
|
"y": 20
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "Load",
|
||||||
|
"text": "Load",
|
||||||
|
"width": 160,
|
||||||
|
"height": 30,
|
||||||
|
"x": 160,
|
||||||
|
"y": 60
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "Save",
|
||||||
|
"text": "Save",
|
||||||
|
"width": 160,
|
||||||
|
"height": 30,
|
||||||
|
"x": 160,
|
||||||
|
"y": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "Resume",
|
||||||
|
"text": "Resume",
|
||||||
|
"width": 160,
|
||||||
|
"height": 30,
|
||||||
|
"x": 160,
|
||||||
|
"y": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "Settings",
|
||||||
|
"text": "Settings",
|
||||||
|
"width": 160,
|
||||||
|
"height": 30,
|
||||||
|
"x": 160,
|
||||||
|
"y": 180
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "Exit",
|
||||||
|
"text": "Exit",
|
||||||
|
"width": 160,
|
||||||
|
"height": 30,
|
||||||
|
"x": 160,
|
||||||
|
"y": 220
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -9,92 +9,109 @@
|
|||||||
"width": 480,
|
"width": 480,
|
||||||
"height": 270
|
"height": 270
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "Scroll",
|
||||||
|
"style": "paper",
|
||||||
|
"x": 300,
|
||||||
|
"y": 18,
|
||||||
|
"width": 160,
|
||||||
|
"height": 180
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "Scroll",
|
"type": "Scroll",
|
||||||
"name": "enemies",
|
"name": "enemies",
|
||||||
"x": 206,
|
"x": 15,
|
||||||
"y": 10,
|
"y": 18,
|
||||||
"width": 256,
|
"width": 256,
|
||||||
"height": 235
|
"height": 235
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Image",
|
"type": "Image",
|
||||||
"name": "avatar",
|
"name": "avatar",
|
||||||
"x": 10,
|
"x": 350,
|
||||||
"y": 10,
|
"y": 28,
|
||||||
"width": 64,
|
"width": 64,
|
||||||
"height": 64
|
"height": 64
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "Label",
|
|
||||||
"name": "totalWins",
|
|
||||||
"x": 90,
|
|
||||||
"y": 84,
|
|
||||||
"width": 80,
|
|
||||||
"height": 24,
|
|
||||||
"font": "default"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Label",
|
|
||||||
"text": "Win:",
|
|
||||||
"x": 10,
|
|
||||||
"y": 84,
|
|
||||||
"width": 80,
|
|
||||||
"height": 24,
|
|
||||||
"font": "default"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Label",
|
|
||||||
"name": "totalLoss",
|
|
||||||
"x": 90,
|
|
||||||
"y": 104,
|
|
||||||
"width": 80,
|
|
||||||
"height": 24,
|
|
||||||
"font": "default"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Label",
|
|
||||||
"text": "Loss:",
|
|
||||||
"x": 10,
|
|
||||||
"y": 104,
|
|
||||||
"width": 80,
|
|
||||||
"height": 24,
|
|
||||||
"font": "default"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Label",
|
|
||||||
"name": "lossWinRatio",
|
|
||||||
"x": 90,
|
|
||||||
"y": 124,
|
|
||||||
"width": 80,
|
|
||||||
"height": 24,
|
|
||||||
"font": "default"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Label",
|
|
||||||
"text": "Win Loss Ratio:",
|
|
||||||
"x": 10,
|
|
||||||
"y": 124,
|
|
||||||
"width": 80,
|
|
||||||
"height": 24,
|
|
||||||
"font": "default"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "Image",
|
"type": "Image",
|
||||||
"image": "ui/avatarhud.png",
|
"image": "ui/avatarhud.png",
|
||||||
"x": 10,
|
"x": 350,
|
||||||
"y": 10,
|
"y": 28,
|
||||||
"width": 64,
|
"width": 64,
|
||||||
"height": 64
|
"height": 64
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "Label",
|
||||||
|
"name": "playerName",
|
||||||
|
"x": 330,
|
||||||
|
"y": 90,
|
||||||
|
"width": 80,
|
||||||
|
"height": 24,
|
||||||
|
"font": "black"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Label",
|
||||||
|
"name": "totalWins",
|
||||||
|
"x": 410,
|
||||||
|
"y": 114,
|
||||||
|
"width": 80,
|
||||||
|
"height": 24,
|
||||||
|
"font": "black"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Label",
|
||||||
|
"text": "Win:",
|
||||||
|
"x": 330,
|
||||||
|
"y": 114,
|
||||||
|
"width": 80,
|
||||||
|
"height": 24,
|
||||||
|
"font": "black"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Label",
|
||||||
|
"name": "totalLoss",
|
||||||
|
"x": 410,
|
||||||
|
"y": 134,
|
||||||
|
"width": 80,
|
||||||
|
"height": 24,
|
||||||
|
"font": "black"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Label",
|
||||||
|
"text": "Loss:",
|
||||||
|
"x": 330,
|
||||||
|
"y": 134,
|
||||||
|
"width": 80,
|
||||||
|
"height": 24,
|
||||||
|
"font": "black"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Label",
|
||||||
|
"name": "lossWinRatio",
|
||||||
|
"x": 410,
|
||||||
|
"y": 154,
|
||||||
|
"width": 80,
|
||||||
|
"height": 24,
|
||||||
|
"font": "black"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Label",
|
||||||
|
"text": "Win Loss Ratio:",
|
||||||
|
"x": 330,
|
||||||
|
"y": 154,
|
||||||
|
"width": 80,
|
||||||
|
"height": 24,
|
||||||
|
"font": "black"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "TextButton",
|
"type": "TextButton",
|
||||||
"name": "return",
|
"name": "return",
|
||||||
"text": "Back",
|
"text": "Back",
|
||||||
"width": 48,
|
"width": 100,
|
||||||
"height": 16,
|
"height": 30,
|
||||||
"x": 15,
|
"x": 335,
|
||||||
"y": 250
|
"y": 212
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Table",
|
"type": "Table",
|
||||||
|
|||||||
Reference in New Issue
Block a user