From 4bd05e82bbf9d5fad2fa48a7518475e95e02468d Mon Sep 17 00:00:00 2001 From: unimatrixgit <95320811+unimatrixgit@users.noreply.github.com> Date: Sun, 29 Nov 2026 02:38:05 +0100 Subject: [PATCH] Close native callbacks once and separate paging controls --- DuneMenus/docs/INTEGRATION.md | 4 ++-- .../src/main/java/com/dunerealms/menus/ServiceMenu.java | 4 +++- .../main/java/com/dunerealms/menus/SuppliedDocument.java | 4 ++-- .../java/com/dunerealms/menus/SuppliedDocumentTest.java | 6 ++++++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/DuneMenus/docs/INTEGRATION.md b/DuneMenus/docs/INTEGRATION.md index c42c6ef8..3beca7d2 100644 --- a/DuneMenus/docs/INTEGRATION.md +++ b/DuneMenus/docs/INTEGRATION.md @@ -15,8 +15,8 @@ | Bank / ATM | BankMenu / AtmMenu / TransferMenu | Existing Rihla APIs, denominations, transfer and redemption references | | Administration, sellall, scoreboard | Existing handlers | Unchanged backend handlers | -The new Java renderer consumes the ZIP menu definitions and direct slot callbacks; it does not use old MenuDocument selected-card pages. Existing native service models are wrapped without replacing their callback implementations. No new confirmation intermediary is added. +The new Java renderer consumes the ZIP menu definitions and direct slot callbacks; it does not use old MenuDocument selected-card pages. Existing native service models are wrapped without replacing their callback implementations. Shared NativeMenus inventory entry points (including DuneNPC travel) also enter the replacement. Estate services retain the original claim/Home Block/deployment screens; website-only organisation functions link to their existing management pages. No new confirmation intermediary is added. -Local verification: 126 Java sources compile for release21 against cached Paper1.21.8 dependencies; 12 focused tests pass. Four resource-pack tests pass and validate item-card fonts/textures in the actual ZIP. Browser render fixtures are local design evidence only. Full CI, actual MCGUI renderer comparison and live NPC/function checks remain required before declaring deployment complete. +Local verification: 140 Java sources compile for release21 against cached Paper1.21.8 dependencies; 12 focused tests pass. Four resource-pack tests pass and validate item-card fonts/textures in the actual ZIP. Browser render fixtures are local design evidence only. Full CI, actual MCGUI renderer comparison and live NPC/function checks remain required before declaring deployment complete. Known visual work remains: the supplied preview's bespoke illustrations are reference artwork, while the dedicated canvas currently implements the gold/emerald frame, themed scenes, direct card grid, travel constellation and journal/council/bank layouts. Do not describe this as pixel-identical preview parity or a live install. diff --git a/DuneMenus/src/main/java/com/dunerealms/menus/ServiceMenu.java b/DuneMenus/src/main/java/com/dunerealms/menus/ServiceMenu.java index 41c23a12..d628e128 100644 --- a/DuneMenus/src/main/java/com/dunerealms/menus/ServiceMenu.java +++ b/DuneMenus/src/main/java/com/dunerealms/menus/ServiceMenu.java @@ -55,8 +55,10 @@ final class ServiceMenu extends Menu { else put(slot, card, click -> { if (click != ClickType.LEFT && !(section.equals("exchange") && click == ClickType.RIGHT)) return; Runnable run = () -> { - if (plugin.hasOpenMenu(player, this) && player.isOnline() && world.equals(player.getWorld().getUID())) + if (plugin.hasOpenMenu(player, this) && player.isOnline() && world.equals(player.getWorld().getUID())) { + end(); action.run(); + } }; if (player.getOpenInventory().getTopInventory().getHolder() == this) plugin.getServer().getScheduler().runTask(plugin, run); diff --git a/DuneMenus/src/main/java/com/dunerealms/menus/SuppliedDocument.java b/DuneMenus/src/main/java/com/dunerealms/menus/SuppliedDocument.java index 86d41679..cd2a85d1 100644 --- a/DuneMenus/src/main/java/com/dunerealms/menus/SuppliedDocument.java +++ b/DuneMenus/src/main/java/com/dunerealms/menus/SuppliedDocument.java @@ -10,10 +10,10 @@ final class SuppliedDocument { StringBuilder b=new StringBuilder("
✦DUNE
REALMS
THE IMPERIAL CONCOURSE

").append(escape(title)).append("

").append(escape(subtitle)).append("

"); if(layout.equals("constellation"))b.append("
✷SPACING GUILD
"); b.append("
");int index=0; - for(Card c:cards){b.append("");} + for(Card c:cards){b.append("");} b.append("
");for(String line:info)b.append("

").append(escape(line)).append("

");return b.append("
").toString(); } private static final String CSS=""" - *{box-sizing:border-box}body{margin:0;padding:12px;background:#03100f;color:#f1e7cd;font-family:Georgia,serif;font-size:13px}button{font-family:Georgia,serif;color:#f4df9d;cursor:pointer}.frame{min-height:570px;border:2px solid #b69149;outline:1px solid #645334;outline-offset:5px;background:#081e1b;position:relative;overflow:hidden}header{height:78px;border-bottom:2px solid #ae8943;background:linear-gradient(90deg,#102f29,#041512);display:flex;align-items:center;padding:8px 22px;gap:22px}.brand{display:flex;align-items:center;gap:8px;color:#d6ad58;font-size:38px;border-right:1px solid #7c683b;padding-right:20px}.brand span{font-size:16px;line-height:17px;letter-spacing:3px}.heading{flex:1}small{font-size:10px;letter-spacing:3px;color:#ad985f}h1{font-size:26px;margin:5px 0 0;color:#eed995;letter-spacing:1px}.close{width:31px;height:31px;border:1px solid #a58b4d;background:#112922;font-size:24px}.scene{position:relative;min-height:411px;padding:0 28px;overflow:hidden;background:linear-gradient(#162d30,#53665a 58%,#a88c52)}.quote{text-align:center;font-style:italic;position:relative;z-index:1;padding:12px 0 8px;margin:0;color:#f4e7bf}.dune{position:absolute;left:-12%;width:125%;height:180px;border-radius:55% 70% 0 0;pointer-events:none}.rear{bottom:0;background:#b4955a;transform:rotate(-8deg)}.front{bottom:-90px;background:#635a38;transform:rotate(9deg)}.moon{position:absolute;right:15%;top:23px;background:#e4dbb6;border-radius:50%;width:45px;height:45px;opacity:.55}main{position:relative;z-index:2}.doors,.bank{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;padding:12px 0 35px}.card{background:linear-gradient(135deg,#173e35,#0c201d);border:1px solid #b59349;box-shadow:inset 0 0 0 3px #0a231f,0 3px 8px #071713;padding:12px;min-height:94px;display:flex;align-items:center;gap:12px;text-align:left;width:22.5%}.card:hover{background:linear-gradient(135deg,#315c45,#183c32);border-color:#f3d784}.emblem{font-size:34px;color:var(--accent);width:35px;flex-shrink:0;text-align:center}h2{font-size:16px;margin:0 0 6px}p{margin:3px 0;font-size:11px;line-height:1.35;color:#d1d3bc}.back{position:absolute;bottom:2px;left:0;background:#12372c;border:1px solid #ad8c48;padding:7px 12px;display:flex;align-items:center;gap:8px}.back .emblem{font-size:17px;width:auto}.back h2{margin:0;font-size:12px}.back p{display:none}.hub .card{width:22%;min-height:89px}.hub .emblem{font-size:30px}.journal{display:flex;flex-direction:column;gap:8px;padding:8px 9% 45px}.journal .card{width:100%;min-height:68px;padding:8px 18px}.journal .card p{display:inline;margin-right:12px}.council{display:flex;flex-wrap:wrap;gap:16px;justify-content:center;padding:20px 8% 44px}.council .card{width:29%;min-height:115px;border-top:3px solid var(--accent)}.bank .card{width:30%;min-height:100px}.travel .scene{background:radial-gradient(ellipse at center,#123a40,#061317)}.travel .dune,.travel .moon{display:none}.constellation{height:350px;position:relative}.constellation .card{position:absolute;width:230px;min-height:83px;border-color:#74aeb6;background:linear-gradient(135deg,#173e43,#091c23)}.constellation .n0{top:0;left:36%}.constellation .n1{top:98px;left:0}.constellation .n2{top:98px;right:0}.constellation .n3{top:225px;left:12%}.constellation .n4{top:225px;right:12%}.constellation .back{bottom:0}.guild{position:absolute;top:168px;left:44%;font-size:52px;color:#c4dcdf;text-align:center}.guild span{display:block;font-size:11px;letter-spacing:2px}.orbit{position:absolute;border:1px solid #467b84;width:62%;height:170px;top:130px;left:19%;border-radius:50%;transform:rotate(24deg)}.orbit.two{transform:rotate(-24deg)}footer{height:76px;padding:9px 22px;background:#0b211c;border-top:1px solid #a88b47;display:flex;align-items:center;gap:22px}.facts{position:relative;padding:12px 0 24px;z-index:2}.facts p{font-size:11px;color:#c0c9b2}.seal{font-size:10px;letter-spacing:2px;color:#bda464}.war .scene{background:linear-gradient(#2e2424,#182c26)}.spice .scene{background:linear-gradient(#715232,#bc9251)}.politics .scene{background:linear-gradient(#2f2444,#132c27)} + *{box-sizing:border-box}body{margin:0;padding:12px;background:#03100f;color:#f1e7cd;font-family:Georgia,serif;font-size:13px}button{font-family:Georgia,serif;color:#f4df9d;cursor:pointer}.frame{min-height:570px;border:2px solid #b69149;outline:1px solid #645334;outline-offset:5px;background:#081e1b;position:relative;overflow:hidden}header{height:78px;border-bottom:2px solid #ae8943;background:linear-gradient(90deg,#102f29,#041512);display:flex;align-items:center;padding:8px 22px;gap:22px}.brand{display:flex;align-items:center;gap:8px;color:#d6ad58;font-size:38px;border-right:1px solid #7c683b;padding-right:20px}.brand span{font-size:16px;line-height:17px;letter-spacing:3px}.heading{flex:1}small{font-size:10px;letter-spacing:3px;color:#ad985f}h1{font-size:26px;margin:5px 0 0;color:#eed995;letter-spacing:1px}.close{width:31px;height:31px;border:1px solid #a58b4d;background:#112922;font-size:24px}.scene{position:relative;min-height:411px;padding:0 28px;overflow:hidden;background:linear-gradient(#162d30,#53665a 58%,#a88c52)}.quote{text-align:center;font-style:italic;position:relative;z-index:1;padding:12px 0 8px;margin:0;color:#f4e7bf}.dune{position:absolute;left:-12%;width:125%;height:180px;border-radius:55% 70% 0 0;pointer-events:none}.rear{bottom:0;background:#b4955a;transform:rotate(-8deg)}.front{bottom:-90px;background:#635a38;transform:rotate(9deg)}.moon{position:absolute;right:15%;top:23px;background:#e4dbb6;border-radius:50%;width:45px;height:45px;opacity:.55}main{position:relative;z-index:2}.doors,.bank{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;padding:12px 0 35px}.card{background:linear-gradient(135deg,#173e35,#0c201d);border:1px solid #b59349;box-shadow:inset 0 0 0 3px #0a231f,0 3px 8px #071713;padding:12px;min-height:94px;display:flex;align-items:center;gap:12px;text-align:left;width:22.5%}.card:hover{background:linear-gradient(135deg,#315c45,#183c32);border-color:#f3d784}.emblem{font-size:34px;color:var(--accent);width:35px;flex-shrink:0;text-align:center}h2{font-size:16px;margin:0 0 6px}p{margin:3px 0;font-size:11px;line-height:1.35;color:#d1d3bc}.back{position:absolute;bottom:2px;left:0;background:#12372c;border:1px solid #ad8c48;padding:7px 12px;display:flex;align-items:center;gap:8px}.pager{border:1px solid #ad8c48;background:#12372c;padding:10px;display:flex;gap:8px;align-items:center}.back .emblem{font-size:17px;width:auto}.back h2{margin:0;font-size:12px}.back p{display:none}.hub .card{width:22%;min-height:89px}.hub .emblem{font-size:30px}.journal{display:flex;flex-direction:column;gap:8px;padding:8px 9% 45px}.journal .card{width:100%;min-height:68px;padding:8px 18px}.journal .card p{display:inline;margin-right:12px}.council{display:flex;flex-wrap:wrap;gap:16px;justify-content:center;padding:20px 8% 44px}.council .card{width:29%;min-height:115px;border-top:3px solid var(--accent)}.bank .card{width:30%;min-height:100px}.travel .scene{background:radial-gradient(ellipse at center,#123a40,#061317)}.travel .dune,.travel .moon{display:none}.constellation{height:350px;position:relative}.constellation .card{position:absolute;width:230px;min-height:83px;border-color:#74aeb6;background:linear-gradient(135deg,#173e43,#091c23)}.constellation .n0{top:0;left:36%}.constellation .n1{top:98px;left:0}.constellation .n2{top:98px;right:0}.constellation .n3{top:225px;left:12%}.constellation .n4{top:225px;right:12%}.constellation .back{bottom:0}.guild{position:absolute;top:168px;left:44%;font-size:52px;color:#c4dcdf;text-align:center}.guild span{display:block;font-size:11px;letter-spacing:2px}.orbit{position:absolute;border:1px solid #467b84;width:62%;height:170px;top:130px;left:19%;border-radius:50%;transform:rotate(24deg)}.orbit.two{transform:rotate(-24deg)}footer{height:76px;padding:9px 22px;background:#0b211c;border-top:1px solid #a88b47;display:flex;align-items:center;gap:22px}.facts{position:relative;padding:12px 0 24px;z-index:2}.facts p{font-size:11px;color:#c0c9b2}.seal{font-size:10px;letter-spacing:2px;color:#bda464}.war .scene{background:linear-gradient(#2e2424,#182c26)}.spice .scene{background:linear-gradient(#715232,#bc9251)}.politics .scene{background:linear-gradient(#2f2444,#132c27)} """; } diff --git a/DuneMenus/src/test/java/com/dunerealms/menus/SuppliedDocumentTest.java b/DuneMenus/src/test/java/com/dunerealms/menus/SuppliedDocumentTest.java index d5628e6f..6943eb3d 100644 --- a/DuneMenus/src/test/java/com/dunerealms/menus/SuppliedDocumentTest.java +++ b/DuneMenus/src/test/java/com/dunerealms/menus/SuppliedDocumentTest.java @@ -11,6 +11,12 @@ class SuppliedDocumentTest { String html=SuppliedDocument.html("exchange","","quoted",List.of(new Card(12,"