Repository navigation
NativeElement.invoke and openMenu('crafting'): a script switches off the recipe list's empty tabs - #350
Closed
Kharote wants to merge 1 commit into
Closed
NativeElement.invoke and openMenu('crafting'): a script switches off the recipe list's empty tabs#350Kharote wants to merge 1 commit into
Kharote wants to merge 1 commit into
Conversation
…the recipe list's empty tabs
The anvil's recipe list keeps its tabs (short swords, long swords, axes,
other) whatever recipes a server gives it, and NativeElement.call reaches
only the functions an element declares, not the list's own
SetEnableTabButton.
- New client NativeElement.invoke(clip, method, args): calls an
ActionScript method of a clip of a game screen, or a function of its
movie with clip '', on every instance that has the clip, and returns the
first answer.
- NativeUI.openMenu('crafting'): a page no key opens comes up as the
inventory, then the menu moves to it as its tab key does.
This was referenced Nov 24, 2026
Merged
Collaborator
Author
|
Shipped in 1.2.2 (#351, release v1.2.2). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
A server with its own smithing recipes (an armourer's 21, all in the Other category) wanted the recipe book's empty tabs gone: the list keeps its tabs (short swords, long swords, axes, other) lit whatever recipes it holds. The tabs are switched in the list's movie (ApseCraftingList,
SetEnableTabButton(tab, enabled)), which the element does not declare, soNativeElement.callcould not reach it.NativeElement.invoke(clip, method, args): calls an ActionScript method of a clip of a game screen, or a function of its movie with clip'', also one the element does not declare. Every instance of the element that has the clip gets the call (asloaddoes: the game draws its screens on other instances); the first answer that is not null comes back.NativeUI.openMenu('crafting'): the crafting page has no key of its own, so it now opens as the inventory, then the menu moves to it as its tab key (move_crafting) does: the screen's tab switch, its vtable slot 7, with the page and 0.NativeElement.invoke(since 1.2.2) with an example that switches off empty smithing tabs onnativeScreenOpened, and the tab numbers (0 short swords, 1 long swords, 2 axes, 3 other, 4 potions, 5 poisons, 6 herbs);NativeUI.openMenunames 'crafting'. C# SDK regenerated.How it was tested
node --test Backend/scripting/runtimes/js/client_native_ui.test.cjs: 15 passed (new: invoke's request, its path, its argument checks).typecheck_examples.cjs): the new ones pass in JS, TS, Lua and C# (the one error left is in the docs repository's carts.md, untouched here).openMenu('crafting')opened the menu's crafting page ("menu page 1 opened by a script: yes"; before, the open was refused).invoke('', 'SetEnableTabButton', [tab, false])switched off tabs 0, 1, 2 and 4 (their labels went, the others stayed). The docs example as a client script (onnativeScreenOpenedfor ApseCraftingList, 200 ms later) switched off tabs 0 to 2 each time the page opened, screenshots before and after.Checklist
python Dev/tools/format_source.py --checkpasses.