Test Kt and java Mixed
……
This commit is contained in:
parent
bfecdafa11
commit
f5b3bc2eef
|
@ -1,4 +1,5 @@
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
apply plugin: 'kotlin-android'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion appAndroidCompileSDK
|
compileSdkVersion appAndroidCompileSDK
|
||||||
|
@ -57,7 +58,7 @@ android {
|
||||||
configurations { natives }
|
configurations { natives }
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.github.RohitSurwase.UCE-Handler:uce_handler:1.4'
|
implementation 'cat.ereza:customactivityoncrash:2.3.0'
|
||||||
implementation project(':core')
|
implementation project(':core')
|
||||||
|
|
||||||
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
|
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
|
||||||
|
@ -71,6 +72,7 @@ dependencies {
|
||||||
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
|
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
|
||||||
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
|
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
|
||||||
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-android:$gdxControllersVersion"
|
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-android:$gdxControllersVersion"
|
||||||
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
// called every time gradle gets executed, takes the native dependencies of
|
// called every time gradle gets executed, takes the native dependencies of
|
||||||
|
@ -97,3 +99,6 @@ task copyAndroidNatives() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
|
@ -33,7 +33,6 @@ import com.badlogic.gdx.backends.android.AndroidApplication;
|
||||||
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
|
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
|
||||||
import com.badlogic.gdx.backends.android.AndroidAudio;
|
import com.badlogic.gdx.backends.android.AndroidAudio;
|
||||||
import com.badlogic.gdx.backends.android.AsynchronousAndroidAudio;
|
import com.badlogic.gdx.backends.android.AsynchronousAndroidAudio;
|
||||||
import com.rohitss.uceh.UCEHandler;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.services.news.News;
|
import com.shatteredpixel.shatteredpixeldungeon.services.news.News;
|
||||||
|
@ -85,9 +84,6 @@ public class AndroidGame extends AndroidApplication {
|
||||||
// this is the default prefs filename given to an android app (.xml is automatically added to it)
|
// this is the default prefs filename given to an android app (.xml is automatically added to it)
|
||||||
SPDSettings.set(instance.getPreferences("ShatteredPixelDungeon"));
|
SPDSettings.set(instance.getPreferences("ShatteredPixelDungeon"));
|
||||||
|
|
||||||
UCEHandler.Builder builder = new UCEHandler.Builder(this);
|
|
||||||
builder.build();
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
instance = this;
|
instance = this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.shatteredpixel.shatteredpixeldungeon.android;
|
||||||
|
|
||||||
|
import android.app.Application
|
||||||
|
import android.content.Context
|
||||||
|
import cat.ereza.customactivityoncrash.config.CaocConfig
|
||||||
|
|
||||||
|
class GameApplication : Application() {
|
||||||
|
|
||||||
|
// companion object {
|
||||||
|
// val appId = "61853bf9e0f9bb492b4f7eba"
|
||||||
|
// val channel = "Umeng"
|
||||||
|
// }
|
||||||
|
override fun onCreate() {
|
||||||
|
super.onCreate()
|
||||||
|
// UMConfigure.preInit(this, appId, channel)
|
||||||
|
CaocConfig.Builder.create()
|
||||||
|
.backgroundMode(CaocConfig.BACKGROUND_MODE_SILENT) //default: CaocConfig.BACKGROUND_MODE_SHOW_CUSTOM
|
||||||
|
.enabled(true) //default: true
|
||||||
|
.backgroundMode(CaocConfig.BACKGROUND_MODE_CRASH) //default: CaocConfig.BACKGROUND_MODE_SHOW_CUSTOM
|
||||||
|
.enabled(true) //default: true
|
||||||
|
.backgroundMode(CaocConfig.BACKGROUND_MODE_SHOW_CUSTOM) //default: CaocConfig.BACKGROUND_MODE_SHOW_CUSTOM
|
||||||
|
.enabled(true) //default: true
|
||||||
|
.showErrorDetails(true) //default: true
|
||||||
|
.showRestartButton(true) //default: true
|
||||||
|
.logErrorOnRestart(true) //default: true
|
||||||
|
.trackActivities(false) //default: false
|
||||||
|
.minTimeBetweenCrashesMs(2000) //default: 3000
|
||||||
|
//.errorDrawable(R.drawable.customactivityoncrash_error_image) //default: bug image
|
||||||
|
//
|
||||||
|
.apply()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
13
android/src/main/res/values/strings.xml
Normal file
13
android/src/main/res/values/strings.xml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">魔绫的像素地牢</string>
|
||||||
|
<string name="customactivityoncrash_error_activity_error_occurred_explanation">魔绫的像素地牢发生了意外的崩溃,\n\n请点击下方错误日志查看错误详情</string>
|
||||||
|
<string name="customactivityoncrash_error_activity_restart_app">重启应用程序</string>
|
||||||
|
<string name="customactivityoncrash_error_activity_close_app">退出应用程序</string>
|
||||||
|
<string name="customactivityoncrash_error_activity_error_details">错误日志</string>
|
||||||
|
<string name="customactivityoncrash_error_activity_error_details_title">错误日志</string>
|
||||||
|
<string name="customactivityoncrash_error_activity_error_details_close">关闭</string>
|
||||||
|
<string name="customactivityoncrash_error_activity_error_details_copy">复制错误日志</string>
|
||||||
|
<string name="customactivityoncrash_error_activity_error_details_copied">错误日志已经复制到你的剪贴板</string>
|
||||||
|
<string name="customactivityoncrash_error_activity_error_details_clipboard_label">错误信息</string>
|
||||||
|
</resources>
|
|
@ -1,10 +1,12 @@
|
||||||
buildscript {
|
buildscript {
|
||||||
|
ext.kotlin_version = '1.5.20'
|
||||||
repositories {
|
repositories {
|
||||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||||
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
|
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.0.4'
|
classpath 'com.android.tools.build:gradle:7.0.4'
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,17 +28,17 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.QuickSlot;
|
import com.shatteredpixel.shatteredpixeldungeon.QuickSlot;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.huntress.NaturesPower;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.huntress.NaturesPower;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.huntress.SpiritHawk;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.huntress.SpectralBlades;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.huntress.SpectralBlades;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.mage.WildMagic;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.huntress.SpiritHawk;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.mage.WarpBeacon;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.mage.ElementalBlast;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.mage.ElementalBlast;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.mage.WarpBeacon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.mage.WildMagic;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.rogue.DeathMark;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.rogue.DeathMark;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.rogue.ShadowClone;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.rogue.ShadowClone;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.rogue.SmokeBomb;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.rogue.SmokeBomb;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.warrior.Endure;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.warrior.HeroicLeap;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.warrior.HeroicLeap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.warrior.Shockwave;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.warrior.Shockwave;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.warrior.Endure;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal;
|
import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Waterskin;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Waterskin;
|
||||||
|
@ -46,6 +46,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClothArmor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CloakOfShadows;
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CloakOfShadows;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.VelvetPouch;
|
import com.shatteredpixel.shatteredpixeldungeon.items.bags.VelvetPouch;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
|
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.food.MeatPie;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
|
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfInvisibility;
|
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfInvisibility;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame;
|
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame;
|
||||||
|
@ -55,7 +56,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfLullaby;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRage;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRage;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfDivination;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfMagicMissile;
|
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfMagicMissile;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Dagger;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Dagger;
|
||||||
|
@ -93,7 +93,9 @@ public enum HeroClass {
|
||||||
|
|
||||||
new VelvetPouch().collect();
|
new VelvetPouch().collect();
|
||||||
Dungeon.LimitedDrops.VELVET_POUCH.drop();
|
Dungeon.LimitedDrops.VELVET_POUCH.drop();
|
||||||
|
if (DeviceCompat.isDebug()){
|
||||||
|
new MeatPie().quantity(100).identify().collect();
|
||||||
|
}
|
||||||
Waterskin waterskin = new Waterskin();
|
Waterskin waterskin = new Waterskin();
|
||||||
waterskin.collect();
|
waterskin.collect();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user