summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-11-10 15:56:18 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-11-10 15:56:18 +0100
commit36d758ebb862e0608ddbf53ce4876af844e9a783 (patch)
tree63934ef87cab4bf8434a65f68097dea5f6ba094d
parent491c2bbe4119e91bad4b91112063dd146d3b9fd8 (diff)
downloadRustAndDust-36d758ebb862e0608ddbf53ce4876af844e9a783.zip
RustAndDust-36d758ebb862e0608ddbf53ce4876af844e9a783.tar.gz
OptionsMenu: graphics changes are canceld on ... cancel
-rw-r--r--core/src/ch/asynk/rustanddust/menu/OptionsMenu.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/src/ch/asynk/rustanddust/menu/OptionsMenu.java b/core/src/ch/asynk/rustanddust/menu/OptionsMenu.java
index 52b0d78..a172a8d 100644
--- a/core/src/ch/asynk/rustanddust/menu/OptionsMenu.java
+++ b/core/src/ch/asynk/rustanddust/menu/OptionsMenu.java
@@ -43,6 +43,7 @@ public class OptionsMenu extends Patch
private Label graphicsValue;
private Label [] checkLabels;
private int fxVolumeIdx;
+ private int graphicsIdx;
private boolean [] checkValues;
private OkCancel okCancel;
protected Bg okBtn;
@@ -64,7 +65,6 @@ public class OptionsMenu extends Patch
this.graphics = new Label(font);
this.graphics.write("Graphics");
this.graphicsValue = new Label(font);
- this.graphicsValue.write(game.config.graphics.s);
this.checkValues = new boolean[checkStrings.length];
this.checkLabels = new Label[checkStrings.length];
for (int i = 0; i < checkLabels.length; i++) {
@@ -91,6 +91,8 @@ public class OptionsMenu extends Patch
checkValues[0] = game.config.debug;
fxVolumeIdx = (int) (game.config.fxVolume * 10);
fxVolumeValue.write(fxStrings[fxVolumeIdx], fxVolumeValue.getX(), fxVolumeValue.getY());
+ graphicsIdx = game.config.graphics.i;
+ graphicsValue.write(game.config.graphics.s, graphicsValue.getX(), graphicsValue.getY());
}
private boolean apply()
@@ -103,6 +105,7 @@ public class OptionsMenu extends Patch
game.config.mustValidate = checkValues[1];
game.config.debug = checkValues[0];
game.config.fxVolume = (fxVolumeIdx / 10.0f);
+ game.config.graphics = game.config.graphics.get(graphicsIdx);
return true;
}
@@ -115,11 +118,8 @@ public class OptionsMenu extends Patch
private void cycleGraphics()
{
- game.config.graphics = game.config.graphics.next();
- float fx = graphicsValue.getX();
- float fy = graphicsValue.getY();
- graphicsValue.write(game.config.graphics.s);
- graphicsValue.setPosition(fx, fy);
+ graphicsIdx = game.config.graphics.get(graphicsIdx).next().i;
+ graphicsValue.write(game.config.graphics.get(graphicsIdx).s, graphicsValue.getX(), graphicsValue.getY());
}
public void setPosition()