mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
integrated Textra for Labels and Buttons
fixed executables for release
This commit is contained in:
@@ -19,6 +19,13 @@
|
|||||||
<id>jitpack.io</id>
|
<id>jitpack.io</id>
|
||||||
<url>https://jitpack.io</url>
|
<url>https://jitpack.io</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>4thline-repo</id>
|
||||||
|
<url>http://4thline.org/m2</url>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<build>
|
<build>
|
||||||
<sourceDirectory>src/main/java</sourceDirectory>
|
<sourceDirectory>src/main/java</sourceDirectory>
|
||||||
@@ -62,7 +69,7 @@
|
|||||||
<jar>${project.build.finalName}-jar-with-dependencies.jar</jar>
|
<jar>${project.build.finalName}-jar-with-dependencies.jar</jar>
|
||||||
<dontWrapJar>true</dontWrapJar>
|
<dontWrapJar>true</dontWrapJar>
|
||||||
<errTitle>forge</errTitle>
|
<errTitle>forge</errTitle>
|
||||||
<icon>src/main/config/forge-adventure.ico</icon>
|
<icon>src/main/config/forge-adventure-editor.ico</icon>
|
||||||
<classPath>
|
<classPath>
|
||||||
<mainClass>forge.adventure.Main</mainClass>
|
<mainClass>forge.adventure.Main</mainClass>
|
||||||
<addDependencies>false</addDependencies>
|
<addDependencies>false</addDependencies>
|
||||||
@@ -110,7 +117,7 @@
|
|||||||
<dontWrapJar>true</dontWrapJar>
|
<dontWrapJar>true</dontWrapJar>
|
||||||
<errTitle>forge</errTitle>
|
<errTitle>forge</errTitle>
|
||||||
<downloadUrl>https://www.oracle.com/java/technologies/downloads/</downloadUrl>
|
<downloadUrl>https://www.oracle.com/java/technologies/downloads/</downloadUrl>
|
||||||
<icon>src/main/config/forge-adventure.ico</icon>
|
<icon>src/main/config/forge-adventure-editor.ico</icon>
|
||||||
<classPath>
|
<classPath>
|
||||||
<mainClass>forge.adventure.Main</mainClass>
|
<mainClass>forge.adventure.Main</mainClass>
|
||||||
<addDependencies>false</addDependencies>
|
<addDependencies>false</addDependencies>
|
||||||
@@ -297,12 +304,6 @@
|
|||||||
<version>22.0.0</version>
|
<version>22.0.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>forge</groupId>
|
|
||||||
<artifactId>forge-gui-mobile</artifactId>
|
|
||||||
<version>1.6.54-SNAPSHOT</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.badlogicgames.gdx-controllers</groupId>
|
<groupId>com.badlogicgames.gdx-controllers</groupId>
|
||||||
<artifactId>gdx-controllers-desktop</artifactId>
|
<artifactId>gdx-controllers-desktop</artifactId>
|
||||||
|
|||||||
BIN
forge-adventure/src/main/config/forge-adventure-editor.ico
Normal file
BIN
forge-adventure/src/main/config/forge-adventure-editor.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 90 KiB |
@@ -560,11 +560,17 @@
|
|||||||
<fileset dir="${project.build.directory}" includes="forge-java8.exe" />
|
<fileset dir="${project.build.directory}" includes="forge-java8.exe" />
|
||||||
<fileset dir="${project.build.directory}" includes="forge.exe" />
|
<fileset dir="${project.build.directory}" includes="forge.exe" />
|
||||||
<fileset dir="${project.build.directory}" includes="${project.build.finalName}-jar-with-dependencies.jar" />
|
<fileset dir="${project.build.directory}" includes="${project.build.finalName}-jar-with-dependencies.jar" />
|
||||||
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure.exe" />
|
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.exe" />
|
||||||
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure-java8.exe" />
|
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure-java8.exe" />
|
||||||
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure.sh" />
|
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.sh" />
|
||||||
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure.command" />
|
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.command" />
|
||||||
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure.cmd" />
|
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.cmd" />
|
||||||
|
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-gui-mobile-dev-${project.version}-jar-with-dependencies.jar" />
|
||||||
|
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure-editor.exe" />
|
||||||
|
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure-editor-java8.exe" />
|
||||||
|
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure-editor.sh" />
|
||||||
|
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure-editor.command" />
|
||||||
|
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure-editor.cmd" />
|
||||||
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure-${project.version}-jar-with-dependencies.jar" />
|
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure-${project.version}-jar-with-dependencies.jar" />
|
||||||
</copy>
|
</copy>
|
||||||
<mkdir dir="${project.build.directory}/${project.build.finalName}/res/cardsfolder" />
|
<mkdir dir="${project.build.directory}/${project.build.finalName}/res/cardsfolder" />
|
||||||
@@ -575,10 +581,15 @@
|
|||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.sh" perm="a+rx" />
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.sh" perm="a+rx" />
|
||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.command" perm="a+rx" />
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.command" perm="a+rx" />
|
||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.cmd" perm="a+rx" />
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.cmd" perm="a+rx" />
|
||||||
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure-editor.sh" perm="a+rx" />
|
||||||
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure-editor.command" perm="a+rx" />
|
||||||
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure-editor.cmd" perm="a+rx" />
|
||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge-java8.exe" perm="a+rx" />
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge-java8.exe" perm="a+rx" />
|
||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge.exe" perm="a+rx" />
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge.exe" perm="a+rx" />
|
||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.exe" perm="a+rx" />
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.exe" perm="a+rx" />
|
||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure-java8.exe" perm="a+rx" />
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure-java8.exe" perm="a+rx" />
|
||||||
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure-editor.exe" perm="a+rx" />
|
||||||
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure-editor-java8.exe" perm="a+rx" />
|
||||||
<tar destfile="${project.build.directory}/${project.build.finalName}.tar.bz2" compression="bzip2">
|
<tar destfile="${project.build.directory}/${project.build.finalName}.tar.bz2" compression="bzip2">
|
||||||
<tarfileset filemode="755" dir="${project.build.directory}/${project.build.finalName}">
|
<tarfileset filemode="755" dir="${project.build.directory}/${project.build.finalName}">
|
||||||
<include name="forge.sh" />
|
<include name="forge.sh" />
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
@@ -46,18 +48,27 @@ public class Main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set this to "true" to make the mobile game port run as a full-screen desktop application
|
// Set this to "true" to make the mobile game port run as a full-screen desktop application
|
||||||
boolean desktopMode = cmd.hasOption("fullscreen");
|
boolean desktopMode = true;//cmd.hasOption("fullscreen");
|
||||||
// Set this to the location where you want the mobile game port to look for assets when working as a full-screen desktop application
|
// Set this to the location where you want the mobile game port to look for assets when working as a full-screen desktop application
|
||||||
// (uncomment the bottom version and comment the top one to load the res folder from the current folder the .jar is in if you would
|
// (uncomment the bottom version and comment the top one to load the res folder from the current folder the .jar is in if you would
|
||||||
// like to make the game load from a desktop game folder configuration).
|
// like to make the game load from a desktop game folder configuration).
|
||||||
String desktopModeAssetsDir = "../forge-gui/";
|
//String desktopModeAssetsDir = "../forge-gui/";
|
||||||
//String desktopModeAssetsDir = "./";
|
String desktopModeAssetsDir = "./";
|
||||||
|
if(!Files.exists(Paths.get(desktopModeAssetsDir+"res")))
|
||||||
|
desktopModeAssetsDir = "../forge-gui/";//try IDE run
|
||||||
|
|
||||||
// Assets directory used when the game fully emulates smartphone/tablet mode (desktopMode = false), useful when debugging from IDE
|
// Assets directory used when the game fully emulates smartphone/tablet mode (desktopMode = false), useful when debugging from IDE
|
||||||
String assetsDir = AssetsDownloader.SHARE_DESKTOP_ASSETS ? "../forge-gui/" : "testAssets/";
|
String assetsDir ;
|
||||||
if (!AssetsDownloader.SHARE_DESKTOP_ASSETS) {
|
if (!AssetsDownloader.SHARE_DESKTOP_ASSETS) {
|
||||||
|
assetsDir= "testAssets/";
|
||||||
FileUtil.ensureDirectoryExists(assetsDir);
|
FileUtil.ensureDirectoryExists(assetsDir);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
assetsDir= "./";
|
||||||
|
if(!Files.exists(Paths.get(assetsDir+"res")))
|
||||||
|
assetsDir = "../forge-gui/";
|
||||||
|
}
|
||||||
|
|
||||||
// Place the file "switch_orientation.ini" to your assets folder to make the game switch to landscape orientation (unless desktopMode = true)
|
// Place the file "switch_orientation.ini" to your assets folder to make the game switch to landscape orientation (unless desktopMode = true)
|
||||||
String switchOrientationFile = assetsDir + "switch_orientation.ini";
|
String switchOrientationFile = assetsDir + "switch_orientation.ini";
|
||||||
@@ -73,6 +84,7 @@ public class Main {
|
|||||||
screenWidth = Integer.parseInt(res[0].trim());
|
screenWidth = Integer.parseInt(res[0].trim());
|
||||||
screenHeight = Integer.parseInt(res[1].trim());
|
screenHeight = Integer.parseInt(res[1].trim());
|
||||||
}
|
}
|
||||||
|
desktopMode=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fullscreen width and height for desktop mode (desktopMode = true)
|
// Fullscreen width and height for desktop mode (desktopMode = true)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class CharacterSprite extends MapActor {
|
|||||||
private Animation<TextureRegion> currentAnimation = null;
|
private Animation<TextureRegion> currentAnimation = null;
|
||||||
private AnimationTypes currentAnimationType = AnimationTypes.Idle;
|
private AnimationTypes currentAnimationType = AnimationTypes.Idle;
|
||||||
private AnimationDirections currentAnimationDir = AnimationDirections.None;
|
private AnimationDirections currentAnimationDir = AnimationDirections.None;
|
||||||
private Array<Sprite> avatar=new Array<>();
|
private final Array<Sprite> avatar=new Array<>();
|
||||||
public boolean hidden = false;
|
public boolean hidden = false;
|
||||||
|
|
||||||
public CharacterSprite(int id,String path) {
|
public CharacterSprite(int id,String path) {
|
||||||
@@ -40,10 +40,6 @@ public class CharacterSprite extends MapActor {
|
|||||||
protected void load(String path) {
|
protected void load(String path) {
|
||||||
if(path==null||path.isEmpty())return;
|
if(path==null||path.isEmpty())return;
|
||||||
TextureAtlas atlas = Config.instance().getAtlas(path);
|
TextureAtlas atlas = Config.instance().getAtlas(path);
|
||||||
/*
|
|
||||||
for (Texture texture : new ObjectSet.ObjectSetIterator<>( atlas.getTextures()))
|
|
||||||
texture.setFilter(Texture.TextureFilter.Nearest, Texture.TextureFilter.Nearest);
|
|
||||||
*/
|
|
||||||
animations.clear();
|
animations.clear();
|
||||||
for (AnimationTypes stand : AnimationTypes.values()) {
|
for (AnimationTypes stand : AnimationTypes.values()) {
|
||||||
if (stand == AnimationTypes.Avatar) {
|
if (stand == AnimationTypes.Avatar) {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class MapActor extends Actor {
|
|||||||
removeIfEffectsAreFinished=true;
|
removeIfEffectsAreFinished=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
class CurrentEffect
|
static class CurrentEffect
|
||||||
{
|
{
|
||||||
public CurrentEffect(String path,ParticleEffect effect,Vector2 offset,boolean overlay)
|
public CurrentEffect(String path,ParticleEffect effect,Vector2 offset,boolean overlay)
|
||||||
{
|
{
|
||||||
@@ -35,7 +35,7 @@ public class MapActor extends Actor {
|
|||||||
this.overlay=overlay;
|
this.overlay=overlay;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String path;
|
private final String path;
|
||||||
public ParticleEffect effect;
|
public ParticleEffect effect;
|
||||||
public Vector2 offset;
|
public Vector2 offset;
|
||||||
public boolean overlay=true;
|
public boolean overlay=true;
|
||||||
@@ -63,7 +63,7 @@ public class MapActor extends Actor {
|
|||||||
{
|
{
|
||||||
ParticleEffect effect = new ParticleEffect();
|
ParticleEffect effect = new ParticleEffect();
|
||||||
effect.load(Config.instance().getFile(path),Config.instance().getFile(path).parent());
|
effect.load(Config.instance().getFile(path),Config.instance().getFile(path).parent());
|
||||||
effects.add(new CurrentEffect(path,effect,offset,overlay));
|
effects.add(new CurrentEffect(path, effect, offset, overlay));
|
||||||
if(duration!=0)//ParticleEffect.setDuration uses an integer for some reason
|
if(duration!=0)//ParticleEffect.setDuration uses an integer for some reason
|
||||||
{
|
{
|
||||||
for(ParticleEmitter emitter:effect.getEmitters()){
|
for(ParticleEmitter emitter:effect.getEmitters()){
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import forge.adventure.util.Reward;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class RewardSprite extends CharacterSprite {
|
public class RewardSprite extends CharacterSprite {
|
||||||
private final String default_reward = "[\n" +
|
private final static String default_reward = "[\n" +
|
||||||
"\t\t{\n" +
|
"\t\t{\n" +
|
||||||
"\t\t\t\"type\": \"gold\",\n" +
|
"\t\t\t\"type\": \"gold\",\n" +
|
||||||
"\t\t\t\"count\": 10,\n" +
|
"\t\t\t\"count\": 10,\n" +
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class BiomeSpriteData implements SaveFileContent {
|
|||||||
startArea=data.readDouble("startArea");
|
startArea=data.readDouble("startArea");
|
||||||
endArea=data.readDouble("endArea");
|
endArea=data.readDouble("endArea");
|
||||||
density=data.readDouble("density");
|
density=data.readDouble("density");
|
||||||
resolution=data.readDouble("resolution");;
|
resolution=data.readDouble("resolution");
|
||||||
layer=data.readInt("layer");
|
layer=data.readInt("layer");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,10 +45,14 @@ public class BiomeStructureData {
|
|||||||
this.structureAtlasPath=biomeStructureData.structureAtlasPath;
|
this.structureAtlasPath=biomeStructureData.structureAtlasPath;
|
||||||
this.sourcePath=biomeStructureData.sourcePath;
|
this.sourcePath=biomeStructureData.sourcePath;
|
||||||
this.maskPath=biomeStructureData.maskPath;
|
this.maskPath=biomeStructureData.maskPath;
|
||||||
|
this.periodicInput=biomeStructureData.periodicInput;
|
||||||
this.x=biomeStructureData.x;
|
this.x=biomeStructureData.x;
|
||||||
this.y=biomeStructureData.y;
|
this.y=biomeStructureData.y;
|
||||||
this.width=biomeStructureData.width;
|
this.width=biomeStructureData.width;
|
||||||
this.height=biomeStructureData.height;
|
this.height=biomeStructureData.height;
|
||||||
|
this.periodicOutput=biomeStructureData.periodicOutput;
|
||||||
|
this.symmetry=biomeStructureData.symmetry;
|
||||||
|
this.ground=biomeStructureData.ground;
|
||||||
this.randomPosition=biomeStructureData.randomPosition;
|
this.randomPosition=biomeStructureData.randomPosition;
|
||||||
if(biomeStructureData.mappingInfo!=null)
|
if(biomeStructureData.mappingInfo!=null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class EffectData implements Serializable {
|
|||||||
if(name != null && !name.isEmpty()) description += name + "\n";
|
if(name != null && !name.isEmpty()) description += name + "\n";
|
||||||
if(colorView) description += "Manasight.\n";
|
if(colorView) description += "Manasight.\n";
|
||||||
if(lifeModifier != 0)
|
if(lifeModifier != 0)
|
||||||
description += "Life: " + ((lifeModifier > 0) ? "+" : "") + lifeModifier + "\n";
|
description += "[+Life] " + ((lifeModifier > 0) ? "+" : "") + lifeModifier + "\n";
|
||||||
if(startBattleWithCard != null && startBattleWithCard.length != 0)
|
if(startBattleWithCard != null && startBattleWithCard.length != 0)
|
||||||
description+="Cards on battlefield: \n" + cardNames() + "\n";
|
description+="Cards on battlefield: \n" + cardNames() + "\n";
|
||||||
if(changeStartCards != 0)
|
if(changeStartCards != 0)
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ public class EnemyData {
|
|||||||
life = enemyData.life;
|
life = enemyData.life;
|
||||||
equipment = enemyData.equipment;
|
equipment = enemyData.equipment;
|
||||||
colors = enemyData.colors;
|
colors = enemyData.colors;
|
||||||
|
teamNumber = enemyData.teamNumber;
|
||||||
|
nextEnemy =enemyData.nextEnemy==null?null: new EnemyData(enemyData.nextEnemy);
|
||||||
if(enemyData.rewards == null) {
|
if(enemyData.rewards == null) {
|
||||||
rewards=null;
|
rewards=null;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ public class ItemData {
|
|||||||
iconName = cpy.iconName;
|
iconName = cpy.iconName;
|
||||||
questItem = cpy.questItem;
|
questItem = cpy.questItem;
|
||||||
cost = cpy.cost;
|
cost = cpy.cost;
|
||||||
|
usableInPoi = cpy.usableInPoi;
|
||||||
|
usableOnWorldMap = cpy.usableOnWorldMap;
|
||||||
|
commandOnUse = cpy.commandOnUse;
|
||||||
manaNeeded = cpy.manaNeeded;
|
manaNeeded = cpy.manaNeeded;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +65,7 @@ public class ItemData {
|
|||||||
Json json = new Json();
|
Json json = new Json();
|
||||||
FileHandle handle = Config.instance().getFile(Paths.ITEMS);
|
FileHandle handle = Config.instance().getFile(Paths.ITEMS);
|
||||||
if (handle.exists()) {
|
if (handle.exists()) {
|
||||||
Array readJson = json.fromJson(Array.class, ItemData.class, handle);
|
Array<ItemData> readJson = json.fromJson(Array.class, ItemData.class, handle);
|
||||||
itemList = readJson;
|
itemList = readJson;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -88,7 +91,7 @@ public class ItemData {
|
|||||||
if(effect != null)
|
if(effect != null)
|
||||||
result += effect.getDescription();
|
result += effect.getDescription();
|
||||||
if(manaNeeded != 0)
|
if(manaNeeded != 0)
|
||||||
result += "Mana cost: "+manaNeeded;
|
result += manaNeeded+" [Mana]";
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,5 +58,7 @@ public class PointOfInterestData {
|
|||||||
sprite=other.sprite;
|
sprite=other.sprite;
|
||||||
map=other.map;
|
map=other.map;
|
||||||
radiusFactor=other.radiusFactor;
|
radiusFactor=other.radiusFactor;
|
||||||
|
offsetX=other.offsetX;
|
||||||
|
offsetY=other.offsetY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,12 +66,12 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
private boolean announceCustom = false;
|
private boolean announceCustom = false;
|
||||||
|
|
||||||
// Signals
|
// Signals
|
||||||
SignalList onLifeTotalChangeList = new SignalList();
|
final SignalList onLifeTotalChangeList = new SignalList();
|
||||||
SignalList onManaTotalChangeList = new SignalList();
|
final SignalList onManaTotalChangeList = new SignalList();
|
||||||
SignalList onGoldChangeList = new SignalList();
|
final SignalList onGoldChangeList = new SignalList();
|
||||||
SignalList onPlayerChangeList = new SignalList();
|
final SignalList onPlayerChangeList = new SignalList();
|
||||||
SignalList onEquipmentChange = new SignalList();
|
final SignalList onEquipmentChange = new SignalList();
|
||||||
SignalList onBlessing = new SignalList();
|
final SignalList onBlessing = new SignalList();
|
||||||
|
|
||||||
public AdventurePlayer() { clear(); }
|
public AdventurePlayer() { clear(); }
|
||||||
|
|
||||||
@@ -458,7 +458,7 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
|
|
||||||
public boolean fullHeal() {
|
public boolean fullHeal() {
|
||||||
if (life < maxLife) {
|
if (life < maxLife) {
|
||||||
life = Math.max(maxLife, life);
|
life = maxLife;
|
||||||
onLifeTotalChangeList.emit();
|
onLifeTotalChangeList.emit();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import java.util.HashSet;
|
|||||||
public class PointOfInterestChanges implements SaveFileContent {
|
public class PointOfInterestChanges implements SaveFileContent {
|
||||||
private final HashSet<Integer> deletedObjects=new HashSet<>();
|
private final HashSet<Integer> deletedObjects=new HashSet<>();
|
||||||
private final HashMap<Integer, HashSet<Integer>> cardsBought = new HashMap<>();
|
private final HashMap<Integer, HashSet<Integer>> cardsBought = new HashMap<>();
|
||||||
private java.util.Map<String, Byte> mapFlags = new HashMap<>();
|
private final java.util.Map<String, Byte> mapFlags = new HashMap<>();
|
||||||
|
|
||||||
public static class Map extends HashMap<String,PointOfInterestChanges> implements SaveFileContent {
|
public static class Map extends HashMap<String,PointOfInterestChanges> implements SaveFileContent {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ import java.util.Map;
|
|||||||
private final FLabel btnMoreOptions = deckHeader.add(new FLabel.Builder().text("...").font(FSkinFont.get(20)).align(Align.center).pressedColor(Header.BTN_PRESSED_COLOR).build());
|
private final FLabel btnMoreOptions = deckHeader.add(new FLabel.Builder().text("...").font(FSkinFont.get(20)).align(Align.center).pressedColor(Header.BTN_PRESSED_COLOR).build());
|
||||||
|
|
||||||
|
|
||||||
boolean isShop=false;
|
boolean isShop;
|
||||||
public AdventureDeckEditor(boolean createAsShop) {
|
public AdventureDeckEditor(boolean createAsShop) {
|
||||||
super(e -> leave(),getPages());
|
super(e -> leave(),getPages());
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class ArenaScene extends UIScene implements IAfterMatch {
|
|||||||
private static ArenaScene object;
|
private static ArenaScene object;
|
||||||
private final float gridSize;
|
private final float gridSize;
|
||||||
private ArenaData arenaData;
|
private ArenaData arenaData;
|
||||||
private TextraButton startButton;
|
private final TextraButton startButton;
|
||||||
|
|
||||||
public static ArenaScene instance() {
|
public static ArenaScene instance() {
|
||||||
if(object==null)
|
if(object==null)
|
||||||
@@ -37,24 +37,24 @@ public class ArenaScene extends UIScene implements IAfterMatch {
|
|||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextraButton doneButton;
|
private final TextraButton doneButton;
|
||||||
Dialog startDialog;
|
Dialog startDialog;
|
||||||
Dialog areYouSureDialog;
|
Dialog areYouSureDialog;
|
||||||
private TextraLabel goldLabel;
|
private final TextraLabel goldLabel;
|
||||||
|
|
||||||
private Group arenaPlane;
|
private final Group arenaPlane;
|
||||||
private Random rand=new Random();
|
private final Random rand=new Random();
|
||||||
|
|
||||||
Sprite fighterSpot;
|
final Sprite fighterSpot;
|
||||||
Sprite lostOverlay;
|
final Sprite lostOverlay;
|
||||||
Sprite up;
|
final Sprite up;
|
||||||
Sprite upWin;
|
final Sprite upWin;
|
||||||
Sprite side;
|
final Sprite side;
|
||||||
Sprite sideWin;
|
final Sprite sideWin;
|
||||||
Sprite edge;
|
final Sprite edge;
|
||||||
Sprite edgeM;
|
final Sprite edgeM;
|
||||||
Sprite edgeWin;
|
final Sprite edgeWin;
|
||||||
Sprite edgeWinM;
|
final Sprite edgeWinM;
|
||||||
boolean arenaStarted=false;
|
boolean arenaStarted=false;
|
||||||
private ArenaScene() {
|
private ArenaScene() {
|
||||||
super(Forge.isLandscapeMode() ? "ui/arena.json" : "ui/arena_portrait.json");
|
super(Forge.isLandscapeMode() ? "ui/arena.json" : "ui/arena_portrait.json");
|
||||||
@@ -98,7 +98,7 @@ public class ArenaScene extends UIScene implements IAfterMatch {
|
|||||||
if(object!=null&&object.equals(true))
|
if(object!=null&&object.equals(true))
|
||||||
startArena();
|
startArena();
|
||||||
startDialog.hide();
|
startDialog.hide();
|
||||||
};
|
}
|
||||||
};
|
};
|
||||||
startDialog.text("Do you want to go into the Arena?");
|
startDialog.text("Do you want to go into the Arena?");
|
||||||
startDialog.button(Forge.getLocalizer().getMessage("lblYes"), true);
|
startDialog.button(Forge.getLocalizer().getMessage("lblYes"), true);
|
||||||
|
|||||||
@@ -10,14 +10,9 @@ import forge.adventure.stage.WorldStage;
|
|||||||
* does render the WorldStage and HUD
|
* does render the WorldStage and HUD
|
||||||
*/
|
*/
|
||||||
public class GameScene extends HudScene {
|
public class GameScene extends HudScene {
|
||||||
private float cameraWidth = 0f, cameraHeight = 0f;
|
|
||||||
public GameScene() {
|
public GameScene() {
|
||||||
super(WorldStage.getInstance());
|
super(WorldStage.getInstance());
|
||||||
|
|
||||||
if (cameraWidth == 0f)
|
|
||||||
cameraWidth = stage.getCamera().viewportWidth;
|
|
||||||
if (cameraHeight == 0f)
|
|
||||||
cameraHeight = stage.getCamera().viewportHeight;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ public class InventoryScene extends UIScene {
|
|||||||
TextraLabel itemDescription;
|
TextraLabel itemDescription;
|
||||||
Dialog confirm;
|
Dialog confirm;
|
||||||
Dialog useDialog;
|
Dialog useDialog;
|
||||||
private Table inventory;
|
private final Table inventory;
|
||||||
Array<Button> inventoryButtons=new Array<>();
|
private final Array<Button> inventoryButtons=new Array<>();
|
||||||
HashMap<String,Button> equipmentSlots=new HashMap<>();
|
private final HashMap<String,Button> equipmentSlots=new HashMap<>();
|
||||||
HashMap<Button,String> itemLocation=new HashMap<>();
|
HashMap<Button,String> itemLocation=new HashMap<>();
|
||||||
Button selected;
|
Button selected;
|
||||||
Button deleteButton;
|
Button deleteButton;
|
||||||
@@ -54,8 +54,6 @@ public class InventoryScene extends UIScene {
|
|||||||
itemDescription = ui.findActor("item_description");
|
itemDescription = ui.findActor("item_description");
|
||||||
itemDescription.setAlignment(Align.topLeft);
|
itemDescription.setAlignment(Align.topLeft);
|
||||||
|
|
||||||
inventoryButtons=new Array<>();
|
|
||||||
equipmentSlots=new HashMap<>();
|
|
||||||
|
|
||||||
Array<Actor> children = ui.getChildren();
|
Array<Actor> children = ui.getChildren();
|
||||||
for (int i = 0, n = children.size; i < n; i++)
|
for (int i = 0, n = children.size; i < n; i++)
|
||||||
@@ -79,7 +77,7 @@ public class InventoryScene extends UIScene {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
String item=Current.player().itemInSlot(slotName);
|
String item=Current.player().itemInSlot(slotName);
|
||||||
if(item!=null&&item!="")
|
if(item!=null&& !item.equals(""))
|
||||||
{
|
{
|
||||||
Button changeButton=null;
|
Button changeButton=null;
|
||||||
for(Button invButton:inventoryButtons)
|
for(Button invButton:inventoryButtons)
|
||||||
@@ -118,7 +116,7 @@ public class InventoryScene extends UIScene {
|
|||||||
if(object!=null&&object.equals(true))
|
if(object!=null&&object.equals(true))
|
||||||
delete();
|
delete();
|
||||||
confirm.hide();
|
confirm.hide();
|
||||||
};
|
}
|
||||||
};
|
};
|
||||||
confirm.text( Controls.newLabel(Forge.getLocalizer().getMessage("lblDelete")));
|
confirm.text( Controls.newLabel(Forge.getLocalizer().getMessage("lblDelete")));
|
||||||
|
|
||||||
@@ -142,7 +140,7 @@ public class InventoryScene extends UIScene {
|
|||||||
triggerUse();
|
triggerUse();
|
||||||
useDialog.getColor().a = 0;
|
useDialog.getColor().a = 0;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useDialog.button(Forge.getLocalizer().getMessage("lblYes"), true);
|
useDialog.button(Forge.getLocalizer().getMessage("lblYes"), true);
|
||||||
@@ -178,6 +176,7 @@ public class InventoryScene extends UIScene {
|
|||||||
public void equip() {
|
public void equip() {
|
||||||
if(selected == null) return;
|
if(selected == null) return;
|
||||||
ItemData data = ItemData.getItem(itemLocation.get(selected));
|
ItemData data = ItemData.getItem(itemLocation.get(selected));
|
||||||
|
if(data==null)return;
|
||||||
Current.player().equip(data);
|
Current.player().equip(data);
|
||||||
updateInventory();
|
updateInventory();
|
||||||
}
|
}
|
||||||
@@ -192,6 +191,7 @@ public class InventoryScene extends UIScene {
|
|||||||
if(selected==null)return;
|
if(selected==null)return;
|
||||||
|
|
||||||
ItemData data = ItemData.getItem(itemLocation.get(selected));
|
ItemData data = ItemData.getItem(itemLocation.get(selected));
|
||||||
|
if(data==null)return;
|
||||||
Current.player().addMana(-data.manaNeeded);
|
Current.player().addMana(-data.manaNeeded);
|
||||||
done();
|
done();
|
||||||
ConsoleCommandInterpreter.getInstance().command(data.commandOnUse);
|
ConsoleCommandInterpreter.getInstance().command(data.commandOnUse);
|
||||||
@@ -199,6 +199,7 @@ public class InventoryScene extends UIScene {
|
|||||||
private void use() {
|
private void use() {
|
||||||
useDialog.getContentTable().clear();
|
useDialog.getContentTable().clear();
|
||||||
ItemData data = ItemData.getItem(itemLocation.get(selected));
|
ItemData data = ItemData.getItem(itemLocation.get(selected));
|
||||||
|
if(data==null)return;
|
||||||
useDialog.text("Use "+data.name+"?\n"+data.getDescription());
|
useDialog.text("Use "+data.name+"?\n"+data.getDescription());
|
||||||
useDialog.show(stage);
|
useDialog.show(stage);
|
||||||
}
|
}
|
||||||
@@ -218,6 +219,8 @@ public class InventoryScene extends UIScene {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ItemData data = ItemData.getItem(itemLocation.get(actor));
|
ItemData data = ItemData.getItem(itemLocation.get(actor));
|
||||||
|
|
||||||
|
if(data==null) return;
|
||||||
deleteButton.setDisabled(data.questItem);
|
deleteButton.setDisabled(data.questItem);
|
||||||
|
|
||||||
boolean isInPoi = MapStage.getInstance().isInMap();
|
boolean isInPoi = MapStage.getInstance().isInMap();
|
||||||
@@ -230,7 +233,7 @@ public class InventoryScene extends UIScene {
|
|||||||
if(Current.player().getMana()<data.manaNeeded)
|
if(Current.player().getMana()<data.manaNeeded)
|
||||||
useButton.setDisabled(true);
|
useButton.setDisabled(true);
|
||||||
|
|
||||||
if(data.equipmentSlot==null||data.equipmentSlot=="")
|
if(data.equipmentSlot==null|| data.equipmentSlot.equals(""))
|
||||||
{
|
{
|
||||||
equipButton.setDisabled(true);
|
equipButton.setDisabled(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ import forge.adventure.world.WorldSave;
|
|||||||
public class MapViewScene extends UIScene {
|
public class MapViewScene extends UIScene {
|
||||||
private static MapViewScene object;
|
private static MapViewScene object;
|
||||||
private final ScrollPane scroll;
|
private final ScrollPane scroll;
|
||||||
private Image img;
|
private final Image img;
|
||||||
private Texture miniMapTexture;
|
private Texture miniMapTexture;
|
||||||
private Image miniMapPlayer;
|
private final Image miniMapPlayer;
|
||||||
|
|
||||||
public static MapViewScene instance() {
|
public static MapViewScene instance() {
|
||||||
if(object==null)
|
if(object==null)
|
||||||
|
|||||||
@@ -36,16 +36,18 @@ import java.util.Random;
|
|||||||
public class NewGameScene extends UIScene {
|
public class NewGameScene extends UIScene {
|
||||||
TextField selectedName;
|
TextField selectedName;
|
||||||
ColorSet[] colorIds;
|
ColorSet[] colorIds;
|
||||||
private Image avatarImage;
|
private final Image avatarImage;
|
||||||
private int avatarIndex = 0;
|
private int avatarIndex = 0;
|
||||||
private Selector race;
|
private final Selector race;
|
||||||
private Selector colorId;
|
private final Selector colorId;
|
||||||
private Selector gender;
|
private final Selector gender;
|
||||||
private Selector mode;
|
private final Selector mode;
|
||||||
private Selector difficulty;
|
private final Selector difficulty;
|
||||||
private Array<String> stringList, random, custom;
|
private final Array<String> stringList;
|
||||||
private TextraLabel colorLabel;
|
private final Array<String> random;
|
||||||
private int selected = -1;
|
private final Array<String> custom;
|
||||||
|
private final TextraLabel colorLabel;
|
||||||
|
private final int selected = -1;
|
||||||
|
|
||||||
private NewGameScene() {
|
private NewGameScene() {
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ import forge.sound.SoundSystem;
|
|||||||
* Displays the rewards of a fight or a treasure
|
* Displays the rewards of a fight or a treasure
|
||||||
*/
|
*/
|
||||||
public class RewardScene extends UIScene {
|
public class RewardScene extends UIScene {
|
||||||
private TextraButton doneButton;
|
private final TextraButton doneButton;
|
||||||
private TextraLabel goldLabel;
|
private final TextraLabel goldLabel;
|
||||||
|
|
||||||
private static RewardScene object;
|
private static RewardScene object;
|
||||||
|
|
||||||
@@ -399,7 +399,7 @@ public class RewardScene extends UIScene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public BuyButton(int id, int i, PointOfInterestChanges ch, RewardActor actor, TextraButton style) {
|
public BuyButton(int id, int i, PointOfInterestChanges ch, RewardActor actor, TextraButton style) {
|
||||||
super("", style.getStyle());
|
super("", style.getStyle(),Controls.getTextraFont());
|
||||||
this.objectID = id;
|
this.objectID = id;
|
||||||
this.index = i;
|
this.index = i;
|
||||||
this.changes = ch;
|
this.changes = ch;
|
||||||
@@ -410,7 +410,7 @@ public class RewardScene extends UIScene {
|
|||||||
setY(actor.getY() - getHeight());
|
setY(actor.getY() - getHeight());
|
||||||
price = CardUtil.getRewardPrice(actor.getReward());
|
price = CardUtil.getRewardPrice(actor.getReward());
|
||||||
price *= Current.player().goldModifier();
|
price *= Current.player().goldModifier();
|
||||||
setText("$ " + price);
|
setText(price+"[+Gold]");
|
||||||
addListener(new ClickListener() {
|
addListener(new ClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void clicked(InputEvent event, float x, float y) {
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
@@ -424,7 +424,7 @@ public class RewardScene extends UIScene {
|
|||||||
SoundSystem.instance.play(SoundEffectType.FlipCoin, false);
|
SoundSystem.instance.play(SoundEffectType.FlipCoin, false);
|
||||||
|
|
||||||
updateBuyButtons();
|
updateBuyButtons();
|
||||||
goldLabel.setText("Gold: " + String.valueOf(AdventurePlayer.current().getGold()));
|
goldLabel.setText(AdventurePlayer.current().getGold()+"[+Gold]");
|
||||||
if(changes==null)
|
if(changes==null)
|
||||||
return;
|
return;
|
||||||
setDisabled(true);
|
setDisabled(true);
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ public class SaveLoadScene extends UIScene {
|
|||||||
diffList[c] = diff.name;
|
diffList[c] = diff.name;
|
||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
;
|
|
||||||
|
|
||||||
difficulty = Controls.newComboBox(diffList, null, o -> {
|
difficulty = Controls.newComboBox(diffList, null, o -> {
|
||||||
//DifficultyData difficulty1 = Config.instance().getConfigData().difficulties[difficulty.getSelectedIndex()];
|
//DifficultyData difficulty1 = Config.instance().getConfigData().difficulties[difficulty.getSelectedIndex()];
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class SettingsScene extends UIScene {
|
|||||||
static public ForgePreferences Preference;
|
static public ForgePreferences Preference;
|
||||||
Stage stage;
|
Stage stage;
|
||||||
Texture Background;
|
Texture Background;
|
||||||
private Table settingGroup;
|
private final Table settingGroup;
|
||||||
TextraButton backButton;
|
TextraButton backButton;
|
||||||
ScrollPane scrollPane;
|
ScrollPane scrollPane;
|
||||||
|
|
||||||
|
|||||||
@@ -38,9 +38,9 @@ public class SpellSmithScene extends UIScene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private List<PaperCard> cardPool = new ArrayList<>();
|
private List<PaperCard> cardPool = new ArrayList<>();
|
||||||
private TextraLabel goldLabel;
|
private final TextraLabel goldLabel;
|
||||||
private TextraButton pullButton;
|
private final TextraButton pullButton;
|
||||||
private ScrollPane rewardDummy;
|
private final ScrollPane rewardDummy;
|
||||||
private RewardActor rewardActor;
|
private RewardActor rewardActor;
|
||||||
SelectBox<CardEdition> editionList;
|
SelectBox<CardEdition> editionList;
|
||||||
//Button containers.
|
//Button containers.
|
||||||
@@ -53,7 +53,7 @@ public class SpellSmithScene extends UIScene {
|
|||||||
private int cost_low = -1;
|
private int cost_low = -1;
|
||||||
private int cost_high = 9999;
|
private int cost_high = 9999;
|
||||||
//Other
|
//Other
|
||||||
private float basePrice = 125f;
|
private final float basePrice = 125f;
|
||||||
private int currentPrice = 0;
|
private int currentPrice = 0;
|
||||||
|
|
||||||
private SpellSmithScene() { super(Forge.isLandscapeMode() ? "ui/spellsmith.json" : "ui/spellsmith_portrait.json");
|
private SpellSmithScene() { super(Forge.isLandscapeMode() ? "ui/spellsmith.json" : "ui/spellsmith_portrait.json");
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ public class TileMapScene extends HudScene {
|
|||||||
PointOfInterestMapRenderer tiledMapRenderer;
|
PointOfInterestMapRenderer tiledMapRenderer;
|
||||||
private String nextMap;
|
private String nextMap;
|
||||||
private boolean autoheal = false;
|
private boolean autoheal = false;
|
||||||
private float cameraWidth = 0f, cameraHeight = 0f;
|
|
||||||
|
|
||||||
private TileMapScene() {
|
private TileMapScene() {
|
||||||
super(MapStage.getInstance());
|
super(MapStage.getInstance());
|
||||||
@@ -32,10 +31,6 @@ public class TileMapScene extends HudScene {
|
|||||||
|
|
||||||
|
|
||||||
//set initial camera width and height
|
//set initial camera width and height
|
||||||
if (cameraWidth == 0f)
|
|
||||||
cameraWidth = stage.getCamera().viewportWidth;
|
|
||||||
if (cameraHeight == 0f)
|
|
||||||
cameraHeight = stage.getCamera().viewportHeight;
|
|
||||||
MapStage.getInstance().setDialogStage(hud);
|
MapStage.getInstance().setDialogStage(hud);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,9 +31,9 @@ public class UIScene extends Scene {
|
|||||||
Stage stage;
|
Stage stage;
|
||||||
|
|
||||||
String uiFile;
|
String uiFile;
|
||||||
private Dialog keyboardDialog;
|
private final Dialog keyboardDialog;
|
||||||
private Label kbLabel;
|
private final Label kbLabel;
|
||||||
private TextraButton keyA, keyB, keyC, keyD, keyE, keyF, keyG, keyH, keyI, keyJ, keyK, keyL, keyM, keyN, keyO, keyP,
|
private final TextraButton keyA, keyB, keyC, keyD, keyE, keyF, keyG, keyH, keyI, keyJ, keyK, keyL, keyM, keyN, keyO, keyP,
|
||||||
keyQ, keyR, keyS, keyT, keyU, keyV, keyW, keyX, keyY, keyZ, key1, key2, key3, key4, key5, key6, key7, key8,
|
keyQ, keyR, keyS, keyT, keyU, keyV, keyW, keyX, keyY, keyZ, key1, key2, key3, key4, key5, key6, key7, key8,
|
||||||
key9, key0, keyDot, keyComma, keyShift, keyBackspace, keySpace, keyOK;
|
key9, key0, keyDot, keyComma, keyShift, keyBackspace, keySpace, keyOK;
|
||||||
public Actor lastInputField;
|
public Actor lastInputField;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import forge.adventure.util.Controls;
|
|||||||
|
|
||||||
public class Console extends Window {
|
public class Console extends Window {
|
||||||
private final ScrollPane scroll;
|
private final ScrollPane scroll;
|
||||||
private String last = "";
|
private String last = "";
|
||||||
private final InputLine input;
|
private final InputLine input;
|
||||||
private final Table content;
|
private final Table content;
|
||||||
|
|
||||||
@@ -22,8 +22,8 @@ public class Console extends Window {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class InputLine extends TextField {
|
static class InputLine extends TextField {
|
||||||
private Console console;
|
private final Console console;
|
||||||
|
|
||||||
public InputLine(Console console) {
|
public InputLine(Console console) {
|
||||||
super("", Controls.getSkin());
|
super("", Controls.getSkin());
|
||||||
@@ -43,8 +43,15 @@ public class Console extends Window {
|
|||||||
case BACKSPACE:
|
case BACKSPACE:
|
||||||
break;
|
break;
|
||||||
case TAB:
|
case TAB:
|
||||||
self.setText(console.complete(self.getText()));
|
if(self.getText().isEmpty())
|
||||||
self.setCursorPosition(Integer.MAX_VALUE);
|
{
|
||||||
|
self.setText(console.last);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.setText(console.complete(self.getText()));
|
||||||
|
self.setCursorPosition(Integer.MAX_VALUE);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case NEWLINE:
|
case NEWLINE:
|
||||||
case CARRIAGE_RETURN:
|
case CARRIAGE_RETURN:
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class ConsoleCommandInterpreter {
|
|||||||
private static ConsoleCommandInterpreter instance;
|
private static ConsoleCommandInterpreter instance;
|
||||||
Command root = new Command();
|
Command root = new Command();
|
||||||
|
|
||||||
class Command {
|
static class Command {
|
||||||
HashMap<String, Command> children = new HashMap<>();
|
HashMap<String, Command> children = new HashMap<>();
|
||||||
Function<String[], String> function;
|
Function<String[], String> function;
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ public class ConsoleCommandInterpreter {
|
|||||||
|
|
||||||
for(String name:path) {
|
for(String name:path) {
|
||||||
if(!currentCommand.children.containsKey(name))
|
if(!currentCommand.children.containsKey(name))
|
||||||
currentCommand.children.put(name,new Command());
|
currentCommand.children.put(name, new Command());
|
||||||
currentCommand = currentCommand.children.get(name);
|
currentCommand = currentCommand.children.get(name);
|
||||||
}
|
}
|
||||||
currentCommand.function = function;
|
currentCommand.function = function;
|
||||||
|
|||||||
@@ -50,10 +50,13 @@ public class GameHUD extends Stage implements ControllerListener {
|
|||||||
private final Image miniMap, gamehud, mapborder, avatarborder, blank;
|
private final Image miniMap, gamehud, mapborder, avatarborder, blank;
|
||||||
private final InputEvent eventTouchDown;
|
private final InputEvent eventTouchDown;
|
||||||
private final InputEvent eventTouchUp;
|
private final InputEvent eventTouchUp;
|
||||||
private TextraButton deckActor, menuActor, statsActor, inventoryActor;
|
private final TextraButton deckActor;
|
||||||
private UIActor ui;
|
private final TextraButton menuActor;
|
||||||
private Touchpad touchpad;
|
private final TextraButton statsActor;
|
||||||
private Console console;
|
private final TextraButton inventoryActor;
|
||||||
|
private final UIActor ui;
|
||||||
|
private final Touchpad touchpad;
|
||||||
|
private final Console console;
|
||||||
float TOUCHPAD_SCALE = 70f, referenceX;
|
float TOUCHPAD_SCALE = 70f, referenceX;
|
||||||
boolean isHiding = false, isShowing = false;
|
boolean isHiding = false, isShowing = false;
|
||||||
float opacity = 1f;
|
float opacity = 1f;
|
||||||
|
|||||||
@@ -256,9 +256,12 @@ public abstract class GameStage extends Stage {
|
|||||||
if (keycode == Input.Keys.F2) {
|
if (keycode == Input.Keys.F2) {
|
||||||
TileMapScene S = TileMapScene.instance();
|
TileMapScene S = TileMapScene.instance();
|
||||||
PointOfInterestData P = PointOfInterestData.getPointOfInterest("DEBUGZONE");
|
PointOfInterestData P = PointOfInterestData.getPointOfInterest("DEBUGZONE");
|
||||||
PointOfInterest PoI = new PointOfInterest(P,new Vector2(0,0), MyRandom.getRandom());
|
if( P != null)
|
||||||
S.load(PoI);
|
{
|
||||||
Forge.switchScene(S);
|
PointOfInterest PoI = new PointOfInterest(P,new Vector2(0,0), MyRandom.getRandom());
|
||||||
|
S.load(PoI);
|
||||||
|
Forge.switchScene(S);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (keycode == Input.Keys.F11) {
|
if (keycode == Input.Keys.F11) {
|
||||||
debugCollision(false);
|
debugCollision(false);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
package forge.adventure.stage;
|
package forge.adventure.stage;
|
||||||
|
|
||||||
public interface IAfterMatch {
|
public interface IAfterMatch {
|
||||||
public void setWinner(boolean winner);
|
void setWinner(boolean winner);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,10 +54,6 @@ public class MapStage extends GameStage {
|
|||||||
|
|
||||||
TiledMap map;
|
TiledMap map;
|
||||||
Array<Rectangle> collisionRect=new Array<>();
|
Array<Rectangle> collisionRect=new Array<>();
|
||||||
private float tileHeight;
|
|
||||||
private float tileWidth;
|
|
||||||
private float width;
|
|
||||||
private float height;
|
|
||||||
private boolean isInMap = false;
|
private boolean isInMap = false;
|
||||||
MapLayer spriteLayer;
|
MapLayer spriteLayer;
|
||||||
private PointOfInterestChanges changes;
|
private PointOfInterestChanges changes;
|
||||||
@@ -93,7 +89,7 @@ public class MapStage extends GameStage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canEscape() {
|
public boolean canEscape() {
|
||||||
return (preventEscape ? true : false);
|
return !preventEscape;
|
||||||
} //Check if escape is possible.
|
} //Check if escape is possible.
|
||||||
|
|
||||||
public void clearIsInMap() {
|
public void clearIsInMap() {
|
||||||
@@ -266,10 +262,10 @@ public class MapStage extends GameStage {
|
|||||||
|
|
||||||
actors.clear();
|
actors.clear();
|
||||||
collisionRect.clear();
|
collisionRect.clear();
|
||||||
width = Float.parseFloat(map.getProperties().get("width").toString());
|
float width = Float.parseFloat(map.getProperties().get("width").toString());
|
||||||
height = Float.parseFloat(map.getProperties().get("height").toString());
|
float height = Float.parseFloat(map.getProperties().get("height").toString());
|
||||||
tileHeight = Float.parseFloat(map.getProperties().get("tileheight").toString());
|
float tileHeight = Float.parseFloat(map.getProperties().get("tileheight").toString());
|
||||||
tileWidth = Float.parseFloat(map.getProperties().get("tilewidth").toString());
|
float tileWidth = Float.parseFloat(map.getProperties().get("tilewidth").toString());
|
||||||
setBounds(width * tileWidth, height * tileHeight);
|
setBounds(width * tileWidth, height * tileHeight);
|
||||||
//collision = new Array[(int) width][(int) height];
|
//collision = new Array[(int) width][(int) height];
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package forge.adventure.stage;
|
package forge.adventure.stage;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Camera;
|
import com.badlogic.gdx.graphics.Camera;
|
||||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
|
||||||
import com.badlogic.gdx.maps.MapLayer;
|
import com.badlogic.gdx.maps.MapLayer;
|
||||||
import com.badlogic.gdx.maps.tiled.TiledMap;
|
import com.badlogic.gdx.maps.tiled.TiledMap;
|
||||||
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer;
|
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer;
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ public class WorldStage extends GameStage implements SaveFileContent {
|
|||||||
protected Random rand = MyRandom.getRandom();
|
protected Random rand = MyRandom.getRandom();
|
||||||
WorldBackground background;
|
WorldBackground background;
|
||||||
private float spawnDelay = 0;
|
private float spawnDelay = 0;
|
||||||
private final float spawnInterval = 4;//todo config
|
private static final float spawnInterval = 4;//todo config
|
||||||
private PointOfInterestMapSprite collidingPoint;
|
private PointOfInterestMapSprite collidingPoint;
|
||||||
protected ArrayList<Pair<Float, EnemySprite>> enemies = new ArrayList<>();
|
protected ArrayList<Pair<Float, EnemySprite>> enemies = new ArrayList<>();
|
||||||
private final Float dieTimer=20f;//todo config
|
private final static Float dieTimer=20f;//todo config
|
||||||
private Float globalTimer=0f;
|
private Float globalTimer=0f;
|
||||||
|
|
||||||
public WorldStage() {
|
public WorldStage() {
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ public class Controls {
|
|||||||
return Color.PURPLE;
|
return Color.PURPLE;
|
||||||
if(upperCase.equals("VIOLET"))
|
if(upperCase.equals("VIOLET"))
|
||||||
return Color.VIOLET;
|
return Color.VIOLET;
|
||||||
if(upperCase.equals("PINK"))
|
if(upperCase.equals("MAROON"))
|
||||||
return Color.MAROON;
|
return Color.MAROON;
|
||||||
return Color.BLACK;
|
return Color.BLACK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ import forge.util.Localizer;
|
|||||||
|
|
||||||
public class MapDialog {
|
public class MapDialog {
|
||||||
private final MapStage stage;
|
private final MapStage stage;
|
||||||
private Array<DialogData> data;
|
private final Array<DialogData> data;
|
||||||
private final int parentID;
|
private final int parentID;
|
||||||
private final float WIDTH = 260f;
|
private final static float WIDTH = 260f;
|
||||||
static private final String defaultJSON = "[\n" +
|
static private final String defaultJSON = "[\n" +
|
||||||
" {\n" +
|
" {\n" +
|
||||||
" \"effect\":[],\n" +
|
" \"effect\":[],\n" +
|
||||||
|
|||||||
@@ -115,17 +115,17 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb
|
|||||||
if (toolTipImage.getDrawable() instanceof TextureRegionDrawable) {
|
if (toolTipImage.getDrawable() instanceof TextureRegionDrawable) {
|
||||||
((TextureRegionDrawable) toolTipImage.getDrawable()).getRegion().getTexture().dispose();
|
((TextureRegionDrawable) toolTipImage.getDrawable()).getRegion().getTexture().dispose();
|
||||||
}
|
}
|
||||||
}
|
toolTipImage.remove();
|
||||||
toolTipImage.remove();
|
toolTipImage = new Image(processDrawable(image));
|
||||||
toolTipImage = new Image(processDrawable(image));
|
if (GuiBase.isAndroid()||Forge.hasGamepad()) {
|
||||||
if (GuiBase.isAndroid()||Forge.hasGamepad()) {
|
if (holdTooltip.tooltip_image.getDrawable() instanceof TextureRegionDrawable) {
|
||||||
if (holdTooltip.tooltip_image.getDrawable() instanceof TextureRegionDrawable) {
|
((TextureRegionDrawable) holdTooltip.tooltip_image.getDrawable()).getRegion().getTexture().dispose();
|
||||||
((TextureRegionDrawable) holdTooltip.tooltip_image.getDrawable()).getRegion().getTexture().dispose();
|
}
|
||||||
|
holdTooltip.tooltip_actor.clear();
|
||||||
|
holdTooltip.tooltip_actor.add(toolTipImage);
|
||||||
|
} else {
|
||||||
|
tooltip.setActor(toolTipImage);
|
||||||
}
|
}
|
||||||
holdTooltip.tooltip_actor.clear();
|
|
||||||
holdTooltip.tooltip_actor.add(toolTipImage);
|
|
||||||
} else {
|
|
||||||
tooltip.setActor(toolTipImage);
|
|
||||||
}
|
}
|
||||||
if (T != null)
|
if (T != null)
|
||||||
T.dispose();
|
T.dispose();
|
||||||
@@ -721,8 +721,7 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb
|
|||||||
tooltip_actor.setX(Scene.getIntendedWidth() / 2 - tooltip_actor.getWidth() / 2);
|
tooltip_actor.setX(Scene.getIntendedWidth() / 2 - tooltip_actor.getWidth() / 2);
|
||||||
}
|
}
|
||||||
tooltip_actor.setY(Scene.getIntendedHeight() / 2 - tooltip_actor.getHeight() / 2);
|
tooltip_actor.setY(Scene.getIntendedHeight() / 2 - tooltip_actor.getHeight() / 2);
|
||||||
//tooltip_actor.setX(480/2 - tooltip_actor.getWidth()/2); //480 hud width
|
|
||||||
//tooltip_actor.setY(270/2-tooltip_actor.getHeight()/2); //270 hud height
|
|
||||||
actor.getStage().addActor(tooltip_actor);
|
actor.getStage().addActor(tooltip_actor);
|
||||||
return super.longPress(actor, x, y);
|
return super.longPress(actor, x, y);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ public class SaveFileData extends HashMap<String,byte[]>
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
||||||
ObjectInputStream objStream=new DecompressibleInputStream(stream);
|
ObjectInputStream objStream= new DecompressibleInputStream(stream);
|
||||||
return (SaveFileData)objStream.readObject();
|
return (SaveFileData)objStream.readObject();
|
||||||
|
|
||||||
} catch (IOException | ClassNotFoundException e) {
|
} catch (IOException | ClassNotFoundException e) {
|
||||||
@@ -177,7 +177,7 @@ public class SaveFileData extends HashMap<String,byte[]>
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
||||||
ObjectInputStream objStream=new DecompressibleInputStream(stream);
|
ObjectInputStream objStream= new DecompressibleInputStream(stream);
|
||||||
return objStream.readObject();
|
return objStream.readObject();
|
||||||
|
|
||||||
} catch (IOException | ClassNotFoundException e) {
|
} catch (IOException | ClassNotFoundException e) {
|
||||||
@@ -193,7 +193,7 @@ public class SaveFileData extends HashMap<String,byte[]>
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
||||||
ObjectInputStream objStream=new DecompressibleInputStream(stream);
|
ObjectInputStream objStream= new DecompressibleInputStream(stream);
|
||||||
return objStream.readUTF();
|
return objStream.readUTF();
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -208,7 +208,7 @@ public class SaveFileData extends HashMap<String,byte[]>
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
||||||
ObjectInputStream objStream=new DecompressibleInputStream(stream);
|
ObjectInputStream objStream= new DecompressibleInputStream(stream);
|
||||||
return objStream.readLong();
|
return objStream.readLong();
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -223,7 +223,7 @@ public class SaveFileData extends HashMap<String,byte[]>
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
||||||
ObjectInputStream objStream=new DecompressibleInputStream(stream);
|
ObjectInputStream objStream= new DecompressibleInputStream(stream);
|
||||||
return objStream.readFloat();
|
return objStream.readFloat();
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -239,7 +239,7 @@ public class SaveFileData extends HashMap<String,byte[]>
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
||||||
ObjectInputStream objStream=new DecompressibleInputStream(stream);
|
ObjectInputStream objStream= new DecompressibleInputStream(stream);
|
||||||
return objStream.readDouble();
|
return objStream.readDouble();
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -254,7 +254,7 @@ public class SaveFileData extends HashMap<String,byte[]>
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
||||||
ObjectInputStream objStream=new DecompressibleInputStream(stream);
|
ObjectInputStream objStream= new DecompressibleInputStream(stream);
|
||||||
float x= objStream.readFloat();
|
float x= objStream.readFloat();
|
||||||
float y= objStream.readFloat();
|
float y= objStream.readFloat();
|
||||||
return new Vector2(x,y);
|
return new Vector2(x,y);
|
||||||
@@ -271,7 +271,7 @@ public class SaveFileData extends HashMap<String,byte[]>
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
||||||
ObjectInputStream objStream=new DecompressibleInputStream(stream);
|
ObjectInputStream objStream= new DecompressibleInputStream(stream);
|
||||||
float x= objStream.readFloat();
|
float x= objStream.readFloat();
|
||||||
float y= objStream.readFloat();
|
float y= objStream.readFloat();
|
||||||
float width= objStream.readFloat();
|
float width= objStream.readFloat();
|
||||||
@@ -299,7 +299,7 @@ public class SaveFileData extends HashMap<String,byte[]>
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
||||||
ObjectInputStream objStream=new DecompressibleInputStream(stream);
|
ObjectInputStream objStream= new DecompressibleInputStream(stream);
|
||||||
return objStream.readInt();
|
return objStream.readInt();
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -314,7 +314,7 @@ public class SaveFileData extends HashMap<String,byte[]>
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
ByteArrayInputStream stream=new ByteArrayInputStream(get(key));
|
||||||
ObjectInputStream objStream=new DecompressibleInputStream(stream);
|
ObjectInputStream objStream= new DecompressibleInputStream(stream);
|
||||||
return objStream.readBoolean();
|
return objStream.readBoolean();
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -326,7 +326,7 @@ public class SaveFileData extends HashMap<String,byte[]>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class DecompressibleInputStream extends ObjectInputStream {
|
static class DecompressibleInputStream extends ObjectInputStream {
|
||||||
|
|
||||||
/*https://stackoverflow.com/questions/1816559/make-java-runtime-ignore-serialversionuids*/
|
/*https://stackoverflow.com/questions/1816559/make-java-runtime-ignore-serialversionuids*/
|
||||||
|
|
||||||
@@ -355,8 +355,7 @@ public class SaveFileData extends HashMap<String,byte[]>
|
|||||||
final StringBuffer s = new StringBuffer("Overriding serialized class version mismatch: ");
|
final StringBuffer s = new StringBuffer("Overriding serialized class version mismatch: ");
|
||||||
s.append("local serialVersionUID = ").append(localSUID);
|
s.append("local serialVersionUID = ").append(localSUID);
|
||||||
s.append(" stream serialVersionUID = ").append(streamSUID);
|
s.append(" stream serialVersionUID = ").append(streamSUID);
|
||||||
//Exception e = new InvalidClassException(s.toString());
|
|
||||||
//logger.error("Potentially Fatal Deserialization Operation.", e);
|
|
||||||
System.err.println("[Invalid Class Exception]\n"+s);
|
System.err.println("[Invalid Class Exception]\n"+s);
|
||||||
resultClassDescriptor = localClassDescriptor; // Use local class descriptor for deserialization
|
resultClassDescriptor = localClassDescriptor; // Use local class descriptor for deserialization
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,9 +20,6 @@ public class BiomeSprites {
|
|||||||
public Sprite getSprite(String name, int seed) {
|
public Sprite getSprite(String name, int seed) {
|
||||||
if (textureAtlasBuffer == null) {
|
if (textureAtlasBuffer == null) {
|
||||||
textureAtlasBuffer = Config.instance().getAtlas(textureAtlas);
|
textureAtlasBuffer = Config.instance().getAtlas(textureAtlas);
|
||||||
/*for (Texture texture : new ObjectSet.ObjectSetIterator<>(textureAtlasBuffer.getTextures())) {
|
|
||||||
texture.setFilter(Texture.TextureFilter.Nearest, Texture.TextureFilter.Nearest);
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
if (!spriteBuffer.containsKey(name)) {
|
if (!spriteBuffer.containsKey(name)) {
|
||||||
spriteBuffer.put(name, new Array<Sprite>());
|
spriteBuffer.put(name, new Array<Sprite>());
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ import java.util.HashMap;
|
|||||||
|
|
||||||
public class BiomeStructure {
|
public class BiomeStructure {
|
||||||
|
|
||||||
private BiomeStructureData data;
|
private final BiomeStructureData data;
|
||||||
long seed;
|
final long seed;
|
||||||
private int biomeWidth;
|
private final int biomeWidth;
|
||||||
private int biomeHeight;
|
private final int biomeHeight;
|
||||||
private int dataMap[][];
|
private int[][] dataMap;
|
||||||
private boolean collisionMap[][];
|
private boolean[][] collisionMap;
|
||||||
boolean init=false;
|
boolean init=false;
|
||||||
private TextureAtlas structureAtlas;
|
private TextureAtlas structureAtlas;
|
||||||
public ColorMap image;
|
public ColorMap image;
|
||||||
@@ -61,7 +61,7 @@ public class BiomeStructure {
|
|||||||
|
|
||||||
init=true;
|
init=true;
|
||||||
int targetWidth=(int) (data.width* biomeWidth);
|
int targetWidth=(int) (data.width* biomeWidth);
|
||||||
int targetHeight=(int) (data.width* biomeWidth);
|
int targetHeight=(int) (data.height* biomeHeight);
|
||||||
dataMap=new int[targetWidth][ targetHeight];
|
dataMap=new int[targetWidth][ targetHeight];
|
||||||
collisionMap=new boolean[targetWidth][ targetHeight];
|
collisionMap=new boolean[targetWidth][ targetHeight];
|
||||||
ColorMap finalImage=new ColorMap(targetWidth, targetHeight);
|
ColorMap finalImage=new ColorMap(targetWidth, targetHeight);
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ public class BiomeTexture implements Serializable {
|
|||||||
ArrayList<Pixmap> spics = new ArrayList<>();
|
ArrayList<Pixmap> spics = new ArrayList<>();
|
||||||
if(!region.getTexture().getTextureData().isPrepared())
|
if(!region.getTexture().getTextureData().isPrepared())
|
||||||
region.getTexture().getTextureData().prepare();
|
region.getTexture().getTextureData().prepare();
|
||||||
Pixmap completePicture = region.getTexture().getTextureData().consumePixmap();
|
Pixmap completePicture = region.getTexture().getTextureData().consumePixmap();
|
||||||
for (int y = 0; y < 4; y++) {
|
for (int y = 0; y < 4; y++) {
|
||||||
for (int x = 0; x < 3; x++) {
|
for (int x = 0; x < 3; x++) {
|
||||||
int px = region.getRegionX() + (x * tileSize);
|
int px = region.getRegionX() + (x * tileSize);
|
||||||
@@ -285,6 +285,7 @@ public class BiomeTexture implements Serializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//noinspection ConstantConditions
|
||||||
if (false)//debug neighbors
|
if (false)//debug neighbors
|
||||||
{
|
{
|
||||||
subPixmap.setColor(Color.GREEN);
|
subPixmap.setColor(Color.GREEN);
|
||||||
@@ -340,7 +341,7 @@ public class BiomeTexture implements Serializable {
|
|||||||
BottomEdge(10),
|
BottomEdge(10),
|
||||||
RightBottomEdge(11);
|
RightBottomEdge(11);
|
||||||
|
|
||||||
public int value;
|
public final int value;
|
||||||
|
|
||||||
BigPictures(int i) {
|
BigPictures(int i) {
|
||||||
value = i;
|
value = i;
|
||||||
@@ -398,7 +399,7 @@ public class BiomeTexture implements Serializable {
|
|||||||
RightBottomEdge01(46),
|
RightBottomEdge01(46),
|
||||||
RightBottomEdge11(47);
|
RightBottomEdge11(47);
|
||||||
|
|
||||||
public int value;
|
public final int value;
|
||||||
|
|
||||||
SmallPictures(int i) {
|
SmallPictures(int i) {
|
||||||
value = i;
|
value = i;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class OverlappingModel extends Model {
|
|||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
interface Agrees<One, Two, Three, Four, Five> {
|
interface Agrees<One, Two, Three, Four, Five> {
|
||||||
public Five apply(One one, Two two, Three three, Four four);
|
Five apply(One one, Two two, Three three, Four four);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,10 +51,10 @@ public class OverlappingModel extends Model {
|
|||||||
|
|
||||||
this.colors = new ArrayList<Color>();
|
this.colors = new ArrayList<Color>();
|
||||||
|
|
||||||
for (int y = 0; y < SMY; y++) for (int x = 0; x < SMX; x++) {
|
for (int y = 0; y < SMY; y++) for (int x = 0; x < SMX; x++) {
|
||||||
Color color = data.getColor(x, y);
|
Color color = data.getColor(x, y);
|
||||||
if(color==null)
|
if(color==null)
|
||||||
break;
|
break;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (Color c : colors) {
|
for (Color c : colors) {
|
||||||
if (c.equals(color)) break;
|
if (c.equals(color)) break;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import java.util.List;
|
|||||||
* Class that hold all sprites as a list for each chunk
|
* Class that hold all sprites as a list for each chunk
|
||||||
*/
|
*/
|
||||||
public class SpritesDataMap implements SaveFileContent {
|
public class SpritesDataMap implements SaveFileContent {
|
||||||
public class BiomeSpriteDataMap extends HashMap<Integer, BiomeSpriteData> implements SaveFileContent
|
public static class BiomeSpriteDataMap extends HashMap<Integer, BiomeSpriteData> implements SaveFileContent
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void load(SaveFileData data) {
|
public void load(SaveFileData data) {
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class World implements Disposable, SaveFileContent {
|
|||||||
return mapObjectIds.get(id);
|
return mapObjectIds.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class DrawingInformation {
|
private static class DrawingInformation {
|
||||||
|
|
||||||
private int neighbors;
|
private int neighbors;
|
||||||
private final BiomeTexture regions;
|
private final BiomeTexture regions;
|
||||||
@@ -407,8 +407,7 @@ public class World implements Disposable, SaveFileContent {
|
|||||||
|
|
||||||
int structureIndex = structure.objectID(structureXStart, structureYStart);
|
int structureIndex = structure.objectID(structureXStart, structureYStart);
|
||||||
if (structureIndex >= 0) {
|
if (structureIndex >= 0) {
|
||||||
//pix.setColor(data.mappingInfo[structureIndex].getColor());
|
|
||||||
//pix.fillRectangle(x*data.miniMapTileSize, y*data.miniMapTileSize,data.miniMapTileSize,data.miniMapTileSize);
|
|
||||||
terrainMap[x][y] = terrainCounter + structureIndex;
|
terrainMap[x][y] = terrainCounter + structureIndex;
|
||||||
if (structure.collision(structureXStart, structureYStart))
|
if (structure.collision(structureXStart, structureYStart))
|
||||||
terrainMap[x][y] |= collisionBit;
|
terrainMap[x][y] |= collisionBit;
|
||||||
@@ -804,7 +803,7 @@ public class World implements Disposable, SaveFileContent {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class DrawInfo
|
static class DrawInfo
|
||||||
{
|
{
|
||||||
Pixmap mapMarkerPixmap;
|
Pixmap mapMarkerPixmap;
|
||||||
int regionX;
|
int regionX;
|
||||||
@@ -818,7 +817,7 @@ public class World implements Disposable, SaveFileContent {
|
|||||||
}
|
}
|
||||||
final Array<DrawInfo> storedInfo=new Array<>();
|
final Array<DrawInfo> storedInfo=new Array<>();
|
||||||
private void drawPixmapLater(Pixmap mapMarkerPixmap, int regionX, int regionY, int regionWidth, int regionHeight, int x, int y, int regionWidth1, int regionHeight1) {
|
private void drawPixmapLater(Pixmap mapMarkerPixmap, int regionX, int regionY, int regionWidth, int regionHeight, int x, int y, int regionWidth1, int regionHeight1) {
|
||||||
DrawInfo info=new DrawInfo();
|
DrawInfo info= new DrawInfo();
|
||||||
info.mapMarkerPixmap=mapMarkerPixmap;
|
info.mapMarkerPixmap=mapMarkerPixmap;
|
||||||
info.regionX=regionX;
|
info.regionX=regionX;
|
||||||
info.regionY=regionY;
|
info.regionY=regionY;
|
||||||
|
|||||||
8
local.properties
Normal file
8
local.properties
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
## This file must *NOT* be checked into Version Control Systems,
|
||||||
|
# as it contains information specific to your local configuration.
|
||||||
|
#
|
||||||
|
# Location of the SDK. This is only used by Gradle.
|
||||||
|
# For customization when using a Version Control System, please read the
|
||||||
|
# header note.
|
||||||
|
#Sun Sep 18 16:22:42 CEST 2022
|
||||||
|
sdk.dir=H\:\\Develop\\Android\\sdk\\current
|
||||||
Reference in New Issue
Block a user