Skip to content

Add interactive JASS choice dialogs for Warcraft III - #590

Closed
sookyboo wants to merge 13 commits into
corepunch:mainfrom
sookyboo:in_game_dialogs
Closed

sookyboo wants to merge 13 commits into
corepunch:mainfrom
sookyboo:in_game_dialogs

Conversation

@sookyboo

@sookyboo sookyboo commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Implement Warcraft III JASS choice dialogs with DialogCreate, button creation, display, and click-event handling. Add modal input and UI support, preserve player identity through click events and save/load, and release temporary dialog frames when dialogs are cleared.

Match the stock EscMenu look for dialog backgrounds and button states. Preserve race-specific skin keys through image resolution so Night Elf and Undead button art renders correctly, including disabled and pushed states.

Document the dialog API, event behavior, limits, and remaining compatibility gaps. Add regression coverage for dialog lifecycle, player identity, save/load, button styling, and race-specific image resolution.

Tests: make test — 46,845 assertions across 2,340 tests. WC3 engine tests pass in classic and TFT modes.

image

Test with: jass Trig_Fork_Dialog_Actions
in -tft +map "Maps\FrozenThrone\Campaign\NightElfX06.w3x"

@sookyboo
sookyboo requested a review from corepunch as a code owner October 6, 2026 17:58
@sookyboo
sookyboo marked this pull request as draft October 6, 2026 17:59
@sookyboo
sookyboo marked this pull request as ready for review October 6, 2026 18:27
@corepunch

Copy link
Copy Markdown
Owner

Landed on main by fast-forward (rebased onto main; full make test green, 47,022 assertions). Thanks! A follow-up on main fixes WoW backdrop blending (non-BlendAll backdrops had GL_BLEND disabled), dialog slot reuse, and a few Quake-style cleanups.

@corepunch corepunch closed this Oct 6, 2026
corepunch added a commit that referenced this pull request Oct 6, 2026
- Backdrop alpha: opaque is now opt-in (Q2 Draw_Pic never drops alpha).
  DRAW_BLEND_ALL is replaced by DRAW_BG_OPAQUE, honoured only when the
  background tint is fully opaque. uiBackdrop_t.BlendAll becomes Opaque
  (same bit) so zero-initialized WoW layouts (UI_WriteWelcomeWindow) and
  WoW XML/Lua backdrops blend again; WC3 hud/menu set it from FDF
  !BackdropBlendAll. R_DrawImageBatchOpaque folds into R_DrawImageBatchEx
  with params.opaque; redundant BlendAll=true assignments dropped.
- JASS dialogs: Clear/Destroy free slots for reuse; ids carry a reuse
  generation ((gen << 16) | slot+1) so stale ids from registrations,
  events, saves and late jassdialog clicks are rejected. Exhaustion is
  logged. jassdialog accepts any uint32 id and lets the game validate.
  ReadGame rejects out-of-range dialog slot counts.
- Load republishes the choice dialog only from ClientBegin (was twice).
- Fixture common.j declares dialog/button types (retail does) so JASS
  globals holding them snapshot; tests cover slot reuse, stale ids,
  malformed/foreign/duplicate jassdialog, sleep-across-save click
  context, single restore, and backdrop opacity in renderer/menu/hud.
- Nits: snapshot v7 comment, UI capacity printed from the define,
  merged DialogDisplay branches, EscMenu key table beside wide keys.

Network: byte layout unchanged; uiBackdrop_t bit 1 now means Opaque
(was BlendAll, ignored by clients before #590). Save: version 66 -> 67
(dialog/button id meaning changed); 66 rejected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants