compactify the options menu

This commit is contained in:
yugecin 2016-09-30 12:18:34 +02:00
parent 3a1f510e31
commit d6b993bfe8
2 changed files with 9 additions and 8 deletions

View File

@ -460,8 +460,8 @@ public class Options {
@Override
public void read(String s) { setGameKeyRight(Keyboard.getKeyIndex(s)); }
},
DISABLE_MOUSE_WHEEL ("Disable mouse wheel in play mode", "MouseDisableWheel", "During play, you can use the mouse wheel to adjust the volume and pause the game.\nThis will disable that functionality.", false),
DISABLE_MOUSE_BUTTONS ("Disable mouse buttons in play mode", "MouseDisableButtons", "This option will disable all mouse buttons.\nSpecifically for people who use their keyboard to click.", false),
DISABLE_MOUSE_WHEEL ("Disable mouse wheel in play mode", "MouseDisableWheel", "During play, you can use the mouse wheel to adjust the volume and pause the game. This will disable that functionality.", false),
DISABLE_MOUSE_BUTTONS ("Disable mouse buttons in play mode", "MouseDisableButtons", "This option will disable all mouse buttons. Specifically for people who use their keyboard to click.", false),
DISABLE_CURSOR ("Disable Cursor", "DisableCursor", "Hide the cursor sprite.", false),
BACKGROUND_DIM ("Background Dim", "DimLevel", "Percentage to dim the background image during gameplay.", 50, 0, 100),
FORCE_DEFAULT_PLAYFIELD ("Force Default Playfield", "ForceDefaultPlayfield", "Override the song background with the default playfield background.", false),

View File

@ -224,8 +224,9 @@ public class OptionsMenu extends BasicGameState {
// game option coordinate modifiers
textY = (int) (tabY + tabImage.getHeight());
int backHeight = GameImage.MENU_BACK.getAnimation(1).getHeight();
offsetY = (height - textY - (backHeight * 4 / 5)) / maxOptionsScreen;
//int backHeight = GameImage.MENU_BACK.getAnimation(1).getHeight();
//offsetY = (height - textY - (backHeight * 4 / 5)) / maxOptionsScreen;
offsetY = (int) ((Fonts.MEDIUM.getLineHeight() + Fonts.SMALL.getLineHeight()) * 1.1f);
}
@Override
@ -486,12 +487,12 @@ public class OptionsMenu extends BasicGameState {
*/
private void drawOption(GameOption option, int pos, boolean focus) {
int width = container.getWidth();
int textHeight = Fonts.LARGE.getLineHeight();
int textHeight = Fonts.MEDIUM.getLineHeight();
float y = textY + (pos * offsetY);
Color color = (focus) ? Color.cyan : Color.white;
Fonts.LARGE.drawString(width / 30, y, option.getName(), color);
Fonts.LARGE.drawString(width / 2, y, option.getValueString(), color);
Fonts.MEDIUM.drawString(width / 30, y, option.getName(), color);
Fonts.MEDIUM.drawString(width / 2, y, option.getValueString(), color);
Fonts.SMALL.drawString(width / 30, y + textHeight, option.getDescription(), color);
g.setColor(Colors.WHITE_ALPHA);
g.drawLine(0, y + textHeight, width, y + textHeight);
@ -506,7 +507,7 @@ public class OptionsMenu extends BasicGameState {
if (y < textY || y > textY + (offsetY * maxOptionsScreen))
return null;
int index = (y - textY + Fonts.LARGE.getLineHeight()) / offsetY;
int index = (y - textY) / offsetY;
if (index >= currentTab.options.length)
return null;