mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
update controls to be playable
This commit is contained in:
@@ -31,6 +31,7 @@ import forge.localinstance.properties.ForgePreferences;
|
||||
import forge.localinstance.properties.ForgePreferences.FPref;
|
||||
import forge.model.FModel;
|
||||
import forge.screens.FScreen;
|
||||
import forge.screens.LoadingOverlay;
|
||||
import forge.screens.SplashScreen;
|
||||
import forge.screens.home.HomeScreen;
|
||||
import forge.screens.home.NewGameMenu;
|
||||
@@ -88,7 +89,7 @@ public class Forge implements ApplicationListener {
|
||||
public static boolean isPortraitMode = false;
|
||||
public static boolean gameInProgress = false;
|
||||
public static boolean disposeTextures = false;
|
||||
public static boolean isAdventureMode = false;
|
||||
public static boolean isMobileAdventureMode = false;
|
||||
public static int cacheSize = 400;
|
||||
public static int totalDeviceRAM = 0;
|
||||
public static int androidVersion = 0;
|
||||
@@ -240,6 +241,10 @@ public class Forge implements ApplicationListener {
|
||||
});
|
||||
}
|
||||
|
||||
public static Graphics getGraphics() {
|
||||
return graphics;
|
||||
}
|
||||
|
||||
private void preloadExtendedArt() {
|
||||
if (!enablePreloadExtendedArt||!enableUIMask.equals("Full"))
|
||||
return;
|
||||
@@ -279,20 +284,31 @@ public class Forge implements ApplicationListener {
|
||||
}
|
||||
public static void openAdventure() {
|
||||
startContinuousRendering();
|
||||
FSkin.loadLight("default", null, Config.instance().getFile("skin"));
|
||||
FSkin.loadFull(splashScreen);
|
||||
splashScreen = null;
|
||||
isAdventureMode = true;
|
||||
try {
|
||||
for (SceneType sceneType : SceneType.values()) {
|
||||
sceneType.instance.resLoaded();
|
||||
}
|
||||
final LoadingOverlay loader = new LoadingOverlay("Loading Adventure");
|
||||
loader.show();
|
||||
FThreads.invokeInBackgroundThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
FThreads.invokeInEdtLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
FSkin.loadLight("default", null, Config.instance().getFile("skin"));
|
||||
FSkin.loadFull(splashScreen);
|
||||
splashScreen = null;
|
||||
isMobileAdventureMode = true;
|
||||
try {
|
||||
for (SceneType sceneType : SceneType.values()) {
|
||||
sceneType.instance.resLoaded();
|
||||
}
|
||||
|
||||
switchScene(SceneType.StartScene.instance);
|
||||
animationBatch=new SpriteBatch();
|
||||
transitionTexture =new Texture(Config.instance().getFile("ui/transition.png"));
|
||||
} catch (Exception e) { e.printStackTrace(); }
|
||||
|
||||
switchScene(SceneType.StartScene.instance);
|
||||
animationBatch=new SpriteBatch();
|
||||
transitionTexture =new Texture(Config.instance().getFile("ui/transition.png"));
|
||||
} catch (Exception e) { e.printStackTrace(); }
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
protected void afterDbLoaded() {
|
||||
stopContinuousRendering(); //save power consumption by disabling continuous rendering once assets loaded
|
||||
@@ -526,6 +542,9 @@ public class Forge implements ApplicationListener {
|
||||
return currentScreen;
|
||||
}
|
||||
|
||||
public static void clearCurrentScreen() {
|
||||
currentScreen = null;
|
||||
}
|
||||
private static void setCurrentScreen(FScreen screen0) {
|
||||
String toNewScreen = screen0 != null ? screen0.toString() : "";
|
||||
String previousScreen = currentScreen != null ? currentScreen.toString() : "";
|
||||
@@ -565,7 +584,7 @@ public class Forge implements ApplicationListener {
|
||||
if (screen == null) {
|
||||
screen = splashScreen;
|
||||
if (screen == null) {
|
||||
if (isAdventureMode) {
|
||||
if (isMobileAdventureMode) {
|
||||
float delta=Gdx.graphics.getDeltaTime();
|
||||
float transitionTime = 0.2f;
|
||||
if(sceneWasSwapped)
|
||||
@@ -731,7 +750,7 @@ public class Forge implements ApplicationListener {
|
||||
|
||||
|
||||
}
|
||||
public Scene switchToLast() {
|
||||
public static Scene switchToLast() {
|
||||
|
||||
if(lastScene.size!=0)
|
||||
{
|
||||
|
||||
@@ -9,10 +9,7 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.Clipboard;
|
||||
import com.badlogic.gdx.utils.ScreenUtils;
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
import forge.adventure.scene.ForgeScene;
|
||||
import forge.adventure.scene.Scene;
|
||||
import forge.adventure.scene.SceneType;
|
||||
import forge.adventure.util.Config;
|
||||
@@ -32,14 +29,6 @@ public class AdventureApplicationAdapter extends Forge {
|
||||
Texture transitionTexture;
|
||||
TextureRegion lastScreenTexture;
|
||||
private boolean sceneWasSwapped =false;
|
||||
private Graphics graphics;
|
||||
|
||||
public Graphics getGraphics()
|
||||
{
|
||||
if(graphics==null)
|
||||
graphics=new Graphics();
|
||||
return graphics;
|
||||
}
|
||||
|
||||
public TextureRegion getLastScreenTexture() {
|
||||
return lastScreenTexture;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package forge.adventure.character;
|
||||
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import forge.adventure.AdventureApplicationAdapter;
|
||||
import forge.Forge;
|
||||
import forge.adventure.scene.RewardScene;
|
||||
import forge.adventure.scene.SceneType;
|
||||
import forge.adventure.stage.MapStage;
|
||||
@@ -34,7 +34,7 @@ public class ShopActor extends MapActor{
|
||||
|
||||
stage.GetPlayer().stop();
|
||||
((RewardScene) SceneType.RewardScene.instance).loadRewards(rewardData, RewardScene.Type.Shop,this);
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.RewardScene.instance);
|
||||
Forge.switchScene(SceneType.RewardScene.instance);
|
||||
}
|
||||
|
||||
public int getObjectID() {
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.badlogic.gdx.utils.Align;
|
||||
import com.google.common.base.Function;
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
import forge.adventure.AdventureApplicationAdapter;
|
||||
import forge.adventure.player.AdventurePlayer;
|
||||
import forge.assets.FImage;
|
||||
import forge.assets.FSkinFont;
|
||||
@@ -104,7 +103,8 @@ import java.util.Map;
|
||||
|
||||
boolean isShop=false;
|
||||
public AdventureDeckEditor(boolean createAsShop) {
|
||||
super(e -> {AdventurePlayer.current().getNewCards().clear();AdventureApplicationAdapter.instance.switchToLast();},getPages());
|
||||
super(e -> {AdventurePlayer.current().getNewCards().clear();
|
||||
Forge.switchToLast();},getPages());
|
||||
|
||||
isShop=createAsShop;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.TextField;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.badlogic.gdx.utils.IntMap;
|
||||
import forge.adventure.AdventureApplicationAdapter;
|
||||
import forge.Forge;
|
||||
import forge.adventure.player.AdventurePlayer;
|
||||
import forge.adventure.util.Controls;
|
||||
import forge.adventure.util.Current;
|
||||
@@ -56,7 +56,7 @@ public class DeckSelectScene extends UIScene {
|
||||
}
|
||||
|
||||
public void back() {
|
||||
AdventureApplicationAdapter.instance.switchToLast();
|
||||
Forge.switchToLast();
|
||||
}
|
||||
|
||||
public boolean select(int slot) {
|
||||
@@ -144,6 +144,6 @@ public class DeckSelectScene extends UIScene {
|
||||
}
|
||||
private void edit() {
|
||||
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.DeckEditScene.instance);
|
||||
Forge.switchScene(SceneType.DeckEditScene.instance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package forge.adventure.scene;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import forge.Forge;
|
||||
import forge.LobbyPlayer;
|
||||
import forge.adventure.AdventureApplicationAdapter;
|
||||
import forge.adventure.character.EnemySprite;
|
||||
import forge.adventure.character.PlayerSprite;
|
||||
import forge.adventure.player.AdventurePlayer;
|
||||
@@ -56,7 +56,7 @@ public class DuelScene extends ForgeScene {
|
||||
String enemyName=enemy.getData().name;
|
||||
Gdx.app.postRunnable(() -> {
|
||||
SoundSystem.instance.setBackgroundMusic(MusicPlaylist.MENUS); //start background music
|
||||
Scene last= AdventureApplicationAdapter.instance.switchToLast();
|
||||
Scene last= Forge.switchToLast();
|
||||
|
||||
if(last instanceof HudScene)
|
||||
{
|
||||
|
||||
@@ -35,10 +35,13 @@ public abstract class ForgeScene extends Scene implements IUpdateable {
|
||||
}
|
||||
|
||||
|
||||
localGraphics.begin(AdventureApplicationAdapter.instance.getCurrentWidth(), AdventureApplicationAdapter.instance.getCurrentHeight());
|
||||
getScreen().screenPos.setSize(AdventureApplicationAdapter.instance.getCurrentWidth(), AdventureApplicationAdapter.instance.getCurrentHeight());
|
||||
localGraphics.begin(Forge.isMobileAdventureMode ? Forge.getScreenWidth() : AdventureApplicationAdapter.instance.getCurrentWidth(),
|
||||
Forge.isMobileAdventureMode ? Forge.getScreenHeight() : AdventureApplicationAdapter.instance.getCurrentHeight());
|
||||
getScreen().screenPos.setSize(Forge.isMobileAdventureMode ? Forge.getScreenWidth() : AdventureApplicationAdapter.instance.getCurrentWidth(),
|
||||
Forge.isMobileAdventureMode ? Forge.getScreenHeight() : AdventureApplicationAdapter.instance.getCurrentHeight());
|
||||
if (getScreen().getRotate180()) {
|
||||
localGraphics.startRotateTransform(AdventureApplicationAdapter.instance.getCurrentWidth() / 2f, AdventureApplicationAdapter.instance.getCurrentHeight() / 2f, 180);
|
||||
localGraphics.startRotateTransform( Forge.isMobileAdventureMode ? Forge.getScreenWidth() / 2f : AdventureApplicationAdapter.instance.getCurrentWidth() / 2f,
|
||||
Forge.isMobileAdventureMode ? Forge.getScreenHeight() / 2f : AdventureApplicationAdapter.instance.getCurrentHeight() / 2f, 180);
|
||||
}
|
||||
getScreen().draw(localGraphics);
|
||||
if (getScreen().getRotate180()) {
|
||||
@@ -46,8 +49,10 @@ public abstract class ForgeScene extends Scene implements IUpdateable {
|
||||
}
|
||||
for (FOverlay overlay : FOverlay.getOverlays()) {
|
||||
if (overlay.isVisibleOnScreen(getScreen())) {
|
||||
overlay.screenPos.setSize(AdventureApplicationAdapter.instance.getCurrentWidth(), AdventureApplicationAdapter.instance.getCurrentHeight());
|
||||
overlay.setSize(AdventureApplicationAdapter.instance.getCurrentWidth(), AdventureApplicationAdapter.instance.getCurrentHeight()); //update overlay sizes as they're rendered
|
||||
overlay.screenPos.setSize(Forge.isMobileAdventureMode ? Forge.getScreenWidth() : AdventureApplicationAdapter.instance.getCurrentWidth(),
|
||||
Forge.isMobileAdventureMode ? Forge.getScreenHeight() : AdventureApplicationAdapter.instance.getCurrentHeight());
|
||||
overlay.setSize(Forge.isMobileAdventureMode ? Forge.getScreenWidth() : AdventureApplicationAdapter.instance.getCurrentWidth(),
|
||||
Forge.isMobileAdventureMode ? Forge.getScreenHeight() : AdventureApplicationAdapter.instance.getCurrentHeight()); //update overlay sizes as they're rendered
|
||||
if (overlay.getRotate180()) {
|
||||
localGraphics.startRotateTransform(AdventureApplicationAdapter.instance.getCurrentHeight() / 2f, AdventureApplicationAdapter.instance.getCurrentHeight() / 2f, 180);
|
||||
}
|
||||
@@ -73,7 +78,8 @@ public abstract class ForgeScene extends Scene implements IUpdateable {
|
||||
public void enter() {
|
||||
FOverlay.hideAll();
|
||||
if(getScreen()!=null)
|
||||
getScreen().setSize(AdventureApplicationAdapter.instance.getCurrentWidth(), AdventureApplicationAdapter.instance.getCurrentHeight());
|
||||
getScreen().setSize(Forge.isMobileAdventureMode ? Forge.getScreenWidth() : AdventureApplicationAdapter.instance.getCurrentWidth(),
|
||||
Forge.isMobileAdventureMode ? Forge.getScreenHeight() : AdventureApplicationAdapter.instance.getCurrentHeight());
|
||||
|
||||
Forge.openScreen(getScreen());
|
||||
Gdx.input.setInputProcessor(input);
|
||||
@@ -88,8 +94,7 @@ public abstract class ForgeScene extends Scene implements IUpdateable {
|
||||
|
||||
@Override
|
||||
public void resLoaded() {
|
||||
if (!Forge.isAdventureMode)
|
||||
localGraphics = AdventureApplicationAdapter.instance.getGraphics();
|
||||
localGraphics = Forge.getGraphics();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package forge.adventure.scene;
|
||||
|
||||
import com.badlogic.gdx.Input;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
|
||||
import forge.adventure.AdventureApplicationAdapter;
|
||||
import forge.Forge;
|
||||
import forge.adventure.util.Current;
|
||||
|
||||
/**
|
||||
@@ -18,7 +18,7 @@ public class InnScene extends UIScene {
|
||||
|
||||
public void done()
|
||||
{
|
||||
AdventureApplicationAdapter.instance.switchToLast();
|
||||
Forge.switchToLast();
|
||||
}
|
||||
public void heal()
|
||||
{
|
||||
@@ -40,7 +40,7 @@ public class InnScene extends UIScene {
|
||||
}
|
||||
|
||||
private void sell() {
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.ShopScene.instance);
|
||||
Forge.switchScene(SceneType.ShopScene.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Image;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.TextField;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import forge.adventure.AdventureApplicationAdapter;
|
||||
import forge.Forge;
|
||||
import forge.adventure.data.DifficultyData;
|
||||
import forge.adventure.data.HeroListData;
|
||||
import forge.adventure.util.Config;
|
||||
@@ -47,12 +47,12 @@ public class NewGameScene extends UIScene {
|
||||
GamePlayerUtil.getGuiPlayer().setName(selectedName.getText());
|
||||
//image = new Texture(img);
|
||||
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.GameScene.instance);
|
||||
Forge.switchScene(SceneType.GameScene.instance);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean back() {
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.StartScene.instance);
|
||||
Forge.switchScene(SceneType.StartScene.instance);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Table;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import forge.adventure.AdventureApplicationAdapter;
|
||||
import forge.Forge;
|
||||
import forge.adventure.character.EnemySprite;
|
||||
import forge.adventure.data.EnemyData;
|
||||
import forge.adventure.data.WorldData;
|
||||
@@ -46,7 +46,7 @@ public class PlayerStatisticScene extends UIScene {
|
||||
return true;
|
||||
}
|
||||
public boolean back() {
|
||||
AdventureApplicationAdapter.instance.switchToLast();
|
||||
Forge.switchToLast();
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.badlogic.gdx.scenes.scene2d.InputEvent;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import forge.adventure.AdventureApplicationAdapter;
|
||||
import forge.Forge;
|
||||
import forge.adventure.character.ShopActor;
|
||||
import forge.adventure.player.AdventurePlayer;
|
||||
import forge.adventure.pointofintrest.PointOfInterestChanges;
|
||||
@@ -73,12 +73,12 @@ public class RewardScene extends UIScene {
|
||||
}
|
||||
else
|
||||
{
|
||||
AdventureApplicationAdapter.instance.switchToLast();
|
||||
Forge.switchToLast();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AdventureApplicationAdapter.instance.switchToLast();
|
||||
Forge.switchToLast();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public class RewardScene extends UIScene {
|
||||
flipCountDown-=Gdx.graphics.getDeltaTime();
|
||||
if(flipCountDown<=0)
|
||||
{
|
||||
AdventureApplicationAdapter.instance.switchToLast();
|
||||
Forge.switchToLast();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.badlogic.gdx.utils.GdxRuntimeException;
|
||||
import com.badlogic.gdx.utils.IntMap;
|
||||
import forge.adventure.AdventureApplicationAdapter;
|
||||
import forge.Forge;
|
||||
import forge.adventure.util.Controls;
|
||||
import forge.adventure.world.WorldSave;
|
||||
import forge.adventure.world.WorldSaveHeader;
|
||||
@@ -75,7 +75,7 @@ public class SaveLoadScene extends UIScene {
|
||||
}
|
||||
|
||||
public void back() {
|
||||
AdventureApplicationAdapter.instance.switchToLast();
|
||||
Forge.switchToLast();
|
||||
}
|
||||
|
||||
public boolean select(int slot) {
|
||||
@@ -106,7 +106,7 @@ public class SaveLoadScene extends UIScene {
|
||||
stage.setKeyboardFocus(textInput);
|
||||
} else {
|
||||
if(WorldSave.load(currentSlot))
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.GameScene.instance);
|
||||
Forge.switchScene(SceneType.GameScene.instance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ public class SaveLoadScene extends UIScene {
|
||||
if( WorldSave.getCurrentSave().save(textInput.getText(), currentSlot))
|
||||
{
|
||||
updateFiles();
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.GameScene.instance);
|
||||
Forge.switchScene(SceneType.GameScene.instance);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +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 forge.adventure.AdventureApplicationAdapter;
|
||||
import forge.Forge;
|
||||
import forge.adventure.util.Config;
|
||||
import forge.adventure.util.Controls;
|
||||
import forge.localinstance.properties.ForgePreferences;
|
||||
@@ -70,7 +70,7 @@ public class SettingsScene extends UIScene {
|
||||
return true;
|
||||
}
|
||||
public boolean back() {
|
||||
AdventureApplicationAdapter.instance.switchToLast();
|
||||
Forge.switchToLast();
|
||||
return true;
|
||||
}
|
||||
private void addInputField(String name, ForgePreferences.FPref pref) {
|
||||
|
||||
@@ -3,7 +3,7 @@ package forge.adventure.scene;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.Input;
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||
import forge.adventure.AdventureApplicationAdapter;
|
||||
import forge.Forge;
|
||||
import forge.adventure.world.WorldSave;
|
||||
|
||||
/**
|
||||
@@ -20,29 +20,29 @@ public class StartScene extends UIScene {
|
||||
|
||||
}
|
||||
public boolean NewGame() {
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.NewGameScene.instance);
|
||||
Forge.switchScene(SceneType.NewGameScene.instance);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean Save() {
|
||||
((SaveLoadScene) SceneType.SaveLoadScene.instance).setSaveGame(true);
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.SaveLoadScene.instance);
|
||||
Forge.switchScene(SceneType.SaveLoadScene.instance);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean Load() {
|
||||
((SaveLoadScene) SceneType.SaveLoadScene.instance).setSaveGame(false);
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.SaveLoadScene.instance);
|
||||
Forge.switchScene(SceneType.SaveLoadScene.instance);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean Resume() {
|
||||
AdventureApplicationAdapter.instance.switchToLast();
|
||||
Forge.switchToLast();
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean settings() {
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.SettingsScene.instance);
|
||||
Forge.switchScene(SceneType.SettingsScene.instance);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Image;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Label;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
|
||||
import com.badlogic.gdx.utils.viewport.FitViewport;
|
||||
import forge.adventure.AdventureApplicationAdapter;
|
||||
import forge.Forge;
|
||||
import forge.adventure.player.AdventurePlayer;
|
||||
import forge.adventure.scene.Scene;
|
||||
import forge.adventure.scene.SceneType;
|
||||
@@ -44,7 +44,7 @@ public class GameHUD extends Stage {
|
||||
|
||||
avatar = ui.findActor("avatar");
|
||||
ui.onButtonPress("menu", () -> menu());
|
||||
ui.onButtonPress("statistic",()-> AdventureApplicationAdapter.instance.switchScene(SceneType.PlayerStatisticScene.instance));
|
||||
ui.onButtonPress("statistic",()-> Forge.switchScene(SceneType.PlayerStatisticScene.instance));
|
||||
ui.onButtonPress("deck", () -> openDeck());
|
||||
lifePoints = ui.findActor("lifePoints");
|
||||
lifePoints.setText("20/20");
|
||||
@@ -109,7 +109,7 @@ public class GameHUD extends Stage {
|
||||
|
||||
private Object openDeck() {
|
||||
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.DeckSelectScene.instance);
|
||||
Forge.switchScene(SceneType.DeckSelectScene.instance);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||
import com.badlogic.gdx.scenes.scene2d.Group;
|
||||
import com.badlogic.gdx.scenes.scene2d.Stage;
|
||||
import com.badlogic.gdx.utils.viewport.StretchViewport;
|
||||
import forge.adventure.AdventureApplicationAdapter;
|
||||
import forge.Forge;
|
||||
import forge.adventure.character.MapActor;
|
||||
import forge.adventure.character.PlayerSprite;
|
||||
import forge.adventure.scene.Scene;
|
||||
@@ -283,7 +283,7 @@ public abstract class GameStage extends Stage {
|
||||
public void openMenu() {
|
||||
|
||||
WorldSave.getCurrentSave().header.createPreview();
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.StartScene.instance);
|
||||
Forge.switchScene(SceneType.StartScene.instance);
|
||||
}
|
||||
|
||||
public void enter() {
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.scenes.scene2d.Group;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import forge.adventure.AdventureApplicationAdapter;
|
||||
import forge.Forge;
|
||||
import forge.adventure.character.CharacterSprite;
|
||||
import forge.adventure.character.EnemySprite;
|
||||
import forge.adventure.character.EntryActor;
|
||||
@@ -241,7 +241,7 @@ public class MapStage extends GameStage {
|
||||
addMapActor(obj, mob);
|
||||
break;
|
||||
case "inn":
|
||||
addMapActor(obj, new OnCollide(() -> AdventureApplicationAdapter.instance.switchScene(SceneType.InnScene.instance)));
|
||||
addMapActor(obj, new OnCollide(() -> Forge.switchScene(SceneType.InnScene.instance)));
|
||||
break;
|
||||
case "exit":
|
||||
addMapActor(obj, new OnCollide(() -> exit()));
|
||||
@@ -296,7 +296,7 @@ public class MapStage extends GameStage {
|
||||
public boolean exit() {
|
||||
|
||||
isInMap=false;
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.GameScene.instance);
|
||||
Forge.switchScene(SceneType.GameScene.instance);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ public class MapStage extends GameStage {
|
||||
actors.removeValue(currentMob,true);
|
||||
changes.deleteObject(currentMob.getId());
|
||||
currentMob = null;
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.RewardScene.instance);
|
||||
Forge.switchScene(SceneType.RewardScene.instance);
|
||||
}
|
||||
@Override
|
||||
protected void onActing(float delta) {
|
||||
@@ -363,7 +363,7 @@ public class MapStage extends GameStage {
|
||||
{
|
||||
((DuelScene) SceneType.DuelScene.instance).setEnemy(mob);
|
||||
((DuelScene) SceneType.DuelScene.instance).setPlayer(player);
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.DuelScene.instance);
|
||||
Forge.switchScene(SceneType.DuelScene.instance);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package forge.adventure.stage;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||
import forge.adventure.AdventureApplicationAdapter;
|
||||
import forge.Forge;
|
||||
import forge.adventure.character.CharacterSprite;
|
||||
import forge.adventure.character.EnemySprite;
|
||||
import forge.adventure.data.BiomeData;
|
||||
@@ -79,7 +79,7 @@ public class WorldStage extends GameStage implements SaveFileContent {
|
||||
|
||||
((DuelScene) SceneType.DuelScene.instance).setEnemy(currentMob);
|
||||
((DuelScene) SceneType.DuelScene.instance).setPlayer(player);
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.DuelScene.instance);
|
||||
Forge.switchScene(SceneType.DuelScene.instance);
|
||||
});
|
||||
currentMob = mob;
|
||||
WorldSave.getCurrentSave().autoSave();
|
||||
@@ -117,7 +117,7 @@ public class WorldStage extends GameStage implements SaveFileContent {
|
||||
((RewardScene)SceneType.RewardScene.instance).loadRewards(currentMob.getRewards(), RewardScene.Type.Loot, null);
|
||||
removeEnemy(currentMob);
|
||||
currentMob = null;
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.RewardScene.instance);
|
||||
Forge.switchScene(SceneType.RewardScene.instance);
|
||||
} );
|
||||
} else {
|
||||
player.setAnimation(CharacterSprite.AnimationTypes.Hit);
|
||||
@@ -142,7 +142,7 @@ public class WorldStage extends GameStage implements SaveFileContent {
|
||||
continue;
|
||||
}
|
||||
((TileMapScene) SceneType.TileMapScene.instance).load(point.getPointOfInterest());
|
||||
AdventureApplicationAdapter.instance.switchScene(SceneType.TileMapScene.instance);
|
||||
Forge.switchScene(SceneType.TileMapScene.instance);
|
||||
} else {
|
||||
if (point == collidingPoint) {
|
||||
collidingPoint = null;
|
||||
|
||||
@@ -106,16 +106,22 @@ public class SplashScreen extends FContainer {
|
||||
|
||||
if (!init) {
|
||||
btnAdventure = new FButton(Localizer.getInstance().getMessageorUseDefault("lblAdventureMode", "Adventure Mode"));
|
||||
btnAdventure.setEnabled(true);
|
||||
btnAdventure.setCommand(new FEvent.FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
btnHome.setEnabled(false);
|
||||
btnAdventure.setEnabled(false);
|
||||
Forge.openAdventure();
|
||||
}
|
||||
});
|
||||
btnHome = new FButton(Localizer.getInstance().getMessageorUseDefault("lblClassicMode", "Classic Mode"));
|
||||
btnHome.setEnabled(true);
|
||||
btnHome.setCommand(new FEvent.FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
btnHome.setEnabled(false);
|
||||
btnAdventure.setEnabled(false);
|
||||
Forge.openHomeDefault();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -304,6 +304,10 @@ public class MatchController extends AbstractGuiGame {
|
||||
|
||||
@Override
|
||||
public void finishGame() {
|
||||
if (Forge.isMobileAdventureMode) {
|
||||
Forge.clearCurrentScreen();
|
||||
return;
|
||||
}
|
||||
if (hasLocalPlayers() || getGameView().isMatchOver()) {
|
||||
view.setViewWinLose(new ViewWinLose(getGameView()));
|
||||
view.getViewWinLose().setVisible(true);
|
||||
|
||||
@@ -360,11 +360,15 @@ public class MatchScreen extends FScreen {
|
||||
gameMenu.getChildAt(0).setEnabled(!game.isMulligan());
|
||||
gameMenu.getChildAt(1).setEnabled(!game.isMulligan());
|
||||
gameMenu.getChildAt(2).setEnabled(!game.isMulligan());
|
||||
if (Forge.isMobileAdventureMode)
|
||||
gameMenu.getChildAt(2).setEnabled(false);
|
||||
gameMenu.getChildAt(3).setEnabled(false);
|
||||
} else {
|
||||
gameMenu.getChildAt(0).setEnabled(false);
|
||||
gameMenu.getChildAt(1).setEnabled(false);
|
||||
gameMenu.getChildAt(2).setEnabled(false);
|
||||
if (Forge.isMobileAdventureMode)
|
||||
gameMenu.getChildAt(2).setEnabled(false);
|
||||
gameMenu.getChildAt(3).setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ public class VPlayers extends FDropDown {
|
||||
player = player0;
|
||||
playerDeck = MatchController.getPlayerDeck(player0);
|
||||
btnDeck = new FLabel.ButtonBuilder().opaque(true).iconScaleFactor(0.99f).selectable().alphaComposite(1).iconInBackground(true).build();
|
||||
btnDeck.setEnabled(!Forge.isMobileAdventureMode);
|
||||
btnDeck.setCommand(new FEvent.FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
|
||||
Reference in New Issue
Block a user