Find an extension surface#

Find the relevant menu and callback in your game version. Prefer an existing extension point or suitable community API. When wrapping an internal function, preserve the original and ordinary path. A new feature may use its own window; another mod's layout is not a universal requirement.

Obtain the menu#

The lookup below is a fragment, not complete hook installation. Retry at an appropriate lifecycle point if the menu does not yet exist. Do not install another wrapper on every frame.

LUA
local menu = Helper and Helper.getMenu
    and Helper.getMenu("MapMenu")
if not menu then
    return
end

Add a button#

Place the fragment in your own table builder, where t is an existing Helper table. Connect it to your MD handler. Do not display game-action completion before an observed result.

LUA
local row = t:addRow(true, {})
row[1]:createButton({ height = 28 }):setText("My action")
row[1].handlers.onClick = function()
    AddUITriggeredEvent("WikiPanel", "apply", "example")
end

Behavior and refresh#

Table rebuilds can emit callbacks resembling user input. Check event source, selected row and owning table, and ensure redraw does not repeat an action. Change only necessary rows; retain availability checks for unrelated objects. Recheck internal signatures after game updates.