don't set elements underneath options overlay as hovered
This commit is contained in:
parent
4a69f1d9b3
commit
70902e42cb
|
@ -52,6 +52,7 @@ import org.newdawn.slick.opengl.renderer.SGL;
|
||||||
import org.newdawn.slick.util.Log;
|
import org.newdawn.slick.util.Log;
|
||||||
import yugecin.opsudance.core.Constants;
|
import yugecin.opsudance.core.Constants;
|
||||||
import yugecin.opsudance.core.Entrypoint;
|
import yugecin.opsudance.core.Entrypoint;
|
||||||
|
import yugecin.opsudance.core.InstanceContainer;
|
||||||
import yugecin.opsudance.core.state.BaseOpsuState;
|
import yugecin.opsudance.core.state.BaseOpsuState;
|
||||||
import yugecin.opsudance.core.state.OpsuState;
|
import yugecin.opsudance.core.state.OpsuState;
|
||||||
import yugecin.opsudance.ui.ImagePosition;
|
import yugecin.opsudance.ui.ImagePosition;
|
||||||
|
@ -483,6 +484,14 @@ public class MainMenu extends BaseOpsuState {
|
||||||
|
|
||||||
int delta = renderDelta;
|
int delta = renderDelta;
|
||||||
|
|
||||||
|
int mouseX = InstanceContainer.mouseX;
|
||||||
|
int mouseY = InstanceContainer.mouseY;
|
||||||
|
if (optionsOverlay.containsMouse()) {
|
||||||
|
// dirty hack to not show elements underneath options overlay as hovered
|
||||||
|
mouseX = -mouseX;
|
||||||
|
mouseY = -mouseY;
|
||||||
|
}
|
||||||
|
|
||||||
final Iterator<PulseData> pulseDataIter = this.pulseData.iterator();
|
final Iterator<PulseData> pulseDataIter = this.pulseData.iterator();
|
||||||
while (pulseDataIter.hasNext()) {
|
while (pulseDataIter.hasNext()) {
|
||||||
final PulseData pd = pulseDataIter.next();
|
final PulseData pd = pulseDataIter.next();
|
||||||
|
|
|
@ -63,6 +63,8 @@ import org.newdawn.slick.Image;
|
||||||
import org.newdawn.slick.Input;
|
import org.newdawn.slick.Input;
|
||||||
import org.newdawn.slick.SpriteSheet;
|
import org.newdawn.slick.SpriteSheet;
|
||||||
import org.newdawn.slick.gui.TextField;
|
import org.newdawn.slick.gui.TextField;
|
||||||
|
|
||||||
|
import yugecin.opsudance.core.InstanceContainer;
|
||||||
import yugecin.opsudance.core.state.ComplexOpsuState;
|
import yugecin.opsudance.core.state.ComplexOpsuState;
|
||||||
|
|
||||||
import static org.lwjgl.input.Keyboard.*;
|
import static org.lwjgl.input.Keyboard.*;
|
||||||
|
@ -703,6 +705,14 @@ public class SongMenu extends ComplexOpsuState {
|
||||||
|
|
||||||
optionsOverlay.preRenderUpdate();
|
optionsOverlay.preRenderUpdate();
|
||||||
|
|
||||||
|
int mouseX = InstanceContainer.mouseX;
|
||||||
|
int mouseY = InstanceContainer.mouseY;
|
||||||
|
if (optionsOverlay.containsMouse()) {
|
||||||
|
// dirty hack to not show elements underneath options overlay as hovered
|
||||||
|
mouseX = -mouseX;
|
||||||
|
mouseY = -mouseY;
|
||||||
|
}
|
||||||
|
|
||||||
int delta = renderDelta;
|
int delta = renderDelta;
|
||||||
UI.update(delta);
|
UI.update(delta);
|
||||||
if (reloadThread == null)
|
if (reloadThread == null)
|
||||||
|
|
|
@ -189,6 +189,10 @@ public class OptionsOverlay implements ResolutionChangedListener {
|
||||||
return this.active;
|
return this.active;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean containsMouse() {
|
||||||
|
return this.active && mouseX <= this.currentWidth;
|
||||||
|
}
|
||||||
|
|
||||||
public void setListener(Listener listener) {
|
public void setListener(Listener listener) {
|
||||||
this.listener = listener;
|
this.listener = listener;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user