Merging 1.7.5 Source: core changes

This commit is contained in:
Evan Debenham
2015-02-04 16:21:42 -05:00
parent 12b647959c
commit a2670f2a36
7 changed files with 132 additions and 111 deletions
@@ -37,15 +37,20 @@ public class ShatteredPixelDungeon extends Game {
public ShatteredPixelDungeon() {
super( TitleScene.class );
/*
// 1.7.2
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.plants.Dreamweed.class,
"com.shatteredpixel.shatteredpixeldungeon.plants.Blindweed" );
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.plants.Dreamweed.Seed.class,
"com.shatteredpixel.shatteredpixeldungeon.plants.Blindweed$Seed" );
*/
// 0.2.4
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shock.class,
"com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Piercing" );
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shock.class,
"com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Swing" );
/* If I rename scroll of weapon upgrade, uncomment this and correct it.
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfEnchantment.class,
"com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfWeaponUpgrade" );
*/
}
@SuppressWarnings("deprecation")
@@ -75,6 +80,55 @@ public class ShatteredPixelDungeon extends Game {
Music.INSTANCE.enable( music() );
Sample.INSTANCE.enable( soundFx() );
Sample.INSTANCE.load(
Assets.SND_CLICK,
Assets.SND_BADGE,
Assets.SND_GOLD,
Assets.SND_DESCEND,
Assets.SND_STEP,
Assets.SND_WATER,
Assets.SND_OPEN,
Assets.SND_UNLOCK,
Assets.SND_ITEM,
Assets.SND_DEWDROP,
Assets.SND_HIT,
Assets.SND_MISS,
Assets.SND_EAT,
Assets.SND_READ,
Assets.SND_LULLABY,
Assets.SND_DRINK,
Assets.SND_SHATTER,
Assets.SND_ZAP,
Assets.SND_LIGHTNING,
Assets.SND_LEVELUP,
Assets.SND_DEATH,
Assets.SND_CHALLENGE,
Assets.SND_CURSED,
Assets.SND_EVOKE,
Assets.SND_TRAP,
Assets.SND_TOMB,
Assets.SND_ALERT,
Assets.SND_MELD,
Assets.SND_BOSS,
Assets.SND_BLAST,
Assets.SND_PLANT,
Assets.SND_RAY,
Assets.SND_BEACON,
Assets.SND_TELEPORT,
Assets.SND_CHARMS,
Assets.SND_MASTERY,
Assets.SND_PUFF,
Assets.SND_ROCKS,
Assets.SND_BURNING,
Assets.SND_FALLING,
Assets.SND_GHOST,
Assets.SND_SECRET,
Assets.SND_BONES,
Assets.SND_BEE,
Assets.SND_DEGRADE,
Assets.SND_MIMIC );
}
@Override
@@ -142,16 +196,21 @@ public class ShatteredPixelDungeon extends Game {
@SuppressLint("NewApi")
public static void updateImmersiveMode() {
if (android.os.Build.VERSION.SDK_INT >= 19) {
instance.getWindow().getDecorView().setSystemUiVisibility(
immersed() ?
View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
:
0 );
try {
// Sometime NullPointerException happens here
instance.getWindow().getDecorView().setSystemUiVisibility(
immersed() ?
View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
:
0 );
} catch (Exception e) {
reportException( e );
}
}
}
@@ -241,8 +300,8 @@ public class ShatteredPixelDungeon extends Game {
/*
* <--- Preferences
*/
public static void reportException( Exception e ) {
Log.e( "PD", Log.getStackTraceString( e ) );
public static void reportException( Throwable tr ) {
Log.e("PD", Log.getStackTraceString(tr));
}
}