Skip to content

Add portable battle.bottom_ui_visible dispatch and cross-engine contracts - #147

Closed
Roxas2712 wants to merge 21 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/portable-battle-bottom-ui
Closed

Roxas2712 wants to merge 21 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/portable-battle-bottom-ui

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 23, 2026 •

Copy link
Copy Markdown

Gen2Recomped accepted API-3 battle.bottom_ui_visible registrations without a native producer. Alternate battle UIs therefore had to patch private draw methods to suppress native text/menu backings, including overlays pushed above the battle.

Add the shared (next, state) predicate to native BattleState text-area dispatch, WideBattle, TextBox and ChoiceBox. Only literal false hides drawing. Text/choice overlays inherit their nearest enclosing battle's decision; field YES/NO prompts do not become hook states. Hiding a move menu also removes its menu-row sprite clip. Native input/update ownership remains unchanged.

The existing Gen2 claim API, claimant introspection, reset and failing-claim removal are preserved. Legacy denials take precedence over public-hook approval. The inheritance helper recognizes both native isBattleState and Gen1-style isBattle metadata without modifying classes. Capability/unified catalogs advertise the real producer.

Stack / review scope

Depends on #146 and its existing prerequisites. This branch adds one feature commit above af4571fa9037273879229c42c9f0219f016ddffa; the main-target diff also includes the unmerged prerequisites. Review only this change.

Validation

  • 4,146 focused checks: shared API-3 contract (40), native routing/overlays/input/claims across all 15 Gen2 versions and four API/callback modes (3,654), and real native battle composition/update checks (452). Capability suite: 346/346.
  • 64 native cross-engine runs / 128 paired observations across the feature and combined integration, using the unchanged committed example on Red, Gold, FireRed and Emerald. Clean pinned Gen1Recomp reference: 79ea62f45fb2ea8f65d081a109431e4eb1bbdb36.
  • Reference engine's unchanged native GBA battle-hook suite: 1,598/1,598, including regular battle menus, healthboxes, sprites and native confirmations. The new CI workflow also runs it.
  • Native Gen2 tests retain real bottom render paths while isolating asset layers, covering classic/wide, GBA/DS and GB palette-canvas composition. Field/actor/HUD/animation dispatch and real menu input/logic ticks stay unchanged. Hidden TextBox typing and delayed YES/NO confirmation remain live.
  • StyLua, actionlint and whitespace checks pass.
ROM-free quick suite Engine Mod SDK B30 profile
Parent #146 88/98 3/3 pass
This feature 91/101 3/3 pass
Combined prior PRs + this feature 145/145 3/3 pass

The feature retains the parent's same ten failing suites and 17 failing assertions, with identical failure output. Separately proposed baseline fixes are included in the green combined integration at a0e6c02f9869b6b8ca795ce97e108a97a9a398ff. Integration needed only documentation placement resolution.

Boundaries

This controls bottom UI, not status-HUD visibility or whole-state visibility. Gen1 API 2 ignores the unified opt-in; that comparison uses native Gen1 API 2 against unified Gen2 API 2. API 3 preserves opaque state identity for this hook on both engines. The shared GBA draw observation uses the reference's native caught-Pokemon scene; its separate, unchanged native suite covers regular menus and confirmations. Existing renderer-specific error handling and presentation-counter timing remain unchanged.

Contract and reproduction commands describe native routing and fixture boundaries. Validation is ROM-free/headless; it does not claim GPU pixel equivalence, physical mirrored-display output or cartridge playthroughs.

Hosted CI

GitHub reports action_required for all 8 pull-request workflows; maintainer approval is required before the fork workflows can run. The new contract workflow has no started jobs. These are not hosted passes. Battle bottom UI contract run. Local feature and integration results above were completed on the published/tested commits.

# Conflicts:
#	src/mods/Loader.lua
# Conflicts:
#	docs/modding.md
#	src/mods/Loader.lua
#	src/world/WorldAPI.lua
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.

1 participant