suppress button hover state when logo is hovered
This commit is contained in:
parent
8fd49d7015
commit
178baceda4
|
@ -570,7 +570,8 @@ public class MainMenu extends BaseOpsuState {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this.logoClickScale.update(delta);
|
this.logoClickScale.update(delta);
|
||||||
if (this.logo.contains(mouseX, mouseY, 0.25f)) {
|
final boolean logoHovered = this.logo.contains(mouseX, mouseY, 0.25f);
|
||||||
|
if (logoHovered) {
|
||||||
this.logoHover.update(delta);
|
this.logoHover.update(delta);
|
||||||
} else {
|
} else {
|
||||||
this.logoHover.update(-delta);
|
this.logoHover.update(-delta);
|
||||||
|
@ -582,7 +583,7 @@ public class MainMenu extends BaseOpsuState {
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
final ImagePosition pos = this.buttonPositions[i];
|
final ImagePosition pos = this.buttonPositions[i];
|
||||||
final AnimatedValue anim = this.buttonAnimations[i];
|
final AnimatedValue anim = this.buttonAnimations[i];
|
||||||
if (pos.contains(mouseX, mouseY, 0.25f)) {
|
if (!logoHovered && pos.contains(mouseX, mouseY, 0.25f)) {
|
||||||
if (anim.getDuration() != 500) {
|
if (anim.getDuration() != 500) {
|
||||||
anim.change(500, 0f, 1f, OUT_ELASTIC);
|
anim.change(500, 0f, 1f, OUT_ELASTIC);
|
||||||
continue;
|
continue;
|
||||||
|
@ -778,32 +779,27 @@ public class MainMenu extends BaseOpsuState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// start moving logo (if clicked)
|
final boolean logoHovered = this.logo.contains(x, y, 0.25f);
|
||||||
if (logoState == LogoState.DEFAULT || logoState == LogoState.CLOSING) {
|
if (logoState == LogoState.DEFAULT || logoState == LogoState.CLOSING) {
|
||||||
if (this.logo.contains(x, y, 0.25f)) {
|
if (logoHovered) {
|
||||||
this.openLogo();
|
this.openLogo();
|
||||||
SoundController.playSound(SoundEffect.MENUHIT);
|
SoundController.playSound(SoundEffect.MENUHIT);
|
||||||
this.logoClickScale.setTime(0);
|
this.logoClickScale.setTime(0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
if (logoHovered || this.buttonPositions[0].contains(x, y, 0.25f)) {
|
||||||
// other button actions (if visible)
|
|
||||||
else if (logoState == LogoState.OPEN || logoState == LogoState.OPENING) {
|
|
||||||
boolean logocontains = false;
|
|
||||||
if (this.logo.contains(x, y, 0.25f)) {
|
|
||||||
logocontains = true;
|
|
||||||
this.logoClickScale.setTime(0);
|
|
||||||
}
|
|
||||||
if (logocontains || this.buttonPositions[0].contains(x, y, 0.25f)) {
|
|
||||||
SoundController.playSound(SoundEffect.MENUHIT);
|
SoundController.playSound(SoundEffect.MENUHIT);
|
||||||
enterSongMenu();
|
enterSongMenu();
|
||||||
return true;
|
return true;
|
||||||
} else if (this.buttonPositions[2].contains(x, y, 0.25f)) {
|
}
|
||||||
|
|
||||||
|
if (this.buttonPositions[2].contains(x, y, 0.25f)) {
|
||||||
displayContainer.exitRequested = true;
|
displayContainer.exitRequested = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user