Many quick bug fixes.

- Fixed bug when having "Sudden Death" and Easy "mods" enabled at the same time.  Additional "lives" are no longer granted.
- Fixed bug where GameMod active states weren't being reset upon restart.
- Fixed bug where GameMods were drawn as if inactive when viewing scores.  Alpha levels are now only set when drawing the button (i.e. calling GameMod.draw()).
- Moved large grade scaling into GameImage, and slightly padded the right side when drawing.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-01-29 01:50:26 -05:00
parent 1ddeb3461d
commit 0165abde56
4 changed files with 60 additions and 18 deletions

View File

@@ -125,9 +125,11 @@ public enum GameMod {
float y = (height * 0.8f) + (img.getHeight() / 2);
// create button
img.setAlpha(0.5f);
this.button = new MenuButton(img, x + (offsetX * id), y);
this.button.setHoverScale(1.15f);
// reset state
this.active = false;
}
/**
@@ -160,7 +162,6 @@ public enum GameMod {
* @param checkInverse if true, perform checks for mutual exclusivity
*/
public void toggle(boolean checkInverse) {
button.getImage().setAlpha(active ? 0.5f : 1.0f);
active = !active;
if (checkInverse) {
@@ -205,7 +206,12 @@ public enum GameMod {
/**
* Draws the game mod.
*/
public void draw() { button.draw(); }
public void draw() {
if (!active)
button.getImage().setAlpha(0.5f);
button.draw();
button.getImage().setAlpha(1.0f);
}
/**
* Checks if the coordinates are within the image bounds.