diff --git a/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookScreen.java b/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookScreen.java index 5d319de1..80ff3728 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookScreen.java +++ b/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookScreen.java @@ -172,7 +172,17 @@ public class SpellbookScreen extends HandledScreen imple context.drawTexture(TEXTURE, bounds.left, bounds.top, isRight ? 510 - bounds.width : 402, v, bounds.width, bounds.height, 512, 256); RenderSystem.setShaderColor(1, 1, 1, 1); - context.drawTexture(tab.icon().get(), isRight ? bounds.left + bounds.width - 16 - 10 : bounds.left + 10, bounds.top + (bounds.height - 16) / 2, 0, 0, 16, 16, 16, 16); + float widthScale = bounds.width / 35F; + int resolution = (int)(16 * widthScale); + int iconInset = (int)(Math.min(widthScale * 2, 1) * 10); + + context.drawTexture(tab.icon().get(), + isRight ? bounds.left + bounds.width - resolution - iconInset : bounds.left + iconInset, + bounds.top + (bounds.height - resolution) / 2, + 0, 0, + resolution, resolution, + resolution, resolution + ); }); MatrixStack matrices = context.getMatrices(); diff --git a/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookTabBar.java b/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookTabBar.java index 313a9fd6..8888e305 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookTabBar.java +++ b/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookTabBar.java @@ -38,19 +38,21 @@ public class SpellbookTabBar { int backgroundHeight = screen.getBackgroundHeight(); int backgroundWidth = screen.getBackgroundWidth(); - int tabInset = 14; + + + int tabInset = 14 + Math.min((screen.width - backgroundWidth) / 2, 0); int top = (screen.height - backgroundHeight) / 2 + 20; int left = (screen.width - backgroundWidth) / 2; + int tabWidth = Math.min(35, left + 15); + int tabHeight = 23; + List leftTabs = chapters.getTabs(side) .sorted(Comparator.comparing(Chapter::tabY)) .toList(); - int tabWidth = 35; - int tabHeight = 23; - int totalTabs = leftTabs.size(); float squashFactor = Math.min(1, (float)(backgroundHeight - 40) / ((tabHeight + 8) * leftTabs.size()));