v0.7.1d: moved debug flags to devicecompat, added flag for load screen
This commit is contained in:
parent
0cbfea7c67
commit
109e710c36
|
@ -26,6 +26,7 @@ import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.watabou.BuildConfig;
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
|
|
||||||
public class DeviceCompat {
|
public class DeviceCompat {
|
||||||
|
@ -46,6 +47,10 @@ public class DeviceCompat {
|
||||||
return Build.VERSION.SDK_INT == Build.VERSION_CODES.FROYO;
|
return Build.VERSION.SDK_INT == Build.VERSION_CODES.FROYO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isDebug(){
|
||||||
|
return BuildConfig.DEBUG;
|
||||||
|
}
|
||||||
|
|
||||||
public static void openURI( String URI ){
|
public static void openURI( String URI ){
|
||||||
Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( URI ) );
|
Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( URI ) );
|
||||||
Game.instance.startActivity( intent );
|
Game.instance.startActivity( intent );
|
||||||
|
|
|
@ -54,6 +54,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ThrowingKn
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ThrowingStone;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ThrowingStone;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
|
import com.watabou.utils.DeviceCompat;
|
||||||
|
|
||||||
public enum HeroClass {
|
public enum HeroClass {
|
||||||
|
|
||||||
|
@ -254,7 +255,7 @@ public enum HeroClass {
|
||||||
|
|
||||||
public boolean isUnlocked(){
|
public boolean isUnlocked(){
|
||||||
//always unlock on debug builds
|
//always unlock on debug builds
|
||||||
if (BuildConfig.DEBUG) return true;
|
if (DeviceCompat.isDebug()) return true;
|
||||||
|
|
||||||
switch (this){
|
switch (this){
|
||||||
case WARRIOR: default:
|
case WARRIOR: default:
|
||||||
|
|
|
@ -46,6 +46,7 @@ import com.watabou.noosa.NoosaScriptNoLighting;
|
||||||
import com.watabou.noosa.RenderedText;
|
import com.watabou.noosa.RenderedText;
|
||||||
import com.watabou.noosa.SkinnedBlock;
|
import com.watabou.noosa.SkinnedBlock;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
|
import com.watabou.utils.DeviceCompat;
|
||||||
|
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -138,6 +139,11 @@ public class InterlevelScene extends PixelScene {
|
||||||
else if (loadingDepth <= 25) loadingAsset = Assets.LOADING_HALLS;
|
else if (loadingDepth <= 25) loadingAsset = Assets.LOADING_HALLS;
|
||||||
else loadingAsset = Assets.SHADOW;
|
else loadingAsset = Assets.SHADOW;
|
||||||
|
|
||||||
|
//speed up transition when debugging
|
||||||
|
if (DeviceCompat.isDebug()){
|
||||||
|
fadeTime /= 2;
|
||||||
|
}
|
||||||
|
|
||||||
SkinnedBlock bg = new SkinnedBlock(Camera.main.width, Camera.main.height, loadingAsset ){
|
SkinnedBlock bg = new SkinnedBlock(Camera.main.width, Camera.main.height, loadingAsset ){
|
||||||
@Override
|
@Override
|
||||||
protected NoosaScript script() {
|
protected NoosaScript script() {
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.BuildConfig;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
|
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
|
@ -127,7 +126,7 @@ public class TitleScene extends PixelScene {
|
||||||
@Override
|
@Override
|
||||||
protected boolean onLongClick() {
|
protected boolean onLongClick() {
|
||||||
//making it easier to start runs quickly while debugging
|
//making it easier to start runs quickly while debugging
|
||||||
if (BuildConfig.DEBUG) {
|
if (DeviceCompat.isDebug()) {
|
||||||
TitleScene.this.add( new WndStartGame(1) );
|
TitleScene.this.add( new WndStartGame(1) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user