mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Create symbolic links to allow asset files to be shared amongst gui projects
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
|
<classpathentry kind="src" path="assets"/>
|
||||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
|
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
|
||||||
|
|||||||
@@ -30,4 +30,11 @@
|
|||||||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
|
<linkedResources>
|
||||||
|
<link>
|
||||||
|
<name>assets</name>
|
||||||
|
<type>2</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/forge-gui/res</locationURI>
|
||||||
|
</link>
|
||||||
|
</linkedResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ public class ForgeGame implements ApplicationListener {
|
|||||||
@Override
|
@Override
|
||||||
public void create () {
|
public void create () {
|
||||||
FSkin.loadLight("default", true);
|
FSkin.loadLight("default", true);
|
||||||
FSkin.loadFull(true);
|
//FSkin.loadFull(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Application.ApplicationType;
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.files.FileHandle;
|
import com.badlogic.gdx.files.FileHandle;
|
||||||
import com.badlogic.gdx.graphics.Texture;
|
import com.badlogic.gdx.graphics.Texture;
|
||||||
@@ -1051,15 +1052,22 @@ public class FSkin {
|
|||||||
public static ArrayList<String> getSkinDirectoryNames() {
|
public static ArrayList<String> getSkinDirectoryNames() {
|
||||||
final ArrayList<String> mySkins = new ArrayList<String>();
|
final ArrayList<String> mySkins = new ArrayList<String>();
|
||||||
|
|
||||||
final FileHandle dir = Gdx.files.internal(FILE_SKINS_DIR);
|
final FileHandle dir;
|
||||||
final String[] children = dir.file().list();
|
if (Gdx.app.getType() == ApplicationType.Desktop) {
|
||||||
if (children == null) {
|
dir = Gdx.files.internal("./bin/" + FILE_SKINS_DIR); //needed to iterate over directory for Desktop
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dir = Gdx.files.internal(FILE_SKINS_DIR);
|
||||||
|
}
|
||||||
|
if (!dir.exists() || !dir.isDirectory()) {
|
||||||
System.err.println("FSkin > can't find skins directory!");
|
System.err.println("FSkin > can't find skins directory!");
|
||||||
} else {
|
}
|
||||||
for (int i = 0; i < children.length; i++) {
|
else {
|
||||||
if (children[i].equalsIgnoreCase(".svn")) { continue; }
|
for (FileHandle skinFile : dir.list()) {
|
||||||
if (children[i].equalsIgnoreCase(".DS_Store")) { continue; }
|
String skinName = skinFile.name();
|
||||||
mySkins.add(children[i]);
|
if (skinName.equalsIgnoreCase(".svn")) { continue; }
|
||||||
|
if (skinName.equalsIgnoreCase(".DS_Store")) { continue; }
|
||||||
|
mySkins.add(skinName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<link>
|
<link>
|
||||||
<name>assets</name>
|
<name>assets</name>
|
||||||
<type>2</type>
|
<type>2</type>
|
||||||
<locationURI>PARENT-1-PROJECT_LOC/forge-m-android/assets</locationURI>
|
<locationURI>PARENT-1-PROJECT_LOC/forge-gui/res</locationURI>
|
||||||
</link>
|
</link>
|
||||||
</linkedResources>
|
</linkedResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
|||||||
Reference in New Issue
Block a user