Skip to content

26.2 HUD and Diagnostics

Rifa edited this page Aug 21, 2026 · 1 revision

๐Ÿ–ฅ๏ธ HUD, Diagnostics & UI Rendering

Parameter Specification
Graphics Extraction Engine net.minecraft.client.gui.GuiGraphicsExtractor
Target Screen Context net.minecraft.client.gui.screens.worldselection.AbstractGameRulesScreen
Hover Text Tint 0xFFFFFFAA (Soft Yellow Highlight)
Default Text Tint 0xFFFFFFFF (Crisp White)
Header Hover Box 0x22FFFFFF (Subtle Alpha Overlay)
Category Separator Line 0x44AAAAAA (Horizontal Border)
Toggle Active Color 0x4400FF00 (Emerald Green)
Toggle Inactive Color 0x44FF0000 (Ruby Red)
Accessibility Narration NarratedElementType.TITLE (NarrationPriority.HOVERED)

๐Ÿ“– Overview

Minecraft 26.2 introduced major refactors to the client rendering pipeline, migrating standard GUI drawing operations to the modern GuiGraphicsExtractor subsystem.

Collapsible Game Rules is built natively for this rendering engine, utilizing direct vector color fills, font metrics centering, and accessibility narration output with zero frame-rate overhead.


๐ŸŽจ Color Palette & Visual Diagnostics

Visual Component Hex ARGB Code Visual Description Usage Location
Hover Fill 0x22FFFFFF 13% opacity white box overlay. Category header hover & Global actions hover.
Border Divider 0x44AAAAAA 27% opacity light gray 1px line. Bottom edge of category headers and global actions.
Hovered Text 0xFFFFFFAA Soft yellow highlighted text. Category header text & button labels on mouse hover.
Standard Text 0xFFFFFFFF 100% white text. Category header title & child count badge.
Child Count Badge ChatFormatting.GRAY Vanilla gray text ( (N rules)). Suffix appended to category header labels.
Toggle Active BG 0x4400FF00 27% opacity emerald green. Background for โœ” ON state in BooleanToggleWidget.
Toggle Inactive BG 0x44FF0000 27% opacity ruby red. Background for โœ– OFF state in BooleanToggleWidget.

๐Ÿ’ป Rendering Implementation Details

Modern GuiGraphicsExtractor Pipeline

Inside CollapsibleCategoryRuleEntry.extractContent(...):

@Override
public void extractContent(GuiGraphicsExtractor graphics, int mouseX, int mouseY, boolean hovered, float a) {
    // 1. Premium Highlight on hover
    if (hovered) {
        graphics.fill(this.getX() - 2, this.getY(), this.getX() + this.getWidth() + 2, this.getY() + 24, 0x22FFFFFF);
    }

    // 2. Directional arrow, label, and child count badge
    String prefix = this.expanded ? "โ–ผ " : "โ–ถ ";
    Component countBadge = Component.literal(" (" + this.childCount + " rules)").withStyle(ChatFormatting.GRAY);
    Component display = Component.literal(prefix).append(this.label).append(countBadge);

    // 3. Centered text with dynamic hover tint
    graphics.centeredText(Minecraft.getInstance().font, display,
            this.getContentXMiddle(), this.getContentY() + 5, hovered ? 0xFFFFFFAA : 0xFFFFFFFF);
    
    // 4. Subtle separating line at the bottom
    graphics.fill(this.getX() + 10, this.getY() + 23, this.getX() + this.getWidth() - 10, this.getY() + 24, 0x44AAAAAA);
}

๐Ÿ”Š Audio & Accessibility Diagnostics

Whenever players interact with the UI, standard vanilla sounds provide tactile feedback:

  • Event: SoundEvents.UI_BUTTON_CLICK
  • Volume: 1.0F
  • Pitch: 1.0F
  • Trigger Conditions:
    • Mouse left or right click on Category Header.
    • Keyboard Space / Enter on Category Header.
    • Keyboard Left Arrow (collapse) or Right Arrow (expand).
    • Mouse click on [ Expand All ] or [ Collapse All ].

๐Ÿ”— Related Documentation

Clone this wiki locally