Script API & versions
Everything is in MF.SimpleVisual. Members listed as stable follow the versioning policy; others are experimental.
Stable API
Reloads data/SimpleVisual.json and re-applies it to the current scene.
Re-applies the layout (default — current scene).
Resolved layout: inheritance, theme, preset and player settings.
registerAction
handler(action, context); return false — "not executed". meta describes the action for the editor picker.
MF.SimpleVisual.registerAction("openQuests", (action, ctx) => {
SceneManager.push(Scene_Quests);
}, { label: { en: "Open quests", ru: "Открыть задания" }, group: "Plugins",
fields: [{ key: "tab", input: "string", label: "Tab" }] });
input: integer string number boolean json enum (+ options).Settings
Keys: theme windowOpacity fontSize hudPosition. get returns null when the key is not allowed by the parameters.
Hud
Without id — the whole HUD. Stored in the save file.
PresetIO
NW.js only. Throws with a readable message. Imported presets are upgraded like the file (deprecated properties renamed).
Deprecated
Keeps old names working. Warnings go through MF.Deprecation: once per id, event mf:deprecated, owner MF_SimpleVisual.
With fn — redirect to the new function; without — wraps the existing one.
Renames a file property on load. Scopes: root theme scene window element template sprite menuCommand command preset, "*" — all. Element rules also apply to hover / pressed / disabled. map(value, owner) converts the old value. If both names are present, the new one wins.
Old action type runs as the new one (map(action) may adjust fields).
Applies all rules in place. Called by the loader and PresetIO.
// Example: element property "label" renamed to "caption" in 0.9.0
Deprecated.renameProp("element", "label", "caption", { since: "0.9.0", removeIn: "1.0.0" });
// Console (once): SimpleVisual.json: element.label is deprecated since MF_SimpleVisual 0.9.0
// and will be removed in 1.0.0. Use "caption" instead. First use: SimpleVisual.json.scenes.Scene_Map.elements[2].
Experimental members experimental
Used by the editor; may change in a MINOR release (listed as "Experimental change"): LayoutStore WindowPatcher SceneHook ElementFactory ActionRegistry Template Sources Presets Compat Resolution BattleLayout MenuCommands Scene_Custom ListAdapter CommandAdapter SpritePatcher Parents ThemeManager Fonts Mouse States Sounds SelfTokens MapTokens Dyn PictureDraw, schema constants (*_PROPS, *_TYPES), sanitize, setEditing.
Versioning policy
Semver, same rules as MF_Core.
| Release | Allowed |
|---|---|
| PATCH | Bug fixes only |
| MINOR | New API, properties, actions, element types; deprecations; experimental changes |
| MAJOR | Removal of previously deprecated names only |
- Replace — the new name is added; the old one keeps working through
Deprecatedwith a one-time warning. - Announce — changelog entry under Deprecated with
since/removeIn. - Remove — only in the stated release. Everything deprecated in 0.x works at least until 1.0.0.
Covers the script API, action types, element types and file properties. Renamed properties are upgraded on load; saving in the editor writes the new names.
Data format: an incompatible structure change raises FORMAT_VERSION and adds a migration vN → vN+1 (MF.Migration, key "SimpleVisual"). A file of a newer format is loaded with a warning.
Deprecated now
| Old | New | Since | Remove in |
|---|---|---|---|
MF.UIEditor | MF.SimpleVisual | 0.1.0 | 1.0.0 |
$dataUILayouts | $dataSimpleVisual | 0.1.0 | 1.0.0 |
"layouts" (root) | "scenes" (v0 migration) | 0.1.0 | 1.0.0 |
Dependent plugins
/*:
* @base MF_SimpleVisual
* @orderAfter MF_SimpleVisual
* @help Requires: MF_SimpleVisual 0.8.0+ (written against 0.8.0)
*/
MF.Core.register("MF_MyPlugin", "1.0.0", { requires: { MF_Core: "1.1.0", MF_SimpleVisual: "0.8.0" } });
Use only the stable API — or pin the exact version if you rely on experimental members.
Error handling
| Situation | Behavior |
|---|---|
| File missing | Standard look |
| File broken | Standard look, console error; the editor refuses to overwrite without confirmation |
| Newer format | Loaded with a warning |
| Unknown / invalid property | Ignored, warned once |
| Expression error | Standard value, warning |
| Unknown action / failing action | Skipped, logged |
| Condition error | Element hidden, warned once |
| Deprecated name | Works, warned once |
Changelog
Full history with tags: CHANGELOG.md.