fix menu hiding items cause derpings in detecting current hovering option
This commit is contained in:
parent
403075a53d
commit
8b1d1e03bb
|
@ -609,14 +609,14 @@ public class OptionsMenu extends BasicGameState {
|
||||||
if (index >= currentTab.options.length)
|
if (index >= currentTab.options.length)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
int i = index;
|
for (GameOption option : currentTab.options) {
|
||||||
while (i >= 0) {
|
if (option.showCondition()) {
|
||||||
if (!currentTab.options[i--].showCondition()) {
|
index--;
|
||||||
if (++index >= currentTab.options.length) {
|
}
|
||||||
return null;
|
if (index < 0) {
|
||||||
}
|
return option;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return currentTab.options[index];
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,15 +130,15 @@ public class OptionsOverlay {
|
||||||
if (index >= options.length) {
|
if (index >= options.length) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
int i = index;
|
for (int i = 0; i < options.length; i++) {
|
||||||
while (i >= 0) {
|
if (options[i].showCondition()) {
|
||||||
if (!options[i--].showCondition()) {
|
index--;
|
||||||
if (++index >= options.length) {
|
}
|
||||||
return -1;
|
if (index < 0) {
|
||||||
}
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return index;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void update(int mouseX, int mouseY) {
|
public void update(int mouseX, int mouseY) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user