Skip to content

Add Lua towner API and dynamic dialog options (prework for multi-town PR)#8539

Merged
AJenbo merged 5 commits intodiasurgical:masterfrom
yuripourre:multitown-towners-only
Apr 11, 2026
Merged

Add Lua towner API and dynamic dialog options (prework for multi-town PR)#8539
AJenbo merged 5 commits intodiasurgical:masterfrom
yuripourre:multitown-towners-only

Conversation

@yuripourre
Copy link
Copy Markdown
Collaborator

Add ability to create new dialog options for NPCs

Expose TownerShortNames to Lua (devilutionx.towners), per-towner position
helpers, and RegisterTownerDialogOption for mod-driven store dialog lines.
Includes stores integration and tests.
@yuripourre yuripourre force-pushed the multitown-towners-only branch from f5e079c to fbe6c09 Compare April 4, 2026 18:20
@yuripourre yuripourre force-pushed the multitown-towners-only branch from fbe6c09 to 0f00b8d Compare April 4, 2026 18:38
@yuripourre yuripourre force-pushed the multitown-towners-only branch from 71a1b8b to a4561e1 Compare April 4, 2026 19:10
@AJenbo
Copy link
Copy Markdown
Member

AJenbo commented Apr 11, 2026

Made a few adjustments:

  • Extra dialog options are now inserted before the "leave" option instead of at hard-coded lines 14–16, so they work for all towners
  • onSelect no longer overwrites ActiveStore after the callback, allowing mods to open sub-dialogs
  • Unknown towner names in RegisterTownerDialogOption now log a warning instead of silently creating dead entries
  • Unplaceable options (no empty lines) now log a warning instead of failing silently

@AJenbo AJenbo enabled auto-merge (squash) April 11, 2026 00:33
@AJenbo AJenbo merged commit 3afccc2 into diasurgical:master Apr 11, 2026
26 checks passed
@yuripourre
Copy link
Copy Markdown
Collaborator Author

@AJenbo thank you, thank you, thank you!!!

@yuripourre yuripourre deleted the multitown-towners-only branch April 11, 2026 22:27
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