enchanced optionmenu
This commit is contained in:
@@ -242,6 +242,7 @@ public enum GameImage {
|
||||
REPLAY_PLAYBACK_HALF ("playback-half", "png", false, false),
|
||||
|
||||
// Non-Game Components
|
||||
SEARCH ("search", "png", false, false),
|
||||
CONTROL_SLIDER_BALL ("control-sliderball", "png", false, false),
|
||||
CONTROL_CHECK_ON ("control-check-on", "png", false, false),
|
||||
CONTROL_CHECK_OFF ("control-check-off", "png", false, false),
|
||||
|
||||
@@ -421,6 +421,7 @@ public class Options {
|
||||
SHOW_UNICODE ("Prefer Non-English Metadata", "ShowUnicode", "Where available, song titles will be shown in their native language.", false) {
|
||||
@Override
|
||||
public void click() {
|
||||
super.click();
|
||||
if (bool) {
|
||||
try {
|
||||
Fonts.LARGE.loadGlyphs();
|
||||
@@ -1009,6 +1010,12 @@ public class Options {
|
||||
/** Whether or not this is a numeric option. */
|
||||
private OptionType type = OptionType.OTHER;
|
||||
|
||||
/**
|
||||
* If this option should not be shown in the optionsmenu because it does
|
||||
* not match the search string.
|
||||
*/
|
||||
private boolean filtered;
|
||||
|
||||
/**
|
||||
* Constructor for internal options (not displayed in-game).
|
||||
* @param displayName the option name, as displayed in the configuration file
|
||||
@@ -1193,6 +1200,29 @@ public class Options {
|
||||
return defaultVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the filtered flag for this option based on the given searchString.
|
||||
* @param searchString the searched string or null to reset the filtered flag
|
||||
* @return true if this option does need to be filtered
|
||||
*/
|
||||
public boolean filter(String searchString) {
|
||||
if (searchString == null || searchString.length() == 0) {
|
||||
filtered = false;
|
||||
return false;
|
||||
}
|
||||
filtered = !(displayName.toLowerCase().contains(searchString) || description.toLowerCase().contains(searchString));
|
||||
return filtered;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this option should be filtered (= not shown) because it does not
|
||||
* match the search string.
|
||||
* @return true if the option shouldn't be shown.
|
||||
*/
|
||||
public boolean isFiltered() {
|
||||
return filtered;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Map of option display names to GameOptions. */
|
||||
|
||||
@@ -326,7 +326,7 @@ public class Game extends ComplexOpsuState {
|
||||
this.instanceContainer = instanceContainer;
|
||||
mirrorCursor = new Cursor(true);
|
||||
this.moveStoryboardOverlay = new MoveStoryboard(displayContainer);
|
||||
this.optionsOverlay = new OptionsOverlay(displayContainer, OptionsMenu.storyboardOptions, 0);
|
||||
this.optionsOverlay = new OptionsOverlay(displayContainer, OptionsMenu.storyboardOptions);
|
||||
this.storyboardOverlay = new StoryboardOverlay(displayContainer, moveStoryboardOverlay, optionsOverlay, this);
|
||||
storyboardOverlay.show();
|
||||
moveStoryboardOverlay.show();
|
||||
|
||||
@@ -20,46 +20,65 @@ package itdelatrisu.opsu.states;
|
||||
|
||||
import itdelatrisu.opsu.Options.GameOption;
|
||||
|
||||
import yugecin.opsudance.ui.OptionsOverlay;
|
||||
import yugecin.opsudance.ui.OptionsOverlay.OptionTab;
|
||||
|
||||
public class OptionsMenu {
|
||||
|
||||
public static final OptionTab[] normalOptions = new OptionsOverlay.OptionTab[]{
|
||||
new OptionTab("Display", new GameOption[]{
|
||||
public static final OptionTab[] normalOptions = new OptionTab[] {
|
||||
new OptionTab("GENERAL", null),
|
||||
new OptionTab("LANGUAGE", new GameOption[]{
|
||||
GameOption.SHOW_UNICODE,
|
||||
}),
|
||||
new OptionTab("GRAPHICS", null),
|
||||
new OptionTab("RENDERER", new GameOption[] {
|
||||
GameOption.SCREEN_RESOLUTION,
|
||||
GameOption.FULLSCREEN,
|
||||
GameOption.ALLOW_LARGER_RESOLUTIONS,
|
||||
GameOption.SKIN,
|
||||
GameOption.FULLSCREEN,
|
||||
// TODO d: UPS option
|
||||
GameOption.TARGET_FPS,
|
||||
GameOption.SHOW_FPS,
|
||||
GameOption.SHOW_UNICODE,
|
||||
GameOption.SCREENSHOT_FORMAT,
|
||||
}),
|
||||
new OptionTab("SLIDER OPTIONS", new GameOption[]{
|
||||
GameOption.SNAKING_SLIDERS,
|
||||
GameOption.FALLBACK_SLIDERS,
|
||||
GameOption.SHRINKING_SLIDERS,
|
||||
GameOption.MERGING_SLIDERS,
|
||||
//GameOption.MERGING_SLIDERS_MIRROR_POOL,
|
||||
GameOption.DRAW_SLIDER_ENDCIRCLES,
|
||||
}),
|
||||
new OptionTab("SKIN", null),
|
||||
new OptionTab("SKIN", new GameOption[]{
|
||||
GameOption.SKIN,
|
||||
GameOption.IGNORE_BEATMAP_SKINS,
|
||||
GameOption.DYNAMIC_BACKGROUND,
|
||||
GameOption.LOAD_HD_IMAGES,
|
||||
GameOption.LOAD_VERBOSE,
|
||||
GameOption.COLOR_MAIN_MENU_LOGO,
|
||||
}),
|
||||
new OptionTab("Music", new GameOption[] {
|
||||
new OptionTab("CURSOR", new GameOption[]{
|
||||
GameOption.CURSOR_SIZE,
|
||||
GameOption.NEW_CURSOR,
|
||||
GameOption.DISABLE_CURSOR
|
||||
// TODO use combo colour as tint for slider ball option
|
||||
}),
|
||||
new OptionTab("AUDIO", null),
|
||||
new OptionTab("VOLUME", new GameOption[]{
|
||||
GameOption.MASTER_VOLUME,
|
||||
GameOption.MUSIC_VOLUME,
|
||||
GameOption.EFFECT_VOLUME,
|
||||
GameOption.HITSOUND_VOLUME,
|
||||
GameOption.SAMPLE_VOLUME_OVERRIDE,
|
||||
}),
|
||||
new OptionTab("MISC", new GameOption[] {
|
||||
GameOption.MUSIC_OFFSET,
|
||||
GameOption.DISABLE_SOUNDS,
|
||||
GameOption.ENABLE_THEME_SONG
|
||||
}),
|
||||
new OptionTab("Gameplay", new GameOption[] {
|
||||
new OptionTab("GAMEPLAY", null),
|
||||
new OptionTab("GENERAL", new GameOption[] {
|
||||
GameOption.BACKGROUND_DIM,
|
||||
GameOption.FORCE_DEFAULT_PLAYFIELD,
|
||||
GameOption.IGNORE_BEATMAP_SKINS,
|
||||
GameOption.SNAKING_SLIDERS,
|
||||
GameOption.SHRINKING_SLIDERS,
|
||||
GameOption.FALLBACK_SLIDERS,
|
||||
GameOption.MERGING_SLIDERS,
|
||||
//GameOption.MERGING_SLIDERS_MIRROR_POOL,
|
||||
GameOption.DRAW_SLIDER_ENDCIRCLES,
|
||||
GameOption.SHOW_HIT_LIGHTING,
|
||||
GameOption.SHOW_HIT_ANIMATIONS,
|
||||
GameOption.SHOW_COMBO_BURSTS,
|
||||
@@ -70,26 +89,30 @@ public class OptionsMenu {
|
||||
GameOption.MAP_END_DELAY,
|
||||
GameOption.EPILEPSY_WARNING,
|
||||
}),
|
||||
new OptionTab("Input", new GameOption[] {
|
||||
new OptionTab("INPUT", null),
|
||||
new OptionTab("KEY MAPPING", new GameOption[]{
|
||||
GameOption.KEY_LEFT,
|
||||
GameOption.KEY_RIGHT,
|
||||
}),
|
||||
new OptionTab("MOUSE", new GameOption[] {
|
||||
GameOption.DISABLE_MOUSE_WHEEL,
|
||||
GameOption.DISABLE_MOUSE_BUTTONS,
|
||||
GameOption.CURSOR_SIZE,
|
||||
GameOption.NEW_CURSOR,
|
||||
GameOption.DISABLE_CURSOR
|
||||
}),
|
||||
new OptionTab("Custom", new GameOption[] {
|
||||
new OptionTab("CUSTOM", null),
|
||||
new OptionTab("DIFFICULTY", new GameOption[]{
|
||||
GameOption.FIXED_CS,
|
||||
GameOption.FIXED_HP,
|
||||
GameOption.FIXED_AR,
|
||||
GameOption.FIXED_OD,
|
||||
}),
|
||||
new OptionTab("MISC", new GameOption[] {
|
||||
GameOption.CHECKPOINT,
|
||||
GameOption.REPLAY_SEEKING,
|
||||
GameOption.DISABLE_UPDATER,
|
||||
GameOption.ENABLE_WATCH_SERVICE
|
||||
}),
|
||||
new OptionTab("Dance", new GameOption[] {
|
||||
new OptionTab("DANCE", null),
|
||||
new OptionTab("MOVER", new GameOption[]{
|
||||
GameOption.DANCE_MOVER,
|
||||
GameOption.DANCE_EXGON_DELAY,
|
||||
GameOption.DANCE_QUAD_BEZ_AGGRESSIVENESS,
|
||||
@@ -100,39 +123,55 @@ public class OptionsMenu {
|
||||
GameOption.DANCE_SLIDER_MOVER_TYPE,
|
||||
GameOption.DANCE_SPINNER,
|
||||
GameOption.DANCE_SPINNER_DELAY,
|
||||
}),
|
||||
new OptionTab("SLIDER OPTIONS", new GameOption[]{
|
||||
GameOption.DANCE_LAZY_SLIDERS,
|
||||
GameOption.DANCE_CIRCLE_STREAMS,
|
||||
GameOption.DANCE_ONLY_CIRCLE_STACKS,
|
||||
GameOption.DANCE_CIRLCE_IN_SLOW_SLIDERS,
|
||||
GameOption.DANCE_CIRLCE_IN_LAZY_SLIDERS,
|
||||
}),
|
||||
new OptionTab("CIRCLE MOVEMENTS", new GameOption[]{
|
||||
GameOption.DANCE_CIRCLE_STREAMS,
|
||||
GameOption.DANCE_ONLY_CIRCLE_STACKS,
|
||||
}),
|
||||
new OptionTab("MIRROR", new GameOption[] {
|
||||
GameOption.DANCE_MIRROR,
|
||||
}),
|
||||
new OptionTab("Dance display", new GameOption[] {
|
||||
new OptionTab("ADVANCED DISPLAY", null),
|
||||
new OptionTab("OBJECTS", new GameOption[]{
|
||||
GameOption.DANCE_DRAW_APPROACH,
|
||||
GameOption.DANCE_OBJECT_COLOR_OVERRIDE,
|
||||
GameOption.DANCE_OBJECT_COLOR_OVERRIDE_MIRRORED,
|
||||
GameOption.DANCE_RGB_OBJECT_INC,
|
||||
GameOption.DANCE_HIDE_OBJECTS,
|
||||
}),
|
||||
new OptionTab("CURSOR", new GameOption[]{
|
||||
GameOption.DANCE_CURSOR_COLOR_OVERRIDE,
|
||||
GameOption.DANCE_CURSOR_MIRROR_COLOR_OVERRIDE,
|
||||
GameOption.DANCE_CURSOR_ONLY_COLOR_TRAIL,
|
||||
GameOption.DANCE_RGB_CURSOR_INC,
|
||||
GameOption.DANCE_CURSOR_TRAIL_OVERRIDE,
|
||||
GameOption.DANCE_REMOVE_BG,
|
||||
GameOption.DANCE_HIDE_OBJECTS,
|
||||
}),
|
||||
new OptionTab("MISC", new GameOption[] {
|
||||
GameOption.DANCE_HIDE_UI,
|
||||
GameOption.DANCE_REMOVE_BG,
|
||||
GameOption.DANCE_ENABLE_SB,
|
||||
}),
|
||||
new OptionTab ("Pippi", new GameOption[] {
|
||||
new OptionTab ("PIPPI", null),
|
||||
new OptionTab ("GENERAL", new GameOption[]{
|
||||
GameOption.PIPPI_ENABLE,
|
||||
GameOption.PIPPI_RADIUS_PERCENT,
|
||||
}),
|
||||
new OptionTab ("ANGLE MULTIPLIERS", new GameOption[]{
|
||||
GameOption.PIPPI_ANGLE_INC_MUL,
|
||||
GameOption.PIPPI_ANGLE_INC_MUL_SLIDER,
|
||||
}),
|
||||
new OptionTab ("MISC", new GameOption[] {
|
||||
GameOption.PIPPI_SLIDER_FOLLOW_EXPAND,
|
||||
GameOption.PIPPI_PREVENT_WOBBLY_STREAMS,
|
||||
})
|
||||
};
|
||||
|
||||
public static final OptionTab[] storyboardOptions = new OptionsOverlay.OptionTab[]{
|
||||
public static final OptionTab[] storyboardOptions = new OptionTab[] {
|
||||
new OptionTab("Gameplay", new GameOption[] {
|
||||
GameOption.BACKGROUND_DIM,
|
||||
GameOption.DANCE_REMOVE_BG,
|
||||
|
||||
@@ -328,7 +328,7 @@ public class SongMenu extends ComplexOpsuState {
|
||||
public SongMenu(final DisplayContainer displayContainer, InstanceContainer instanceContainer) {
|
||||
super(displayContainer);
|
||||
this.instanceContainer = instanceContainer;
|
||||
optionsOverlay = new OptionsOverlay(displayContainer, OptionsMenu.normalOptions, 0);
|
||||
optionsOverlay = new OptionsOverlay(displayContainer, OptionsMenu.normalOptions);
|
||||
overlays.add(optionsOverlay);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user