Added description for game mods.

These will appear on the bottom of the screen when hovering over the buttons in the options menu.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-01-30 03:45:06 -05:00
parent 84e463e8fb
commit cb5a7d6a4b
2 changed files with 48 additions and 15 deletions

View File

@@ -196,11 +196,11 @@ public class OptionsMenu extends BasicGameState {
// title
Utils.FONT_XLARGE.drawString(
(width / 2) - (Utils.FONT_XLARGE.getWidth("GAME OPTIONS") / 2), 10,
(width - Utils.FONT_XLARGE.getWidth("GAME OPTIONS")) / 2, 10,
"GAME OPTIONS", Color.white
);
Utils.FONT_DEFAULT.drawString(
(width / 2) - (Utils.FONT_DEFAULT.getWidth("Click or drag an option to change it.") / 2),
(width - Utils.FONT_DEFAULT.getWidth("Click or drag an option to change it.")) / 2,
10 + Utils.FONT_XLARGE.getLineHeight(),
"Click or drag an option to change it.", Color.white
);
@@ -233,8 +233,18 @@ public class OptionsMenu extends BasicGameState {
// game mods
Utils.FONT_LARGE.drawString(width / 30, height * 0.8f, "Game Mods:", Color.white);
for (GameMod mod : GameMod.values())
boolean descDrawn = false;
for (GameMod mod : GameMod.values()) {
mod.draw();
if (!descDrawn && mod.contains(mouseX, mouseY)) {
Utils.FONT_DEFAULT.drawString(
(width - Utils.FONT_DEFAULT.getWidth(mod.getDescription())) / 2,
height * 0.975f - Utils.FONT_DEFAULT.getLineHeight(),
mod.getDescription(), Color.white
);
descDrawn = true;
}
}
Utils.getBackButton().draw();