Major Redesgin and improvements #1

Merged
Magnus-Krill merged 3 commits from main into main 2026-07-17 21:27:22 +00:00
Magnus-Krill commented 2026-07-17 14:42:47 +00:00 (Migrated from github.com)

Redesign the client menu: liquid-glass UI over the live game

Replaces the old click-GUI with a new liquid-glass menu rendered entirely through Blaze3D. The game stays visible and is blurred/refracted only behind the panels, so the menu reads as frosted glass floating over the world.

Highlights

  • Glassmorphism with real per-panel blur. A backdrop capture (GlassBackdrop + a mixin around processBlurEffect) snapshots the sharp frame, keeps a blurred copy as a sampleable texture, and restores the sharp frame — the world stays crisp, only the glass blurs it. Custom shaders (glass_panel.fsh, sdf_fill.fsh, sdf_shadow.fsh) do edge refraction, chromatic dispersion, a top specular rim, and SDF-anti-aliased shapes/shadows (round circles, clean corners, continuous penumbra — no tessellation or banding).
  • Auto-scale. The menu is authored for GUI Scale 2 and fits any screen regardless of the user's GUI-scale setting.
  • Live, global theme. A Theme tab edits design tokens (accent preset, glass opacity, corner radius, blur, background design, layout toggles) that every component reads live, so changes restyle instantly and persist to config.
  • Structure. Left icon dock (categories + Friends/Profiles/Theme), module card grid, a floating inspector for the opened module, and a settings drawer. Toggle-to-close, right-click to open/close settings, word-wrapped descriptions with hover tooltips, compact cards.
  • Friends. Unified friend system across modules; the Friends tab renders each friend's player head. Enter submits in the Friends/Profiles add fields.

Fixes

  • AirPlace now places mid-air blocks correctly (routes block items through a direct useItemOn instead of the neighbor-face placer).
  • Blur is crash-safe: the Blur control drives vanilla's menu-blur strength instead of re-running the blur pass mid-frame (which tripped a GPU fence assert and crashed).
  • Menu render failures are caught, logged, and close the menu cleanly instead of crashing the game.
  • TntTimer fuse text uses a fixed locale.

Affected areas

rivet/ (Blaze3D backend, glass/SDF render commands, backdrop, shaders), ui/ (menu, theme, panels, screen), config/ (UI preferences), mixin/GameRendererMixin, module/impl (AirPlace, TntTimer). Adds DESIGN.md — a full recreation spec for the design language.
Verification

  • ./gradlew build — compiles, access widener validated, tests pass.

Examples
2026-07-17_16 41 16
2026-07-17_16 41 35


--- Redesign the client menu: liquid-glass UI over the live game Replaces the old click-GUI with a new liquid-glass menu rendered entirely through Blaze3D. The game stays visible and is blurred/refracted only behind the panels, so the menu reads as frosted glass floating over the world. Highlights - Glassmorphism with real per-panel blur. A backdrop capture (GlassBackdrop + a mixin around processBlurEffect) snapshots the sharp frame, keeps a blurred copy as a sampleable texture, and restores the sharp frame — the world stays crisp, only the glass blurs it. Custom shaders (glass_panel.fsh, sdf_fill.fsh, sdf_shadow.fsh) do edge refraction, chromatic dispersion, a top specular rim, and SDF-anti-aliased shapes/shadows (round circles, clean corners, continuous penumbra — no tessellation or banding). - Auto-scale. The menu is authored for GUI Scale 2 and fits any screen regardless of the user's GUI-scale setting. - Live, global theme. A Theme tab edits design tokens (accent preset, glass opacity, corner radius, blur, background design, layout toggles) that every component reads live, so changes restyle instantly and persist to config. - Structure. Left icon dock (categories + Friends/Profiles/Theme), module card grid, a floating inspector for the opened module, and a settings drawer. Toggle-to-close, right-click to open/close settings, word-wrapped descriptions with hover tooltips, compact cards. - Friends. Unified friend system across modules; the Friends tab renders each friend's player head. Enter submits in the Friends/Profiles add fields. Fixes - AirPlace now places mid-air blocks correctly (routes block items through a direct useItemOn instead of the neighbor-face placer). - Blur is crash-safe: the Blur control drives vanilla's menu-blur strength instead of re-running the blur pass mid-frame (which tripped a GPU fence assert and crashed). - Menu render failures are caught, logged, and close the menu cleanly instead of crashing the game. - TntTimer fuse text uses a fixed locale. Affected areas rivet/ (Blaze3D backend, glass/SDF render commands, backdrop, shaders), ui/ (menu, theme, panels, screen), config/ (UI preferences), mixin/GameRendererMixin, module/impl (AirPlace, TntTimer). Adds DESIGN.md — a full recreation spec for the design language. Verification - ./gradlew build — compiles, access widener validated, tests pass. Examples <img width="1920" height="1080" alt="2026-07-17_16 41 16" src="https://github.com/user-attachments/assets/126803ef-99f1-4cbd-923a-5a0af7a84ca9" /> <img width="1920" height="1080" alt="2026-07-17_16 41 35" src="https://github.com/user-attachments/assets/7a88e2ec-9b25-4b5d-815f-729d8e2f8f74" /> ---
Owner

wow the screenshots look great

wow the screenshots look great
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2026-07-17 21:23:40 +00:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull request overview

This PR overhauls AnarchyClient’s in-game menu into a new “liquid-glass” UI rendered via Blaze3D/Rivet, including per-panel blurred backdrop capture and new SDF-based shaders/pipelines, while also addressing a couple of gameplay/UI correctness fixes (AirPlace placement path, TNT fuse locale formatting) and expanding persisted UI preferences.

Changes:

  • Introduces glass panel + SDF fill/shadow fragment shaders and new Blaze3D render pipelines/commands (glass panels, soft shadows, distance-field grids).
  • Rebuilds the menu UI layout/interaction model (dock + cards + inspector + theme tab) and adds live, persisted design tokens via GlassTheme.
  • Updates config schema + tests to persist new UI preference fields (glass opacity, corner radius, blur) and hooks vanilla blur to capture/restore the scene for per-panel blur.

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/test/java/net/blockhost/anarchyclient/config/ClientConfigTest.java Updates UI preference round-trip assertions for new persisted glass/theme fields.
src/main/resources/assets/anarchyclient/shaders/core/sdf_shadow.fsh Adds SDF-based soft shadow shader for continuous penumbra.
src/main/resources/assets/anarchyclient/shaders/core/sdf_fill.fsh Adds SDF-based AA fill shader for rounded rects/circles.
src/main/resources/assets/anarchyclient/shaders/core/glass_panel.fsh Adds glass refraction/dispersion/rim shader sampling the captured blurred scene.
src/main/java/net/blockhost/anarchyclient/ui/ModulePanel.java Replaces old click GUI with dock + glass panels, cards, inspector, friends/profiles/theme tabs, tooltip wrapping, and theme-driven tokens.
src/main/java/net/blockhost/anarchyclient/ui/LayoutDebugScrollContainer.java Adjusts scroll container ideal sizing behavior to avoid grid row expansion from content size.
src/main/java/net/blockhost/anarchyclient/ui/GlassTheme.java Introduces global live design tokens (accent preset, glass opacity, corner radius, blur) persisted via UI preferences.
src/main/java/net/blockhost/anarchyclient/ui/AnarchyClientTheme.java Updates Rivet theme values to match the new glass UI style.
src/main/java/net/blockhost/anarchyclient/ui/AnarchyClientScreen.java Activates glass backdrop capture, adds GUI auto-scale virtualization, and guards render failures by closing cleanly.
src/main/java/net/blockhost/anarchyclient/rivet/SoftShadowCommand.java Adds a custom render command for SDF soft shadows under panels.
src/main/java/net/blockhost/anarchyclient/rivet/GlassPanelRenderState.java Adds a GUI render state carrying a distance-field UV mesh for the glass/SDF shaders.
src/main/java/net/blockhost/anarchyclient/rivet/GlassPanelCommand.java Adds a custom render command for a glass panel (tint + optional background design).
src/main/java/net/blockhost/anarchyclient/rivet/GlassBackdrop.java Implements blur-pass interception capture: keep blurred texture for sampling while restoring sharp framebuffer.
src/main/java/net/blockhost/anarchyclient/rivet/Blaze3DRenderer.java Extends renderer to submit glass panels and SDF grids, including distance-field mesh generation and pipeline binding.
src/main/java/net/blockhost/anarchyclient/rivet/AnarchyClientRenderPipelines.java Registers new GLASS_PANEL / SDF_FILL / SDF_SHADOW pipelines.
src/main/java/net/blockhost/anarchyclient/module/impl/TntTimerModule.java Fixes fuse formatting to use Locale.ROOT for stable decimal rendering.
src/main/java/net/blockhost/anarchyclient/module/impl/AirPlaceModule.java Fixes mid-air placement by routing through direct useItemOn and adds obstruction checks for block items.
src/main/java/net/blockhost/anarchyclient/mixin/GameRendererMixin.java Hooks processBlurEffect to drive glass backdrop capture/restoration.
src/main/java/net/blockhost/anarchyclient/config/ClientConfig.java Persists new UI preference fields (glassOpacity, cornerRadius, glassBlur) and clamps them in UiPreferences.
DESIGN.md Adds a detailed design/spec document describing the new UI language, tokens, layout rules, and rendering approach.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

## Pull request overview This PR overhauls AnarchyClient’s in-game menu into a new “liquid-glass” UI rendered via Blaze3D/Rivet, including per-panel blurred backdrop capture and new SDF-based shaders/pipelines, while also addressing a couple of gameplay/UI correctness fixes (AirPlace placement path, TNT fuse locale formatting) and expanding persisted UI preferences. **Changes:** - Introduces glass panel + SDF fill/shadow fragment shaders and new Blaze3D render pipelines/commands (glass panels, soft shadows, distance-field grids). - Rebuilds the menu UI layout/interaction model (dock + cards + inspector + theme tab) and adds live, persisted design tokens via `GlassTheme`. - Updates config schema + tests to persist new UI preference fields (glass opacity, corner radius, blur) and hooks vanilla blur to capture/restore the scene for per-panel blur. ### Reviewed changes Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments. <details> <summary>Show a summary per file</summary> | File | Description | | ---- | ----------- | | src/test/java/net/blockhost/anarchyclient/config/ClientConfigTest.java | Updates UI preference round-trip assertions for new persisted glass/theme fields. | | src/main/resources/assets/anarchyclient/shaders/core/sdf_shadow.fsh | Adds SDF-based soft shadow shader for continuous penumbra. | | src/main/resources/assets/anarchyclient/shaders/core/sdf_fill.fsh | Adds SDF-based AA fill shader for rounded rects/circles. | | src/main/resources/assets/anarchyclient/shaders/core/glass_panel.fsh | Adds glass refraction/dispersion/rim shader sampling the captured blurred scene. | | src/main/java/net/blockhost/anarchyclient/ui/ModulePanel.java | Replaces old click GUI with dock + glass panels, cards, inspector, friends/profiles/theme tabs, tooltip wrapping, and theme-driven tokens. | | src/main/java/net/blockhost/anarchyclient/ui/LayoutDebugScrollContainer.java | Adjusts scroll container ideal sizing behavior to avoid grid row expansion from content size. | | src/main/java/net/blockhost/anarchyclient/ui/GlassTheme.java | Introduces global live design tokens (accent preset, glass opacity, corner radius, blur) persisted via UI preferences. | | src/main/java/net/blockhost/anarchyclient/ui/AnarchyClientTheme.java | Updates Rivet theme values to match the new glass UI style. | | src/main/java/net/blockhost/anarchyclient/ui/AnarchyClientScreen.java | Activates glass backdrop capture, adds GUI auto-scale virtualization, and guards render failures by closing cleanly. | | src/main/java/net/blockhost/anarchyclient/rivet/SoftShadowCommand.java | Adds a custom render command for SDF soft shadows under panels. | | src/main/java/net/blockhost/anarchyclient/rivet/GlassPanelRenderState.java | Adds a GUI render state carrying a distance-field UV mesh for the glass/SDF shaders. | | src/main/java/net/blockhost/anarchyclient/rivet/GlassPanelCommand.java | Adds a custom render command for a glass panel (tint + optional background design). | | src/main/java/net/blockhost/anarchyclient/rivet/GlassBackdrop.java | Implements blur-pass interception capture: keep blurred texture for sampling while restoring sharp framebuffer. | | src/main/java/net/blockhost/anarchyclient/rivet/Blaze3DRenderer.java | Extends renderer to submit glass panels and SDF grids, including distance-field mesh generation and pipeline binding. | | src/main/java/net/blockhost/anarchyclient/rivet/AnarchyClientRenderPipelines.java | Registers new GLASS_PANEL / SDF_FILL / SDF_SHADOW pipelines. | | src/main/java/net/blockhost/anarchyclient/module/impl/TntTimerModule.java | Fixes fuse formatting to use `Locale.ROOT` for stable decimal rendering. | | src/main/java/net/blockhost/anarchyclient/module/impl/AirPlaceModule.java | Fixes mid-air placement by routing through direct `useItemOn` and adds obstruction checks for block items. | | src/main/java/net/blockhost/anarchyclient/mixin/GameRendererMixin.java | Hooks `processBlurEffect` to drive glass backdrop capture/restoration. | | src/main/java/net/blockhost/anarchyclient/config/ClientConfig.java | Persists new UI preference fields (glassOpacity, cornerRadius, glassBlur) and clamps them in `UiPreferences`. | | DESIGN.md | Adds a detailed design/spec document describing the new UI language, tokens, layout rules, and rendering approach. | </details> --- 💡 <a href="/6b6t/AnarchyClient/new/main?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
@ -0,0 +24,4 @@
private static GpuTexture blurredTexture;
private static GpuTextureView blurredView;
private static boolean capturedThisFrame;
// Resources retired on resize. Closed one frame later so draws recorded against the old view finish first.
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026-07-17 21:23:40 +00:00

The flag name capturedThisFrame is misleading: it’s only reset on deactivate()/resize, not per frame, so it effectively means “has a capture ever happened since activation”. Either rename it (e.g. hasCapture) or reset it at the start of each blur pass so the name matches the semantics.

The flag name capturedThisFrame is misleading: it’s only reset on deactivate()/resize, not per frame, so it effectively means “has a capture ever happened since activation”. Either rename it (e.g. hasCapture) or reset it at the start of each blur pass so the name matches the semantics.
@ -1077,3 +1310,4 @@
@Override
public void render(final Renderer renderer, final Size size) {
float clientWidth = textWidth(this, "client", GlassTheme.accent());
float brandWidth = textWidth(this, "ANARCHY", TEXT);
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026-07-17 21:23:39 +00:00

enabledCount() calls ModuleManager.byCategory(), which allocates a new ArrayList each call. Because enabledCount is used from DockButton.activeDot suppliers during render, this can create per-frame allocations (multiple categories) and unnecessary GC churn in the UI loop. Consider caching enabled counts per category (recomputed on toggle/refresh) or restructuring DockButton to avoid invoking byCategory every render.

enabledCount() calls ModuleManager.byCategory(), which allocates a new ArrayList each call. Because enabledCount is used from DockButton.activeDot suppliers during render, this can create per-frame allocations (multiple categories) and unnecessary GC churn in the UI loop. Consider caching enabled counts per category (recomputed on toggle/refresh) or restructuring DockButton to avoid invoking byCategory every render.
Sign in to join this conversation.
No description provided.