v3.2.2: removed Android landscape setting, now uses system orientation

This commit is contained in:
Evan Debenham
2025-08-19 11:59:14 -04:00
parent 949cf8e71e
commit aa1d403ea5
5 changed files with 1 additions and 60 deletions

View File

@@ -67,21 +67,6 @@ public class SPDSettings extends GameSettings {
return getBoolean( KEY_FULLSCREEN, DeviceCompat.isDesktop() );
}
public static void landscape( boolean value ){
put( KEY_LANDSCAPE, value );
((ShatteredPixelDungeon)ShatteredPixelDungeon.instance).updateDisplaySize();
}
//can return null because we need to directly handle the case of landscape not being set
// as there are different defaults for different devices
public static Boolean landscape(){
if (contains(KEY_LANDSCAPE)){
return getBoolean(KEY_LANDSCAPE, false);
} else {
return null;
}
}
public static void zoom( int value ) {
put( KEY_ZOOM, value );
}

View File

@@ -220,8 +220,6 @@ public class WndSettings extends WndTabbed {
RenderedTextBlock title;
ColorBlock sep1;
CheckBox chkFullscreen;
OptionSlider optScale;
RedButton btnOrientation;
ColorBlock sep2;
OptionSlider optBrightness;
OptionSlider optVisGrid;
@@ -252,24 +250,6 @@ public class WndSettings extends WndTabbed {
}
add(chkFullscreen);
//TODO change to respect auto-rotation when updating Android SDK?
if (DeviceCompat.isAndroid()) {
Boolean landscape = SPDSettings.landscape();
if (landscape == null){
landscape = Game.width > Game.height;
}
Boolean finalLandscape = landscape;
btnOrientation = new RedButton(finalLandscape ?
Messages.get(this, "portrait")
: Messages.get(this, "landscape")) {
@Override
protected void onClick() {
SPDSettings.landscape(!finalLandscape);
}
};
add(btnOrientation);
}
sep2 = new ColorBlock(1, 1, 0xFF000000);
add(sep2);
@@ -329,16 +309,6 @@ public class WndSettings extends WndTabbed {
chkFullscreen.setRect(0, bottom + GAP, width, BTN_HEIGHT);
bottom = chkFullscreen.bottom();
if (btnOrientation != null) {
btnOrientation.setRect(0, bottom + GAP, width, BTN_HEIGHT);
bottom = btnOrientation.bottom();
}
if (optScale != null){
optScale.setRect(0, bottom + GAP, width, SLIDER_HEIGHT);
bottom = optScale.bottom();
}
sep2.size(width, 1);
sep2.y = bottom + GAP;
bottom = sep2.y + 1;