v0.6.3: refactored all game settings into SPD-Settings
This commit is contained in:
parent
079bc8c4d1
commit
b6022a2901
|
@ -183,7 +183,7 @@ public class Dungeon {
|
||||||
public static void init() {
|
public static void init() {
|
||||||
|
|
||||||
version = Game.versionCode;
|
version = Game.versionCode;
|
||||||
challenges = ShatteredPixelDungeon.challenges();
|
challenges = SPDSettings.challenges();
|
||||||
|
|
||||||
seed = DungeonSeed.randomSeed();
|
seed = DungeonSeed.randomSeed();
|
||||||
|
|
||||||
|
|
|
@ -21,30 +21,241 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon;
|
package com.shatteredpixel.shatteredpixeldungeon;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Languages;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
|
import com.watabou.noosa.Game;
|
||||||
|
import com.watabou.noosa.RenderedText;
|
||||||
|
import com.watabou.noosa.audio.Music;
|
||||||
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.utils.GameSettings;
|
import com.watabou.utils.GameSettings;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
public class SPDSettings extends GameSettings {
|
public class SPDSettings extends GameSettings {
|
||||||
|
|
||||||
|
//Version info
|
||||||
|
|
||||||
|
public static final String KEY_VERSION = "version";
|
||||||
|
|
||||||
|
public static void version( int value) {
|
||||||
|
put( KEY_VERSION, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int version() {
|
||||||
|
return getInt( KEY_VERSION, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
//Graphics
|
||||||
|
|
||||||
|
public static final String KEY_FULLSCREEN = "fullscreen";
|
||||||
public static final String KEY_LANDSCAPE = "landscape";
|
public static final String KEY_LANDSCAPE = "landscape";
|
||||||
public static final String KEY_IMMERSIVE = "immersive";
|
|
||||||
public static final String KEY_POWER_SAVER = "power_saver";
|
public static final String KEY_POWER_SAVER = "power_saver";
|
||||||
public static final String KEY_SCALE = "scale";
|
public static final String KEY_SCALE = "scale";
|
||||||
public static final String KEY_MUSIC = "music";
|
|
||||||
public static final String KEY_MUSIC_VOL = "music_vol";
|
|
||||||
public static final String KEY_SOUND_FX = "soundfx";
|
|
||||||
public static final String KEY_SFX_VOL = "sfx_vol";
|
|
||||||
public static final String KEY_ZOOM = "zoom";
|
public static final String KEY_ZOOM = "zoom";
|
||||||
public static final String KEY_LAST_CLASS = "last_class";
|
public static final String KEY_BRIGHTNESS = "brightness";
|
||||||
public static final String KEY_CHALLENGES = "challenges";
|
public static final String KEY_GRID = "visual_grid";
|
||||||
|
|
||||||
|
public static void fullscreen( boolean value ) {
|
||||||
|
put( KEY_FULLSCREEN, value );
|
||||||
|
|
||||||
|
ShatteredPixelDungeon.instance.runOnUiThread( new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
ShatteredPixelDungeon.updateSystemUI();
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean fullscreen() {
|
||||||
|
return getBoolean( KEY_FULLSCREEN, false );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void landscape( boolean value ){
|
||||||
|
put( KEY_LANDSCAPE, value );
|
||||||
|
((ShatteredPixelDungeon)ShatteredPixelDungeon.instance).updateDisplaySize();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean landscape() {
|
||||||
|
return getBoolean(KEY_LANDSCAPE, Game.dispWidth > Game.dispHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void powerSaver( boolean value ){
|
||||||
|
put( KEY_POWER_SAVER, value );
|
||||||
|
((ShatteredPixelDungeon)ShatteredPixelDungeon.instance).updateDisplaySize();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean powerSaver(){
|
||||||
|
return getBoolean( KEY_POWER_SAVER, false );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void scale( int value ) {
|
||||||
|
put( KEY_SCALE, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int scale() {
|
||||||
|
return getInt( KEY_SCALE, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void zoom( int value ) {
|
||||||
|
put( KEY_ZOOM, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int zoom() {
|
||||||
|
return getInt( KEY_ZOOM, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void brightness( int value ) {
|
||||||
|
put( KEY_BRIGHTNESS, value );
|
||||||
|
GameScene.updateFog();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int brightness() {
|
||||||
|
return getInt( KEY_BRIGHTNESS, 0, -2, 2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void visualGrid( int value ){
|
||||||
|
put( KEY_GRID, value );
|
||||||
|
GameScene.updateMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int visualGrid() {
|
||||||
|
return getInt( KEY_GRID, 0, -1, 3 );
|
||||||
|
}
|
||||||
|
|
||||||
|
//Interface
|
||||||
|
|
||||||
public static final String KEY_QUICKSLOTS = "quickslots";
|
public static final String KEY_QUICKSLOTS = "quickslots";
|
||||||
public static final String KEY_FLIPTOOLBAR = "flipped_ui";
|
public static final String KEY_FLIPTOOLBAR = "flipped_ui";
|
||||||
public static final String KEY_FLIPTAGS = "flip_tags";
|
public static final String KEY_FLIPTAGS = "flip_tags";
|
||||||
public static final String KEY_BARMODE = "toolbar_mode";
|
public static final String KEY_BARMODE = "toolbar_mode";
|
||||||
public static final String KEY_LANG = "language";
|
|
||||||
public static final String KEY_CLASSICFONT = "classic_font";
|
public static void quickSlots( int value ){ put( KEY_QUICKSLOTS, value ); }
|
||||||
|
|
||||||
|
public static int quickSlots(){ return getInt( KEY_QUICKSLOTS, 4, 0, 4); }
|
||||||
|
|
||||||
|
public static void flipToolbar( boolean value) {
|
||||||
|
put(KEY_FLIPTOOLBAR, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean flipToolbar(){ return getBoolean(KEY_FLIPTOOLBAR, false); }
|
||||||
|
|
||||||
|
public static void flipTags( boolean value) {
|
||||||
|
put(KEY_FLIPTAGS, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean flipTags(){ return getBoolean(KEY_FLIPTAGS, false); }
|
||||||
|
|
||||||
|
public static void toolbarMode( String value ) {
|
||||||
|
put( KEY_BARMODE, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String toolbarMode() {
|
||||||
|
return getString(KEY_BARMODE, !SPDSettings.landscape() ? "SPLIT" : "GROUP");
|
||||||
|
}
|
||||||
|
|
||||||
|
//Game State
|
||||||
|
|
||||||
|
public static final String KEY_LAST_CLASS = "last_class";
|
||||||
|
public static final String KEY_CHALLENGES = "challenges";
|
||||||
public static final String KEY_INTRO = "intro";
|
public static final String KEY_INTRO = "intro";
|
||||||
public static final String KEY_BRIGHTNESS = "brightness";
|
|
||||||
public static final String KEY_GRID = "visual_grid";
|
public static void intro( boolean value ) {
|
||||||
public static final String KEY_VERSION = "version";
|
put( KEY_INTRO, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean intro() {
|
||||||
|
return getBoolean( KEY_INTRO, true );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void lastClass( int value ) {
|
||||||
|
put( KEY_LAST_CLASS, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int lastClass() {
|
||||||
|
return getInt( KEY_LAST_CLASS, 0, 0, 3 );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void challenges( int value ) {
|
||||||
|
put( KEY_CHALLENGES, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int challenges() {
|
||||||
|
return getInt( KEY_CHALLENGES, 0, 0, Challenges.MAX_VALUE );
|
||||||
|
}
|
||||||
|
|
||||||
|
//Audio
|
||||||
|
|
||||||
|
public static final String KEY_MUSIC = "music";
|
||||||
|
public static final String KEY_MUSIC_VOL = "music_vol";
|
||||||
|
public static final String KEY_SOUND_FX = "soundfx";
|
||||||
|
public static final String KEY_SFX_VOL = "sfx_vol";
|
||||||
|
|
||||||
|
public static void music( boolean value ) {
|
||||||
|
Music.INSTANCE.enable( value );
|
||||||
|
put( KEY_MUSIC, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean music() {
|
||||||
|
return getBoolean( KEY_MUSIC, true );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void musicVol( int value ){
|
||||||
|
Music.INSTANCE.volume(value/10f);
|
||||||
|
put( KEY_MUSIC_VOL, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int musicVol(){
|
||||||
|
return getInt( KEY_MUSIC_VOL, 10, 0, 10 );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void soundFx( boolean value ) {
|
||||||
|
Sample.INSTANCE.enable( value );
|
||||||
|
put( KEY_SOUND_FX, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean soundFx() {
|
||||||
|
return getBoolean( KEY_SOUND_FX, true );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SFXVol( int value ) {
|
||||||
|
Sample.INSTANCE.volume(value/10f);
|
||||||
|
put( KEY_SFX_VOL, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int SFXVol() {
|
||||||
|
return getInt( KEY_SFX_VOL, 10, 0, 10 );
|
||||||
|
}
|
||||||
|
|
||||||
|
//Languages and Font
|
||||||
|
|
||||||
|
public static final String KEY_LANG = "language";
|
||||||
|
public static final String KEY_SYSTEMFONT = "system_font";
|
||||||
|
|
||||||
|
public static void language(Languages lang) {
|
||||||
|
put( KEY_LANG, lang.code());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Languages language() {
|
||||||
|
String code = getString(KEY_LANG, null);
|
||||||
|
if (code == null){
|
||||||
|
return Languages.matchLocale(Locale.getDefault());
|
||||||
|
} else {
|
||||||
|
return Languages.matchCode(code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void systemFont(boolean value){
|
||||||
|
put(KEY_SYSTEMFONT, value);
|
||||||
|
if (!value) {
|
||||||
|
RenderedText.setFont("pixelfont.ttf");
|
||||||
|
} else {
|
||||||
|
RenderedText.setFont( null );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean systemFont(){
|
||||||
|
return getBoolean(KEY_SYSTEMFONT,
|
||||||
|
(language() == Languages.KOREAN || language() == Languages.CHINESE));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@ package com.shatteredpixel.shatteredpixeldungeon;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.DisplayMetrics;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
@ -39,8 +38,6 @@ import com.watabou.noosa.audio.Music;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.utils.DeviceCompat;
|
import com.watabou.utils.DeviceCompat;
|
||||||
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
import javax.microedition.khronos.opengles.GL10;
|
import javax.microedition.khronos.opengles.GL10;
|
||||||
|
|
||||||
public class ShatteredPixelDungeon extends Game {
|
public class ShatteredPixelDungeon extends Game {
|
||||||
|
@ -139,25 +136,12 @@ public class ShatteredPixelDungeon extends Game {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
updateSystemUI();
|
updateSystemUI();
|
||||||
|
SPDSettings.landscape ( SPDSettings.landscape() );
|
||||||
|
|
||||||
if (SPDSettings.contains( SPDSettings.KEY_LANDSCAPE )){
|
Music.INSTANCE.enable( SPDSettings.music() );
|
||||||
landscape ( SPDSettings.getBoolean( SPDSettings.KEY_LANDSCAPE, false));
|
Music.INSTANCE.volume( SPDSettings.musicVol()/10f );
|
||||||
|
Sample.INSTANCE.enable( SPDSettings.soundFx() );
|
||||||
} else {
|
Sample.INSTANCE.volume( SPDSettings.SFXVol()/10f );
|
||||||
DisplayMetrics metrics = new DisplayMetrics();
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
|
|
||||||
getWindowManager().getDefaultDisplay().getRealMetrics( metrics );
|
|
||||||
else
|
|
||||||
getWindowManager().getDefaultDisplay().getMetrics( metrics );
|
|
||||||
boolean landscape = metrics.widthPixels > metrics.heightPixels;
|
|
||||||
|
|
||||||
landscape( landscape );
|
|
||||||
}
|
|
||||||
|
|
||||||
Music.INSTANCE.enable( music() );
|
|
||||||
Music.INSTANCE.volume( musicVol()/10f );
|
|
||||||
Sample.INSTANCE.enable( soundFx() );
|
|
||||||
Sample.INSTANCE.volume( SFXVol()/10f );
|
|
||||||
|
|
||||||
Music.setMuteListener();
|
Music.setMuteListener();
|
||||||
|
|
||||||
|
@ -211,7 +195,7 @@ public class ShatteredPixelDungeon extends Game {
|
||||||
Assets.SND_DEGRADE,
|
Assets.SND_DEGRADE,
|
||||||
Assets.SND_MIMIC );
|
Assets.SND_MIMIC );
|
||||||
|
|
||||||
if (classicFont()) {
|
if (!SPDSettings.systemFont()) {
|
||||||
RenderedText.setFont("pixelfont.ttf");
|
RenderedText.setFont("pixelfont.ttf");
|
||||||
} else {
|
} else {
|
||||||
RenderedText.setFont( null );
|
RenderedText.setFont( null );
|
||||||
|
@ -239,47 +223,6 @@ public class ShatteredPixelDungeon extends Game {
|
||||||
switchScene( c, callback );
|
switchScene( c, callback );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* ---> Settings
|
|
||||||
*/
|
|
||||||
|
|
||||||
//TODO migrate some of these to SPDSettings, no reason to clutter up Shattered Pixel Dungeon
|
|
||||||
|
|
||||||
public static void landscape( boolean value ) {
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
|
|
||||||
Game.instance.setRequestedOrientation(value ?
|
|
||||||
ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE :
|
|
||||||
ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
|
|
||||||
} else {
|
|
||||||
Game.instance.setRequestedOrientation(value ?
|
|
||||||
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE :
|
|
||||||
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
|
||||||
}
|
|
||||||
SPDSettings.put( SPDSettings.KEY_LANDSCAPE, value );
|
|
||||||
((ShatteredPixelDungeon)instance).updateDisplaySize();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean landscape() {
|
|
||||||
return width > height;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void scale( int value ) {
|
|
||||||
SPDSettings.put( SPDSettings.KEY_SCALE, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void immerse( boolean value ) {
|
|
||||||
SPDSettings.put( SPDSettings.KEY_IMMERSIVE, value );
|
|
||||||
|
|
||||||
instance.runOnUiThread( new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
updateSystemUI();
|
|
||||||
//ensures surfacechanged is called if the view was previously set to be fixed.
|
|
||||||
((ShatteredPixelDungeon)instance).view.getHolder().setSizeFromLayout();
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSurfaceChanged( GL10 gl, int width, int height ) {
|
public void onSurfaceChanged( GL10 gl, int width, int height ) {
|
||||||
|
|
||||||
|
@ -289,7 +232,21 @@ public class ShatteredPixelDungeon extends Game {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateDisplaySize(){
|
public void updateDisplaySize(){
|
||||||
|
boolean landscape = SPDSettings.landscape();
|
||||||
|
|
||||||
|
if (landscape != (width > height)) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
|
||||||
|
instance.setRequestedOrientation(landscape ?
|
||||||
|
ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE :
|
||||||
|
ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
|
||||||
|
} else {
|
||||||
|
instance.setRequestedOrientation(landscape ?
|
||||||
|
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE :
|
||||||
|
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (view.getMeasuredWidth() == 0 || view.getMeasuredHeight() == 0)
|
if (view.getMeasuredWidth() == 0 || view.getMeasuredHeight() == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -305,7 +262,7 @@ public class ShatteredPixelDungeon extends Game {
|
||||||
if (dispWidth < renderWidth*2 || dispHeight < renderHeight*2)
|
if (dispWidth < renderWidth*2 || dispHeight < renderHeight*2)
|
||||||
SPDSettings.put( SPDSettings.KEY_POWER_SAVER, true );
|
SPDSettings.put( SPDSettings.KEY_POWER_SAVER, true );
|
||||||
|
|
||||||
if (powerSaver()){
|
if (SPDSettings.powerSaver()){
|
||||||
|
|
||||||
int maxZoom = (int)Math.min(dispWidth/renderWidth, dispHeight/renderHeight);
|
int maxZoom = (int)Math.min(dispWidth/renderWidth, dispHeight/renderHeight);
|
||||||
|
|
||||||
|
@ -354,7 +311,7 @@ public class ShatteredPixelDungeon extends Game {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DeviceCompat.supportsFullScreen()){
|
if (DeviceCompat.supportsFullScreen()){
|
||||||
if (fullscreen && immersed()) {
|
if (fullscreen && SPDSettings.fullscreen()) {
|
||||||
instance.getWindow().getDecorView().setSystemUiVisibility(
|
instance.getWindow().getDecorView().setSystemUiVisibility(
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
|
View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
|
||||||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
|
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
|
||||||
|
@ -368,170 +325,6 @@ public class ShatteredPixelDungeon extends Game {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean immersed() {
|
|
||||||
return SPDSettings.getBoolean( SPDSettings.KEY_IMMERSIVE, false );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean powerSaver(){
|
|
||||||
return SPDSettings.getBoolean( SPDSettings.KEY_POWER_SAVER, false );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void powerSaver( boolean value ){
|
|
||||||
SPDSettings.put( SPDSettings.KEY_POWER_SAVER, value );
|
|
||||||
((ShatteredPixelDungeon)instance).updateDisplaySize();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int scale() {
|
|
||||||
return SPDSettings.getInt( SPDSettings.KEY_SCALE, 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void zoom( int value ) {
|
|
||||||
SPDSettings.put( SPDSettings.KEY_ZOOM, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int zoom() {
|
|
||||||
return SPDSettings.getInt( SPDSettings.KEY_ZOOM, 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void music( boolean value ) {
|
|
||||||
Music.INSTANCE.enable( value );
|
|
||||||
SPDSettings.put( SPDSettings.KEY_MUSIC, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean music() {
|
|
||||||
return SPDSettings.getBoolean( SPDSettings.KEY_MUSIC, true );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void musicVol( int value ){
|
|
||||||
SPDSettings.put( SPDSettings.KEY_MUSIC_VOL, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int musicVol(){
|
|
||||||
return SPDSettings.getInt( SPDSettings.KEY_MUSIC_VOL, 10, 0, 10 );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void soundFx( boolean value ) {
|
|
||||||
Sample.INSTANCE.enable( value );
|
|
||||||
SPDSettings.put( SPDSettings.KEY_SOUND_FX, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean soundFx() {
|
|
||||||
return SPDSettings.getBoolean( SPDSettings.KEY_SOUND_FX, true );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void SFXVol( int value ) {
|
|
||||||
SPDSettings.put( SPDSettings.KEY_SFX_VOL, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int SFXVol() {
|
|
||||||
return SPDSettings.getInt( SPDSettings.KEY_SFX_VOL, 10, 0, 10 );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void brightness( int value ) {
|
|
||||||
SPDSettings.put( SPDSettings.KEY_BRIGHTNESS, value );
|
|
||||||
GameScene.updateFog();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int brightness() {
|
|
||||||
return SPDSettings.getInt( SPDSettings.KEY_BRIGHTNESS, 0, -2, 2 );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void visualGrid( int value ){
|
|
||||||
SPDSettings.put( SPDSettings.KEY_GRID, value );
|
|
||||||
GameScene.updateMap();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int visualGrid() {
|
|
||||||
return SPDSettings.getInt( SPDSettings.KEY_GRID, 0, -1, 3 );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void language(Languages lang) {
|
|
||||||
SPDSettings.put( SPDSettings.KEY_LANG, lang.code());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Languages language() {
|
|
||||||
String code = SPDSettings.getString(SPDSettings.KEY_LANG, null);
|
|
||||||
if (code == null){
|
|
||||||
return Languages.matchLocale(Locale.getDefault());
|
|
||||||
} else {
|
|
||||||
return Languages.matchCode(code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void classicFont(boolean classic){
|
|
||||||
SPDSettings.put(SPDSettings.KEY_CLASSICFONT, classic);
|
|
||||||
if (classic) {
|
|
||||||
RenderedText.setFont("pixelfont.ttf");
|
|
||||||
} else {
|
|
||||||
RenderedText.setFont( null );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean classicFont(){
|
|
||||||
return SPDSettings.getBoolean(SPDSettings.KEY_CLASSICFONT,
|
|
||||||
(language() != Languages.KOREAN && language() != Languages.CHINESE));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void lastClass( int value ) {
|
|
||||||
SPDSettings.put( SPDSettings.KEY_LAST_CLASS, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int lastClass() {
|
|
||||||
return SPDSettings.getInt( SPDSettings.KEY_LAST_CLASS, 0, 0, 3 );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void challenges( int value ) {
|
|
||||||
SPDSettings.put( SPDSettings.KEY_CHALLENGES, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int challenges() {
|
|
||||||
return SPDSettings.getInt( SPDSettings.KEY_CHALLENGES, 0, 0, Challenges.MAX_VALUE );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void quickSlots( int value ){ SPDSettings.put( SPDSettings.KEY_QUICKSLOTS, value ); }
|
|
||||||
|
|
||||||
public static int quickSlots(){ return SPDSettings.getInt( SPDSettings.KEY_QUICKSLOTS, 4, 0, 4); }
|
|
||||||
|
|
||||||
public static void flipToolbar( boolean value) {
|
|
||||||
SPDSettings.put(SPDSettings.KEY_FLIPTOOLBAR, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean flipToolbar(){ return SPDSettings.getBoolean(SPDSettings.KEY_FLIPTOOLBAR, false); }
|
|
||||||
|
|
||||||
public static void flipTags( boolean value) {
|
|
||||||
SPDSettings.put(SPDSettings.KEY_FLIPTAGS, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean flipTags(){ return SPDSettings.getBoolean(SPDSettings.KEY_FLIPTAGS, false); }
|
|
||||||
|
|
||||||
public static void toolbarMode( String value ) {
|
|
||||||
SPDSettings.put( SPDSettings.KEY_BARMODE, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String toolbarMode() {
|
|
||||||
return SPDSettings.getString(SPDSettings.KEY_BARMODE, !landscape() ? "SPLIT" : "GROUP");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void intro( boolean value ) {
|
|
||||||
SPDSettings.put( SPDSettings.KEY_INTRO, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean intro() {
|
|
||||||
return SPDSettings.getBoolean( SPDSettings.KEY_INTRO, true );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void version( int value) {
|
|
||||||
SPDSettings.put( SPDSettings.KEY_VERSION, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int version() {
|
|
||||||
return SPDSettings.getInt( SPDSettings.KEY_VERSION, 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* <--- Settings
|
|
||||||
*/
|
|
||||||
|
|
||||||
public static void reportException( Throwable tr ) {
|
public static void reportException( Throwable tr ) {
|
||||||
Log.e("PD", Log.getStackTraceString(tr));
|
Log.e("PD", Log.getStackTraceString(tr));
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.messages;
|
package com.shatteredpixel.shatteredpixeldungeon.messages;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.watabou.utils.DeviceCompat;
|
import com.watabou.utils.DeviceCompat;
|
||||||
|
|
||||||
|
@ -73,7 +74,7 @@ public class Messages {
|
||||||
};
|
};
|
||||||
|
|
||||||
static{
|
static{
|
||||||
setup(ShatteredPixelDungeon.language());
|
setup(SPDSettings.language());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setup( Languages lang ){
|
public static void setup( Languages lang ){
|
||||||
|
|
|
@ -23,6 +23,8 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Flare;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Flare;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Archs;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Archs;
|
||||||
|
@ -58,9 +60,9 @@ public class AboutScene extends PixelScene {
|
||||||
public void create() {
|
public void create() {
|
||||||
super.create();
|
super.create();
|
||||||
|
|
||||||
final float colWidth = Camera.main.width / (ShatteredPixelDungeon.landscape() ? 2 : 1);
|
final float colWidth = Camera.main.width / (SPDSettings.landscape() ? 2 : 1);
|
||||||
final float colTop = (Camera.main.height / 2) - (ShatteredPixelDungeon.landscape() ? 30 : 90);
|
final float colTop = (Camera.main.height / 2) - (SPDSettings.landscape() ? 30 : 90);
|
||||||
final float wataOffset = ShatteredPixelDungeon.landscape() ? colWidth : 0;
|
final float wataOffset = SPDSettings.landscape() ? colWidth : 0;
|
||||||
|
|
||||||
Image shpx = Icons.SHPX.get();
|
Image shpx = Icons.SHPX.get();
|
||||||
shpx.x = (colWidth - shpx.width()) / 2;
|
shpx.x = (colWidth - shpx.width()) / 2;
|
||||||
|
@ -104,7 +106,7 @@ public class AboutScene extends PixelScene {
|
||||||
|
|
||||||
Image wata = Icons.WATA.get();
|
Image wata = Icons.WATA.get();
|
||||||
wata.x = wataOffset + (colWidth - wata.width()) / 2;
|
wata.x = wataOffset + (colWidth - wata.width()) / 2;
|
||||||
wata.y = ShatteredPixelDungeon.landscape() ?
|
wata.y = SPDSettings.landscape() ?
|
||||||
colTop:
|
colTop:
|
||||||
shpxlink.top() + wata.height + 20;
|
shpxlink.top() + wata.height + 20;
|
||||||
align(wata);
|
align(wata);
|
||||||
|
|
|
@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.BadgeBanner;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.BadgeBanner;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
|
@ -81,8 +82,8 @@ public class BadgesScene extends PixelScene {
|
||||||
blankBadges = Math.max(0, blankBadges);
|
blankBadges = Math.max(0, blankBadges);
|
||||||
|
|
||||||
//guarantees a max of 5 rows in landscape, and 8 in portrait, assuming a max of 40 buttons
|
//guarantees a max of 5 rows in landscape, and 8 in portrait, assuming a max of 40 buttons
|
||||||
int nCols = ShatteredPixelDungeon.landscape() ? 7 : 4;
|
int nCols = SPDSettings.landscape() ? 7 : 4;
|
||||||
if (badges.size() + blankBadges > 32 && !ShatteredPixelDungeon.landscape()) nCols++;
|
if (badges.size() + blankBadges > 32 && !SPDSettings.landscape()) nCols++;
|
||||||
|
|
||||||
int nRows = 1 + (blankBadges + badges.size())/nCols;
|
int nRows = 1 + (blankBadges + badges.size())/nCols;
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
|
@ -82,7 +82,7 @@ public class CellSelector extends TouchArea {
|
||||||
private float zoom( float value ) {
|
private float zoom( float value ) {
|
||||||
|
|
||||||
value = GameMath.gate( PixelScene.minZoom, value, PixelScene.maxZoom );
|
value = GameMath.gate( PixelScene.minZoom, value, PixelScene.maxZoom );
|
||||||
ShatteredPixelDungeon.zoom((int) (value - PixelScene.defaultZoom));
|
SPDSettings.zoom((int) (value - PixelScene.defaultZoom));
|
||||||
camera.zoom( value );
|
camera.zoom( value );
|
||||||
|
|
||||||
//Resets character sprite positions with the new camera zoom
|
//Resets character sprite positions with the new camera zoom
|
||||||
|
|
|
@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
|
@ -161,10 +162,10 @@ public class GameScene extends PixelScene {
|
||||||
|
|
||||||
Music.INSTANCE.play( Assets.TUNE, true );
|
Music.INSTANCE.play( Assets.TUNE, true );
|
||||||
|
|
||||||
ShatteredPixelDungeon.lastClass(Dungeon.hero.heroClass.ordinal());
|
SPDSettings.lastClass(Dungeon.hero.heroClass.ordinal());
|
||||||
|
|
||||||
super.create();
|
super.create();
|
||||||
Camera.main.zoom( GameMath.gate(minZoom, defaultZoom + ShatteredPixelDungeon.zoom(), maxZoom));
|
Camera.main.zoom( GameMath.gate(minZoom, defaultZoom + SPDSettings.zoom(), maxZoom));
|
||||||
|
|
||||||
scene = this;
|
scene = this;
|
||||||
|
|
||||||
|
@ -528,9 +529,9 @@ public class GameScene extends PixelScene {
|
||||||
|
|
||||||
if (scene == null) return;
|
if (scene == null) return;
|
||||||
|
|
||||||
float tagLeft = ShatteredPixelDungeon.flipTags() ? 0 : uiCamera.width - scene.attack.width();
|
float tagLeft = SPDSettings.flipTags() ? 0 : uiCamera.width - scene.attack.width();
|
||||||
|
|
||||||
if (ShatteredPixelDungeon.flipTags()) {
|
if (SPDSettings.flipTags()) {
|
||||||
scene.log.setRect(scene.attack.width(), scene.toolbar.top(), uiCamera.width - scene.attack.width(), 0);
|
scene.log.setRect(scene.attack.width(), scene.toolbar.top(), uiCamera.width - scene.attack.width(), 0);
|
||||||
} else {
|
} else {
|
||||||
scene.log.setRect(0, scene.toolbar.top(), uiCamera.width - scene.attack.width(), 0 );
|
scene.log.setRect(0, scene.toolbar.top(), uiCamera.width - scene.attack.width(), 0 );
|
||||||
|
|
|
@ -23,7 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.BadgeBanner;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.BadgeBanner;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline;
|
||||||
import com.watabou.glwrap.Blending;
|
import com.watabou.glwrap.Blending;
|
||||||
|
@ -73,7 +73,7 @@ public class PixelScene extends Scene {
|
||||||
GameScene.scene = null;
|
GameScene.scene = null;
|
||||||
|
|
||||||
float minWidth, minHeight;
|
float minWidth, minHeight;
|
||||||
if (ShatteredPixelDungeon.landscape()) {
|
if (SPDSettings.landscape()) {
|
||||||
minWidth = MIN_WIDTH_L;
|
minWidth = MIN_WIDTH_L;
|
||||||
minHeight = MIN_HEIGHT_L;
|
minHeight = MIN_HEIGHT_L;
|
||||||
} else {
|
} else {
|
||||||
|
@ -83,7 +83,7 @@ public class PixelScene extends Scene {
|
||||||
|
|
||||||
maxDefaultZoom = (int)Math.min(Game.width/minWidth, Game.height/minHeight);
|
maxDefaultZoom = (int)Math.min(Game.width/minWidth, Game.height/minHeight);
|
||||||
maxScreenZoom = (int)Math.min(Game.dispWidth/minWidth, Game.dispHeight/minHeight);
|
maxScreenZoom = (int)Math.min(Game.dispWidth/minWidth, Game.dispHeight/minHeight);
|
||||||
defaultZoom = ShatteredPixelDungeon.scale();
|
defaultZoom = SPDSettings.scale();
|
||||||
|
|
||||||
if (defaultZoom < Math.ceil( Game.density * 2 ) || defaultZoom > maxDefaultZoom){
|
if (defaultZoom < Math.ceil( Game.density * 2 ) || defaultZoom > maxDefaultZoom){
|
||||||
defaultZoom = (int)Math.ceil( Game.density * 2.5 );
|
defaultZoom = (int)Math.ceil( Game.density * 2.5 );
|
||||||
|
|
|
@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
|
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.BannerSprites;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.BannerSprites;
|
||||||
|
@ -93,7 +94,7 @@ public class StartScene extends PixelScene {
|
||||||
int h = Camera.main.height;
|
int h = Camera.main.height;
|
||||||
|
|
||||||
float width, height;
|
float width, height;
|
||||||
if (ShatteredPixelDungeon.landscape()) {
|
if (SPDSettings.landscape()) {
|
||||||
width = WIDTH_L;
|
width = WIDTH_L;
|
||||||
height = HEIGHT_L;
|
height = HEIGHT_L;
|
||||||
} else {
|
} else {
|
||||||
|
@ -161,7 +162,7 @@ public class StartScene extends PixelScene {
|
||||||
shields.put( cl, shield );
|
shields.put( cl, shield );
|
||||||
add( shield );
|
add( shield );
|
||||||
}
|
}
|
||||||
if (ShatteredPixelDungeon.landscape()) {
|
if (SPDSettings.landscape()) {
|
||||||
float shieldW = width / 4;
|
float shieldW = width / 4;
|
||||||
float shieldH = Math.min( centralHeight, shieldW );
|
float shieldH = Math.min( centralHeight, shieldW );
|
||||||
top = title.y + title.height + (centralHeight - shieldH) / 2;
|
top = title.y + title.height + (centralHeight - shieldH) / 2;
|
||||||
|
@ -219,7 +220,7 @@ public class StartScene extends PixelScene {
|
||||||
|
|
||||||
GamesInProgress.curSlot = 0;
|
GamesInProgress.curSlot = 0;
|
||||||
ActionIndicator.action = null;
|
ActionIndicator.action = null;
|
||||||
updateClass( HeroClass.values()[ShatteredPixelDungeon.lastClass()] );
|
updateClass( HeroClass.values()[SPDSettings.lastClass()] );
|
||||||
|
|
||||||
fadeIn();
|
fadeIn();
|
||||||
|
|
||||||
|
@ -300,8 +301,8 @@ public class StartScene extends PixelScene {
|
||||||
Dungeon.hero = null;
|
Dungeon.hero = null;
|
||||||
InterlevelScene.mode = InterlevelScene.Mode.DESCEND;
|
InterlevelScene.mode = InterlevelScene.Mode.DESCEND;
|
||||||
|
|
||||||
if (ShatteredPixelDungeon.intro()) {
|
if (SPDSettings.intro()) {
|
||||||
ShatteredPixelDungeon.intro( false );
|
SPDSettings.intro( false );
|
||||||
Game.switchScene( IntroScene.class );
|
Game.switchScene( IntroScene.class );
|
||||||
} else {
|
} else {
|
||||||
Game.switchScene( InterlevelScene.class );
|
Game.switchScene( InterlevelScene.class );
|
||||||
|
@ -492,7 +493,7 @@ public class StartScene extends PixelScene {
|
||||||
|
|
||||||
super.createChildren();
|
super.createChildren();
|
||||||
|
|
||||||
image = Icons.get( ShatteredPixelDungeon.challenges() > 0 ? Icons.CHALLENGE_ON :Icons.CHALLENGE_OFF );
|
image = Icons.get( SPDSettings.challenges() > 0 ? Icons.CHALLENGE_ON :Icons.CHALLENGE_OFF );
|
||||||
add( image );
|
add( image );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -508,10 +509,10 @@ public class StartScene extends PixelScene {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
if (Badges.isUnlocked( Badges.Badge.VICTORY )) {
|
if (Badges.isUnlocked( Badges.Badge.VICTORY )) {
|
||||||
StartScene.this.add(new WndChallenges(ShatteredPixelDungeon.challenges(), true) {
|
StartScene.this.add(new WndChallenges(SPDSettings.challenges(), true) {
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
image.copy( Icons.get( ShatteredPixelDungeon.challenges() > 0 ?
|
image.copy( Icons.get( SPDSettings.challenges() > 0 ?
|
||||||
Icons.CHALLENGE_ON :Icons.CHALLENGE_OFF ) );
|
Icons.CHALLENGE_ON :Icons.CHALLENGE_OFF ) );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.BannerSprites;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.BannerSprites;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Fireball;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Fireball;
|
||||||
|
@ -65,7 +66,7 @@ public class TitleScene extends PixelScene {
|
||||||
float topRegion = Math.max(95f, h*0.45f);
|
float topRegion = Math.max(95f, h*0.45f);
|
||||||
|
|
||||||
title.x = (w - title.width()) / 2f;
|
title.x = (w - title.width()) / 2f;
|
||||||
if (ShatteredPixelDungeon.landscape())
|
if (SPDSettings.landscape())
|
||||||
title.y = (topRegion - title.height()) / 2f;
|
title.y = (topRegion - title.height()) / 2f;
|
||||||
else
|
else
|
||||||
title.y = 16 + (topRegion - title.height() - 16) / 2f;
|
title.y = 16 + (topRegion - title.height() - 16) / 2f;
|
||||||
|
@ -113,7 +114,7 @@ public class TitleScene extends PixelScene {
|
||||||
DashboardItem btnPlay = new DashboardItem( Messages.get(this, "play"), 0 ) {
|
DashboardItem btnPlay = new DashboardItem( Messages.get(this, "play"), 0 ) {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
ShatteredPixelDungeon.switchNoFade( StartScene.class );
|
ShatteredPixelDungeon.switchNoFade( StartSceneV2.class );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
add( btnPlay );
|
add( btnPlay );
|
||||||
|
@ -126,7 +127,7 @@ public class TitleScene extends PixelScene {
|
||||||
};
|
};
|
||||||
add( btnRankings );
|
add( btnRankings );
|
||||||
|
|
||||||
if (ShatteredPixelDungeon.landscape()) {
|
if (SPDSettings.landscape()) {
|
||||||
btnRankings .setPos( w / 2 - btnRankings.width(), topRegion );
|
btnRankings .setPos( w / 2 - btnRankings.width(), topRegion );
|
||||||
btnBadges .setPos( w / 2, topRegion );
|
btnBadges .setPos( w / 2, topRegion );
|
||||||
btnPlay .setPos( btnRankings.left() - btnPlay.width(), topRegion );
|
btnPlay .setPos( btnRankings.left() - btnPlay.width(), topRegion );
|
||||||
|
|
|
@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
|
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Rankings;
|
import com.shatteredpixel.shatteredpixeldungeon.Rankings;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.BannerSprites;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.BannerSprites;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Fireball;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Fireball;
|
||||||
|
@ -47,7 +48,7 @@ public class WelcomeScene extends PixelScene {
|
||||||
public void create() {
|
public void create() {
|
||||||
super.create();
|
super.create();
|
||||||
|
|
||||||
final int previousVersion = ShatteredPixelDungeon.version();
|
final int previousVersion = SPDSettings.version();
|
||||||
|
|
||||||
if (ShatteredPixelDungeon.versionCode == previousVersion) {
|
if (ShatteredPixelDungeon.versionCode == previousVersion) {
|
||||||
ShatteredPixelDungeon.switchNoFade(TitleScene.class);
|
ShatteredPixelDungeon.switchNoFade(TitleScene.class);
|
||||||
|
@ -66,7 +67,7 @@ public class WelcomeScene extends PixelScene {
|
||||||
float topRegion = Math.max(95f, h*0.45f);
|
float topRegion = Math.max(95f, h*0.45f);
|
||||||
|
|
||||||
title.x = (w - title.width()) / 2f;
|
title.x = (w - title.width()) / 2f;
|
||||||
if (ShatteredPixelDungeon.landscape())
|
if (SPDSettings.landscape())
|
||||||
title.y = (topRegion - title.height()) / 2f;
|
title.y = (topRegion - title.height()) / 2f;
|
||||||
else
|
else
|
||||||
title.y = 16 + (topRegion - title.height() - 16) / 2f;
|
title.y = 16 + (topRegion - title.height() - 16) / 2f;
|
||||||
|
@ -199,8 +200,8 @@ public class WelcomeScene extends PixelScene {
|
||||||
Badges.disown(Badges.Badge.ALL_ITEMS_IDENTIFIED);
|
Badges.disown(Badges.Badge.ALL_ITEMS_IDENTIFIED);
|
||||||
Badges.saveGlobal();
|
Badges.saveGlobal();
|
||||||
}
|
}
|
||||||
|
|
||||||
ShatteredPixelDungeon.version(ShatteredPixelDungeon.versionCode);
|
SPDSettings.version(ShatteredPixelDungeon.versionCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void placeTorch( float x, float y ) {
|
private void placeTorch( float x, float y ) {
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.tiles;
|
package com.shatteredpixel.shatteredpixeldungeon.tiles;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.watabou.gltextures.BufferTexture;
|
import com.watabou.gltextures.BufferTexture;
|
||||||
import com.watabou.gltextures.TextureCache;
|
import com.watabou.gltextures.TextureCache;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
|
@ -168,7 +168,7 @@ public class FogOfWar extends Image {
|
||||||
this.visible = visible;
|
this.visible = visible;
|
||||||
this.visited = visited;
|
this.visited = visited;
|
||||||
this.mapped = mapped;
|
this.mapped = mapped;
|
||||||
this.brightness = ShatteredPixelDungeon.brightness() + 2;
|
this.brightness = SPDSettings.brightness() + 2;
|
||||||
|
|
||||||
moveToUpdating();
|
moveToUpdating();
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.tiles;
|
package com.shatteredpixel.shatteredpixeldungeon.tiles;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
|
|
||||||
public class GridTileMap extends DungeonTilemap {
|
public class GridTileMap extends DungeonTilemap {
|
||||||
|
@ -37,7 +37,7 @@ public class GridTileMap extends DungeonTilemap {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void updateMap() {
|
public synchronized void updateMap() {
|
||||||
gridSetting = ShatteredPixelDungeon.visualGrid();
|
gridSetting = SPDSettings.visualGrid();
|
||||||
super.updateMap();
|
super.updateMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
|
||||||
|
@ -157,7 +157,7 @@ public class Toolbar extends Component {
|
||||||
protected void layout() {
|
protected void layout() {
|
||||||
|
|
||||||
int[] visible = new int[4];
|
int[] visible = new int[4];
|
||||||
int slots = ShatteredPixelDungeon.quickSlots();
|
int slots = SPDSettings.quickSlots();
|
||||||
|
|
||||||
for(int i = 0; i <= 3; i++)
|
for(int i = 0; i <= 3; i++)
|
||||||
visible[i] = (int)((slots > i) ? y+2 : y+25);
|
visible[i] = (int)((slots > i) ? y+2 : y+25);
|
||||||
|
@ -167,8 +167,8 @@ public class Toolbar extends Component {
|
||||||
//decides on quickslot layout, depending on available screen size.
|
//decides on quickslot layout, depending on available screen size.
|
||||||
if (slots == 4 && width < 152){
|
if (slots == 4 && width < 152){
|
||||||
if (width < 138){
|
if (width < 138){
|
||||||
if ((ShatteredPixelDungeon.flipToolbar() && i == 3) ||
|
if ((SPDSettings.flipToolbar() && i == 3) ||
|
||||||
(!ShatteredPixelDungeon.flipToolbar() && i == 0)) {
|
(!SPDSettings.flipToolbar() && i == 0)) {
|
||||||
btnQuick[i].border(0, 0);
|
btnQuick[i].border(0, 0);
|
||||||
btnQuick[i].frame(88, 0, 17, 24);
|
btnQuick[i].frame(88, 0, 17, 24);
|
||||||
} else {
|
} else {
|
||||||
|
@ -176,12 +176,12 @@ public class Toolbar extends Component {
|
||||||
btnQuick[i].frame(88, 0, 18, 24);
|
btnQuick[i].frame(88, 0, 18, 24);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (i == 0 && !ShatteredPixelDungeon.flipToolbar() ||
|
if (i == 0 && !SPDSettings.flipToolbar() ||
|
||||||
i == 3 && ShatteredPixelDungeon.flipToolbar()){
|
i == 3 && SPDSettings.flipToolbar()){
|
||||||
btnQuick[i].border(0, 2);
|
btnQuick[i].border(0, 2);
|
||||||
btnQuick[i].frame(106, 0, 19, 24);
|
btnQuick[i].frame(106, 0, 19, 24);
|
||||||
} else if (i == 0 && ShatteredPixelDungeon.flipToolbar() ||
|
} else if (i == 0 && SPDSettings.flipToolbar() ||
|
||||||
i == 3 && !ShatteredPixelDungeon.flipToolbar()){
|
i == 3 && !SPDSettings.flipToolbar()){
|
||||||
btnQuick[i].border(2, 1);
|
btnQuick[i].border(2, 1);
|
||||||
btnQuick[i].frame(86, 0, 20, 24);
|
btnQuick[i].frame(86, 0, 20, 24);
|
||||||
} else {
|
} else {
|
||||||
|
@ -197,7 +197,7 @@ public class Toolbar extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
float right = width;
|
float right = width;
|
||||||
switch(Mode.valueOf(ShatteredPixelDungeon.toolbarMode())){
|
switch(Mode.valueOf(SPDSettings.toolbarMode())){
|
||||||
case SPLIT:
|
case SPLIT:
|
||||||
btnWait.setPos(x, y);
|
btnWait.setPos(x, y);
|
||||||
btnSearch.setPos(btnWait.right(), y);
|
btnSearch.setPos(btnWait.right(), y);
|
||||||
|
@ -231,7 +231,7 @@ public class Toolbar extends Component {
|
||||||
}
|
}
|
||||||
right = width;
|
right = width;
|
||||||
|
|
||||||
if (ShatteredPixelDungeon.flipToolbar()) {
|
if (SPDSettings.flipToolbar()) {
|
||||||
|
|
||||||
btnWait.setPos( (right - btnWait.right()), y);
|
btnWait.setPos( (right - btnWait.right()), y);
|
||||||
btnSearch.setPos( (right - btnSearch.right()), y);
|
btnSearch.setPos( (right - btnSearch.right()), y);
|
||||||
|
|
|
@ -25,7 +25,7 @@ import android.graphics.RectF;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem;
|
import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem;
|
||||||
|
@ -119,7 +119,7 @@ public class WndBag extends WndTabbed {
|
||||||
lastMode = mode;
|
lastMode = mode;
|
||||||
lastBag = bag;
|
lastBag = bag;
|
||||||
|
|
||||||
nCols = ShatteredPixelDungeon.landscape() ? COLS_L : COLS_P;
|
nCols = SPDSettings.landscape() ? COLS_L : COLS_P;
|
||||||
nRows = (int)Math.ceil((Belongings.BACKPACK_SIZE + 4) / (float)nCols);
|
nRows = (int)Math.ceil((Belongings.BACKPACK_SIZE + 4) / (float)nCols);
|
||||||
|
|
||||||
int slotsWidth = SLOT_WIDTH * nCols + SLOT_MARGIN * (nCols - 1);
|
int slotsWidth = SLOT_WIDTH * nCols + SLOT_MARGIN * (nCols - 1);
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.CheckBox;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.CheckBox;
|
||||||
|
@ -86,7 +86,7 @@ public class WndChallenges extends Window {
|
||||||
value |= Challenges.MASKS[i];
|
value |= Challenges.MASKS[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ShatteredPixelDungeon.challenges( value );
|
SPDSettings.challenges( value );
|
||||||
}
|
}
|
||||||
|
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
|
@ -74,7 +75,7 @@ public class WndGame extends Window {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
Dungeon.hero = null;
|
Dungeon.hero = null;
|
||||||
ShatteredPixelDungeon.challenges( Dungeon.challenges );
|
SPDSettings.challenges( Dungeon.challenges );
|
||||||
InterlevelScene.mode = InterlevelScene.Mode.DESCEND;
|
InterlevelScene.mode = InterlevelScene.Mode.DESCEND;
|
||||||
InterlevelScene.noStory = true;
|
InterlevelScene.noStory = true;
|
||||||
Game.switchScene( InterlevelScene.class );
|
Game.switchScene( InterlevelScene.class );
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
|
@ -57,7 +57,7 @@ public class WndInfoItem extends Window {
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
fillFields( heap.image(), heap.glowing(), TITLE_COLOR, heap.toString(), heap.info() );
|
fillFields( heap.image(), heap.glowing(), TITLE_COLOR, heap.toString(), heap.info() );
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ public class WndInfoItem extends Window {
|
||||||
|
|
||||||
private void fillFields( int image, ItemSprite.Glowing glowing, int titleColor, String title, String info ) {
|
private void fillFields( int image, ItemSprite.Glowing glowing, int titleColor, String title, String info ) {
|
||||||
|
|
||||||
int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P;
|
int width = SPDSettings.landscape() ? WIDTH_L : WIDTH_P;
|
||||||
|
|
||||||
IconTitle titlebar = new IconTitle();
|
IconTitle titlebar = new IconTitle();
|
||||||
titlebar.icon( new ItemSprite( image, glowing ) );
|
titlebar.icon( new ItemSprite( image, glowing ) );
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
|
@ -52,7 +52,7 @@ public class WndItem extends Window {
|
||||||
|
|
||||||
super();
|
super();
|
||||||
|
|
||||||
int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P;
|
int width = SPDSettings.landscape() ? WIDTH_L : WIDTH_P;
|
||||||
|
|
||||||
IconTitle titlebar = new IconTitle( item );
|
IconTitle titlebar = new IconTitle( item );
|
||||||
titlebar.setRect( 0, 0, width, 0 );
|
titlebar.setRect( 0, 0, width, 0 );
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
||||||
|
@ -68,8 +69,8 @@ public class WndJournal extends WndTabbed {
|
||||||
|
|
||||||
public WndJournal(){
|
public WndJournal(){
|
||||||
|
|
||||||
int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P;
|
int width = SPDSettings.landscape() ? WIDTH_L : WIDTH_P;
|
||||||
int height = ShatteredPixelDungeon.landscape() ? HEIGHT_L : HEIGHT_P;
|
int height = SPDSettings.landscape() ? HEIGHT_L : HEIGHT_P;
|
||||||
|
|
||||||
resize(width, height);
|
resize(width, height);
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Languages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Languages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
|
@ -71,7 +72,7 @@ public class WndLangs extends Window {
|
||||||
ShatteredPixelDungeon.switchNoFade(TitleScene.class, new Game.SceneChangeCallback() {
|
ShatteredPixelDungeon.switchNoFade(TitleScene.class, new Game.SceneChangeCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void beforeCreate() {
|
public void beforeCreate() {
|
||||||
ShatteredPixelDungeon.language(langs.get(langIndex));
|
SPDSettings.language(langs.get(langIndex));
|
||||||
RenderedText.clearCache();
|
RenderedText.clearCache();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
@ -94,7 +95,7 @@ public class WndLangs extends Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
btn.setSize(BTN_WIDTH, BTN_HEIGHT);
|
btn.setSize(BTN_WIDTH, BTN_HEIGHT);
|
||||||
if (ShatteredPixelDungeon.landscape() && i % 2 == 1){
|
if (SPDSettings.landscape() && i % 2 == 1){
|
||||||
btn.setPos(BTN_WIDTH+1, y-(BTN_HEIGHT + 1));
|
btn.setPos(BTN_WIDTH+1, y-(BTN_HEIGHT + 1));
|
||||||
} else {
|
} else {
|
||||||
btn.setPos(0, y);
|
btn.setPos(0, y);
|
||||||
|
@ -104,7 +105,7 @@ public class WndLangs extends Window {
|
||||||
add(btn);
|
add(btn);
|
||||||
}
|
}
|
||||||
y = Math.max(MIN_HEIGHT, y);
|
y = Math.max(MIN_HEIGHT, y);
|
||||||
resize(ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P, y);
|
resize(SPDSettings.landscape() ? WIDTH_L : WIDTH_P, y);
|
||||||
|
|
||||||
int textLeft = width - 65;
|
int textLeft = width - 65;
|
||||||
int textWidth = width - textLeft;
|
int textWidth = width - textLeft;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||||
|
@ -37,7 +37,7 @@ public class WndMessage extends Window {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
RenderedTextMultiline info = PixelScene.renderMultiline( text, 6 );
|
RenderedTextMultiline info = PixelScene.renderMultiline( text, 6 );
|
||||||
info.maxWidth((ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P) - MARGIN * 2);
|
info.maxWidth((SPDSettings.landscape() ? WIDTH_L : WIDTH_P) - MARGIN * 2);
|
||||||
info.setPos(MARGIN, MARGIN);
|
info.setPos(MARGIN, MARGIN);
|
||||||
add( info );
|
add( info );
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline;
|
||||||
|
@ -38,7 +38,7 @@ public class WndOptions extends Window {
|
||||||
public WndOptions( String title, String message, String... options ) {
|
public WndOptions( String title, String message, String... options ) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P;
|
int width = SPDSettings.landscape() ? WIDTH_L : WIDTH_P;
|
||||||
|
|
||||||
RenderedTextMultiline tfTitle = PixelScene.renderMultiline( title, 9 );
|
RenderedTextMultiline tfTitle = PixelScene.renderMultiline( title, 9 );
|
||||||
tfTitle.hardlight( TITLE_COLOR );
|
tfTitle.hardlight( TITLE_COLOR );
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
|
@ -33,7 +34,6 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.Toolbar;
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
import com.watabou.noosa.Group;
|
import com.watabou.noosa.Group;
|
||||||
import com.watabou.noosa.RenderedText;
|
import com.watabou.noosa.RenderedText;
|
||||||
import com.watabou.noosa.audio.Music;
|
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.utils.DeviceCompat;
|
import com.watabou.utils.DeviceCompat;
|
||||||
|
|
||||||
|
@ -112,8 +112,8 @@ public class WndSettings extends WndTabbed {
|
||||||
PixelScene.maxDefaultZoom ) {
|
PixelScene.maxDefaultZoom ) {
|
||||||
@Override
|
@Override
|
||||||
protected void onChange() {
|
protected void onChange() {
|
||||||
if (getSelectedValue() != ShatteredPixelDungeon.scale()) {
|
if (getSelectedValue() != SPDSettings.scale()) {
|
||||||
ShatteredPixelDungeon.scale(getSelectedValue());
|
SPDSettings.scale(getSelectedValue());
|
||||||
ShatteredPixelDungeon.switchNoFade((Class<? extends PixelScene>) ShatteredPixelDungeon.scene().getClass(), new Game.SceneChangeCallback() {
|
ShatteredPixelDungeon.switchNoFade((Class<? extends PixelScene>) ShatteredPixelDungeon.scene().getClass(), new Game.SceneChangeCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void beforeCreate() {
|
public void beforeCreate() {
|
||||||
|
@ -149,27 +149,27 @@ public class WndSettings extends WndTabbed {
|
||||||
protected void onSelect(int index) {
|
protected void onSelect(int index) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
checked(!checked());
|
checked(!checked());
|
||||||
ShatteredPixelDungeon.powerSaver(checked());
|
SPDSettings.powerSaver(checked());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ShatteredPixelDungeon.powerSaver(checked());
|
SPDSettings.powerSaver(checked());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (PixelScene.maxScreenZoom >= 2) {
|
if (PixelScene.maxScreenZoom >= 2) {
|
||||||
chkSaver.setRect(0, scale.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
chkSaver.setRect(0, scale.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
||||||
chkSaver.checked(ShatteredPixelDungeon.powerSaver());
|
chkSaver.checked(SPDSettings.powerSaver());
|
||||||
add(chkSaver);
|
add(chkSaver);
|
||||||
}
|
}
|
||||||
|
|
||||||
RedButton btnOrientation = new RedButton( ShatteredPixelDungeon.landscape() ?
|
RedButton btnOrientation = new RedButton( SPDSettings.landscape() ?
|
||||||
Messages.get(this, "portrait")
|
Messages.get(this, "portrait")
|
||||||
: Messages.get(this, "landscape") ) {
|
: Messages.get(this, "landscape") ) {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
ShatteredPixelDungeon.landscape(!ShatteredPixelDungeon.landscape());
|
SPDSettings.landscape(!SPDSettings.landscape());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
btnOrientation.setRect(0, chkSaver.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
btnOrientation.setRect(0, chkSaver.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
||||||
|
@ -180,10 +180,10 @@ public class WndSettings extends WndTabbed {
|
||||||
Messages.get(this, "dark"), Messages.get(this, "bright"), -2, 2) {
|
Messages.get(this, "dark"), Messages.get(this, "bright"), -2, 2) {
|
||||||
@Override
|
@Override
|
||||||
protected void onChange() {
|
protected void onChange() {
|
||||||
ShatteredPixelDungeon.brightness(getSelectedValue());
|
SPDSettings.brightness(getSelectedValue());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
brightness.setSelectedValue(ShatteredPixelDungeon.brightness());
|
brightness.setSelectedValue(SPDSettings.brightness());
|
||||||
brightness.setRect(0, btnOrientation.bottom() + GAP_LRG, WIDTH, SLIDER_HEIGHT);
|
brightness.setRect(0, btnOrientation.bottom() + GAP_LRG, WIDTH, SLIDER_HEIGHT);
|
||||||
add(brightness);
|
add(brightness);
|
||||||
|
|
||||||
|
@ -191,10 +191,10 @@ public class WndSettings extends WndTabbed {
|
||||||
Messages.get(this, "off"), Messages.get(this, "high"), -1, 3) {
|
Messages.get(this, "off"), Messages.get(this, "high"), -1, 3) {
|
||||||
@Override
|
@Override
|
||||||
protected void onChange() {
|
protected void onChange() {
|
||||||
ShatteredPixelDungeon.visualGrid(getSelectedValue());
|
SPDSettings.visualGrid(getSelectedValue());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
tileGrid.setSelectedValue(ShatteredPixelDungeon.visualGrid());
|
tileGrid.setSelectedValue(SPDSettings.visualGrid());
|
||||||
tileGrid.setRect(0, brightness.bottom() + GAP_TINY, WIDTH, SLIDER_HEIGHT);
|
tileGrid.setRect(0, brightness.bottom() + GAP_TINY, WIDTH, SLIDER_HEIGHT);
|
||||||
add(tileGrid);
|
add(tileGrid);
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ public class WndSettings extends WndTabbed {
|
||||||
RedButton btnSplit = new RedButton(Messages.get(this, "split")){
|
RedButton btnSplit = new RedButton(Messages.get(this, "split")){
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
ShatteredPixelDungeon.toolbarMode(Toolbar.Mode.SPLIT.name());
|
SPDSettings.toolbarMode(Toolbar.Mode.SPLIT.name());
|
||||||
Toolbar.updateLayout();
|
Toolbar.updateLayout();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -225,7 +225,7 @@ public class WndSettings extends WndTabbed {
|
||||||
RedButton btnGrouped = new RedButton(Messages.get(this, "group")){
|
RedButton btnGrouped = new RedButton(Messages.get(this, "group")){
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
ShatteredPixelDungeon.toolbarMode(Toolbar.Mode.GROUP.name());
|
SPDSettings.toolbarMode(Toolbar.Mode.GROUP.name());
|
||||||
Toolbar.updateLayout();
|
Toolbar.updateLayout();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -235,7 +235,7 @@ public class WndSettings extends WndTabbed {
|
||||||
RedButton btnCentered = new RedButton(Messages.get(this, "center")){
|
RedButton btnCentered = new RedButton(Messages.get(this, "center")){
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
ShatteredPixelDungeon.toolbarMode(Toolbar.Mode.CENTER.name());
|
SPDSettings.toolbarMode(Toolbar.Mode.CENTER.name());
|
||||||
Toolbar.updateLayout();
|
Toolbar.updateLayout();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -246,34 +246,34 @@ public class WndSettings extends WndTabbed {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
super.onClick();
|
super.onClick();
|
||||||
ShatteredPixelDungeon.flipToolbar(checked());
|
SPDSettings.flipToolbar(checked());
|
||||||
Toolbar.updateLayout();
|
Toolbar.updateLayout();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
chkFlipToolbar.setRect(0, btnGrouped.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
chkFlipToolbar.setRect(0, btnGrouped.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
||||||
chkFlipToolbar.checked(ShatteredPixelDungeon.flipToolbar());
|
chkFlipToolbar.checked(SPDSettings.flipToolbar());
|
||||||
add(chkFlipToolbar);
|
add(chkFlipToolbar);
|
||||||
|
|
||||||
final CheckBox chkFlipTags = new CheckBox(Messages.get(this, "flip_indicators")){
|
final CheckBox chkFlipTags = new CheckBox(Messages.get(this, "flip_indicators")){
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
super.onClick();
|
super.onClick();
|
||||||
ShatteredPixelDungeon.flipTags(checked());
|
SPDSettings.flipTags(checked());
|
||||||
GameScene.layoutTags();
|
GameScene.layoutTags();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
chkFlipTags.setRect(0, chkFlipToolbar.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
chkFlipTags.setRect(0, chkFlipToolbar.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
||||||
chkFlipTags.checked(ShatteredPixelDungeon.flipTags());
|
chkFlipTags.checked(SPDSettings.flipTags());
|
||||||
add(chkFlipTags);
|
add(chkFlipTags);
|
||||||
|
|
||||||
OptionSlider slots = new OptionSlider(Messages.get(this, "quickslots"), "0", "4", 0, 4) {
|
OptionSlider slots = new OptionSlider(Messages.get(this, "quickslots"), "0", "4", 0, 4) {
|
||||||
@Override
|
@Override
|
||||||
protected void onChange() {
|
protected void onChange() {
|
||||||
ShatteredPixelDungeon.quickSlots(getSelectedValue());
|
SPDSettings.quickSlots(getSelectedValue());
|
||||||
Toolbar.updateLayout();
|
Toolbar.updateLayout();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
slots.setSelectedValue(ShatteredPixelDungeon.quickSlots());
|
slots.setSelectedValue(SPDSettings.quickSlots());
|
||||||
slots.setRect(0, chkFlipTags.bottom() + GAP_TINY, WIDTH, SLIDER_HEIGHT);
|
slots.setRect(0, chkFlipTags.bottom() + GAP_TINY, WIDTH, SLIDER_HEIGHT);
|
||||||
add(slots);
|
add(slots);
|
||||||
|
|
||||||
|
@ -281,11 +281,11 @@ public class WndSettings extends WndTabbed {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
super.onClick();
|
super.onClick();
|
||||||
ShatteredPixelDungeon.immerse(checked());
|
SPDSettings.fullscreen(checked());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
chkImmersive.setRect( 0, slots.bottom() + GAP_SML, WIDTH, BTN_HEIGHT );
|
chkImmersive.setRect( 0, slots.bottom() + GAP_SML, WIDTH, BTN_HEIGHT );
|
||||||
chkImmersive.checked(ShatteredPixelDungeon.immersed());
|
chkImmersive.checked(SPDSettings.fullscreen());
|
||||||
chkImmersive.enable(DeviceCompat.supportsFullScreen());
|
chkImmersive.enable(DeviceCompat.supportsFullScreen());
|
||||||
add(chkImmersive);
|
add(chkImmersive);
|
||||||
|
|
||||||
|
@ -296,7 +296,7 @@ public class WndSettings extends WndTabbed {
|
||||||
ShatteredPixelDungeon.switchNoFade((Class<? extends PixelScene>) ShatteredPixelDungeon.scene().getClass(), new Game.SceneChangeCallback() {
|
ShatteredPixelDungeon.switchNoFade((Class<? extends PixelScene>) ShatteredPixelDungeon.scene().getClass(), new Game.SceneChangeCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void beforeCreate() {
|
public void beforeCreate() {
|
||||||
ShatteredPixelDungeon.classicFont(!checked());
|
SPDSettings.systemFont(checked());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -307,7 +307,7 @@ public class WndSettings extends WndTabbed {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
chkFont.setRect(0, chkImmersive.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
chkFont.setRect(0, chkImmersive.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
||||||
chkFont.checked(!ShatteredPixelDungeon.classicFont());
|
chkFont.checked(SPDSettings.systemFont());
|
||||||
add(chkFont);
|
add(chkFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,11 +319,10 @@ public class WndSettings extends WndTabbed {
|
||||||
OptionSlider musicVol = new OptionSlider(Messages.get(this, "music_vol"), "0", "10", 0, 10) {
|
OptionSlider musicVol = new OptionSlider(Messages.get(this, "music_vol"), "0", "10", 0, 10) {
|
||||||
@Override
|
@Override
|
||||||
protected void onChange() {
|
protected void onChange() {
|
||||||
Music.INSTANCE.volume(getSelectedValue()/10f);
|
SPDSettings.musicVol(getSelectedValue());
|
||||||
ShatteredPixelDungeon.musicVol(getSelectedValue());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
musicVol.setSelectedValue(ShatteredPixelDungeon.musicVol());
|
musicVol.setSelectedValue(SPDSettings.musicVol());
|
||||||
musicVol.setRect(0, 0, WIDTH, SLIDER_HEIGHT);
|
musicVol.setRect(0, 0, WIDTH, SLIDER_HEIGHT);
|
||||||
add(musicVol);
|
add(musicVol);
|
||||||
|
|
||||||
|
@ -331,22 +330,21 @@ public class WndSettings extends WndTabbed {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
super.onClick();
|
super.onClick();
|
||||||
ShatteredPixelDungeon.music(!checked());
|
SPDSettings.music(!checked());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
musicMute.setRect(0, musicVol.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
musicMute.setRect(0, musicVol.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
||||||
musicMute.checked(!ShatteredPixelDungeon.music());
|
musicMute.checked(!SPDSettings.music());
|
||||||
add(musicMute);
|
add(musicMute);
|
||||||
|
|
||||||
|
|
||||||
OptionSlider SFXVol = new OptionSlider(Messages.get(this, "sfx_vol"), "0", "10", 0, 10) {
|
OptionSlider SFXVol = new OptionSlider(Messages.get(this, "sfx_vol"), "0", "10", 0, 10) {
|
||||||
@Override
|
@Override
|
||||||
protected void onChange() {
|
protected void onChange() {
|
||||||
Sample.INSTANCE.volume(getSelectedValue()/10f);
|
SPDSettings.SFXVol(getSelectedValue());
|
||||||
ShatteredPixelDungeon.SFXVol(getSelectedValue());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
SFXVol.setSelectedValue(ShatteredPixelDungeon.SFXVol());
|
SFXVol.setSelectedValue(SPDSettings.SFXVol());
|
||||||
SFXVol.setRect(0, musicMute.bottom() + GAP_LRG, WIDTH, SLIDER_HEIGHT);
|
SFXVol.setRect(0, musicMute.bottom() + GAP_LRG, WIDTH, SLIDER_HEIGHT);
|
||||||
add(SFXVol);
|
add(SFXVol);
|
||||||
|
|
||||||
|
@ -354,12 +352,12 @@ public class WndSettings extends WndTabbed {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
super.onClick();
|
super.onClick();
|
||||||
ShatteredPixelDungeon.soundFx(!checked());
|
SPDSettings.soundFx(!checked());
|
||||||
Sample.INSTANCE.play( Assets.SND_CLICK );
|
Sample.INSTANCE.play( Assets.SND_CLICK );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
btnSound.setRect(0, SFXVol.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
btnSound.setRect(0, SFXVol.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT);
|
||||||
btnSound.checked(!ShatteredPixelDungeon.soundFx());
|
btnSound.checked(!SPDSettings.soundFx());
|
||||||
add( btnSound );
|
add( btnSound );
|
||||||
|
|
||||||
resize( WIDTH, (int)btnSound.bottom());
|
resize( WIDTH, (int)btnSound.bottom());
|
||||||
|
|
|
@ -23,7 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Chrome;
|
import com.shatteredpixel.shatteredpixeldungeon.Chrome;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline;
|
||||||
|
@ -67,7 +67,7 @@ public class WndStory extends Window {
|
||||||
super( 0, 0, Chrome.get( Chrome.Type.SCROLL ) );
|
super( 0, 0, Chrome.get( Chrome.Type.SCROLL ) );
|
||||||
|
|
||||||
tf = PixelScene.renderMultiline( text, 6 );
|
tf = PixelScene.renderMultiline( text, 6 );
|
||||||
tf.maxWidth(ShatteredPixelDungeon.landscape() ?
|
tf.maxWidth(SPDSettings.landscape() ?
|
||||||
WIDTH_L - MARGIN * 2:
|
WIDTH_L - MARGIN * 2:
|
||||||
WIDTH_P - MARGIN *2);
|
WIDTH_P - MARGIN *2);
|
||||||
tf.invert();
|
tf.invert();
|
||||||
|
|
|
@ -34,6 +34,7 @@ import android.widget.EditText;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||||
|
@ -65,14 +66,14 @@ public class WndTextInput extends Window {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
//need to offset to give space for the soft keyboard
|
//need to offset to give space for the soft keyboard
|
||||||
if (ShatteredPixelDungeon.landscape()) {
|
if (SPDSettings.landscape()) {
|
||||||
offset( multiLine ? -45 : -45 );
|
offset( multiLine ? -45 : -45 );
|
||||||
} else {
|
} else {
|
||||||
offset( multiLine ? -60 : -45 );
|
offset( multiLine ? -60 : -45 );
|
||||||
}
|
}
|
||||||
|
|
||||||
final int width;
|
final int width;
|
||||||
if (ShatteredPixelDungeon.landscape() && multiLine){
|
if (SPDSettings.landscape() && multiLine){
|
||||||
width = W_LAND_MULTI; //more editing space for landscape users
|
width = W_LAND_MULTI; //more editing space for landscape users
|
||||||
} else {
|
} else {
|
||||||
width = WIDTH;
|
width = WIDTH;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||||
|
@ -44,7 +44,7 @@ public class WndTitledMessage extends Window {
|
||||||
|
|
||||||
super();
|
super();
|
||||||
|
|
||||||
int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P;
|
int width = SPDSettings.landscape() ? WIDTH_L : WIDTH_P;
|
||||||
|
|
||||||
titlebar.setRect( 0, 0, width, 0 );
|
titlebar.setRect( 0, 0, width, 0 );
|
||||||
add(titlebar);
|
add(titlebar);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user