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.ScreenUtils;
|
||||
import forge.adventure.scene.ForgeScene;
|
||||
import forge.adventure.scene.GameScene;
|
||||
import forge.adventure.scene.Scene;
|
||||
import forge.adventure.scene.SceneType;
|
||||
import forge.adventure.stage.MapStage;
|
||||
import forge.adventure.util.Config;
|
||||
import forge.animation.ForgeAnimation;
|
||||
import forge.assets.AssetsDownloader;
|
||||
@@ -887,7 +889,6 @@ public class Forge implements ApplicationListener {
|
||||
}
|
||||
|
||||
public static boolean switchScene(Scene newScene) {
|
||||
|
||||
if (currentScene != null) {
|
||||
if (!currentScene.leave())
|
||||
return false;
|
||||
@@ -895,6 +896,8 @@ public class Forge implements ApplicationListener {
|
||||
}
|
||||
storeScreen();
|
||||
sceneWasSwapped =true;
|
||||
if (newScene instanceof GameScene)
|
||||
MapStage.getInstance().clearIsInMap();
|
||||
currentScene = newScene;
|
||||
currentScene.enter();
|
||||
return true;
|
||||
|
||||
@@ -54,8 +54,8 @@ import java.util.Map;
|
||||
private static ItemPool<InventoryItem> decksUsingMyCards=new ItemPool<>(InventoryItem.class);
|
||||
public static void leave() {
|
||||
AdventurePlayer.current().getNewCards().clear();
|
||||
Forge.switchScene(SceneType.DeckSelectScene.instance);
|
||||
Forge.clearCurrentScreen();
|
||||
Forge.switchToLast();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,6 +16,7 @@ import forge.Forge;
|
||||
import forge.adventure.player.AdventurePlayer;
|
||||
import forge.adventure.util.Controls;
|
||||
import forge.adventure.util.Current;
|
||||
import forge.gui.GuiBase;
|
||||
|
||||
public class DeckSelectScene extends UIScene {
|
||||
private final IntMap<TextButton> buttons = new IntMap<>();
|
||||
@@ -27,19 +28,16 @@ public class DeckSelectScene extends UIScene {
|
||||
int currentSlot = 0;
|
||||
|
||||
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) {
|
||||
TextButton button = Controls.newTextButton("-");
|
||||
button.addListener(new ClickListener() {
|
||||
@Override
|
||||
public void clicked(InputEvent event, float x, float y) {
|
||||
try {
|
||||
if(!button.isDisabled())
|
||||
if (!button.isDisabled())
|
||||
select(i);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -47,22 +45,21 @@ public class DeckSelectScene extends UIScene {
|
||||
}
|
||||
});
|
||||
|
||||
layout.add(Controls.newLabel(name)).expandX();
|
||||
layout.add(button).expandX();
|
||||
layout.add(Controls.newLabel(name)).expandX().pad(2);
|
||||
layout.add(button).expandX().pad(2);
|
||||
buttons.put(i, button);
|
||||
layout.row();
|
||||
return button;
|
||||
|
||||
}
|
||||
|
||||
public void back() {
|
||||
Forge.switchScene(SceneType.GameScene.instance);
|
||||
Forge.switchToLast();
|
||||
}
|
||||
|
||||
public boolean select(int 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);
|
||||
}
|
||||
if (buttons.containsKey(slot)) {
|
||||
@@ -75,23 +72,19 @@ public class DeckSelectScene extends UIScene {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean keyPressed(int keycode)
|
||||
{
|
||||
if (keycode == Input.Keys.ESCAPE)
|
||||
{
|
||||
public boolean keyPressed(int keycode) {
|
||||
if (keycode == Input.Keys.ESCAPE) {
|
||||
back();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enter() {
|
||||
select(Current.player().getSelectedDeckIndex());
|
||||
for(int i=0;i<AdventurePlayer.NUMBER_OF_DECKS;i++)
|
||||
{
|
||||
if(buttons.containsKey(i))
|
||||
{
|
||||
for (int i = 0; i < AdventurePlayer.NUMBER_OF_DECKS; i++) {
|
||||
if (buttons.containsKey(i)) {
|
||||
buttons.get(i).setText(Current.player().getDeck(i).getName());
|
||||
}
|
||||
}
|
||||
@@ -102,15 +95,13 @@ public class DeckSelectScene extends UIScene {
|
||||
public void resLoaded() {
|
||||
super.resLoaded();
|
||||
layout = new Table();
|
||||
layout.setFillParent(true);
|
||||
stage.addActor(layout);
|
||||
|
||||
header = Controls.newLabel("Select your Deck");
|
||||
header.setHeight(header.getHeight() * 2);
|
||||
layout.add(header).colspan(2).align(Align.center);
|
||||
layout.add(header).colspan(2).align(Align.center).pad(2, 5, 2, 5);
|
||||
layout.row();
|
||||
for (int i = 0; i < AdventurePlayer.NUMBER_OF_DECKS; i++)
|
||||
addDeckSlot("Deck:" + (i+1), i);
|
||||
addDeckSlot("Deck:" + (i + 1), i);
|
||||
|
||||
dialog = Controls.newDialog("Save");
|
||||
textInput = Controls.newTextField("");
|
||||
@@ -154,19 +145,18 @@ public class DeckSelectScene extends UIScene {
|
||||
});
|
||||
defColor = ui.findActor("return").getColor();
|
||||
|
||||
|
||||
ScrollPane scrollPane = ui.findActor("deckSlots");
|
||||
scrollPane.setActor(layout);
|
||||
}
|
||||
|
||||
private void rename() {
|
||||
dialog.hide();
|
||||
String text=textInput.getText();
|
||||
String text = textInput.getText();
|
||||
Current.player().renameDeck(text);
|
||||
buttons.get(currentSlot).setText(Current.player().getDeck(currentSlot).getName());
|
||||
}
|
||||
private void edit() {
|
||||
|
||||
private void edit() {
|
||||
Forge.switchScene(SceneType.DeckEditScene.instance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,12 @@ package forge.adventure.scene;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.GL20;
|
||||
import com.badlogic.gdx.utils.ScreenUtils;
|
||||
import forge.Forge;
|
||||
import forge.animation.ForgeAnimation;
|
||||
import forge.assets.ImageCache;
|
||||
import forge.gamemodes.match.LobbySlotType;
|
||||
import forge.interfaces.IUpdateable;
|
||||
import forge.screens.FScreen;
|
||||
import forge.screens.TransitionScreen;
|
||||
import forge.toolbox.FDisplayObject;
|
||||
import forge.toolbox.FOverlay;
|
||||
|
||||
@@ -68,22 +66,9 @@ public abstract class ForgeScene extends Scene implements IUpdateable {
|
||||
if(getScreen()!=null)
|
||||
getScreen().setSize(Forge.getScreenWidth(), Forge.getScreenHeight());
|
||||
|
||||
if (this instanceof DuelScene) {
|
||||
Runnable runnable = new Runnable() {
|
||||
@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 void buildTouchListeners(int x, int y, List<FDisplayObject> potentialListeners) {
|
||||
|
||||
@@ -50,5 +50,6 @@ public class GameScene extends HudScene {
|
||||
Forge.clearCurrentScreen();
|
||||
super.enter();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -8,30 +8,27 @@ import forge.adventure.util.Current;
|
||||
|
||||
/**
|
||||
* Scene for the Inn in towns
|
||||
*
|
||||
*/
|
||||
public class InnScene extends UIScene {
|
||||
|
||||
public InnScene()
|
||||
{
|
||||
public InnScene() {
|
||||
super("ui/inn.json");
|
||||
}
|
||||
|
||||
public void done()
|
||||
{
|
||||
public void done() {
|
||||
GameHUD.getInstance().getTouchpad().setVisible(false);
|
||||
Forge.switchToLast();
|
||||
}
|
||||
public void heal()
|
||||
{
|
||||
|
||||
public void heal() {
|
||||
Current.player().heal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void act(float delta) {
|
||||
|
||||
stage.act(delta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resLoaded() {
|
||||
super.resLoaded();
|
||||
@@ -61,10 +58,8 @@ public class InnScene extends UIScene {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean keyPressed(int keycode)
|
||||
{
|
||||
if (keycode == Input.Keys.ESCAPE)
|
||||
{
|
||||
public boolean keyPressed(int keycode) {
|
||||
if (keycode == Input.Keys.ESCAPE) {
|
||||
done();
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -14,6 +14,7 @@ import forge.adventure.util.Config;
|
||||
import forge.adventure.util.Selector;
|
||||
import forge.adventure.world.WorldSave;
|
||||
import forge.deck.Deck;
|
||||
import forge.gui.GuiBase;
|
||||
import forge.localinstance.properties.ForgePreferences;
|
||||
import forge.model.FModel;
|
||||
import forge.player.GamePlayerUtil;
|
||||
@@ -36,10 +37,13 @@ public class NewGameScene extends UIScene {
|
||||
private Selector difficulty;
|
||||
|
||||
public NewGameScene() {
|
||||
super("ui/new_game.json");
|
||||
super(GuiBase.isAndroid() ? "ui/new_game_mobile.json" : "ui/new_game.json");
|
||||
}
|
||||
|
||||
public boolean start() {
|
||||
if (selectedName.getText().isEmpty()) {
|
||||
selectedName.setText(NameGenerator.getRandomName("Any", "Any", ""));
|
||||
}
|
||||
Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -49,7 +53,7 @@ public class NewGameScene extends UIScene {
|
||||
race.getCurrentIndex(),
|
||||
avatarIndex,
|
||||
deck.getCurrentIndex(),
|
||||
Config.instance().getConfigData().difficulties[difficulty.getCurrentIndex()],0);
|
||||
Config.instance().getConfigData().difficulties[difficulty.getCurrentIndex()], 0);
|
||||
GamePlayerUtil.getGuiPlayer().setName(selectedName.getText());
|
||||
Forge.clearTransitionScreen();
|
||||
Forge.switchScene(SceneType.GameScene.instance);
|
||||
@@ -78,7 +82,7 @@ public class NewGameScene extends UIScene {
|
||||
return NewGameScene.this.updateAvatar();
|
||||
}
|
||||
});
|
||||
Random rand=new Random();
|
||||
Random rand = new Random();
|
||||
|
||||
deck = ui.findActor("deck");
|
||||
|
||||
@@ -100,18 +104,17 @@ public class NewGameScene extends UIScene {
|
||||
difficulty = ui.findActor("difficulty");
|
||||
|
||||
Array<String> diffList = new Array<>(starterDeck.length);
|
||||
int i=0;
|
||||
int startingDifficulty=0;
|
||||
for (DifficultyData diff : Config.instance().getConfigData().difficulties)
|
||||
{
|
||||
if(diff.startingDifficulty)
|
||||
startingDifficulty=i;
|
||||
int i = 0;
|
||||
int startingDifficulty = 0;
|
||||
for (DifficultyData diff : Config.instance().getConfigData().difficulties) {
|
||||
if (diff.startingDifficulty)
|
||||
startingDifficulty = i;
|
||||
diffList.add(diff.name);
|
||||
i++;
|
||||
}
|
||||
difficulty.setTextList(diffList);
|
||||
difficulty.setCurrentIndex(startingDifficulty);
|
||||
avatarIndex=rand.nextInt();
|
||||
avatarIndex = rand.nextInt();
|
||||
gender.setCurrentIndex(rand.nextInt());
|
||||
deck.setCurrentIndex(rand.nextInt());
|
||||
race.setCurrentIndex(rand.nextInt());
|
||||
|
||||
@@ -11,8 +11,10 @@ import forge.Forge;
|
||||
import forge.adventure.character.EnemySprite;
|
||||
import forge.adventure.data.EnemyData;
|
||||
import forge.adventure.data.WorldData;
|
||||
import forge.adventure.stage.GameHUD;
|
||||
import forge.adventure.util.Controls;
|
||||
import forge.adventure.util.Current;
|
||||
import forge.player.GamePlayerUtil;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -24,6 +26,7 @@ public class PlayerStatisticScene extends UIScene {
|
||||
Label totalWins;
|
||||
Label totalLoss;
|
||||
Label lossWinRatio;
|
||||
Label playerName;
|
||||
private Table enemiesGroup;
|
||||
|
||||
public PlayerStatisticScene() {
|
||||
@@ -37,64 +40,64 @@ public class PlayerStatisticScene extends UIScene {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean keyPressed(int keycode)
|
||||
{
|
||||
if (keycode == Input.Keys.ESCAPE)
|
||||
{
|
||||
public boolean keyPressed(int keycode) {
|
||||
if (keycode == Input.Keys.ESCAPE) {
|
||||
back();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean back() {
|
||||
GameHUD.getInstance().getTouchpad().setVisible(false);
|
||||
Forge.switchToLast();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enter() {
|
||||
super.enter();
|
||||
enemiesGroup.clear();
|
||||
|
||||
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(("Win")).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("Avatar").align(Align.center).space(3, 10, 3, 10);
|
||||
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(("/")).align(Align.center).space(3, 5, 3, 5);
|
||||
enemiesGroup.add("Loss").align(Align.center).space(3, 5, 3, 5);
|
||||
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()));
|
||||
}
|
||||
if(totalWins!=null)
|
||||
{
|
||||
if (totalWins != null) {
|
||||
totalWins.setText(Current.player().getStatistic().totalWins());
|
||||
}
|
||||
if(totalLoss!=null)
|
||||
{
|
||||
if (totalLoss != null) {
|
||||
totalLoss.setText(Current.player().getStatistic().totalLoss());
|
||||
}
|
||||
if(lossWinRatio!=null)
|
||||
{
|
||||
if (lossWinRatio != null) {
|
||||
lossWinRatio.setText(Float.toString(Current.player().getStatistic().winLossRatio()));
|
||||
}
|
||||
|
||||
for(Map.Entry<String, Pair<Integer,Integer>> entry : Current.player().getStatistic().getWinLossRecord().entrySet())
|
||||
{
|
||||
EnemyData data=WorldData.getEnemy(entry.getKey());
|
||||
if(data==null)continue;
|
||||
Image enemyImage=new Image();
|
||||
for (Map.Entry<String, Pair<Integer, Integer>> entry : Current.player().getStatistic().getWinLossRecord().entrySet()) {
|
||||
EnemyData data = WorldData.getEnemy(entry.getKey());
|
||||
if (data == null) continue;
|
||||
Image enemyImage = new Image();
|
||||
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((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(("/")).align(Align.center).space(3,2,3,2);
|
||||
enemiesGroup.add((entry.getValue().getRight().toString())).align(Align.center).space(0,2,0,2);
|
||||
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((entry.getValue().getLeft().toString())).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.row().space(8);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resLoaded() {
|
||||
super.resLoaded();
|
||||
@@ -107,11 +110,12 @@ public class PlayerStatisticScene extends UIScene {
|
||||
PlayerStatisticScene.this.back();
|
||||
}
|
||||
});
|
||||
avatar=ui.findActor("avatar");
|
||||
avatar = ui.findActor("avatar");
|
||||
playerName = ui.findActor("playerName");
|
||||
|
||||
totalWins=ui.findActor("totalWins");
|
||||
totalLoss=ui.findActor("totalLoss");
|
||||
lossWinRatio=ui.findActor("lossWinRatio");
|
||||
totalWins = ui.findActor("totalWins");
|
||||
totalLoss = ui.findActor("totalLoss");
|
||||
lossWinRatio = ui.findActor("lossWinRatio");
|
||||
|
||||
ScrollPane scrollPane = ui.findActor("enemies");
|
||||
scrollPane.setActor(enemiesGroup);
|
||||
|
||||
@@ -20,6 +20,7 @@ import forge.Forge;
|
||||
import forge.adventure.util.Controls;
|
||||
import forge.adventure.world.WorldSave;
|
||||
import forge.adventure.world.WorldSaveHeader;
|
||||
import forge.gui.GuiBase;
|
||||
import forge.screens.TransitionScreen;
|
||||
|
||||
import java.io.File;
|
||||
@@ -30,7 +31,6 @@ import java.util.zip.InflaterInputStream;
|
||||
|
||||
/**
|
||||
* Scene to load and save the game.
|
||||
*
|
||||
*/
|
||||
public class SaveLoadScene extends UIScene {
|
||||
private final IntMap<TextButton> buttons = new IntMap<>();
|
||||
@@ -43,20 +43,18 @@ public class SaveLoadScene extends UIScene {
|
||||
Label header;
|
||||
int currentSlot = -3;
|
||||
Image previewImage;
|
||||
Image previewBorder;
|
||||
TextButton saveLoadButton;
|
||||
TextButton quickSave;
|
||||
TextButton autoSave;
|
||||
|
||||
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) {
|
||||
layout.add(Controls.newLabel(name)).colspan(1).align(Align.right).expandX();
|
||||
layout.add(Controls.newLabel(" "));
|
||||
layout.add(Controls.newLabel(name)).align(Align.left).pad(4, 10, 4, 15);
|
||||
TextButton button = Controls.newTextButton("...");
|
||||
button.addListener(new ClickListener() {
|
||||
@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);
|
||||
layout.row();
|
||||
return button;
|
||||
@@ -88,9 +86,13 @@ public class SaveLoadScene extends UIScene {
|
||||
if (header.preview != null) {
|
||||
previewImage.setDrawable(new TextureRegionDrawable(new Texture(header.preview)));
|
||||
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);
|
||||
}
|
||||
if (buttons.containsKey(slot)) {
|
||||
@@ -123,18 +125,16 @@ public class SaveLoadScene extends UIScene {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean keyPressed(int keycode)
|
||||
{
|
||||
if (keycode == Input.Keys.ESCAPE)
|
||||
{
|
||||
public boolean keyPressed(int keycode) {
|
||||
if (keycode == Input.Keys.ESCAPE) {
|
||||
back();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void save() {
|
||||
dialog.hide();
|
||||
if( WorldSave.getCurrentSave().save(textInput.getText(), currentSlot))
|
||||
{
|
||||
if (WorldSave.getCurrentSave().save(textInput.getText(), currentSlot)) {
|
||||
updateFiles();
|
||||
Forge.switchScene(SceneType.GameScene.instance);
|
||||
}
|
||||
@@ -147,7 +147,7 @@ public class SaveLoadScene extends UIScene {
|
||||
File f = new File(WorldSave.getSaveDir());
|
||||
f.mkdirs();
|
||||
File[] names = f.listFiles();
|
||||
if(names==null)
|
||||
if (names == null)
|
||||
throw new RuntimeException("Can not find save directory");
|
||||
previews.clear();
|
||||
for (File name : names) {
|
||||
@@ -159,7 +159,7 @@ public class SaveLoadScene extends UIScene {
|
||||
ObjectInputStream oos = new ObjectInputStream(inf)) {
|
||||
|
||||
|
||||
int slot=WorldSave.filenameToSlot(name.getName());
|
||||
int slot = WorldSave.filenameToSlot(name.getName());
|
||||
WorldSaveHeader header = (WorldSaveHeader) oos.readObject();
|
||||
buttons.get(slot).setText(header.name);
|
||||
previews.put(slot, header);
|
||||
@@ -222,12 +222,14 @@ public class SaveLoadScene extends UIScene {
|
||||
})).align(Align.left);
|
||||
|
||||
previewImage = ui.findActor("preview");
|
||||
previewBorder = ui.findActor("preview_border");
|
||||
header = Controls.newLabel("Save");
|
||||
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();
|
||||
autoSave=addSaveSlot("Auto save", WorldSave.AUTO_SAVE_SLOT);
|
||||
quickSave=addSaveSlot("Quick save", WorldSave.QUICK_SAVE_SLOT);
|
||||
autoSave = addSaveSlot("Auto save", WorldSave.AUTO_SAVE_SLOT);
|
||||
quickSave = addSaveSlot("Quick save", WorldSave.QUICK_SAVE_SLOT);
|
||||
for (int i = 1; i < 11; i++)
|
||||
addSaveSlot("Slot:" + i, i);
|
||||
|
||||
@@ -244,8 +246,8 @@ public class SaveLoadScene extends UIScene {
|
||||
SaveLoadScene.this.back();
|
||||
}
|
||||
});
|
||||
defColor = saveLoadButton.getColor();
|
||||
|
||||
defColor = saveLoadButton.getColor();
|
||||
|
||||
ScrollPane scrollPane = ui.findActor("saveSlots");
|
||||
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.utils.ChangeListener;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.badlogic.gdx.utils.Scaling;
|
||||
import forge.Forge;
|
||||
import forge.adventure.util.Config;
|
||||
import forge.adventure.util.Controls;
|
||||
@@ -37,7 +38,7 @@ public class SettingsScene extends UIScene {
|
||||
private Table settingGroup;
|
||||
|
||||
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
|
||||
public boolean keyPressed(int keycode)
|
||||
{
|
||||
if (keycode == Input.Keys.ESCAPE)
|
||||
{
|
||||
public boolean keyPressed(int keycode) {
|
||||
if (keycode == Input.Keys.ESCAPE) {
|
||||
back();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean back() {
|
||||
Forge.switchToLast();
|
||||
return true;
|
||||
}
|
||||
|
||||
private void addInputField(String name, ForgePreferences.FPref pref) {
|
||||
|
||||
|
||||
@@ -91,10 +92,14 @@ public class SettingsScene extends UIScene {
|
||||
addLabel(name);
|
||||
settingGroup.add(box).align(Align.right);
|
||||
}
|
||||
|
||||
private void addCheckBox(String name, ForgePreferences.FPref pref) {
|
||||
|
||||
|
||||
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.addListener(new ChangeListener() {
|
||||
@Override
|
||||
@@ -107,9 +112,9 @@ public class SettingsScene extends UIScene {
|
||||
addLabel(name);
|
||||
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.addListener(new ChangeListener() {
|
||||
@Override
|
||||
@@ -121,17 +126,22 @@ public class SettingsScene extends UIScene {
|
||||
addLabel(name);
|
||||
settingGroup.add(slide).align(Align.right);
|
||||
}
|
||||
|
||||
private void addSettingField(String name, boolean value, ChangeListener change) {
|
||||
|
||||
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.addListener(change);
|
||||
addLabel(name);
|
||||
settingGroup.add(box).align(Align.right);
|
||||
}
|
||||
|
||||
private void addSettingField(String name, int value, ChangeListener change) {
|
||||
|
||||
|
||||
TextField text = Controls.newTextField(String.valueOf(value));
|
||||
text.setTextFieldFilter(new TextField.TextFieldFilter() {
|
||||
@Override
|
||||
@@ -140,19 +150,16 @@ public class SettingsScene extends UIScene {
|
||||
}
|
||||
});
|
||||
text.addListener(change);
|
||||
|
||||
|
||||
addLabel(name);
|
||||
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.add(label).align(Align.left).fillX();
|
||||
settingGroup.add(label).align(Align.left).pad(2,2, 2, 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void 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>() {
|
||||
@Override
|
||||
public Void apply(Object o) {
|
||||
Config.instance().getSettingData().plane= (String) o;
|
||||
Config.instance().getSettingData().plane = (String) o;
|
||||
Config.instance().saveSettings();
|
||||
return null;
|
||||
}
|
||||
});
|
||||
addLabel("Plane");
|
||||
settingGroup.add(plane).align(Align.right);
|
||||
settingGroup.add(plane).align(Align.right).pad(2);
|
||||
|
||||
if (!GuiBase.isAndroid()) {
|
||||
SelectBox videomode = Controls.newComboBox(new String[]{"720p", "768p", "900p", "1080p"}, Config.instance().getSettingData().videomode, new Function<Object, Void>() {
|
||||
@Override
|
||||
public Void apply(Object o) {
|
||||
String mode = (String)o;
|
||||
String mode = (String) o;
|
||||
if (mode == null)
|
||||
mode = "720p";
|
||||
Config.instance().getSettingData().videomode = mode;
|
||||
@@ -204,12 +211,12 @@ public class SettingsScene extends UIScene {
|
||||
}
|
||||
});
|
||||
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() {
|
||||
@Override
|
||||
public void changed(ChangeEvent event, Actor actor) {
|
||||
boolean value = ((CheckBox) actor).isChecked();
|
||||
Config.instance().getSettingData().fullScreen=value;
|
||||
Config.instance().getSettingData().fullScreen = value;
|
||||
Config.instance().saveSettings();
|
||||
//update
|
||||
if (FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_FULLSCREEN_MODE) != value) {
|
||||
@@ -220,8 +227,8 @@ public class SettingsScene extends UIScene {
|
||||
});
|
||||
}
|
||||
addCheckBox(localizer.getMessage("lblCardName"), ForgePreferences.FPref.UI_OVERLAY_CARD_NAME);
|
||||
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("cbAdjustMusicVolume"), ForgePreferences.FPref.UI_VOL_MUSIC, 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("lblPowerOrToughness"), ForgePreferences.FPref.UI_OVERLAY_CARD_POWER);
|
||||
addCheckBox(localizer.getMessage("lblCardID"), ForgePreferences.FPref.UI_OVERLAY_CARD_ID);
|
||||
@@ -245,6 +252,7 @@ public class SettingsScene extends UIScene {
|
||||
|
||||
|
||||
settingGroup.row();
|
||||
|
||||
ui.onButtonPress("return", new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
@@ -4,7 +4,9 @@ import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.Input;
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||
import forge.Forge;
|
||||
import forge.adventure.stage.GameHUD;
|
||||
import forge.adventure.world.WorldSave;
|
||||
import forge.gui.GuiBase;
|
||||
|
||||
/**
|
||||
* First scene after the splash screen
|
||||
@@ -16,7 +18,7 @@ public class StartScene extends UIScene {
|
||||
|
||||
public StartScene()
|
||||
{
|
||||
super("ui/start_menu.json");
|
||||
super(GuiBase.isAndroid() ? "ui/start_menu_mobile.json" : "ui/start_menu.json");
|
||||
|
||||
}
|
||||
public boolean NewGame() {
|
||||
@@ -38,6 +40,7 @@ public class StartScene extends UIScene {
|
||||
|
||||
public boolean Resume() {
|
||||
Forge.switchToLast();
|
||||
GameHUD.getInstance().getTouchpad().setVisible(false);
|
||||
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.Drawable;
|
||||
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.adventure.player.AdventurePlayer;
|
||||
import forge.adventure.scene.Scene;
|
||||
import forge.adventure.scene.SceneType;
|
||||
import forge.adventure.util.Config;
|
||||
import forge.adventure.util.Current;
|
||||
@@ -46,7 +46,7 @@ public class GameHUD extends Stage {
|
||||
float TOUCHPAD_KNOB_MIN_WIDTH = 40f;
|
||||
|
||||
private GameHUD(GameStage gameStage) {
|
||||
super(new FitViewport(Scene.GetIntendedWidth(), Scene.GetIntendedHeight()), gameStage.getBatch());
|
||||
super(new ScalingViewport(Scaling.fillX, 480f, 270f), gameStage.getBatch());
|
||||
instance = this;
|
||||
this.gameStage = gameStage;
|
||||
|
||||
@@ -193,10 +193,11 @@ public class GameHUD extends Stage {
|
||||
float deckY = ui.findActor("deck").getY();
|
||||
float deckR = ui.findActor("deck").getRight();
|
||||
float deckT = ui.findActor("deck").getTop();
|
||||
float deckOriginX = ui.findActor("deck").getOriginX();
|
||||
//deck button bounds
|
||||
if (c.x>=deckX&&c.x<=deckR&&c.y>=deckY&&c.y<=deckT) {
|
||||
openDeck();
|
||||
stageToScreenCoordinates(c2.set(deckX, deckY));
|
||||
stageToScreenCoordinates(c2.set(deckOriginX, deckY));
|
||||
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 menuR = ui.findActor("menu").getRight();
|
||||
float menuT = ui.findActor("menu").getTop();
|
||||
float menuOriginX = ui.findActor("menu").getOriginX();
|
||||
//menu button bounds
|
||||
if (c.x>=menuX&&c.x<=menuR&&c.y>=menuY&&c.y<=menuT) {
|
||||
menu();
|
||||
stageToScreenCoordinates(c2.set(menuX, menuY));
|
||||
stageToScreenCoordinates(c2.set(menuOriginX, menuY));
|
||||
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 statsR = ui.findActor("statistic").getRight();
|
||||
float statsT = ui.findActor("statistic").getTop();
|
||||
float statsOriginX = ui.findActor("statistic").getOriginX();
|
||||
//stats button bounds
|
||||
if (c.x>=statsX&&c.x<=statsR&&c.y>=statsY&&c.y<=statsT) {
|
||||
statistic();
|
||||
stageToScreenCoordinates(c2.set(statsX, statsY));
|
||||
stageToScreenCoordinates(c2.set(statsOriginX, statsY));
|
||||
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 oldPosition4=new Vector2();
|
||||
|
||||
public void clearIsInMap() {
|
||||
isInMap = false;
|
||||
}
|
||||
|
||||
|
||||
public MapLayer getSpriteLayer()
|
||||
{
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package forge.adventure.stage;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||
import com.badlogic.gdx.utils.ScreenUtils;
|
||||
import com.badlogic.gdx.utils.viewport.Viewport;
|
||||
import forge.Forge;
|
||||
import forge.adventure.character.CharacterSprite;
|
||||
@@ -20,6 +22,7 @@ import forge.adventure.util.SaveFileContent;
|
||||
import forge.adventure.util.SaveFileData;
|
||||
import forge.adventure.world.World;
|
||||
import forge.adventure.world.WorldSave;
|
||||
import forge.screens.TransitionScreen;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -76,10 +79,17 @@ public class WorldStage extends GameStage implements SaveFileContent {
|
||||
if (player.collideWith(mob)) {
|
||||
player.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() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
((DuelScene) SceneType.DuelScene.instance).setEnemy(currentMob);
|
||||
((DuelScene) SceneType.DuelScene.instance).setPlayer(player);
|
||||
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.utils.ChangeListener;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -30,8 +31,8 @@ public class Controls {
|
||||
}
|
||||
|
||||
static public SelectBox newComboBox(String[] text, String item, Function<Object, Void> func) {
|
||||
|
||||
SelectBox ret = new SelectBox<String>(GetSkin());
|
||||
ret.getStyle().listStyle.selection.setTopHeight(4);
|
||||
ret.setItems(text);
|
||||
ret.addListener(new ChangeListener() {
|
||||
@Override
|
||||
@@ -44,8 +45,9 @@ public class Controls {
|
||||
}
|
||||
});
|
||||
func.apply(item);
|
||||
|
||||
ret.getList().setAlignment(Align.center);
|
||||
ret.setSelected(item);
|
||||
ret.setAlignment(Align.right);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -137,6 +137,9 @@ public class UIActor extends Group {
|
||||
case "text":
|
||||
newActor.setText(property.value.toString());
|
||||
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.deck.Deck;
|
||||
import forge.localinstance.properties.ForgeProfileProperties;
|
||||
import forge.player.GamePlayerUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@@ -69,6 +70,7 @@ public class WorldSave {
|
||||
currentSave.header = (WorldSaveHeader) oos.readObject();
|
||||
SaveFileData mainData=(SaveFileData)oos.readObject();
|
||||
currentSave.player.load(mainData.readSubData("player"));
|
||||
GamePlayerUtil.getGuiPlayer().setName(currentSave.player.getName());
|
||||
currentSave.world.load(mainData.readSubData("world"));
|
||||
WorldStage.getInstance().load(mainData.readSubData("worldStage"));
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ public class CardZoom extends FOverlay {
|
||||
cardHeight = FCardPanel.ASPECT_RATIO * cardWidth;
|
||||
|
||||
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
|
||||
if (cardHeight > Gdx.graphics.getWidth())
|
||||
{
|
||||
|
||||
@@ -15,7 +15,6 @@ import forge.card.CardEdition;
|
||||
import forge.deck.io.DeckPreferences;
|
||||
import forge.gamemodes.limited.BoosterDraft;
|
||||
import forge.gamemodes.planarconquest.ConquestUtil;
|
||||
import forge.gui.FThreads;
|
||||
import forge.gui.GuiBase;
|
||||
import forge.gui.card.CardPreferences;
|
||||
import forge.item.PaperCard;
|
||||
@@ -32,7 +31,6 @@ import forge.menu.FMenuItem;
|
||||
import forge.menu.FPopupMenu;
|
||||
import forge.model.FModel;
|
||||
import forge.screens.FScreen;
|
||||
import forge.screens.LoadingOverlay;
|
||||
import forge.screens.TabPageScreen;
|
||||
import forge.toolbox.*;
|
||||
import forge.toolbox.FEvent.FEventHandler;
|
||||
@@ -1134,12 +1132,6 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
||||
|
||||
@Override
|
||||
public void refresh() {
|
||||
FThreads.invokeInEdtLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
LoadingOverlay.show(Localizer.getInstance().getMessage("lblLoading"), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Predicate<PaperCard> additionalFilter = null;
|
||||
final EditorType editorType = parentScreen.getEditorType();
|
||||
final Localizer localizer = Localizer.getInstance();
|
||||
@@ -1222,10 +1214,6 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCardActivated(PaperCard card) {
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import forge.player.GamePlayerUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
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?
|
||||
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
|
||||
@Override
|
||||
|
||||
@@ -312,10 +312,10 @@ public class MatchController extends AbstractGuiGame {
|
||||
public void run() {
|
||||
Forge.clearTransitionScreen();
|
||||
Forge.clearCurrentScreen();
|
||||
Forge.setCursor(null, "0");
|
||||
}
|
||||
};
|
||||
Forge.setTransitionScreen(new TransitionScreen(runnable, ScreenUtils.getFrameBufferTexture(), false, false));
|
||||
Forge.setCursor(null, "0");
|
||||
return;
|
||||
}
|
||||
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 |
@@ -2,50 +2,47 @@
|
||||
"width": 480,
|
||||
"height": 270,
|
||||
"yDown": true,
|
||||
"elements":[
|
||||
"elements": [
|
||||
{
|
||||
"type" : "Image",
|
||||
"image":"ui/title_bg.png",
|
||||
"type": "Image",
|
||||
"image": "ui/title_bg.png",
|
||||
"width": 480,
|
||||
"height": 270
|
||||
} ,
|
||||
|
||||
},
|
||||
{
|
||||
"type" : "Scroll",
|
||||
"type": "Scroll",
|
||||
"name": "deckSlots",
|
||||
"x": 10,
|
||||
"y": 10 ,
|
||||
"y": 10,
|
||||
"width": 344,
|
||||
"height": 235
|
||||
} ,
|
||||
},
|
||||
{
|
||||
"type" : "TextButton",
|
||||
"name" : "return" ,
|
||||
"text" : "Back" ,
|
||||
"type": "TextButton",
|
||||
"name": "return",
|
||||
"text": "Back",
|
||||
"width": 96,
|
||||
"height": 16,
|
||||
"x": 15,
|
||||
"y": 250
|
||||
} ,
|
||||
},
|
||||
{
|
||||
"type" : "TextButton",
|
||||
"name" : "rename" ,
|
||||
"text" : "Rename Deck" ,
|
||||
"type": "TextButton",
|
||||
"name": "rename",
|
||||
"text": "Rename Deck",
|
||||
"width": 96,
|
||||
"height": 16,
|
||||
"x": 115,
|
||||
"y": 250
|
||||
} ,
|
||||
},
|
||||
{
|
||||
"type" : "TextButton",
|
||||
"name" : "edit" ,
|
||||
"text" : "Edit Deck" ,
|
||||
"type": "TextButton",
|
||||
"name": "edit",
|
||||
"text": "Edit Deck",
|
||||
"width": 96,
|
||||
"height": 16,
|
||||
"x": 215,
|
||||
"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,
|
||||
"height": 270
|
||||
},
|
||||
{
|
||||
"type": "Image",
|
||||
"image": "ui/heal.png",
|
||||
"x": 60,
|
||||
"y": 85,
|
||||
"width": 100,
|
||||
"height": 100
|
||||
},
|
||||
{
|
||||
"type": "TextButton",
|
||||
"name": "heal",
|
||||
"text": "Heal",
|
||||
"width": 48,
|
||||
"height": 16,
|
||||
"x": 420,
|
||||
"y": 10
|
||||
"width": 100,
|
||||
"height": 30,
|
||||
"x": 60,
|
||||
"y": 200
|
||||
},
|
||||
{
|
||||
"type": "Image",
|
||||
"image": "ui/sell.png",
|
||||
"x": 190,
|
||||
"y": 85,
|
||||
"width": 100,
|
||||
"height": 100
|
||||
},
|
||||
{
|
||||
"type": "TextButton",
|
||||
"name": "sell",
|
||||
"text": "Sell cards",
|
||||
"width": 48,
|
||||
"height": 16,
|
||||
"x": 420,
|
||||
"y": 34
|
||||
"width": 100,
|
||||
"height": 30,
|
||||
"x": 190,
|
||||
"y": 200
|
||||
},
|
||||
{
|
||||
"type": "Image",
|
||||
"image": "ui/leave.png",
|
||||
"x": 320,
|
||||
"y": 85,
|
||||
"width": 100,
|
||||
"height": 100
|
||||
},
|
||||
{
|
||||
"type": "TextButton",
|
||||
"name": "done",
|
||||
"text": "Leave",
|
||||
"width": 48,
|
||||
"height": 16,
|
||||
"x": 420,
|
||||
"y": 58
|
||||
"width": 100,
|
||||
"height": 30,
|
||||
"x": 320,
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,69 +2,66 @@
|
||||
"width": 480,
|
||||
"height": 270,
|
||||
"yDown": true,
|
||||
"elements":[
|
||||
"elements": [
|
||||
{
|
||||
"type" : "Image",
|
||||
"image":"ui/title_bg.png",
|
||||
"type": "Image",
|
||||
"image": "ui/title_bg.png",
|
||||
"width": 480,
|
||||
"height": 270
|
||||
}
|
||||
,
|
||||
},
|
||||
{
|
||||
"type" : "TextButton",
|
||||
"name" : "Start" ,
|
||||
"text" : "New Game",
|
||||
"type": "TextButton",
|
||||
"name": "Start",
|
||||
"text": "New Game",
|
||||
"width": 120,
|
||||
"height": 30,
|
||||
"x": 20,
|
||||
"y": 20
|
||||
} ,
|
||||
},
|
||||
{
|
||||
"type" : "TextButton",
|
||||
"name" : "Load" ,
|
||||
"text" : "Load",
|
||||
"type": "TextButton",
|
||||
"name": "Load",
|
||||
"text": "Load",
|
||||
"width": 120,
|
||||
"height": 30,
|
||||
"x": 20,
|
||||
"y": 60
|
||||
} ,
|
||||
},
|
||||
{
|
||||
"type" : "TextButton",
|
||||
"name" : "Save" ,
|
||||
"text" : "Save",
|
||||
"type": "TextButton",
|
||||
"name": "Save",
|
||||
"text": "Save",
|
||||
"width": 120,
|
||||
"height": 30,
|
||||
"x": 20,
|
||||
"y": 100
|
||||
},
|
||||
{
|
||||
"type" : "TextButton",
|
||||
"name" : "Resume" ,
|
||||
"text" : "Resume",
|
||||
"type": "TextButton",
|
||||
"name": "Resume",
|
||||
"text": "Resume",
|
||||
"width": 120,
|
||||
"height": 30,
|
||||
"x": 20,
|
||||
"y": 140
|
||||
} ,
|
||||
},
|
||||
{
|
||||
"type" : "TextButton",
|
||||
"name" : "Settings" ,
|
||||
"text" : "Settings",
|
||||
"type": "TextButton",
|
||||
"name": "Settings",
|
||||
"text": "Settings",
|
||||
"width": 120,
|
||||
"height": 30,
|
||||
"x": 20,
|
||||
"y": 180
|
||||
} ,
|
||||
},
|
||||
{
|
||||
"type" : "TextButton",
|
||||
"name" : "Exit" ,
|
||||
"text" : "Exit",
|
||||
"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,
|
||||
"height": 270
|
||||
},
|
||||
{
|
||||
"type": "Scroll",
|
||||
"style": "paper",
|
||||
"x": 300,
|
||||
"y": 18,
|
||||
"width": 160,
|
||||
"height": 180
|
||||
},
|
||||
{
|
||||
"type": "Scroll",
|
||||
"name": "enemies",
|
||||
"x": 206,
|
||||
"y": 10,
|
||||
"x": 15,
|
||||
"y": 18,
|
||||
"width": 256,
|
||||
"height": 235
|
||||
},
|
||||
{
|
||||
"type": "Image",
|
||||
"name": "avatar",
|
||||
"x": 10,
|
||||
"y": 10,
|
||||
"x": 350,
|
||||
"y": 28,
|
||||
"width": 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",
|
||||
"image": "ui/avatarhud.png",
|
||||
"x": 10,
|
||||
"y": 10,
|
||||
"x": 350,
|
||||
"y": 28,
|
||||
"width": 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",
|
||||
"name": "return",
|
||||
"text": "Back",
|
||||
"width": 48,
|
||||
"height": 16,
|
||||
"x": 15,
|
||||
"y": 250
|
||||
"width": 100,
|
||||
"height": 30,
|
||||
"x": 335,
|
||||
"y": 212
|
||||
},
|
||||
{
|
||||
"type": "Table",
|
||||
|
||||
Reference in New Issue
Block a user