mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Fix GUI refactoring issue that was preventing Android app from working on mobile devices
This commit is contained in:
@@ -21,6 +21,7 @@ import javax.swing.MenuElement;
|
||||
import javax.swing.MenuSelectionManager;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
@@ -83,7 +84,6 @@ import forge.view.PlayerView;
|
||||
import forge.view.SpellAbilityView;
|
||||
|
||||
public class GuiDesktop implements IGuiBase {
|
||||
|
||||
private boolean showOverlay = true;
|
||||
|
||||
@Override
|
||||
@@ -96,6 +96,12 @@ public class GuiDesktop implements IGuiBase {
|
||||
return BuildInfo.getVersionString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAssetsDir() {
|
||||
return StringUtils.containsIgnoreCase(BuildInfo.getVersionString(), "svn") ?
|
||||
"../forge-gui/" : "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invokeInEdtLater(Runnable proc) {
|
||||
SwingUtilities.invokeLater(proc);
|
||||
|
||||
@@ -19,7 +19,6 @@ package forge;
|
||||
|
||||
import forge.control.FControl;
|
||||
import forge.model.FModel;
|
||||
import forge.properties.ForgeProfileProperties;
|
||||
import forge.view.FView;
|
||||
|
||||
/**
|
||||
@@ -47,8 +46,6 @@ public final class Singletons {
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
ForgeProfileProperties.init(GuiBase.getInterface());
|
||||
|
||||
if (withUi) {
|
||||
view = FView.SINGLETON_INSTANCE;
|
||||
}
|
||||
|
||||
@@ -17,15 +17,11 @@
|
||||
*/
|
||||
package forge.view;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import forge.GuiBase;
|
||||
import forge.GuiDesktop;
|
||||
import forge.Singletons;
|
||||
import forge.card.CardReaderExperiments;
|
||||
import forge.error.ExceptionHandler;
|
||||
import forge.properties.ForgeConstants;
|
||||
import forge.util.BuildInfo;
|
||||
|
||||
/**
|
||||
* Main class for Forge's swing application view.
|
||||
@@ -35,10 +31,6 @@ public final class Main {
|
||||
* Main entrypoint for Forge
|
||||
*/
|
||||
public static void main(final String[] args) {
|
||||
// Init ForgeConstants
|
||||
final String assetsDir = StringUtils.containsIgnoreCase(BuildInfo.getVersionString(), "svn") ? "../forge-gui/" : "";
|
||||
ForgeConstants.init(assetsDir);
|
||||
|
||||
// HACK - temporary solution to "Comparison method violates it's general contract!" crash
|
||||
System.setProperty("java.util.Arrays.useLegacyMergeSort", "true");
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import java.util.List;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.testng.annotations.BeforeTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@@ -16,7 +15,6 @@ import forge.card.CardRarity;
|
||||
import forge.card.CardRules;
|
||||
import forge.card.DeckHints;
|
||||
import forge.properties.ForgeConstants;
|
||||
import forge.util.BuildInfo;
|
||||
import forge.util.FileUtil;
|
||||
|
||||
/**
|
||||
@@ -28,10 +26,6 @@ public class DeckHintsTest {
|
||||
|
||||
@BeforeTest
|
||||
void setupTest() {
|
||||
// Init ForgeConstants
|
||||
final String assetsDir = StringUtils.containsIgnoreCase(BuildInfo.getVersionString(), "svn") ? "../forge-gui/" : "";
|
||||
ForgeConstants.init(assetsDir);
|
||||
|
||||
GuiBase.setInterface(new GuiDesktop());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user