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 yugecin.opsudance.core.Constants;
|
||||
import yugecin.opsudance.core.Entrypoint;
|
||||
import yugecin.opsudance.core.InstanceContainer;
|
||||
import yugecin.opsudance.core.state.BaseOpsuState;
|
||||
import yugecin.opsudance.core.state.OpsuState;
|
||||
import yugecin.opsudance.ui.ImagePosition;
|
||||
|
@ -483,6 +484,14 @@ public class MainMenu extends BaseOpsuState {
|
|||
|
||||
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();
|
||||
while (pulseDataIter.hasNext()) {
|
||||
final PulseData pd = pulseDataIter.next();
|
||||
|
|
|
@ -63,6 +63,8 @@ import org.newdawn.slick.Image;
|
|||
import org.newdawn.slick.Input;
|
||||
import org.newdawn.slick.SpriteSheet;
|
||||
import org.newdawn.slick.gui.TextField;
|
||||
|
||||
import yugecin.opsudance.core.InstanceContainer;
|
||||
import yugecin.opsudance.core.state.ComplexOpsuState;
|
||||
|
||||
import static org.lwjgl.input.Keyboard.*;
|
||||
|
@ -703,6 +705,14 @@ public class SongMenu extends ComplexOpsuState {
|
|||
|
||||
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;
|
||||
UI.update(delta);
|
||||
if (reloadThread == null)
|
||||
|
|
|
@ -188,6 +188,10 @@ public class OptionsOverlay implements ResolutionChangedListener {
|
|||
public boolean isActive() {
|
||||
return this.active;
|
||||
}
|
||||
|
||||
public boolean containsMouse() {
|
||||
return this.active && mouseX <= this.currentWidth;
|
||||
}
|
||||
|
||||
public void setListener(Listener listener) {
|
||||
this.listener = listener;
|
||||
|
|
Loading…
Reference in New Issue
Block a user