cleanup tabstuff in optionsoverlay

This commit is contained in:
yugecin 2016-12-11 16:33:32 +01:00
parent 6660f127f9
commit 7096201521

View File

@ -409,18 +409,16 @@ public class OptionsOverlay {
}
}
// check if tab was clicked
int tScrollOffset = 0;
for (int tabIndex = 0; tabIndex < tabs.length; tabIndex++) {
if (tabs[tabIndex].button.contains(x, y)) {
if (selectedTab != tabIndex) {
selectedTab = tabIndex;
for (OptionTab tab : tabs) {
if (tab.button.contains(x, y)) {
scrollOffset = tScrollOffset;
SoundController.playSound(SoundEffect.MENUCLICK);
}
return;
}
tScrollOffset += Fonts.MEDIUM.getLineHeight() * 2;
tScrollOffset += tabs[tabIndex].options.length * optionHeight;
tScrollOffset += tab.options.length * optionHeight;
}
}