{"id":50269672,"url":"https://github.com/chemodun/x4-contextmenuapi","last_synced_at":"2026-05-27T16:04:49.697Z","repository":{"id":357863816,"uuid":"1236684258","full_name":"chemodun/X4-ContextMenuAPI","owner":"chemodun","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-14T14:55:57.000Z","size":9523,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-14T16:48:04.096Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chemodun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-12T13:28:37.000Z","updated_at":"2026-05-14T14:56:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chemodun/X4-ContextMenuAPI","commit_stats":null,"previous_names":["chemodun/x4-contextmenuapi"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/chemodun/X4-ContextMenuAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chemodun%2FX4-ContextMenuAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chemodun%2FX4-ContextMenuAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chemodun%2FX4-ContextMenuAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chemodun%2FX4-ContextMenuAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chemodun","download_url":"https://codeload.github.com/chemodun/X4-ContextMenuAPI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chemodun%2FX4-ContextMenuAPI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33573311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-27T16:04:24.593Z","updated_at":"2026-05-27T16:04:49.684Z","avatar_url":"https://github.com/chemodun.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Context Menu API\n\nAn API mod for X4: Foundations that *extends* the modding surface beyond what *SirNukes Mod Support APIs* covers, targeting menus and context frame modes not exposed by that API. Currently it supports the `Information` panel context frames on `Map` screen, and the `Personnel Management`, `Inventory`, `Spacesuit Upgrades`, and `Transaction Log` context frames on `Player Info` screen.\n\n## Overview\n\nThe mod intercepts `createContextFrame` on the supported menus and fires a signal before the frame is built. Consumers respond synchronously (within the same MD tick / Lua call) by appending entries via the builder API.\n\nTwo integration paths exist, both with equivalent capabilities:\n\n- **MD API** - for Mission Director scripts. Uses `Get_Actions` / `Add_Action` cue signals.\n- **Lua API** - for Lua UI scripts. Register a callback via `cmAPI.registerLuaCallback(fn)`; the function returns a list of entry tables, which the API renders using the same pipeline as MD entries.\n\n## Requirements\n\n- **X4: Foundations**: Version **8.00HF4** or higher and **UI Extensions and HUD**: Version **v8.0.4.x** or higher by [kuertee](https://next.nexusmods.com/profile/kuertee?gameId=2659):\n  - Available on Nexus Mods: [UI Extensions and HUD](https://www.nexusmods.com/x4foundations/mods/552)\n- **X4: Foundations**: Version **9.00 beta 3** or higher and **UI Extensions and HUD**: Version **v9.0.0.0.3** or higher by [kuertee](https://next.nexusmods.com/profile/kuertee?gameId=2659).\n- **Mod Support APIs**: Version 1.95 or higher by [SirNukes](https://next.nexusmods.com/profile/sirnukes?gameId=2659):\n  - Available on Steam: [SirNukes Mod Support APIs](https://steamcommunity.com/sharedfiles/filedetails/?id=2042901274)\n  - Available on Nexus Mods: [Mod Support APIs](https://www.nexusmods.com/x4foundations/mods/503)\n- **Options Helper**: Version 1.0 or higher by [Chem O`Dun](https://next.nexusmods.com/profile/ChemODun/mods?gameId=2659):\n  - Available on Steam: [Options Helper](https://steamcommunity.com/sharedfiles/filedetails/?id=3715253556)\n  - Available on Nexus Mods: [Options Helper](https://www.nexusmods.com/x4foundations/mods/2089)\n\n## Installation\n\n- **Steam Workshop**: [Context Menu API](https://steamcommunity.com/sharedfiles/filedetails/?id=3725826962)\n- **Nexus Mods**: [Context Menu API](https://www.nexusmods.com/x4foundations/mods/2110)\n\n## MD API\n\n### Flow\n\n```\n1. Your cue listens to  md.Context_Menu_API.Get_Actions\n2. Check event.param.$mode (and other fields) to decide what to add\n3. Call md.Context_Menu_API.Add_Action one or more times (synchronously)\n4. The API builds the frame; user clicks trigger your $callback cue\n```\n\n### `Get_Actions` - event fields\n\n- `$menuName` *(string)* - source menu (`\"MapMenu\"`)\n- `$mode` *(string)* - context frame mode, e.g. `\"info_context\"`, `\"trade\"` (see Vanilla context menu modes below); changes at every sub-menu level\n- `$rootMode` *(string)* - the original vanilla mode that opened the menu; stays constant across all sub-menu levels (same as `$mode` at the root level)\n- Additional mode-specific string fields (e.g. `$component`, `$entity`, `$person`, `$inv_ware`, `$weaponmacro`, ...) - see per-mode docs below\n\n### `Add_Action` - entry fields\n\n- `$type` - entry type: `\"menuItem\"` (default), `\"subMenu\"`, `\"separator\"`, `\"header\"`\n- `$id` *(string)* - unique ID; required for `menuItem` / `subMenu` / `header`; for `menuItem` auto-derived from `$text` if omitted and `$callback` is set\n- `$text` *(string)* - display label\n- `$icon` *(string, optional)* - icon name (X4 icon set); prepended to `$text` as `\\027[icon] text`\n- `$text2` *(string, optional)* - right-side secondary text; for `subMenu` the API fills in `\u003e` if omitted\n- `$textColor` *(string, optional)* - Color key for the main text (e.g. `'text_positive'`); default: `'text_normal'`\n- `$text2Color` *(string, optional)* - Color key for `$text2`; default: `'text_normal'`\n- `$mouseOver` *(string, optional)* - tooltip text shown on hover\n- `$mouseOverIcon` *(string, optional)* - icon prepended to the tooltip text\n- `$callback` *(cue reference)* - cue to call when this `menuItem` is clicked\n- `$echo` *(any, optional)* - arbitrary value passed back in `event.param.$echo` of the callback\n- `$active` *(bool)* - whether the entry is clickable; default: `true` (auto-set to `false` when no `$callback`)\n- `$keepOpen` *(bool, optional)* - if `true`, the context menu stays open after the click; default: menu closes\n\n### Callback `event.param` fields\n\nThe callback cue receives all original `Get_Actions` fields, i.e.:\n\n- `$menuName` *(string)* - source menu (`\"MapMenu\"`)\n- `$mode` *(string)* - same as in `Get_Actions`\n- `$rootMode` *(string)* - same as in `Get_Actions`\n- Additional mode-specific string fields - same as in `Get_Actions`\n\n**plus**:\n\n- `$id` - the action ID that was clicked\n- `$echo` - the value of `$echo` passed to `Add_Action` (if any) or `null`.\n\n### Minimal example - append to an existing mode\n\n```xml\n\u003ccue name=\"On_CMA_Get_Actions\" instantiate=\"true\"\u003e\n    \u003cconditions\u003e\n        \u003cevent_cue_signalled cue=\"md.Context_Menu_API.Get_Actions\" /\u003e\n    \u003c/conditions\u003e\n    \u003cactions\u003e\n        \u003cdo_if value=\"event.param.$mode == 'info_context' and event.param.$entity?\"\u003e\n            \u003csignal_cue_instantly cue=\"md.Context_Menu_API.Add_Action\"\n                param=\"table[\n                    $type     = 'menuItem',\n                    $text     = 'My Action',\n                    $icon     = 'order_follow',\n                    $callback = My_Callback,\n                    $echo     = event.param.$entity,\n                ]\" /\u003e\n        \u003c/do_if\u003e\n    \u003c/actions\u003e\n\u003c/cue\u003e\n\n\u003ccue name=\"My_Callback\" instantiate=\"true\"\u003e\n    \u003cconditions\u003e\n        \u003cevent_cue_signalled /\u003e\n    \u003c/conditions\u003e\n    \u003cactions\u003e\n        \u003c!-- event.param.$echo is the entity from above --\u003e\n        \u003cdebug_text text=\"'clicked on entity: %s'.[event.param.$echo]\" /\u003e\n    \u003c/actions\u003e\n\u003c/cue\u003e\n```\n\n### Multi-level sub-menus (MD)\n\nA `subMenu` entry navigates to a new blank frame identified by `$id`. The API manages a navigation stack and injects a `\u003c Back` button automatically. Supply a `header` as the first entry of a custom mode to label the frame.\n\n```xml\n\u003ccue name=\"On_CMA_Get_Actions\" instantiate=\"true\"\u003e\n    \u003cconditions\u003e\n        \u003cevent_cue_signalled cue=\"md.Context_Menu_API.Get_Actions\" /\u003e\n    \u003c/conditions\u003e\n    \u003cactions\u003e\n\n        \u003c!-- Append sub-menu trigger to the vanilla frame --\u003e\n        \u003cdo_if value=\"event.param.$mode == 'info_context'\"\u003e\n            \u003csignal_cue_instantly cue=\"md.Context_Menu_API.Add_Action\"\n                param=\"table[$type = 'separator']\" /\u003e\n            \u003csignal_cue_instantly cue=\"md.Context_Menu_API.Add_Action\"\n                param=\"table[$type = 'subMenu', $text = 'My Tool', $id = 'mytool_main']\" /\u003e\n        \u003c/do_if\u003e\n\n        \u003c!-- Define the custom mode contents (header + items) --\u003e\n        \u003cdo_elseif value=\"event.param.$mode == 'mytool_main'\"\u003e\n            \u003csignal_cue_instantly cue=\"md.Context_Menu_API.Add_Action\"\n                param=\"table[$type = 'header', $text = 'My Tool']\" /\u003e\n            \u003csignal_cue_instantly cue=\"md.Context_Menu_API.Add_Action\"\n                param=\"table[$type = 'menuItem', $text = 'Do Something', $id = 'mytool_do', $callback = My_Action]\" /\u003e\n            \u003csignal_cue_instantly cue=\"md.Context_Menu_API.Add_Action\"\n                param=\"table[$type = 'subMenu', $text = 'More Options', $id = 'mytool_sub']\" /\u003e\n        \u003c/do_elseif\u003e\n\n        \u003cdo_elseif value=\"event.param.$mode == 'mytool_sub'\"\u003e\n            \u003csignal_cue_instantly cue=\"md.Context_Menu_API.Add_Action\"\n                param=\"table[$type = 'header', $text = 'More Options']\" /\u003e\n            \u003csignal_cue_instantly cue=\"md.Context_Menu_API.Add_Action\"\n                param=\"table[$type = 'menuItem', $text = 'Option A', $id = 'mytool_a', $callback = My_Action]\" /\u003e\n        \u003c/do_elseif\u003e\n\n    \u003c/actions\u003e\n\u003c/cue\u003e\n```\n\nNote: Do NOT add a `back` entry manually - the API inserts it automatically for every custom mode, right after the leading `header` (if present).\n\n## Lua API\n\n### Flow (Lua)\n\n```\n1. At init time, call  cmAPI.registerLuaCallback(fn)\n2. fn(menuName, mode, rootMode, data) is called synchronously on every whitelisted context open\n3. Return a list of entry tables (same fields as MD Add_Action, with onClick instead of $callback)\n4. The API renders the entries; user clicks invoke your onClick function directly\n```\n\n### `registerLuaCallback` - signature\n\n```lua\nlocal cmAPI = require(\"extensions.context_menu_api.ui.context_menu_api\")\ncmAPI.registerLuaCallback(function(menuName, mode, rootMode, data)\n    -- return a list of entry tables, or {} to add nothing\nend)\n```\n\n- `menuName` *(string)* - source menu name, e.g. `\"MapMenu\"`\n- `mode` *(string)* - current context frame mode (changes at sub-menu levels)\n- `rootMode` *(string or nil)* - original vanilla mode that opened the menu; constant across sub-menu levels\n- `data` *(table or nil)* - raw context data table; fields mirror the MD param fields but as Lua values (`data.component` and `data.entity` are uint64 cdata; `data.person` is the raw NPCSeed cdata, not yet resolved to an entity)\n\nThe callback is called for **every** whitelisted open across all supported menus. Filter by `menuName` and `mode` inside your callback as needed.\n\n### Entry table fields\n\nEntry tables mirror the MD `Add_Action` fields, with two differences:\n\n- Field names are plain Lua strings (no `$` prefix)\n- Use `onClick` instead of `callback` + `echo`\n\n- `type` *(string)* - `\"menuItem\"` (default), `\"subMenu\"`, `\"separator\"`, `\"header\"`\n- `id` *(string)* - **required** for `menuItem` and `subMenu`; entries without `id` are silently skipped\n- `text` *(string)* - display label\n- `icon` *(string, optional)* - X4 icon name; prepended to `text`\n- `text2` *(string, optional)* - right-side secondary text; `subMenu` defaults to `\u003e`\n- `textColor` *(string, optional)* - color key, e.g. `\"text_positive\"`\n- `text2Color` *(string, optional)* - color key for `text2`\n- `mouseOver` *(string, optional)* - tooltip text\n- `mouseOverIcon` *(string, optional)* - icon prepended to the tooltip\n- `active` *(bool)* - whether the entry is clickable; default `true`\n- `keepOpen` *(bool, optional)* - if `true`, menu stays open after click; default `false`\n- `onClick` *(function)* - called as `onClick(data, mode)` when the entry is clicked; `data` and `mode` are the same values passed to the callback\n\n\u003e **Note:** `onClick` closures already capture any context the caller needs. There is no `echo` field - closures are the Lua-native equivalent.\n\n### Minimal example (Lua) - append to an existing mode\n\n```lua\nlocal cmAPI = require(\"extensions.context_menu_api.ui.context_menu_api\")\n\ncmAPI.registerLuaCallback(function(menuName, mode, rootMode, data)\n    if mode ~= \"info_context\" then return {} end\n    return {\n        {\n            type    = \"menuItem\",\n            id      = \"mymod_action\",\n            text    = \"My Lua Action\",\n            icon    = \"order_follow\",\n            onClick = function(data, mode)\n                DebugError(\"clicked entity: \" .. tostring(data.component))\n            end,\n        },\n    }\nend)\n```\n\n### Multi-level sub-menus (Lua)\n\nSub-menu navigation works identically to MD. Return a `subMenu` entry with an `id`; define the contents of that custom mode in the same callback by checking `mode`.\n\n```lua\ncmAPI.registerLuaCallback(function(menuName, mode, rootMode, data)\n    if mode == \"info_context\" then\n        return {\n            { type = \"subMenu\", id = \"mytool_main\", text = \"My Tool\" },\n        }\n    elseif mode == \"mytool_main\" then\n        return {\n            { type = \"header\", text = \"My Tool\" },\n            { type = \"subMenu\",  id = \"mytool_sub\",  text = \"More Options\" },\n            {\n                type    = \"menuItem\",\n                id      = \"mytool_do\",\n                text    = \"Do Something\",\n                onClick = function(data, mode) DebugError(\"did something\") end,\n            },\n        }\n    elseif mode == \"mytool_sub\" then\n        return {\n            { type = \"header\", text = \"More Options\" },\n            {\n                type    = \"menuItem\",\n                id      = \"mytool_a\",\n                text    = \"Option A\",\n                onClick = function(data, mode) DebugError(\"option A\") end,\n            },\n        }\n    end\n    return {}\nend)\n```\n\nThe `\u003c Back` button is inserted automatically. Do NOT return a `back` entry.\n\n## Supported game Menus/Screens and Modes\n\nThese are the two Menus(screens) are supported by the API: `MapMenu` (the main map screen) and `PlayerInfoMenu`. Each menu has a set of supported modes (context frame types).\n\n### Supported modes per Menu with attached data fields\n\nThese modes use a single-column frame and are whitelisted in the API. The `Get_Actions` event fires only for these modes. Entry injection and custom sub-menus work fully.\n\n#### MapMenu\n\nWhen **mode** is equal to `\"info_context\"` - the most useful entry point. Opens when the player right-clicks a crew member, pilot, manager, or ship trader in the info panel.\n\n**On pilots/managers/traders:**\n\n- `$type` *(string)* - `\"entity\"`\n- `$component` *(component or null)* - controllable (ship or station) as MD component reference\n- `$entity` *(component or null)* - pilot or manager NPC as MD component reference\n- `$instance` *(string or null)* - `\"left\"` or `\"right\"` for dual-panel frames; null otherwise\n- `$xoffset` *(number)* - mouse X offset from the default frame position;\n- `$yoffset` *(number)* - mouse Y offset from the default frame position\n\n**On crew members and other personnel:**\n\n- `$type` *(string)* - `\"person\"`\n- `$component` *(component or null)* - controllable (ship or station) as MD component reference\n- `$person` *(NPCSeed or null)* - crew member as raw NPCSeed/npctemplate reference\n- `$instance` *(string or null)* - `\"left\"` or `\"right\"` for dual-panel frames; null otherwise\n- `$xoffset` *(number)* - mouse X offset from the default frame position;\n- `$yoffset` *(number)* - mouse Y offset from the default frame position\n\n**On loadout items (Equipment)**:\n\n- or `$weaponmacro` *(string or null)* - weapon macro string when a weapon row was clicked\n- or `$equipmentmacro` *(string or null)* - equipment/deploy macro string when an equipment row was clicked\n- or `$software` *(string or null)* - software macro string when a software row was clicked\n\n**On pilot/captain inventory items**:\n\n- `$inv_ware` *(string or null)* - ware macro string when an inventory item row was clicked\n\n#### PlayerInfoMenu\n\nWhen **mode** is equal to `inventory` - context actions for a selected ware in the player's inventory or spacesuit equipment.\n\n- `$ware` *(string)* - ware macro string of the selected item, e.g. `\"modpart_weaponchamber_t2\"`\n- `$name` *(string)* - localized display name of the ware, e.g. `\"Advanced Weapon Chamber\"`\n- `$amount` *(number)* - quantity of the ware currently held\n- `$price` *(number)* - unit price in credits (may be 0 or 1 for non-tradeable items)\n- `$selectedWares` *(array)* - list of ware macro strings currently selected (usually one element matching `$ware`)\n\nWhen **mode** is equal to **`personnel`** - context actions for a selected crew member, pilot, manager, or trader in the personnel list.\n\n**On pilots/managers/traders:**\n\n- `$type` *(string)* - `\"entity\"`\n- `$subMode` *(string)* - personnel sub-mode, e.g. `\"personnel_employee\"`\n- `$component` *(component)* - controllable (ship or station) as MD component reference\n- `$container` *(number)* - same UniverseID as `$component` (raw integer before MD resolution)\n- `$containername` *(string)* - display name of the ship or station\n- `$entity` *(component)* - the NPC as MD component reference\n- `$name` *(string)* - NPC display name\n- `$roleid` *(string)* - role identifier, e.g. `\"manager\"`, `\"aipilot\"`, `\"shiptrader\"`\n- `$rolename` *(string)* - localised role display name, e.g. `\"Manager\"`, `\"Captain\"`, `\"Ship trader\"`\n- `$combinedskill` *(number)* - combined skill value (0–100)\n- `$skill` *(number)* - filtered/sorted skill value (same as `$combinedskill` when no role filter is active)\n\n**On crew members and other personnel:**\n\n- `$type` *(string)* - `\"person\"`\n- `$subMode` *(string)* - personnel sub-mode, e.g. `\"personnel_employee\"`\n- `$component` *(component)* - controllable (ship or station) as MD component reference\n- `$container` *(number)* - same UniverseID as `$component` (raw integer before MD resolution)\n- `$containername` *(string)* - display name of the ship or station\n- `$person` *(npctemplateentry)* - crew NPC resolved from NPCSeed; access `.name`, `.role.name`, etc.\n- `$name` *(string)* - NPC display name\n- `$roleid` *(string)* - role identifier, e.g. `\"service\"`, `\"marine\"`, `\"unassigned\"`\n- `$rolename` *(string)* - localised role display name, e.g. `\"Service crew\"`\n- `$combinedskill` *(number)* - combined skill value (0–100)\n- `$skill` *(number)* - filtered/sorted skill value (same as `$combinedskill` when no role filter is active)\n\nWhen **mode** is equal to **`transactionlog`** - context actions for a selected transaction log entry.\n\n- `$entryid` *(number)* - unique ID of the log entry\n- `$eventtype` *(string)* - internal event type, e.g. `\"orderqueue_add\"`, `\"orderqueue_remove\"`\n- `$eventtypename` *(string)* - localised event type name, e.g. `\"Trade Order\"`, `\"Profit from Trade Orders\"`\n- `$active` *(number)* - `1` if the entry is currently active\n- `$complete` *(number)* - `1` if the transaction is complete, `0` if still pending\n- `$money` *(number)* - money change for this entry in credits (negative = paid, positive = received)\n- `$amount` *(number)* - ware quantity involved; `0` for non-ware events\n- `$price` *(number)* - unit price in Cr; `0` for non-ware events\n- `$ware` *(string)* - ware id string, e.g. `\"siliconcarbide\"`; empty string for non-ware events\n- `$description` *(string)* - human-readable summary of the transaction; empty for completed entries\n- `$partner` *(component or null)* - trading partner as MD component reference\n- `$partnername` *(string)* - display name of the trading partner\n- `$contextObject` *(component or null)* - context object as MD component reference (often same as `$partner`)\n- `$contextObjectName` *(string)* - display name of the context object\n- `$buyer` *(component or null)* - buyer component; may be null when not applicable\n- `$seller` *(component or null)* - seller component; may be null when not applicable\n- `$tradeentry` *(number)* - trade entry reference ID; `0` if none\n- `$tradeentrytype` *(string)* - trade entry type string, e.g. `\"trade\"`; empty if none\n- `$tradeentrytypename` *(string)* - localised trade entry type name, e.g. `\"Trade Payment\"`, `\"Unknown\"`\n- `$destroyedpartner` *(number)* - `1` if the partner was destroyed during the trade\n- `$time` *(number)* - game time (seconds) when the entry was recorded\n\n### Excluded modes\n\nThese modes currently does not supported by the API. Mostly because they are complex windows with a lot of UI elements, i.e. they are a far beyond the scope of a simple context menu.\nIt's support can be added in the future if there's demand, but for now they are listed here for reference.\nNo `Get_Actions` event is fired for these modes; the API passes through transparently and does not interfere with them.\n\n#### MapMenu excluded modes\n\nThese modes are not in the whitelist. No `Get_Actions` event is fired; the API passes through transparently. They are documented here for reference.\n\n- **`neworder`** - order selection list when assigning a new order to a ship (1-column).\n\n  possible additional fields: `$instance` (string, which panel side)\n\n- **`set_orderparam_formationshape`** - formation shape picker for an order parameter (1-column).\n\n  possible additional fields: `$index` (number, parameter index), `$instance` (string)\n\n- **`searchfield`** - search input overlay (1-column). No meaningful data fields.\n\n- **`select`** - generic single-component selection picker (1-column).\n\n  possible additional fields: `$component` (string, UniverseID of the pre-selected component)\n\n- **`set_orderparam_sector`** - sector picker for an order parameter (3-column table).\n\n  possible additional fields: `$index` (number, parameter index in the order), `$instance` (string)\n\n- **`set_orderparam_ware`** - ware picker for an order parameter (3-column table).\n\n  possible additional fields: `$index` (number, parameter index), `$instance` (string)\n\n- **`orderqueuesetting`** - order queue settings panel (2-column table). No meaningful data fields.\n\n- **`filter_multiselectlist`** - multi-select filter picker inside the order queue (3-column table).\n\n  possible additional fields: `$id` (string, filter setting ID), `$value` (any scalar, current value)\n\n- **`trade`** - direct trade dialog between ship and station (9-column table).\n\n  possible additional fields: `$component` (string, station UniverseID), `$currentShip` (string, ship UniverseID), `$shadyOnly` (bool), `$wareexchange` (bool)\n\n- **`tradeloop`** - trade loop configuration (3-column table).\n\n  possible additional fields: `$component` (string, station UniverseID), `$currentShip` (string, ship UniverseID), `$loop` (string, loop type)\n\n- **`mission`** - mission briefing / accept context frame (3-column table).\n\n  possible additional fields: `$missionid` (string, uint64 mission ID), `$isoffer` (bool), `$name` (string), `$type` (string, main mission type), `$subtype` (string), `$threadtype` (string), `$difficulty` (number), `$rewardmoney` (number, credits × 100), `$rewardtext` (string), `$timeout` (number, seconds, -1 if none), `$abortable` (bool), `$onlinechapter` (string), `$onlineID` (string), `$groupID` (string)\n\n- **`sellships`** - sell ships dialog at a shipyard (2-column table).\n\n  possible additional fields: `$shipyard` (string, shipyard UniverseID)\n\n- **`dropwares`** - drop / jettison wares from a pilot's inventory (3-column table).\n\n  possible additional fields: `$mode` (string, sub-mode e.g. `\"inventory\"`), `$entity` (string, pilot UniverseID)\n\n- **`weaponconfig`** - weapon loadout configuration for a ship (2-column table).\n\n  possible additional fields: `$component` (string, ship UniverseID), `$orderidx` (number), `$usedefault` (bool), `$instance` (string)\n\n- **`boardingcontext`** - boarding operation targeting dialog (9-column table).\n\n  possible additional fields: `$target` (string, target UniverseID), `$boarders` (string, boarding ship UniverseID)\n\n- **`crewtransfer`** - crew transfer between two ships (11-column table).\n\n  possible additional fields: `$leftShip` (string, UniverseID), `$rightShip` (string, UniverseID)\n\n- **`hire`** - hire a crew member or captain (2-column table).\n\n  possible additional fields: `$hireObject` (string, UniverseID of the object being hired for)\n\n- **`rename`** - rename a ship, station, or fleet (2-column table).\n\n  possible additional fields: `$component` (string, UniverseID), `$fleetrename` (bool, true when renaming a fleet)\n\n- **`changelogo`** - change hull decal / logo on a ship or station (5-column table).\n\n  possible additional fields: `$component` (string, UniverseID)\n\n- **`userquestion`** - yes/no confirmation dialog; used for many different actions (5-7 columns depending on sub-mode). The `$mode` field indicates which question is being asked:\n- `$mode = \"discardplanneddefaultbehaviour\"` - discard planned order\n- `$mode = \"removeplot\"` - destroy build plot; also has `$station` (string, UniverseID)\n- `$mode = \"clearlogbook\"` - clear logbook entries; also has `$instance` (string)\n- `$mode = \"markashostile\"` - mark target as hostile; also has `$controllable` (string, UniverseID)\n- `$mode = \"removebuildstorage\"` - remove build storage; also has `$buildstorage` (string, UniverseID)\n- `$mode = \"fireindividual\"` - fire a specific crew member; also has `$controllable` (string), `$entity` (string), `$person` (string), `$instance` (string)\n- `$mode = \"fireall\"` - fire all crew; also has `$controllable` (string, UniverseID), `$instance` (string)\n\n- **`userquestion_multiverse`** - multiverse-specific yes/no confirmation. No meaningful data fields.\n\n\u003e **Note:** Venture and multiplayer modes (`onlinemode`, `onlinereward`, `ventureconfig`, `venturecreateparty`, `venturepatron`, `venturereport`, `ventureteammembercontext`, `venturecontactcontext`, `venturefriendlist`, `ventureoutcome`, `ventureshipselection`) are not accessible when the game is modded and are listed here for completeness only.\n\n### PlayerInfoMenu excluded modes\n\n- **`dropwares`** - drop / jettison wares from a pilot's inventory (3-column table via `Helper.createDropWaresContext`).\n\n\u003e **Note:** Venture modes (`venturecontactcontext`, `venturefriendlist`, `venturereport`) are not accessible when the game is modded.\n\n## Extension options\n\n**Options Menu \u003e Extension options \u003e Context Menu API**:\n\n- **Debug mode**: Controls log verbosity. Options: None (default), Debug, Trace. Use Debug or Trace only when troubleshooting - these write to the game log on every refresh.\n\n![Extension options](docs/images/extension_options.png)\n\n## Credits\n\n- **Author**: Chem O`Dun, on [Nexus Mods](https://next.nexusmods.com/profile/ChemODun/mods?gameId=2659) and [Steam Workshop](https://steamcommunity.com/id/chemodun/myworkshopfiles/?appid=392160)\n- *\"X4: Foundations\"* is a trademark of [Egosoft](https://www.egosoft.com).\n\n## Acknowledgements\n\n- [EGOSOFT](https://www.egosoft.com) - for the X series.\n- [kuertee](https://next.nexusmods.com/profile/kuertee?gameId=2659) - for the `UI Extensions and HUD` that makes this extension possible.\n- [SirNukes](https://next.nexusmods.com/profile/sirnukes?gameId=2659) - for the `Mod Support APIs` that power the UI hooks and options menu.\n\n## Changelog\n\n### [1.00] - 2026-05-14\n\n- **Added**\n  - Initial public version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchemodun%2Fx4-contextmenuapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchemodun%2Fx4-contextmenuapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchemodun%2Fx4-contextmenuapi/lists"}