restart when the skin changed
This commit is contained in:
parent
45dc7260b4
commit
b3d8b02cb8
|
@ -1419,6 +1419,10 @@ public class Options {
|
||||||
// This class should not be instantiated.
|
// This class should not be instantiated.
|
||||||
private Options() {}
|
private Options() {}
|
||||||
|
|
||||||
|
public static String getSkinName() {
|
||||||
|
return skinName;
|
||||||
|
}
|
||||||
|
|
||||||
public static int getResolutionIdx() {
|
public static int getResolutionIdx() {
|
||||||
return resolutionIdx;
|
return resolutionIdx;
|
||||||
}
|
}
|
||||||
|
|
|
@ -521,19 +521,24 @@ public class OptionsMenu extends BasicGameState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String resolutionOptions;
|
/**
|
||||||
|
* This string is built with option values when entering the options menu.
|
||||||
|
* When leaving the options menu, this string is checked against the new optionstring with the same options.
|
||||||
|
* If those do not match, it means some option has change which requires a restart
|
||||||
|
*/
|
||||||
|
private String restartOptions;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enter(GameContainer container, StateBasedGame game)
|
public void enter(GameContainer container, StateBasedGame game)
|
||||||
throws SlickException {
|
throws SlickException {
|
||||||
UI.enter();
|
UI.enter();
|
||||||
currentTab = OptionTab.DANCE;
|
currentTab = OptionTab.DANCE;
|
||||||
resolutionOptions = "" + Options.getResolutionIdx() + Options.isFullscreen() + Options.allowLargeResolutions();
|
restartOptions = "" + Options.getResolutionIdx() + Options.isFullscreen() + Options.allowLargeResolutions() + Options.getSkinName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void leave(GameContainer container, StateBasedGame game) throws SlickException {
|
public void leave(GameContainer container, StateBasedGame game) throws SlickException {
|
||||||
if (!("" + Options.getResolutionIdx() + Options.isFullscreen() + Options.allowLargeResolutions()).equals(resolutionOptions)) {
|
if (!("" + Options.getResolutionIdx() + Options.isFullscreen() + Options.allowLargeResolutions() + Options.getSkinName()).equals(restartOptions)) {
|
||||||
container.setForceExit(false);
|
container.setForceExit(false);
|
||||||
container.exit();
|
container.exit();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user