Skip to main content

UI Systems

Hyperscape’s client UI features a customizable interface system with draggable windows, action bars, chat filtering, and mobile support. Recent updates include RS3-style keyboard shortcuts, vertical action bars for mobile, and enhanced edit mode.
Location: packages/client/src/game/interface/ and packages/client/src/ui/

Action Bar System

The Action Bar provides quick access to items and skills with RS3-style keyboard shortcuts supporting up to 5 bars.

Features

  • 5 Action Bars: Each with 14 slots (1-9, 0, -, =, Backspace, Insert)
  • Modifier Keys: Ctrl, Shift, Alt for bars 2-4
  • Bar 5: Q, W, E, R, T, Y, U, I, O, P, [, ], \
  • Drag & Drop: Drag items/skills from inventory/skills panel
  • Context Menu: Right-click to remove or configure slots
  • Mobile Support: Vertical layout for touch devices

Keyboard Shortcuts

Keybind Display

Shortcuts are displayed on slots with modifier symbols:
  • ^1 — Ctrl+1 (Bar 2)
  • ⇧2 — Shift+2 (Bar 3)
  • ⌥3 — Alt+3 (Bar 4)
  • Q — Q key (Bar 5)

Mobile Layout

Action bars support vertical orientation for mobile devices:

Drag & Drop

Action bars use the centralized drag system:

Chat System

The chat system supports multiple channels with filtering and clickable messages.

Chat Channels

Message Types

Message Colors

Clickable Messages

Trade requests and duel challenges are clickable to accept:

Message Filtering


Edit Mode

Edit mode allows players to customize their UI layout with drag-and-drop window positioning.

Features

  • Hold-to-Toggle: Hold Ctrl key to enter edit mode (with progress indicator)
  • Escape to Exit: Press Escape to exit edit mode
  • Drag Windows: Reposition any panel
  • Delete Zone: Drag panels to trash icon to remove them
  • Alignment Guides: Visual guides for snapping windows
  • Grid Snapping: Windows snap to grid for clean layouts

Edit Mode Keyboard

Delete Zone


The menu bar features responsive layout that adapts to container size.

Dynamic Layout

Responsive Behavior

  • 1 row: Wide containers (desktop)
  • 2-3 rows: Medium containers
  • 4-5 rows: Narrow containers (mobile portrait)
  • Auto-reflow: Uses ResizeObserver to detect container changes

Panel Sizing

Recent updates increased panel sizes by ~30% for better readability:

Theme System

The theme system provides consistent colors across all UI components.

Theme Colors

Panel Background Updates

All panels now use theme colors for consistency:

Inventory Cross-Tab Isolation

Recent fixes prevent inventory updates from affecting other tabs:

Problem

When multiple browser tabs were open, inventory updates in one tab would trigger updates in all tabs, causing items to appear/disappear incorrectly.

Solution


Window Management

The window system provides draggable, resizable panels with snapping and constraints.

Window Features

  • Drag & Drop: Move windows anywhere on screen
  • Resize: Drag edges/corners to resize
  • Snap to Edges: Windows snap to viewport edges
  • Constraints: Min/max width/height per panel
  • Z-Index Management: Clicked windows come to front
  • Viewport Clamping: Windows stay on screen during resize

Window Store


Responsive Design

The UI adapts to different screen sizes and orientations.

Breakpoints

Mobile Interface Manager


Type Safety Improvements

Recent updates added strong typing for event payloads:

Action Bar Event Types

Network Cache Extensions


Performance Optimizations

Memoized Styles

UI components use useMemo to prevent unnecessary style recalculations:

Race Condition Fixes


Accessibility

Title Attributes

All interactive elements have descriptive titles:

Keyboard Navigation

  • Tab: Navigate between focusable elements
  • Enter: Activate buttons
  • Escape: Close modals and exit edit mode
  • Arrow Keys: Navigate context menus

Debug Logging Cleanup

Recent commits removed debug console.log statements in favor of structured logging:

Logger Service


Client Overview

Client architecture and rendering systems

Inventory System

Item management and drag-and-drop

Combat System

Combat mechanics and action bar integration

Mobile Guide

Mobile-specific UI and controls