From 7459dd66d0eb7e059a67a4e8b7d84c850988c37c Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 4 Dec 2016 13:57:02 +0100 Subject: [PATCH] add the showcondition to sboverlay options --- src/yugecin/opsudance/ui/OptionsOverlay.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/yugecin/opsudance/ui/OptionsOverlay.java b/src/yugecin/opsudance/ui/OptionsOverlay.java index 33c500f9..22b10cbc 100644 --- a/src/yugecin/opsudance/ui/OptionsOverlay.java +++ b/src/yugecin/opsudance/ui/OptionsOverlay.java @@ -36,6 +36,7 @@ public class OptionsOverlay { private static Options.GameOption[] options = new Options.GameOption[] { Options.GameOption.DANCE_MOVER, + Options.GameOption.DANCE_QUAD_BEZ_AGGRESSIVENESS, Options.GameOption.DANCE_MOVER_DIRECTION, Options.GameOption.DANCE_SLIDER_MOVER_TYPE, Options.GameOption.DANCE_SPINNER, @@ -99,8 +100,12 @@ public class OptionsOverlay { g.setColor(Color.black); g.fillRect(0, 0, width, height); Color.black.a = a; - for (int i = 0; i < options.length; i++) { - drawOption(g, options[i], i, selectedOption == null ? hoverIdx == i : selectedOption == options[i]); + for (int i = 0, j = 0; i < options.length; i++) { + if (!options[i].showCondition()) { + continue; + } + j++; + drawOption(g, options[j], j, selectedOption == null ? hoverIdx == j : selectedOption == options[j]); } if (list.isVisible()) { list.render(container, game, g); @@ -123,6 +128,14 @@ public class OptionsOverlay { if (index >= options.length) { return -1; } + int i = index; + while (i >= 0) { + if (!options[i--].showCondition()) { + if (++index >= options.length) { + return -1; + } + } + } return index; }