Add option to color main menu logo based on the cursor color (close #82)

This commit is contained in:
yugecin 2016-12-18 21:03:19 +01:00
parent 64a3a85eb0
commit c974374d67
4 changed files with 20 additions and 9 deletions

View File

@ -445,6 +445,7 @@ public class Options {
},
DYNAMIC_BACKGROUND ("Enable Dynamic Backgrounds", "DynamicBackground", "The song background will be used as the main menu background.", true),
LOAD_VERBOSE ("Show Detailed Loading Progress", "LoadVerbose", "Display more specific loading information in the splash screen.", false),
COLOR_MAIN_MENU_LOGO ("Use cursor color as main menu logo tint", "ColorMainMenuLogo", "Colorful main menu logo", false),
MASTER_VOLUME ("Master Volume", "VolumeUniversal", "Global volume level.", 35, 0, 100) {
@Override
public void setValue(int value) {
@ -1545,6 +1546,12 @@ public class Options {
*/
public static boolean isLoadVerbose() { return GameOption.LOAD_VERBOSE.getBooleanValue(); }
/**
* Returns whether or not to color the main menu logo.
* @return true if enabled
*/
public static boolean isColorMainMenuLogo() { return GameOption.COLOR_MAIN_MENU_LOGO.getBooleanValue(); }
/**
* Returns the track checkpoint time.
* @return the checkpoint time (in ms)

View File

@ -32,11 +32,8 @@ import itdelatrisu.opsu.beatmap.BeatmapSetNode;
import itdelatrisu.opsu.beatmap.TimingPoint;
import itdelatrisu.opsu.downloads.Updater;
import itdelatrisu.opsu.states.ButtonMenu.MenuState;
import itdelatrisu.opsu.ui.Colors;
import itdelatrisu.opsu.ui.Fonts;
import itdelatrisu.opsu.ui.MenuButton;
import itdelatrisu.opsu.ui.*;
import itdelatrisu.opsu.ui.MenuButton.Expand;
import itdelatrisu.opsu.ui.UI;
import itdelatrisu.opsu.ui.animations.AnimatedValue;
import itdelatrisu.opsu.ui.animations.AnimationEquation;
@ -126,6 +123,9 @@ public class MainMenu extends BasicGameState {
private Input input;
private final int state;
private float hue = 0;
private boolean huedone = false;
public MainMenu(int state) {
this.state = state;
}
@ -273,14 +273,16 @@ public class MainMenu extends BasicGameState {
Double position = MusicController.getBeatProgress();
// logo
Color color = Options.isColorMainMenuLogo() ? Cursor.lastCursorColor : Color.white;
if (position != null) {
double scale = 1 - (0 - position) * 0.05;
logo.draw(Color.white, (float) scale);
logo.draw(color, (float) scale);
Image piece = GameImage.MENU_LOGO_PIECE.getImage().getScaledCopy(logo.getCurrentScale());
float scaleposmodx = piece.getWidth() / 2;
float scaleposmody = piece.getHeight() / 2;
piece.rotate((float)(position * 360));
piece.draw(logo.getX() - scaleposmodx, logo.getY() - scaleposmody);
piece.draw(logo.getX() - scaleposmodx, logo.getY() - scaleposmody, color);
Image logoCopy = GameImage.MENU_LOGO.getImage().getScaledCopy(logo.getCurrentScale() / (float) scale * 1.05f);
scaleposmodx = logoCopy.getWidth() / 2;
scaleposmody = logoCopy.getHeight() / 2;
@ -289,7 +291,7 @@ public class MainMenu extends BasicGameState {
logoCopy.draw(logo.getX() - scaleposmodx, logo.getY() - scaleposmody, Colors.GHOST_LOGO);
Colors.GHOST_LOGO.a = a;
} else {
logo.draw();
logo.draw(color);
}
// draw music buttons

View File

@ -58,7 +58,8 @@ public class OptionsMenu extends BasicGameState implements OptionsOverlay.Parent
GameOption.SCREENSHOT_FORMAT,
GameOption.DYNAMIC_BACKGROUND,
GameOption.LOAD_HD_IMAGES,
GameOption.LOAD_VERBOSE
GameOption.LOAD_VERBOSE,
GameOption.COLOR_MAIN_MENU_LOGO,
}),
new OptionTab("Music", new GameOption[] {
GameOption.MASTER_VOLUME,

View File

@ -76,6 +76,7 @@ public class Cursor {
public static Color lastMirroredObjColor = Color.white;
public static Color nextObjColor = Color.white;
public static Color nextMirroredObjColor = Color.white;
public static Color lastCursorColor = Color.white;
private boolean isMirrored;
@ -177,7 +178,7 @@ public class Cursor {
if (isMirrored) {
filter = Dancer.cursorColorMirrorOverride.getMirrorColor();
} else {
filter = Dancer.cursorColorOverride.getColor();
lastCursorColor = filter = Dancer.cursorColorOverride.getColor();
}
// draw a fading trail