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; int tScrollOffset = 0;
for (int tabIndex = 0; tabIndex < tabs.length; tabIndex++) { for (OptionTab tab : tabs) {
if (tabs[tabIndex].button.contains(x, y)) { if (tab.button.contains(x, y)) {
if (selectedTab != tabIndex) { scrollOffset = tScrollOffset;
selectedTab = tabIndex; SoundController.playSound(SoundEffect.MENUCLICK);
scrollOffset = tScrollOffset;
SoundController.playSound(SoundEffect.MENUCLICK);
}
return; return;
} }
tScrollOffset += Fonts.MEDIUM.getLineHeight() * 2; tScrollOffset += Fonts.MEDIUM.getLineHeight() * 2;
tScrollOffset += tabs[tabIndex].options.length * optionHeight; tScrollOffset += tab.options.length * optionHeight;
} }
} }