mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Fixed tribe selection gui not scrolling to the correct position when opening
This commit is contained in:
parent
cdcbfea8dc
commit
db53f4906e
1 changed files with 5 additions and 7 deletions
|
@ -71,10 +71,7 @@ public class TribeSelectionScreen extends GameGui implements HidesHud {
|
||||||
addOption(race, top);
|
addOption(race, top);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SELECTION == -1) {
|
scroll(SELECTION == -1 ? options.size() / 2 : SELECTION, false);
|
||||||
SELECTION = options.size() / 2;
|
|
||||||
}
|
|
||||||
scroll(SELECTION, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addOption(Race race, int y) {
|
private void addOption(Race race, int y) {
|
||||||
|
@ -167,11 +164,12 @@ public class TribeSelectionScreen extends GameGui implements HidesHud {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void scroll(int target, boolean animate) {
|
private void scroll(int target, boolean animate) {
|
||||||
if (target == SELECTION) {
|
SELECTION = target;
|
||||||
|
target *= 4;
|
||||||
|
if (targetScroll == target) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SELECTION = target;
|
targetScroll = target;
|
||||||
targetScroll = SELECTION * 4;
|
|
||||||
if (!animate) {
|
if (!animate) {
|
||||||
scrollPosition = targetScroll;
|
scrollPosition = targetScroll;
|
||||||
prevScrollPosition = scrollPosition;
|
prevScrollPosition = scrollPosition;
|
||||||
|
|
Loading…
Reference in a new issue