Player HUD Item Dictionary - UQcsse3200/2026-studio-2 GitHub Wiki

Player HUD: Item Dictionary

Part of the Player HUD. This page covers the UI; the data and discovery rules are in Item Dictionary.

Purpose

Pressing I toggles a full-screen overlay listing every ItemType. Items the player has picked up show their icon and stats; undiscovered items show a ?.

Item dictionary grid

Item dictionary details page

Class diagram

classDiagram
    class UIComponent {
        <<abstract>>
    }

    class ItemDictionaryDisplay {
        -DictionaryPage currentPage
        -ItemType selectedItem
        -boolean visible
        +showDictionary()
        +hideDictionary()
        +toggleDictionary()
        +isDictionaryVisible() boolean
    }

    class DictionaryPage {
        <<enum>>
        GRID
        DETAILS
    }

    class ItemDictionaryComponent {
        +isDiscovered(ItemType) boolean
    }

    class InventorySlotStyle

    UIComponent <|-- ItemDictionaryDisplay
    ItemDictionaryDisplay --> DictionaryPage
    ItemDictionaryDisplay --> ItemDictionaryComponent : reads discovered items
    ItemDictionaryDisplay ..> InventorySlotStyle : styles slots
    ItemDictionaryComponent ..> ItemDictionaryDisplay : "itemDictionaryChanged" event
Loading

Lifecycle

ItemDictionaryDisplay has two pages, switched by the DictionaryPage enum:

  • Grid page: a title and a 5-column grid of 110x110px slots, one per ItemType. Discovered items show their icon; undiscovered items show a ? and cannot be clicked.
  • Details page: opened by clicking a discovered slot. Shows the icon, name and description, plus only the stats that apply to that item (damage, range, cooldown, heal amount, burn damage/time, slow speed/time, speed boost, duration, poison damage/duration). A < Back label returns to the grid.

Events:

Event Effect
itemDictionaryChanged Refresh the current page (an item was discovered)
backpackOpened Hide the dictionary so the two overlays do not stack
dictionaryOpened / dictionaryClosed Fired by the display on show/hide; the hotbar hides and shows in response

An item is discovered the first time it is picked up (ItemDictionaryComponent listens for itemPickedUp events). Reopening the dictionary always starts on the grid page.

Public methods

Method Purpose
showDictionary() Open the overlay on the grid page
hideDictionary() Close the overlay
toggleDictionary() What the I key calls
isDictionaryVisible() Whether the overlay is showing

Tuning constants

In ItemDictionaryDisplay:

Constant Value Purpose
GRID_COLUMNS 5 Columns in the grid page
Slot size 110x110px Size of each grid slot

Tests

Links

⚠️ **GitHub.com Fallback** ⚠️