Compare commits

...

9 Commits

Author SHA1 Message Date
OMGeeky
b3b3f6ff98 rename spawnchance to respawnspeed
This reflects the actual effect it has better
2023-08-30 13:32:57 +02:00
Nut
4e5aa4314e Merge pull request #57 from OMGeeky/v0.8.7(new)
AndroidX missed spot
2023-08-18 23:09:01 +02:00
OMGeeky
5223951db4 AndroidX missed spot 2023-08-18 21:34:35 +02:00
Nut.andor
ddcb355113 Versions
- next AndroidVersion 34
- 73 = 0.8.7beta
2023-08-18 20:22:29 +02:00
Nut.andor
7a80e15628 typo 2023-08-18 20:06:55 +02:00
Nut
34dc053011 Merge pull request #52 from OMGeeky/gradle-copy-v2
Improvements to the copy Gradle Tasks
2023-08-18 19:52:19 +02:00
Nut
0266449d67 Merge branch 'v0.8.7(new)' into gradle-copy-v2 2023-08-18 19:51:31 +02:00
Nut
ea3afcf99d Merge pull request #50 from OMGeeky/AndroidX-Migration
Android x migration
2023-08-18 19:45:39 +02:00
OMGeeky
1f365b170e improves the gradle tasks for copying the maps and translations
Instead of copying the files to the normal res folder they get copied
to the build folder, which gives the user the hint that they are
generated and should not be edited in this location.

> **Warning**
After pulling this commit both folders '/app/src/main/res' and 'app/src/main/assets'
should be deleted if they exist, since they are no longer ignored (since they don't get used anymore)!
2023-01-31 22:06:34 +01:00
7 changed files with 34 additions and 23 deletions

View File

@@ -1,6 +1,3 @@
# Android ignores
app/src/main/res
app/src/main/assets
gen/
bin/
target/

View File

@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 33
compileSdkVersion 34
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.gpl.rpg.AndorsTrail"
minSdkVersion 14
targetSdkVersion 33
targetSdkVersion 34
}
buildTypes {
@@ -22,6 +22,13 @@ android {
}
}
namespace 'com.gpl.rpg.AndorsTrail'
sourceSets {
main {
res.srcDirs = ['build/gen-res', 'src/main/res']
assets.srcDirs = ['build/gen-assets', 'src/main/assets']
}
}
}
dependencies {
@@ -31,23 +38,31 @@ dependencies {
task copyRes(type: Copy) {
description "Copies the res folder to the modules res folder (& renames .tmx to .xml)"
from "${rootDir}/res"
into "${projectDir}/src/main/res"
into "${projectDir}/build/gen-res"
rename "(.*)\\.tmx", "\$1.xml"
}
task copyTranslation(type: Copy) {
description("Copies the translation files to the modules translations folder")
from "${rootDir}/assets/translation"
into "${projectDir}/src/main/assets/translation"
into "${projectDir}/build/gen-assets/translation"
}
task cleanup(type: Delete) {
description("Deletes the assets/translation and the res folder from the modules folder")
delete "${projectDir}/src/main/res", "${projectDir}/src/main/assets/translation"
delete "${projectDir}/build/gen-res", "${projectDir}/build/gen-assets/translation"
}
afterEvaluate {
preBuild.dependsOn project.tasks.copyRes
preBuild.dependsOn project.tasks.copyTranslation
mergeDebugResources.dependsOn project.tasks.copyRes
extractDeepLinksDebug.dependsOn project.tasks.copyRes
mergeReleaseResources.dependsOn project.tasks.copyRes
extractDeepLinksRelease.dependsOn project.tasks.copyRes
mergeDebugAssets.dependsOn project.tasks.copyTranslation
mergeReleaseAssets.dependsOn project.tasks.copyTranslation
extractDeepLinksDebug.dependsOn project.tasks.copyTranslation
extractDeepLinksRelease.dependsOn project.tasks.copyTranslation
clean.dependsOn project.tasks.cleanup
}

View File

@@ -4,7 +4,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gpl.rpg.AndorsTrail"
android:versionCode="73"
android:versionName="0.8.7"
android:versionName="0.8.7beta"
android:installLocation="auto"
>
@@ -34,7 +34,6 @@
<activity
android:exported="true"
android:name="com.gpl.rpg.AndorsTrail.activity.StartScreenActivity"
android:exported="true"
android:clearTaskOnLaunch="true"
>
<intent-filter>

View File

@@ -28,7 +28,7 @@ public final class AndorsTrailApplication extends Application {
public static final boolean DEVELOPMENT_FASTSPEED = false;
public static final boolean DEVELOPMENT_VALIDATEDATA = true;
public static final boolean DEVELOPMENT_DEBUGMESSAGES = true;
public static final String CURRENT_VERSION_DISPLAY = "0.8.7";
public static final String CURRENT_VERSION_DISPLAY = "0.8.7beta";
public static final boolean IS_RELEASE_VERSION = !CURRENT_VERSION_DISPLAY.matches(".*[a-d].*");
public static final boolean DEVELOPMENT_INCOMPATIBLE_SAVEGAMES = DEVELOPMENT_DEBUGRESOURCES || DEVELOPMENT_DEBUGBUTTONS || DEVELOPMENT_FASTSPEED || !IS_RELEASE_VERSION;
public static final int DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION = 999;

View File

@@ -17,7 +17,7 @@ import com.gpl.rpg.AndorsTrail.util.Range;
public final class MonsterSpawnArea {
public final CoordRect area;
public final Range quantity;
private final Range spawnChance;
private final Range respawnspeed;
public final String areaID;
public final String[] monsterTypeIDs;
public final List<Monster> monsters = new CopyOnWriteArrayList<Monster>();
@@ -30,7 +30,7 @@ public final class MonsterSpawnArea {
public MonsterSpawnArea(
CoordRect area
, Range quantity
, Range spawnChance
, Range respawnspeed
, String areaID
, String[] monsterTypeIDs
, boolean isUnique
@@ -40,7 +40,7 @@ public final class MonsterSpawnArea {
) {
this.area = area;
this.quantity = quantity;
this.spawnChance = spawnChance;
this.respawnspeed = respawnspeed;
this.areaID = areaID;
this.monsterTypeIDs = monsterTypeIDs;
this.isUnique = isUnique;
@@ -101,7 +101,7 @@ public final class MonsterSpawnArea {
}
public boolean rollShouldSpawn() {
return Constants.rollResult(spawnChance);
return Constants.rollResult(respawnspeed);
}
public void removeAllMonsters() {

View File

@@ -115,7 +115,7 @@ public final class TMXMapTranslator {
boolean isActiveForNewGame = true;
boolean ignoreAreas = false;
int maxQuantity = 1;
int spawnChance = 10;
int respawnspeed = 10;
String spawnGroup = object.name;
for (TMXProperty p : object.properties) {
if (AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA) {
@@ -126,8 +126,8 @@ public final class TMXMapTranslator {
}
if (p.name.equalsIgnoreCase("quantity")) {
maxQuantity = Integer.parseInt(p.value);
} else if (p.name.equalsIgnoreCase("spawnchance")) {
spawnChance = Integer.parseInt(p.value);
} else if (p.name.equalsIgnoreCase("respawnspeed")) {
respawnspeed = Integer.parseInt(p.value);
} else if (p.name.equalsIgnoreCase("active")) {
isActiveForNewGame = Boolean.parseBoolean(p.value);
} else if (p.name.equalsIgnoreCase("ignoreAreas")) {
@@ -155,7 +155,7 @@ public final class TMXMapTranslator {
MonsterSpawnArea area = new MonsterSpawnArea(
position
,new Range(maxQuantity, 0)
,new Range(1000, spawnChance)
,new Range(1000, respawnspeed)
,object.name
,monsterTypeIDs
,isUnique

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.app.FragmentTabHost
<androidx.fragment.app.FragmentTabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="match_parent"
@@ -26,4 +26,4 @@
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout>
</android.support.v4.app.FragmentTabHost>
</androidx.fragment.app.FragmentTabHost>