From 35d153b516a0b739c1afc423107642a98a1b8ae0 Mon Sep 17 00:00:00 2001 From: unimatrixgit <95320811+unimatrixgit@users.noreply.github.com> Date: Sat, 5 Dec 2026 10:22:50 +0100 Subject: [PATCH] Keep read-only cards aligned at the same compact size --- .../src/main/java/com/dunerealms/menus/MenuPolish.java | 2 +- .../java/com/dunerealms/menus/RendererVerification.java | 7 +++++++ .../src/main/java/com/dunerealms/gui/MenuPolish.java | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/DuneMenus/src/main/java/com/dunerealms/menus/MenuPolish.java b/DuneMenus/src/main/java/com/dunerealms/menus/MenuPolish.java index 16975f11..1dc6f85f 100644 --- a/DuneMenus/src/main/java/com/dunerealms/menus/MenuPolish.java +++ b/DuneMenus/src/main/java/com/dunerealms/menus/MenuPolish.java @@ -15,7 +15,7 @@ final class MenuPolish { .hub .card{width:13.875%;min-height:66.75px}.journal .card{width:23.25%;height:103.5px;min-height:51px;padding:6px} .council .card{width:25.875%;height:103.5px;min-height:86.25px}.bank .card{width:18%;min-height:75px} .card .emblem{font-size:19.5px;width:24px;height:24px;line-height:20px;padding:1px;margin:0 auto 2px;border-radius:6px;box-shadow:none;text-shadow:none} -.card .item-icon{width:20px;height:20px}.card h2{font-size:11.5px;line-height:1.15;height:26.45px;overflow:hidden;margin:0 0 2px}.card p{font-size:9.5px;line-height:1.2;max-height:22.8px;overflow:hidden;margin:1px 0}.card p+p{max-height:11.4px}.house-choices .card p{max-height:11.4px}.locked.card{height:auto}.locked.card p{max-height:none} +.card .item-icon{width:20px;height:20px}.card h2{font-size:11.5px;line-height:1.15;height:26.45px;overflow:hidden;margin:0 0 2px}.card p{font-size:9.5px;line-height:1.2;max-height:22.8px;overflow:hidden;margin:1px 0}.card p+p{max-height:11.4px}.house-choices .card p{max-height:11.4px}.locked.card{height:auto;min-height:103.5px}.locked.card p{max-height:none} .house-choices .card{width:19.5%;height:78.75px;min-height:78.75px}.house-choices .card h2{font-size:11px} .house-choices .card .emblem{font-size:19.5px;width:24px;height:24px;line-height:20px}.house-choices .card .item-icon{width:20px;height:20px} .constellation{height:auto;min-height:262.5px;display:flex;flex-wrap:wrap;gap:12px;justify-content:center;align-items:flex-start;align-content:flex-start;padding:12px 0 36px} diff --git a/DuneMenus/src/rendererTest/java/com/dunerealms/menus/RendererVerification.java b/DuneMenus/src/rendererTest/java/com/dunerealms/menus/RendererVerification.java index 31fa8fae..356ca93f 100644 --- a/DuneMenus/src/rendererTest/java/com/dunerealms/menus/RendererVerification.java +++ b/DuneMenus/src/rendererTest/java/com/dunerealms/menus/RendererVerification.java @@ -59,6 +59,13 @@ public class RendererVerification { } System.out.println(id+": parser clean; "+cards.size()+" action hitboxes; maxScroll="+frame.maxScroll()+"; render-and-hitbox-ms="+((System.nanoTime()-started)/1_000_000)); } + String readOnlyHtml=SuppliedDocument.html("hub","Status","",List.of(new Card(13,"Account status",List.of("Read only"),"paper",false)),List.of()); + var readOnlyPage=Page.of(readOnlyHtml,dir.resolve("read-only.html"),loader);var readOnlyFrame=HtmlRenderer.render(readOnlyPage,1536,896,1.5,0,Selector.State.NONE); + int readOnlyMarker=readOnlyHtml.indexOf("/* compact-dune-cards */"),readOnlyEnd=readOnlyHtml.indexOf("",readOnlyMarker); + var readOnlyBefore=Page.of(readOnlyHtml.substring(0,readOnlyMarker)+readOnlyHtml.substring(readOnlyEnd),dir.resolve("read-only-before.html"),loader); + var readOnlyOldFrame=HtmlRenderer.render(readOnlyBefore,1536,896,1.5,0,Selector.State.NONE); + var readOnlyBox=readOnlyFrame.boundsOf(readOnlyPage.document.selectFirst("main .card"));var readOnlyOldBox=readOnlyOldFrame.boundsOf(readOnlyBefore.document.selectFirst("main .card")); + if(Math.abs(readOnlyBox.getHeight()/readOnlyOldBox.getHeight()-.75)>.002 || !readOnlyPage.document.select("main [data-slot]").isEmpty())throw new AssertionError("Read-only card sizing or authority changed"); verifyNavigators(dir,loader); verifyHouseChoices(dir,loader); var actualIcon=Path.of("../network/resource-pack/central/overlay/assets/dunerealms/textures/item/equipment/legendary_mk14_axe.png");Path iconTarget=dir.resolve("pack/assets/dunerealms/textures/item/equipment/legendary_mk14_axe.png");Files.createDirectories(iconTarget.getParent());Files.copy(actualIcon,iconTarget,StandardCopyOption.REPLACE_EXISTING); diff --git a/DuneRealmsGUI/src/main/java/com/dunerealms/gui/MenuPolish.java b/DuneRealmsGUI/src/main/java/com/dunerealms/gui/MenuPolish.java index c90f8dff..2b918c1f 100644 --- a/DuneRealmsGUI/src/main/java/com/dunerealms/gui/MenuPolish.java +++ b/DuneRealmsGUI/src/main/java/com/dunerealms/gui/MenuPolish.java @@ -15,7 +15,7 @@ final class MenuPolish { .hub .card{width:13.875%;min-height:66.75px}.journal .card{width:23.25%;height:103.5px;min-height:51px;padding:6px} .council .card{width:25.875%;height:103.5px;min-height:86.25px}.bank .card{width:18%;min-height:75px} .card .emblem{font-size:19.5px;width:24px;height:24px;line-height:20px;padding:1px;margin:0 auto 2px;border-radius:6px;box-shadow:none;text-shadow:none} -.card .item-icon{width:20px;height:20px}.card h2{font-size:11.5px;line-height:1.15;height:26.45px;overflow:hidden;margin:0 0 2px}.card p{font-size:9.5px;line-height:1.2;max-height:22.8px;overflow:hidden;margin:1px 0}.card p+p{max-height:11.4px}.house-choices .card p{max-height:11.4px}.locked.card{height:auto}.locked.card p{max-height:none} +.card .item-icon{width:20px;height:20px}.card h2{font-size:11.5px;line-height:1.15;height:26.45px;overflow:hidden;margin:0 0 2px}.card p{font-size:9.5px;line-height:1.2;max-height:22.8px;overflow:hidden;margin:1px 0}.card p+p{max-height:11.4px}.house-choices .card p{max-height:11.4px}.locked.card{height:auto;min-height:103.5px}.locked.card p{max-height:none} .house-choices .card{width:19.5%;height:78.75px;min-height:78.75px}.house-choices .card h2{font-size:11px} .house-choices .card .emblem{font-size:19.5px;width:24px;height:24px;line-height:20px}.house-choices .card .item-icon{width:20px;height:20px} .constellation{height:auto;min-height:262.5px;display:flex;flex-wrap:wrap;gap:12px;justify-content:center;align-items:flex-start;align-content:flex-start;padding:12px 0 36px}