v0.7.3: tied more logic into the window restoring functionality
This commit is contained in:
parent
7ca293bcc5
commit
ad2e3d7350
|
@ -245,6 +245,19 @@ public class ShatteredPixelDungeon extends Game {
|
|||
switchScene( c, callback );
|
||||
}
|
||||
|
||||
public static void seamlessResetScene(SceneChangeCallback callback) {
|
||||
if (scene() instanceof PixelScene){
|
||||
((PixelScene) scene()).saveWindows();
|
||||
switchNoFade((Class<? extends PixelScene>) sceneClass, callback );
|
||||
} else {
|
||||
resetScene();
|
||||
}
|
||||
}
|
||||
|
||||
public static void seamlessResetScene(){
|
||||
seamlessResetScene(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void switchScene() {
|
||||
super.switchScene();
|
||||
|
|
|
@ -69,7 +69,7 @@ public class WndLangs extends Window {
|
|||
protected void onClick() {
|
||||
super.onClick();
|
||||
Messages.setup(langs.get(langIndex));
|
||||
ShatteredPixelDungeon.switchNoFade(TitleScene.class, new Game.SceneChangeCallback() {
|
||||
ShatteredPixelDungeon.seamlessResetScene(new Game.SceneChangeCallback() {
|
||||
@Override
|
||||
public void beforeCreate() {
|
||||
SPDSettings.language(langs.get(langIndex));
|
||||
|
@ -77,7 +77,7 @@ public class WndLangs extends Window {
|
|||
}
|
||||
@Override
|
||||
public void afterCreate() {
|
||||
Game.scene().add(new WndLangs());
|
||||
//do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -114,17 +114,7 @@ public class WndSettings extends WndTabbed {
|
|||
protected void onChange() {
|
||||
if (getSelectedValue() != SPDSettings.scale()) {
|
||||
SPDSettings.scale(getSelectedValue());
|
||||
ShatteredPixelDungeon.switchNoFade((Class<? extends PixelScene>) ShatteredPixelDungeon.scene().getClass(), new Game.SceneChangeCallback() {
|
||||
@Override
|
||||
public void beforeCreate() {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCreate() {
|
||||
Game.scene().add(new WndSettings());
|
||||
}
|
||||
});
|
||||
ShatteredPixelDungeon.seamlessResetScene();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -293,7 +283,7 @@ public class WndSettings extends WndTabbed {
|
|||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
ShatteredPixelDungeon.switchNoFade((Class<? extends PixelScene>) ShatteredPixelDungeon.scene().getClass(), new Game.SceneChangeCallback() {
|
||||
ShatteredPixelDungeon.seamlessResetScene(new Game.SceneChangeCallback() {
|
||||
@Override
|
||||
public void beforeCreate() {
|
||||
SPDSettings.systemFont(checked());
|
||||
|
@ -301,7 +291,7 @@ public class WndSettings extends WndTabbed {
|
|||
|
||||
@Override
|
||||
public void afterCreate() {
|
||||
Game.scene().add(new WndSettings());
|
||||
//do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user