Mission Editor – Generic Type Data
Editor sub-module for editing **mission-type-specific data** (`missionTypeData`). Provides a type selector dropdown, per-type custom editors, a raw JSON fallback editor, and a flowgraph variable synch
Editor sub-module for editing mission-type-specific data (missionTypeData). Provides a type selector dropdown, per-type custom editors, a raw JSON fallback editor, and a flowgraph variable synchronisation popup.
Overview
Manages the missionTypeData field for each mission. Loads a per-type editor (e.g. gameplay/missionTypes/<type>/editor.lua) when available, falling back to a generic JSON text editor. Also offers a helper popup that compares mission-editor fields with flowgraph variables.
Class Methods
| Method | Signature | Description |
|---|---|---|
C:init | (missionEditor) | Enumerates mission types, loads type editors. |
C:loadEditor | (missionType) | Requires the editor Lua for a type; creates a default editor if none found. |
C:setMission | (mission) | Forwards to the type editor's setContainer, runs checkContainer. |
C:fillGeneric | (mission) | Populates missionTypeData with default data from the type editor. |
C:changeMissionType | (newType, force) | Stores old data, switches type, restores cached data if available. |
C:openPopup | () | Opens the missionFGVariables ImGui popup. |
C:variablesHelperPopup | () | Draws a popup comparing FG variables with mission editor fields (missing / mismatch / correct / other). |
C:draw | () | Renders type dropdown, raw toggle, auto-fix button, and the type-specific or raw editor. |
C:drawTools | () | Renders per-type tool menus. |
C:drawViewsMenu | () | Renders per-type view menus. |
C:drawViews | () | Calls drawViews on each type editor. |
C:getCurrentEditorHelper | () → editor | Returns the editor helper for the current mission type. |
C:getMissionIssues | (m) → table | Runs checkContainer and optional calculateMissionIssues on the type editor. |
Flowgraph Variable Popup
The popup missionFGVariables categorises variables into:
| Category | Meaning |
|---|---|
| Missing | Present in mission editor but not in FG project |
| Mismatch | Exists in both but types differ |
| Found | Correct match |
| Other | Only in FG, not in mission editor |
Buttons allow batch-adding missing variables or fixing type mismatches.
Usage Example
local mtdTab = require('extensions/editor/missionEditor/genericTypeData')(missionEditorRef)
mtdTab:setMission(currentMission)
mtdTab:draw()
mtdTab:variablesHelperPopup()
-- Switching mission type
mtdTab:changeMissionType("race")See Also
- Mission Editor - Additional Attributes - Related reference
- Mission Editor - Career Setup - Related reference
- Mission Editor - Conditions - Related reference
- World Editor Guide - Guide
Mission Editor – General
Editor sub-module for editing the **name** and **description** of a mission inside the Mission Editor. Validates translation keys and renders translation-status icons.
Mission Editor – Issues
Editor sub-module that **aggregates and displays validation issues** across all missions. Provides a sortable, filterable table window and per-mission issue lists.