Skip to content

Add portable native marts with owned transaction callbacks - #117

Closed
Roxas2712 wants to merge 30 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/portable-script-shops
Closed

Roxas2712 wants to merge 30 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/portable-script-shops

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 22, 2026 •

Copy link
Copy Markdown

Adds API-3 open_mart(textConstant) using native screen factories and transactions on Gen1–3.

Preflight validates every map/text stock entry, including entries after a warp, plus item IDs/prices and wallet/inventory stores. Dispatch checks again. Native classic lists, quantity selectors, confirmations, FireRed's inline quantity and Emerald's sell bag retain their normal behavior. Screen/phase callback leases prevent cancelled, closed, superseded or retired callbacks from replaying purchases; foreign overlays pause effects. Changed inventories/item prices or retired constructors cannot leave a stale transaction/root behind. Committed native transactions are retained on cancellation.

Dependency: merge #116 and prerequisites first. Focused change 089a4c9…1a09b6c.

Validation at clean head 1a09b6c7847a723805fd39e88ea0be17f5dc7795:

  • 262 focused checks covering real native buys/sells, full-stack sale/order cleanup, inline/bag Gen3 flows, callback replay, overlays, unloads at quantity/confirmation phases, constructor retirement, live data changes and destination-stock preflight.
  • Existing 139 gift, 185 travel and 5,283 portable checks pass.
  • 144 cross-engine comparisons / 288 isolated loader runs against Gen1 79ea62f45fb2ea8f65d081a109431e4eb1bbdb36, including native shop open/close and continuation across eight versions.
  • Full headless: 91/101 engine suites, SDK 3/3 and B30 pass.
  • All-PR integration 0f35bc8f68bb21789b31091ecd3595dc4acebefb: 96/106 engine suites, SDK 3/3, B30 and 144/288 cross-engine checks.
  • Same 17 baseline failing assertions and 10 failed suites (27 FAIL lines); one integration assertion shares a buffered log line with driver output, and extracting its FAIL prefix confirms all 27 exact baseline messages. Both full commands still exit 1. No additional failures.
  • StyLua and git diff --check pass.

Tests are ROM-free; shared checks use real native shop implementations with fixture stock/font/greeting data. Native purchases/sales are exercised locally in this host; no ROM gameplay or pixel/audio equivalence claim. Missing native mart entries are refused rather than inferred from unrelated ROM pointers. Price/count/size and exact-integer limits are documented.

Hosted Actions: API 3 contracts and ci are action_required (fork workflow approval). Hosted tests have not run; the results above are local.

# 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