Files
sacred_k/docs/escape.md
T
khallaandClaude Opus 5.5 1fd89524d3 Skills, auto-attack, aura and chain lightning rework, Esc, cache fix
- Skill bar: no art selection; slot 0 is the right-click art, keys 0-6 cast
  slots directly; cooldown labels in exact seconds; slot 0 set apart.
- Arts regenerate on their own (casting no longer refills the group).
- Auto-attack after targeting or casting at a hostile creature, at the speed
  of a held button.
- Auras can be recast while active (renew, no second visual).
- Blicke wie Klingen hits every enemy in range, physical, with life leech.
- Blitzschlag steers the game's own chain: 3 + level/5 hits, 1 + level/10
  chains, re-hits a lone enemy.
- Weapon sets: click selects, drag only from the selected set; the leftmost
  set is clickable (signed hit tests).
- Esc closes open windows before opening the game menu.
- HUD: standalone buttons and texts are centred.
- Record cache sized for widened views (town lag while walking).
- Shared game code: orders, fx events, text drawing, cooldowns, effects.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 00:11:38 +02:00

1.7 KiB

Esc closes windows first (src/mods/escape.cpp)

Asked 2026-10-15: with a dialog open, Esc should close it instead of opening the game menu.

The game (cUI_Manager::HandleEsc 0x756ba0, measured 2026-10-15)

On an Esc key event the UI manager (0x757544) calls HandleEsc. It knows its windows by slot (cUI_Manager dwords): 0x20 taskbar, 0x21 inventory, 0x22 equipment, 0x23 blacksmith, 0x24 merchant, 0x25 megamap, 0x26 overview map, 0x27 mercenary (party panel), 0x28 stats, 0x29 console, 0x2a diary (quest book), 0x2b savegame, 0x2c ESC menu, 0x2d purchase, 0x2e master, 0x2f options, 0x30 chest, 0x31 horse, 0x32 network info, 0x33 net portrait, 0x34 character, 0x35 cube. It closes the ESC menu, the megamap, the quest book, or (with 0x21/0x23/0x24/0x2e/0x30 open) the inventory; hides 0x2b / 0x2f; otherwise opens the ESC menu. With a trader open only the inventory closed, and the trader opened it again.

Closing a window: a cEventUI2 (vtable 0x88edd0, 0x80 bytes: +4 code 0x12, +8 subtype 5 = hide, names via 0x5904e0: sender at +0x28, window at +0x48 as measured in the commands the game sends when a window is closed by its button or hotkey; a string at +0x68, 0x423920 / 0x416660) sent to the UI manager's event handler (vf00, 0x757120), which routes it by name. Sent to the window's own vf10 it was not understood (first version).

The mod

HandleEsc is hooked: unless the ESC menu is open, every visible window of a table (slot, name) gets that hide command, and Esc does nothing else. If none is open, the game handles Esc as before.

Not covered: dialogs that are not one of these windows, e.g. quest dialogs (standalone buttons and texts in the UI manager, docs/hud.md).