fix array index oob exception when changing dropdown option (fixes #118)
This commit is contained in:
parent
0af6bc8c09
commit
84fb44475f
|
@ -30,7 +30,6 @@ import itdelatrisu.opsu.ui.MenuButton;
|
||||||
import itdelatrisu.opsu.ui.UI;
|
import itdelatrisu.opsu.ui.UI;
|
||||||
import org.newdawn.slick.*;
|
import org.newdawn.slick.*;
|
||||||
import yugecin.opsudance.core.DisplayContainer;
|
import yugecin.opsudance.core.DisplayContainer;
|
||||||
import yugecin.opsudance.core.state.ComplexOpsuState;
|
|
||||||
import yugecin.opsudance.core.state.OverlayOpsuState;
|
import yugecin.opsudance.core.state.OverlayOpsuState;
|
||||||
|
|
||||||
public class OptionsOverlay extends OverlayOpsuState {
|
public class OptionsOverlay extends OverlayOpsuState {
|
||||||
|
@ -402,9 +401,11 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
|
|
||||||
if (isListOptionOpen) {
|
if (isListOptionOpen) {
|
||||||
if (y > optionStartY && listStartX <= x && x < listStartX + listWidth && listStartY <= y && y < listStartY + listHeight) {
|
if (y > optionStartY && listStartX <= x && x < listStartX + listWidth && listStartY <= y && y < listStartY + listHeight) {
|
||||||
hoverOption.clickListItem(listHoverIndex);
|
if (0 <= listHoverIndex && listHoverIndex < hoverOption.getListItems().length) {
|
||||||
if (listener != null) {
|
hoverOption.clickListItem(listHoverIndex);
|
||||||
listener.onSaveOption(hoverOption);
|
if (listener != null) {
|
||||||
|
listener.onSaveOption(hoverOption);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SoundController.playSound(SoundEffect.MENUCLICK);
|
SoundController.playSound(SoundEffect.MENUCLICK);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user