Improved appearance of tabs.
- Replaced 'selection-tab.png' with a new image (by @kouyang). - Simulate osu! color scheme (tab color/font color changes instead of alpha changes for selected tab). - Added Utils.drawTab() method to avoid code duplication for Option menu tabs. Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
@@ -487,17 +487,14 @@ public class Options extends BasicGameState {
|
||||
}
|
||||
|
||||
// option tabs
|
||||
g.setColor(Color.white);
|
||||
Image tab = optionTabs[0].getImage();
|
||||
float tabTextY = optionTabs[0].getY() - (tab.getHeight() / 2f);
|
||||
for (int i = optionTabs.length - 1; i >= 0; i--) {
|
||||
tab.setAlpha((i == currentTab) ? 1.0f : 0.7f);
|
||||
optionTabs[i].draw();
|
||||
float tabTextX = optionTabs[i].getX() - (Utils.FONT_MEDIUM.getWidth(TAB_NAMES[i]) / 2);
|
||||
Utils.FONT_MEDIUM.drawString(tabTextX, tabTextY, TAB_NAMES[i], Color.white);
|
||||
if (i != currentTab)
|
||||
Utils.drawTab(optionTabs[i].getX(), optionTabs[i].getY(), TAB_NAMES[i], false);
|
||||
}
|
||||
Utils.drawTab(optionTabs[currentTab].getX(), optionTabs[currentTab].getY(), TAB_NAMES[currentTab], true);
|
||||
g.setColor(Color.white);
|
||||
g.setLineWidth(2f);
|
||||
float lineY = optionTabs[0].getY() + (tab.getHeight() / 2f);
|
||||
float lineY = optionTabs[0].getY() + (GameImage.MENU_TAB.getImage().getHeight() / 2f);
|
||||
g.drawLine(0, lineY, width, lineY);
|
||||
g.resetLineWidth();
|
||||
|
||||
|
||||
@@ -254,7 +254,12 @@ public class SongMenu extends BasicGameState {
|
||||
optionsButton.draw();
|
||||
|
||||
// sorting tabs
|
||||
SongSort.drawAll();
|
||||
SongSort currentSort = SongSort.getSort();
|
||||
for (SongSort sort : SongSort.VALUES_REVERSED) {
|
||||
if (sort != currentSort)
|
||||
sort.draw(false);
|
||||
}
|
||||
currentSort.draw(true);
|
||||
|
||||
// search
|
||||
Image searchIcon = GameImage.MENU_SEARCH.getImage();
|
||||
|
||||
Reference in New Issue
Block a user