diff --git a/src/components/script/AddScriptEventMenu.tsx b/src/components/script/AddScriptEventMenu.tsx index a30e3d29e..40e312a60 100644 --- a/src/components/script/AddScriptEventMenu.tsx +++ b/src/components/script/AddScriptEventMenu.tsx @@ -33,9 +33,7 @@ import { useDebounce } from "ui/hooks/use-debounce"; import { ScriptEditorContext } from "./ScriptEditorContext"; import { defaultVariableForContext } from "shared/lib/scripts/context"; import { EVENT_TEXT } from "consts"; -import { - selectScriptEventDefsWithPresets, -} from "store/features/scriptEventDefs/scriptEventDefsState"; +import { selectScriptEventDefsWithPresets } from "store/features/scriptEventDefs/scriptEventDefsState"; import type { ScriptEventDef } from "lib/project/loadScriptEventHandlers"; import { useAppDispatch, useAppSelector } from "store/hooks"; import { mapScriptValueLeafNodes } from "shared/lib/scriptValue/helpers"; @@ -59,6 +57,8 @@ interface EventOption { value: string; group?: string; groupLabel?: string; + subGroup?: string; + subGroupLabel?: string; isFavorite: boolean; defaultArgs?: Record; event: ScriptEventDef; @@ -215,29 +215,23 @@ const instanciateScriptEvent = ( }; const eventToOption = - (favorites: string[]) => + (favorites: string[], group?: string) => (event: ScriptEventDef): EventOption => { const localisedKey = l10n(event.id as L10NKey); //.replace(/[^:*]*:[ ]*/g, ""); const name = localisedKey !== event.id ? localisedKey : event.name || event.id; - - let eventGroups: string[] = []; - if ("groups" in event) { - if (Array.isArray(event.groups)) { - eventGroups = event.groups; - } else if (typeof event.groups === "string") { - eventGroups = [event.groups]; - } - } - - const groupName = eventGroups.map((key) => l10n(key as L10NKey)).join(" "); - + const groupName = group ? l10n(group as L10NKey) : undefined; + const subGroup = + group && event.subGroups?.[group] + ? l10n(event.subGroups?.[group] as L10NKey) + : undefined; return { label: name, group: groupName, value: event.id, event, isFavorite: favorites.includes(event.id), + subGroup, }; }; @@ -456,6 +450,19 @@ const sortAlphabeticallyByLabel = ( return a.label < b.label ? -1 : 1; }; +const sortAlphabeticallyBySubGroupThenLabel = ( + a: { subGroup?: string; label: string }, + b: { subGroup?: string; label: string } +) => { + const aSubGroup = a.subGroup ?? ""; + const bSubGroup = b.subGroup ?? ""; + + if (aSubGroup === bSubGroup) { + return a.label.localeCompare(b.label); + } + return aSubGroup.localeCompare(bSubGroup); +}; + const notDeprecated = (a: { deprecated?: boolean }) => { return !a.deprecated; }; @@ -577,8 +584,14 @@ const AddScriptEventMenu = ({ .map((key: string) => ({ label: key === "" ? l10n("EVENT_GROUP_MISC") : l10n(key as L10NKey), options: (groupedEvents[key] || []) - .map(eventToOption(favoriteEvents)) - .sort(sortAlphabeticallyByLabel), + .map(eventToOption(favoriteEvents, key)) + .sort(sortAlphabeticallyBySubGroupThenLabel) + .map((item, index, array) => { + if (index === 0 || item.subGroup !== array[index - 1].subGroup) { + return { ...item, subGroupLabel: item.subGroup }; + } + return item; + }), })) .sort(sortAlphabeticallyByLabel) .map((option, optionIndex) => { @@ -924,36 +937,43 @@ const AddScriptEventMenu = ({ (options[renderCategoryIndex] as EventOptGroup)?.options && (options[renderCategoryIndex] as EventOptGroup).options.map( (childOption, childOptionIndex) => ( - setSelectedIndex(childOptionIndex)} - onClick={() => onSelectOption(childOptionIndex)} - title={childOption.event.description} - > - {childOption.label} - - + {childOption.subGroupLabel && ( + + {childOption.subGroupLabel} + + )} + setSelectedIndex(childOptionIndex)} + onClick={() => onSelectOption(childOptionIndex)} + title={childOption.event.description} > - - - + + + + ) )} diff --git a/src/lang/en.json b/src/lang/en.json index c915c33e4..0e0bd40ac 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -1105,7 +1105,15 @@ "EVENT_IF": "If", "EVENT_IF_LABEL": "If {condition}", "EVENT_IF_DESC": "Conditionally run part of the script if the specified value evaluates to true.", - + "EVENT_GROUP_MULTIPLAYER": "Multiplayer", + "EVENT_GROUP_MOVEMENT": "Movement", + "EVENT_GROUP_PROPERTIES": "Properties", + "EVENT_GROUP_DEVICE": "Device", + "EVENT_GROUP_VISIBILITY": "Visibility", + "EVENT_GROUP_SCRIPT": "Script", + "EVENT_GROUP_TILES": "Tiles", + "EVENT_GROUP_SCENE_STACK": "Scene Stack", + "// 10": "Menu -----------------------------------------------------", "MENU_FILE": "File", diff --git a/src/lib/events/eventActorActivate.js b/src/lib/events/eventActorActivate.js index 8e555bf86..a9e373ba5 100644 --- a/src/lib/events/eventActorActivate.js +++ b/src/lib/events/eventActorActivate.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_ACTIVATE"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_PROPERTIES", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_ACTIVATE_LABEL", { @@ -29,6 +32,7 @@ module.exports = { description: l10n("EVENT_ACTOR_ACTIVATE_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorCollisionsDisable.js b/src/lib/events/eventActorCollisionsDisable.js index 6aaa08beb..4f9a6e88b 100644 --- a/src/lib/events/eventActorCollisionsDisable.js +++ b/src/lib/events/eventActorCollisionsDisable.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_COLLISIONS_DISABLE"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_PROPERTIES", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_COLLISIONS_DISABLE_LABEL", { @@ -30,6 +33,7 @@ module.exports = { description: l10n("EVENT_ACTOR_COLLISIONS_DISABLE_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorCollisionsEnable.js b/src/lib/events/eventActorCollisionsEnable.js index 7ec22a675..ffd5a5d54 100644 --- a/src/lib/events/eventActorCollisionsEnable.js +++ b/src/lib/events/eventActorCollisionsEnable.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_COLLISIONS_ENABLE"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_PROPERTIES", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_COLLISIONS_ENABLE_LABEL", { @@ -30,6 +33,7 @@ module.exports = { description: l10n("EVENT_ACTOR_COLLISIONS_ENABLE_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorDeactivate.js b/src/lib/events/eventActorDeactivate.js index cbc9cbf60..91d792f88 100644 --- a/src/lib/events/eventActorDeactivate.js +++ b/src/lib/events/eventActorDeactivate.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_DEACTIVATE"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_PROPERTIES", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_DEACTIVATE_LABEL", { @@ -29,6 +32,7 @@ module.exports = { description: l10n("EVENT_ACTOR_DEACTIVATE_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorGetDirection.js b/src/lib/events/eventActorGetDirection.js index cb3471309..a22a0d9a5 100644 --- a/src/lib/events/eventActorGetDirection.js +++ b/src/lib/events/eventActorGetDirection.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_GET_DIRECTION"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_VARIABLES", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_GET_DIRECTION_LABEL", { @@ -38,6 +41,7 @@ module.exports = { description: l10n("EVENT_ACTOR_GET_DIRECTION_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorGetPosition.js b/src/lib/events/eventActorGetPosition.js index e7ff25d7f..779b6ede7 100644 --- a/src/lib/events/eventActorGetPosition.js +++ b/src/lib/events/eventActorGetPosition.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_GET_POSITION"; const groups = ["EVENT_GROUP_ACTOR", "EVENT_GROUP_VARIABLES"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_VARIABLES", +}; const autoLabel = (fetchArg, _input) => { return l10n("EVENT_ACTOR_GET_POSITION_LABEL", { @@ -59,6 +62,7 @@ module.exports = { description: l10n("EVENT_ACTOR_GET_POSITION_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorHide.js b/src/lib/events/eventActorHide.js index f9826e1f8..3f095f67a 100644 --- a/src/lib/events/eventActorHide.js +++ b/src/lib/events/eventActorHide.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_HIDE"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_VISIBILITY", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_HIDE_LABEL", { @@ -29,6 +32,7 @@ module.exports = { description: l10n("EVENT_ACTOR_HIDE_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorInvoke.js b/src/lib/events/eventActorInvoke.js index 8b5b30fbb..595ae7c13 100644 --- a/src/lib/events/eventActorInvoke.js +++ b/src/lib/events/eventActorInvoke.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_INVOKE"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_SCRIPT", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_INVOKE_LABEL", { @@ -28,6 +31,7 @@ module.exports = { id, autoLabel, groups, + subGroups, fields, compile, deprecated: true, diff --git a/src/lib/events/eventActorMoveCancel.js b/src/lib/events/eventActorMoveCancel.js index 1198ebcb0..1a7560197 100644 --- a/src/lib/events/eventActorMoveCancel.js +++ b/src/lib/events/eventActorMoveCancel.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_MOVE_CANCEL"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_MOVEMENT", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_MOVE_CANCEL_LABEL", { @@ -30,6 +33,7 @@ module.exports = { description: l10n("EVENT_ACTOR_MOVE_CANCEL_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorMoveRelative.js b/src/lib/events/eventActorMoveRelative.js index c7d51b14d..7e892c70c 100644 --- a/src/lib/events/eventActorMoveRelative.js +++ b/src/lib/events/eventActorMoveRelative.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_MOVE_RELATIVE"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_MOVEMENT", +}; const autoLabel = (fetchArg, input) => { const unitPostfix = @@ -89,6 +92,7 @@ module.exports = { description: l10n("EVENT_ACTOR_MOVE_RELATIVE_DESC"), autoLabel, groups, + subGroups, fields, compile, waitUntilAfterInitFade: true, diff --git a/src/lib/events/eventActorMoveTo.js b/src/lib/events/eventActorMoveTo.js index 21d2d965d..2b7b89e6d 100644 --- a/src/lib/events/eventActorMoveTo.js +++ b/src/lib/events/eventActorMoveTo.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_MOVE_TO"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_MOVEMENT", +}; const weight = 2; const autoLabel = (fetchArg, input) => { @@ -109,6 +112,7 @@ module.exports = { description: l10n("EVENT_ACTOR_MOVE_TO_DESC"), autoLabel, groups, + subGroups, weight, fields, compile, diff --git a/src/lib/events/eventActorPush.js b/src/lib/events/eventActorPush.js index 88f96c65b..f7f60ff40 100644 --- a/src/lib/events/eventActorPush.js +++ b/src/lib/events/eventActorPush.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_PUSH"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_MOVEMENT", +}; const fields = [ { @@ -25,6 +28,7 @@ module.exports = { id, description: l10n("EVENT_ACTOR_PUSH_DESC"), groups, + subGroups, fields, compile, waitUntilAfterInitFade: true, diff --git a/src/lib/events/eventActorSetAnimationSpeed.js b/src/lib/events/eventActorSetAnimationSpeed.js index 5e62e92ff..ae10cea6c 100644 --- a/src/lib/events/eventActorSetAnimationSpeed.js +++ b/src/lib/events/eventActorSetAnimationSpeed.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_SET_ANIMATION_SPEED"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_PROPERTIES", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_SET_ANIMATION_SPEED_LABEL", { @@ -38,6 +41,7 @@ module.exports = { description: l10n("EVENT_ACTOR_SET_ANIMATION_SPEED_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorSetDirection.js b/src/lib/events/eventActorSetDirection.js index d4900f94c..8e838007a 100644 --- a/src/lib/events/eventActorSetDirection.js +++ b/src/lib/events/eventActorSetDirection.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_SET_DIRECTION"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_PROPERTIES", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_SET_DIRECTION_LABEL", { @@ -40,6 +43,7 @@ module.exports = { description: l10n("EVENT_ACTOR_SET_DIRECTION_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorSetFrame.js b/src/lib/events/eventActorSetFrame.js index ad0b3163b..9c3dc8c81 100644 --- a/src/lib/events/eventActorSetFrame.js +++ b/src/lib/events/eventActorSetFrame.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_SET_FRAME"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_PROPERTIES", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_SET_FRAME_LABEL", { @@ -42,6 +45,7 @@ module.exports = { description: l10n("EVENT_ACTOR_SET_FRAME_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorSetMovementSpeed.js b/src/lib/events/eventActorSetMovementSpeed.js index 66ea362fa..f371b38fc 100644 --- a/src/lib/events/eventActorSetMovementSpeed.js +++ b/src/lib/events/eventActorSetMovementSpeed.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_SET_MOVEMENT_SPEED"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_PROPERTIES", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_SET_MOVEMENT_SPEED_LABEL", { @@ -38,6 +41,7 @@ module.exports = { description: l10n("EVENT_ACTOR_SET_MOVEMENT_SPEED_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorSetPosition.js b/src/lib/events/eventActorSetPosition.js index 864aab2f9..582e99b77 100644 --- a/src/lib/events/eventActorSetPosition.js +++ b/src/lib/events/eventActorSetPosition.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_SET_POSITION"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_MOVEMENT", +}; const autoLabel = (fetchArg, input) => { const unitPostfix = @@ -78,6 +81,7 @@ module.exports = { description: l10n("EVENT_ACTOR_SET_POSITION_DESC"), autoLabel, groups, + subGroups, fields, compile, helper: { diff --git a/src/lib/events/eventActorSetPositionRelative.js b/src/lib/events/eventActorSetPositionRelative.js index 459ee4d05..7a8ac5345 100644 --- a/src/lib/events/eventActorSetPositionRelative.js +++ b/src/lib/events/eventActorSetPositionRelative.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_SET_POSITION_RELATIVE"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_MOVEMENT", +}; const autoLabel = (fetchArg, input) => { const unitPostfix = @@ -65,6 +68,7 @@ module.exports = { description: l10n("EVENT_ACTOR_SET_POSITION_RELATIVE_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorSetSprite.js b/src/lib/events/eventActorSetSprite.js index 84bbeeb1a..90f71e632 100644 --- a/src/lib/events/eventActorSetSprite.js +++ b/src/lib/events/eventActorSetSprite.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_SET_SPRITE"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_PROPERTIES", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_SET_SPRITE_LABEL", { @@ -38,6 +41,7 @@ module.exports = { description: l10n("EVENT_ACTOR_SET_SPRITE_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorSetState.js b/src/lib/events/eventActorSetState.js index 180f588c7..9e510a9ed 100644 --- a/src/lib/events/eventActorSetState.js +++ b/src/lib/events/eventActorSetState.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_SET_STATE"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_PROPERTIES", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_SET_STATE_LABEL", { @@ -45,9 +48,9 @@ const compile = (input, helpers) => { module.exports = { id, description: l10n("EVENT_ACTOR_SET_STATE_DESC"), - autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorShow.js b/src/lib/events/eventActorShow.js index d93e2476a..09691dd9b 100644 --- a/src/lib/events/eventActorShow.js +++ b/src/lib/events/eventActorShow.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_SHOW"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_VISIBILITY", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_SHOW_LABEL", { @@ -29,6 +32,7 @@ module.exports = { description: l10n("EVENT_ACTOR_SHOW_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorStartUpdateScript.js b/src/lib/events/eventActorStartUpdateScript.js index 22aa3052a..57fc373b7 100644 --- a/src/lib/events/eventActorStartUpdateScript.js +++ b/src/lib/events/eventActorStartUpdateScript.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_START_UPDATE"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_SCRIPT", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_START_UPDATE_LABEL", { @@ -30,6 +33,7 @@ module.exports = { description: l10n("EVENT_ACTOR_START_UPDATE_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventActorStopUpdateScript.js b/src/lib/events/eventActorStopUpdateScript.js index 61a7b18ce..18ad6f0eb 100644 --- a/src/lib/events/eventActorStopUpdateScript.js +++ b/src/lib/events/eventActorStopUpdateScript.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_ACTOR_STOP_UPDATE"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_SCRIPT", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_ACTOR_STOP_UPDATE_LABEL", { @@ -30,6 +33,7 @@ module.exports = { description: l10n("EVENT_ACTOR_STOP_UPDATE_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventDataPeek.js b/src/lib/events/eventDataPeek.js index 543898bb1..0029f621a 100644 --- a/src/lib/events/eventDataPeek.js +++ b/src/lib/events/eventDataPeek.js @@ -2,6 +2,10 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_PEEK_DATA"; const groups = ["EVENT_GROUP_SAVE_DATA", "EVENT_GROUP_VARIABLES"]; +const subGroups = { + "EVENT_GROUP_SAVE_DATA": "EVENT_GROUP_VARIABLES", + "EVENT_GROUP_VARIABLES": "EVENT_GROUP_SAVE_DATA" +} const fields = [ { @@ -59,6 +63,7 @@ module.exports = { id, description: l10n("EVENT_PEEK_DATA_DESC"), groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventFadeIn.js b/src/lib/events/eventFadeIn.js index 41efc62be..a445f8763 100644 --- a/src/lib/events/eventFadeIn.js +++ b/src/lib/events/eventFadeIn.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_FADE_IN"; const groups = ["EVENT_GROUP_SCREEN", "EVENT_GROUP_CAMERA"]; +const subGroups = { + "EVENT_GROUP_CAMERA": "EVENT_GROUP_SCREEN" +} const fields = [ { @@ -23,6 +26,7 @@ module.exports = { id, description: l10n("EVENT_FADE_IN_DESC"), groups, + subGroups, fields, compile, waitUntilAfterInitFade: true, diff --git a/src/lib/events/eventFadeOut.js b/src/lib/events/eventFadeOut.js index 6f410e08c..8204a2bbe 100644 --- a/src/lib/events/eventFadeOut.js +++ b/src/lib/events/eventFadeOut.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_FADE_OUT"; const groups = ["EVENT_GROUP_SCREEN", "EVENT_GROUP_CAMERA"]; +const subGroups = { + "EVENT_GROUP_CAMERA": "EVENT_GROUP_SCREEN" +} const fields = [ { @@ -22,6 +25,7 @@ module.exports = { id, description: l10n("EVENT_FADE_OUT_DESC"), groups, + subGroups, fields, compile, waitUntilAfterInitFade: true, diff --git a/src/lib/events/eventIf.js b/src/lib/events/eventIf.js index 4da6b12b2..b0fa80f12 100644 --- a/src/lib/events/eventIf.js +++ b/src/lib/events/eventIf.js @@ -82,6 +82,9 @@ module.exports = { id: "EVENT_IF_TRUE", name: l10n("EVENT_IF_TRUE"), description: l10n("EVENT_IF_TRUE_DESC"), + subGroups: { + EVENT_GROUP_CONTROL_FLOW: "EVENT_GROUP_VARIABLES", + }, values: { condition: { type: "variable", @@ -93,6 +96,9 @@ module.exports = { id: "EVENT_IF_FALSE", name: l10n("EVENT_IF_FALSE"), description: l10n("EVENT_IF_FALSE_DESC"), + subGroups: { + EVENT_GROUP_CONTROL_FLOW: "EVENT_GROUP_VARIABLES", + }, values: { condition: { type: "eq", @@ -111,6 +117,10 @@ module.exports = { name: l10n("EVENT_IF_EXPRESSION"), description: l10n("EVENT_IF_EXPRESSION_DESC"), groups: ["EVENT_GROUP_MATH", "EVENT_GROUP_CONTROL_FLOW"], + subGroups: { + EVENT_GROUP_MATH: "EVENT_GROUP_CONTROL_FLOW", + EVENT_GROUP_CONTROL_FLOW: "EVENT_GROUP_MATH", + }, values: { condition: { type: "expression", @@ -118,5 +128,51 @@ module.exports = { }, }, }, + { + id: "EVENT_IF_VALUE", + name: l10n("EVENT_IF_VALUE"), + description: l10n("EVENT_IF_VALUE_DESC"), + groups: ["EVENT_GROUP_VARIABLES", "EVENT_GROUP_CONTROL_FLOW"], + subGroups: { + EVENT_GROUP_VARIABLES: "EVENT_GROUP_CONTROL_FLOW", + EVENT_GROUP_CONTROL_FLOW: "EVENT_GROUP_VARIABLES", + }, + values: { + condition: { + type: "eq", + valueA: { + type: "variable", + value: "LAST_VARIABLE", + }, + valueB: { + type: "number", + value: 0, + }, + }, + }, + }, + { + id: "EVENT_IF_VALUE_COMPARE", + name: l10n("EVENT_IF_VALUE_COMPARE"), + description: l10n("EVENT_IF_VALUE_COMPARE_DESC"), + groups: ["EVENT_GROUP_VARIABLES", "EVENT_GROUP_CONTROL_FLOW"], + subGroups: { + EVENT_GROUP_VARIABLES: "EVENT_GROUP_CONTROL_FLOW", + EVENT_GROUP_CONTROL_FLOW: "EVENT_GROUP_VARIABLES", + }, + values: { + condition: { + type: "eq", + valueA: { + type: "variable", + value: "LAST_VARIABLE", + }, + valueB: { + type: "variable", + value: "LAST_VARIABLE", + }, + }, + }, + }, ], }; diff --git a/src/lib/events/eventIfActorAtPosition.js b/src/lib/events/eventIfActorAtPosition.js index acce3e614..93396c889 100644 --- a/src/lib/events/eventIfActorAtPosition.js +++ b/src/lib/events/eventIfActorAtPosition.js @@ -2,6 +2,10 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_IF_ACTOR_AT_POSITION"; const groups = ["EVENT_GROUP_CONTROL_FLOW", "EVENT_GROUP_ACTOR"]; +const subGroups = { + "EVENT_GROUP_ACTOR": "EVENT_GROUP_CONTROL_FLOW", + "EVENT_GROUP_CONTROL_FLOW": "EVENT_GROUP_ACTOR" +} const autoLabel = (fetchArg, input) => { const unitPostfix = @@ -101,6 +105,7 @@ module.exports = { description: l10n("EVENT_IF_ACTOR_AT_POSITION_DESC"), autoLabel, groups, + subGroups, fields, compile, helper: { diff --git a/src/lib/events/eventIfActorDirection.js b/src/lib/events/eventIfActorDirection.js index bdb262d9f..e2f4f8207 100644 --- a/src/lib/events/eventIfActorDirection.js +++ b/src/lib/events/eventIfActorDirection.js @@ -2,6 +2,10 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_IF_ACTOR_DIRECTION"; const groups = ["EVENT_GROUP_CONTROL_FLOW", "EVENT_GROUP_ACTOR"]; +const subGroups = { + "EVENT_GROUP_ACTOR": "EVENT_GROUP_CONTROL_FLOW", + "EVENT_GROUP_CONTROL_FLOW": "EVENT_GROUP_ACTOR" +} const autoLabel = (fetchArg) => { return l10n("EVENT_IF_ACTOR_DIRECTION_LABEL", { @@ -74,6 +78,7 @@ module.exports = { description: l10n("EVENT_IF_ACTOR_DIRECTION_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventIfActorDistanceFromActor.js b/src/lib/events/eventIfActorDistanceFromActor.js index c25e9ca54..ee95ee8ea 100644 --- a/src/lib/events/eventIfActorDistanceFromActor.js +++ b/src/lib/events/eventIfActorDistanceFromActor.js @@ -2,6 +2,10 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_IF_ACTOR_DISTANCE_FROM_ACTOR"; const groups = ["EVENT_GROUP_CONTROL_FLOW", "EVENT_GROUP_ACTOR"]; +const subGroups = { + "EVENT_GROUP_ACTOR": "EVENT_GROUP_CONTROL_FLOW", + "EVENT_GROUP_CONTROL_FLOW": "EVENT_GROUP_ACTOR" +} const autoLabel = (fetchArg) => { const distance = fetchArg("distance"); @@ -126,6 +130,7 @@ module.exports = { description: l10n("EVENT_IF_ACTOR_DISTANCE_FROM_ACTOR_DESC"), autoLabel, groups, + subGroups, fields, compile, helper: { diff --git a/src/lib/events/eventIfActorRelativeToActor.js b/src/lib/events/eventIfActorRelativeToActor.js index e13e1aa5c..e8bd28a95 100644 --- a/src/lib/events/eventIfActorRelativeToActor.js +++ b/src/lib/events/eventIfActorRelativeToActor.js @@ -2,6 +2,10 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_IF_ACTOR_RELATIVE_TO_ACTOR"; const groups = ["EVENT_GROUP_CONTROL_FLOW", "EVENT_GROUP_ACTOR"]; +const subGroups = { + "EVENT_GROUP_ACTOR": "EVENT_GROUP_CONTROL_FLOW", + "EVENT_GROUP_CONTROL_FLOW": "EVENT_GROUP_ACTOR" +} const autoLabel = (fetchArg) => { const dir = fetchArg("operation"); @@ -103,6 +107,7 @@ module.exports = { description: l10n("EVENT_IF_ACTOR_RELATIVE_TO_ACTOR_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventIfColorSupported.js b/src/lib/events/eventIfColorSupported.js index fa1209867..21801913e 100644 --- a/src/lib/events/eventIfColorSupported.js +++ b/src/lib/events/eventIfColorSupported.js @@ -2,6 +2,10 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_IF_COLOR_SUPPORTED"; const groups = ["EVENT_GROUP_CONTROL_FLOW", "EVENT_GROUP_COLOR"]; +const subGroups = { + EVENT_GROUP_CONTROL_FLOW: "EVENT_GROUP_DEVICE", + EVENT_GROUP_COLOR: "EVENT_GROUP_CONTROL_FLOW", +}; const fields = [ { @@ -51,6 +55,7 @@ module.exports = { id, description: l10n("EVENT_IF_COLOR_SUPPORTED_DESC"), groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventIfCurrentSceneIs.js b/src/lib/events/eventIfCurrentSceneIs.js index 6fb38e78c..b63765578 100644 --- a/src/lib/events/eventIfCurrentSceneIs.js +++ b/src/lib/events/eventIfCurrentSceneIs.js @@ -2,6 +2,10 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_IF_CURRENT_SCENE_IS"; const groups = ["EVENT_GROUP_CONTROL_FLOW", "EVENT_GROUP_SCENE"]; +const subGroups = { + EVENT_GROUP_CONTROL_FLOW: "EVENT_GROUP_SCENE", + EVENT_GROUP_SCENE: "EVENT_GROUP_CONTROL_FLOW", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_IF_CURRENT_SCENE_IS_LABEL", { @@ -61,6 +65,7 @@ module.exports = { id, autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventIfDataSaved.js b/src/lib/events/eventIfDataSaved.js index f35444041..c94956163 100644 --- a/src/lib/events/eventIfDataSaved.js +++ b/src/lib/events/eventIfDataSaved.js @@ -2,7 +2,10 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_IF_SAVED_DATA"; const groups = ["EVENT_GROUP_SAVE_DATA", "EVENT_GROUP_CONTROL_FLOW"]; - +const subGroups = { + "EVENT_GROUP_SAVE_DATA": "EVENT_GROUP_CONTROL_FLOW", + "EVENT_GROUP_CONTROL_FLOW": "EVENT_GROUP_SAVE_DATA" +} const fields = [ { key: "saveSlot", @@ -79,6 +82,7 @@ module.exports = { id, description: l10n("EVENT_IF_SAVED_DATA_DESC"), groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventIfDeviceGBA.js b/src/lib/events/eventIfDeviceGBA.js index 60a1122b5..23e2450d9 100644 --- a/src/lib/events/eventIfDeviceGBA.js +++ b/src/lib/events/eventIfDeviceGBA.js @@ -2,6 +2,10 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_IF_DEVICE_GBA"; const groups = ["EVENT_GROUP_CONTROL_FLOW", "EVENT_GROUP_COLOR"]; +const subGroups = { + EVENT_GROUP_CONTROL_FLOW: "EVENT_GROUP_DEVICE", + EVENT_GROUP_COLOR: "EVENT_GROUP_CONTROL_FLOW", +}; const fields = [ { @@ -51,6 +55,7 @@ module.exports = { id, description: l10n("EVENT_IF_DEVICE_GBA_DESC"), groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventIfDeviceSGB.js b/src/lib/events/eventIfDeviceSGB.js index b4bfe4d03..35ba711b0 100644 --- a/src/lib/events/eventIfDeviceSGB.js +++ b/src/lib/events/eventIfDeviceSGB.js @@ -2,6 +2,10 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_IF_DEVICE_SGB"; const groups = ["EVENT_GROUP_CONTROL_FLOW", "EVENT_GROUP_COLOR"]; +const subGroups = { + EVENT_GROUP_CONTROL_FLOW: "EVENT_GROUP_DEVICE", + EVENT_GROUP_COLOR: "EVENT_GROUP_CONTROL_FLOW", +}; const fields = [ { @@ -51,6 +55,7 @@ module.exports = { id, description: l10n("EVENT_IF_DEVICE_SGB_DESC"), groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventIfInput.js b/src/lib/events/eventIfInput.js index 75a1af3cc..3d5cf0ee4 100644 --- a/src/lib/events/eventIfInput.js +++ b/src/lib/events/eventIfInput.js @@ -2,6 +2,10 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_IF_INPUT"; const groups = ["EVENT_GROUP_INPUT", "EVENT_GROUP_CONTROL_FLOW"]; +const subGroups = { + EVENT_GROUP_INPUT: "EVENT_GROUP_CONTROL_FLOW", + EVENT_GROUP_CONTROL_FLOW: "EVENT_GROUP_INPUT", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_IF_INPUT_LABEL", { @@ -66,6 +70,7 @@ module.exports = { references: ["/docs/scripting/script-glossary/input#attach-script-to-button"], autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventIfVariableCompare.js b/src/lib/events/eventIfVariableCompare.js index 4ca32e67b..30ef4ab82 100644 --- a/src/lib/events/eventIfVariableCompare.js +++ b/src/lib/events/eventIfVariableCompare.js @@ -100,4 +100,5 @@ module.exports = { groups, fields, compile, + deprecated: true, }; diff --git a/src/lib/events/eventIfVariableFlagsCompare.js b/src/lib/events/eventIfVariableFlagsCompare.js index 62729775f..4e9883484 100644 --- a/src/lib/events/eventIfVariableFlagsCompare.js +++ b/src/lib/events/eventIfVariableFlagsCompare.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_IF_FLAGS_COMPARE"; const groups = ["EVENT_GROUP_CONTROL_FLOW"]; +const subGroups = { + "EVENT_GROUP_CONTROL_FLOW": "EVENT_GROUP_VARIABLES" +}; const autoLabel = (fetchArg) => { return l10n("EVENT_IF_FLAGS_COMPARE_LABEL", { @@ -108,6 +111,7 @@ module.exports = { description: l10n("EVENT_IF_FLAGS_COMPARE_DESC"), autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventIfVariableValue.js b/src/lib/events/eventIfVariableValue.js index e49afa4e2..4fe91ce33 100644 --- a/src/lib/events/eventIfVariableValue.js +++ b/src/lib/events/eventIfVariableValue.js @@ -103,4 +103,5 @@ module.exports = { groups, fields, compile, + deprecated: true, }; diff --git a/src/lib/events/eventLinkClose.js b/src/lib/events/eventLinkClose.js index 45bd0d5e9..62d43797c 100644 --- a/src/lib/events/eventLinkClose.js +++ b/src/lib/events/eventLinkClose.js @@ -1,6 +1,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_LINK_CLOSE"; +const subGroups = { + "EVENT_GROUP_MISC": "EVENT_GROUP_MULTIPLAYER", +} const fields = [ { @@ -15,6 +18,7 @@ const compile = (input, helpers) => { module.exports = { id, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventLinkJoin.js b/src/lib/events/eventLinkJoin.js index a95445e9e..db2dcb583 100644 --- a/src/lib/events/eventLinkJoin.js +++ b/src/lib/events/eventLinkJoin.js @@ -1,6 +1,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_LINK_JOIN"; +const subGroups = { + "EVENT_GROUP_MISC": "EVENT_GROUP_MULTIPLAYER", +} const fields = [ { @@ -16,5 +19,6 @@ const compile = (input, helpers) => { module.exports = { id, fields, + subGroups, compile, }; diff --git a/src/lib/events/eventLinkStart.js b/src/lib/events/eventLinkStart.js index f802609d2..99a472617 100644 --- a/src/lib/events/eventLinkStart.js +++ b/src/lib/events/eventLinkStart.js @@ -1,6 +1,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_LINK_HOST"; +const subGroups = { + "EVENT_GROUP_MISC": "EVENT_GROUP_MULTIPLAYER", +} const fields = [ { @@ -15,6 +18,7 @@ const compile = (input, helpers) => { module.exports = { id, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventLinkTransfer.js b/src/lib/events/eventLinkTransfer.js index ee33c0a39..bd2ae3c08 100644 --- a/src/lib/events/eventLinkTransfer.js +++ b/src/lib/events/eventLinkTransfer.js @@ -1,6 +1,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_LINK_TRANSFER"; +const subGroups = { + "EVENT_GROUP_MISC": "EVENT_GROUP_MULTIPLAYER", +} const fields = [ { @@ -30,6 +33,7 @@ const compile = (input, helpers) => { module.exports = { id, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventMusicRoutine.js b/src/lib/events/eventMusicRoutine.js index e58ae94a6..fff7d3599 100644 --- a/src/lib/events/eventMusicRoutine.js +++ b/src/lib/events/eventMusicRoutine.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_SET_MUSIC_ROUTINE"; const groups = ["EVENT_GROUP_MUSIC"]; +const subGroups = { + EVENT_GROUP_MUSIC: "EVENT_GROUP_SCRIPT", +}; const fields = [ { @@ -46,6 +49,7 @@ module.exports = { description: l10n("EVENT_SET_MUSIC_ROUTINE_DESC"), references: ["/docs/assets/music/music-huge#effects"], groups, + subGroups, fields, compile, editableSymbol: true, diff --git a/src/lib/events/eventPlayerBounce.js b/src/lib/events/eventPlayerBounce.js index 51a02d0f3..18e779488 100644 --- a/src/lib/events/eventPlayerBounce.js +++ b/src/lib/events/eventPlayerBounce.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_PLAYER_BOUNCE"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "GAMETYPE_PLATFORMER", +}; const fields = [ { @@ -30,6 +33,7 @@ module.exports = { id, description: l10n("EVENT_PLAYER_BOUNCE_DESC"), groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventPlayerSetSprite.js b/src/lib/events/eventPlayerSetSprite.js index 329b2a2d3..1756cca74 100644 --- a/src/lib/events/eventPlayerSetSprite.js +++ b/src/lib/events/eventPlayerSetSprite.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_PLAYER_SET_SPRITE"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_PROPERTIES", +}; const fields = [ { @@ -29,6 +32,7 @@ module.exports = { id, description: l10n("EVENT_PLAYER_SET_SPRITE_DESC"), groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventReplaceTileXY.js b/src/lib/events/eventReplaceTileXY.js index 1d7b460a6..0a5121687 100644 --- a/src/lib/events/eventReplaceTileXY.js +++ b/src/lib/events/eventReplaceTileXY.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_REPLACE_TILE_XY"; const groups = ["EVENT_GROUP_SCENE"]; +const subGroups = { + EVENT_GROUP_SCENE: "EVENT_GROUP_TILES", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_REPLACE_TILE_XY_LABEL", { @@ -80,6 +83,7 @@ module.exports = { description: l10n("EVENT_REPLACE_TILE_XY_DESC"), autoLabel, groups, + subGroups, fields, compile, helper: { diff --git a/src/lib/events/eventReplaceTileXYSequence.js b/src/lib/events/eventReplaceTileXYSequence.js index 43ea9c572..c07466ac2 100644 --- a/src/lib/events/eventReplaceTileXYSequence.js +++ b/src/lib/events/eventReplaceTileXYSequence.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_REPLACE_TILE_XY_SEQUENCE"; const groups = ["EVENT_GROUP_SCENE"]; +const subGroups = { + EVENT_GROUP_SCENE: "EVENT_GROUP_TILES", +}; const autoLabel = (fetchArg) => { return l10n("EVENT_REPLACE_TILE_XY_SEQUENCE_LABEL", { @@ -168,6 +171,7 @@ module.exports = { description: l10n("EVENT_REPLACE_TILE_XY_SEQUENCE_DESC"), autoLabel, groups, + subGroups, fields, compile, helper: { diff --git a/src/lib/events/eventScenePopAllState.js b/src/lib/events/eventScenePopAllState.js index e1c243f49..c6eb2cb73 100644 --- a/src/lib/events/eventScenePopAllState.js +++ b/src/lib/events/eventScenePopAllState.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_SCENE_POP_ALL_STATE"; const groups = ["EVENT_GROUP_SCENE"]; +const subGroups = { + EVENT_GROUP_SCENE: "EVENT_GROUP_SCENE_STACK", +}; const fields = [ { @@ -30,6 +33,7 @@ module.exports = { id, description: l10n("EVENT_SCENE_POP_ALL_STATE_DESC"), groups, + subGroups, fields, compile, waitUntilAfterInitFade: true, diff --git a/src/lib/events/eventScenePopState.js b/src/lib/events/eventScenePopState.js index e3af37b51..028f38335 100644 --- a/src/lib/events/eventScenePopState.js +++ b/src/lib/events/eventScenePopState.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_SCENE_POP_STATE"; const groups = ["EVENT_GROUP_SCENE"]; +const subGroups = { + EVENT_GROUP_SCENE: "EVENT_GROUP_SCENE_STACK", +}; const fields = [ { @@ -30,6 +33,7 @@ module.exports = { id, description: l10n("EVENT_SCENE_POP_STATE_DESC"), groups, + subGroups, fields, compile, waitUntilAfterInitFade: true, diff --git a/src/lib/events/eventScenePushState.js b/src/lib/events/eventScenePushState.js index 1b455fd02..1bfd381db 100644 --- a/src/lib/events/eventScenePushState.js +++ b/src/lib/events/eventScenePushState.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_SCENE_PUSH_STATE"; const groups = ["EVENT_GROUP_SCENE"]; +const subGroups = { + EVENT_GROUP_SCENE: "EVENT_GROUP_SCENE_STACK", +}; const fields = [ { @@ -18,6 +21,7 @@ module.exports = { id, description: l10n("EVENT_SCENE_PUSH_STATE_DESC"), groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventSceneResetState.js b/src/lib/events/eventSceneResetState.js index 169324dea..0fe68fb34 100644 --- a/src/lib/events/eventSceneResetState.js +++ b/src/lib/events/eventSceneResetState.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_SCENE_RESET_STATE"; const groups = ["EVENT_GROUP_SCENE"]; +const subGroups = { + EVENT_GROUP_SCENE: "EVENT_GROUP_SCENE_STACK", +}; const fields = [ { @@ -18,6 +21,7 @@ module.exports = { id, description: l10n("EVENT_SCENE_RESET_STATE_DESC"), groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventSpritesHide.js b/src/lib/events/eventSpritesHide.js index 06e9c50fd..c51a5ae6a 100644 --- a/src/lib/events/eventSpritesHide.js +++ b/src/lib/events/eventSpritesHide.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_HIDE_SPRITES"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + "EVENT_GROUP_ACTOR": "EVENT_GROUP_VISIBILITY" +} const fields = [ { @@ -18,6 +21,7 @@ module.exports = { id, description: l10n("EVENT_HIDE_SPRITES_DESC"), groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventSpritesShow.js b/src/lib/events/eventSpritesShow.js index 721a53d2e..e61b8e022 100644 --- a/src/lib/events/eventSpritesShow.js +++ b/src/lib/events/eventSpritesShow.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_SHOW_SPRITES"; const groups = ["EVENT_GROUP_ACTOR"]; +const subGroups = { + EVENT_GROUP_ACTOR: "EVENT_GROUP_VISIBILITY", +}; const fields = [ { @@ -18,6 +21,7 @@ module.exports = { id, description: l10n("EVENT_SHOW_SPRITES_DESC"), groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventTextSetAnimationSpeed.js b/src/lib/events/eventTextSetAnimationSpeed.js index 50c0abea8..ab8447d3f 100644 --- a/src/lib/events/eventTextSetAnimationSpeed.js +++ b/src/lib/events/eventTextSetAnimationSpeed.js @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_TEXT_SET_ANIMATION_SPEED"; const groups = ["EVENT_GROUP_DIALOGUE"]; +const subGroups = { + "EVENT_GROUP_DIALOGUE": "EVENT_GROUP_PROPERTIES" +} const fields = [ { @@ -47,6 +50,7 @@ module.exports = { id, description: l10n("EVENT_TEXT_SET_ANIMATION_SPEED_DESC"), groups, + subGroups, fields, compile, }; diff --git a/src/lib/events/eventVariableMathEvaluate.js b/src/lib/events/eventVariableMathEvaluate.js index 2148cf18a..8fe7b5833 100644 --- a/src/lib/events/eventVariableMathEvaluate.js +++ b/src/lib/events/eventVariableMathEvaluate.js @@ -2,6 +2,10 @@ const l10n = require("../helpers/l10n").default; const id = "EVENT_VARIABLE_MATH_EVALUATE"; const groups = ["EVENT_GROUP_MATH", "EVENT_GROUP_VARIABLES"]; +const subGroups = { + EVENT_GROUP_MATH: "EVENT_GROUP_VARIABLES", + EVENT_GROUP_VARIABLES: "EVENT_GROUP_MATH", +}; const autoLabel = (fetchArg, args) => { if (args.expression) { @@ -45,6 +49,7 @@ module.exports = { references: ["/docs/scripting/math-expressions"], autoLabel, groups, + subGroups, fields, compile, }; diff --git a/src/lib/project/loadScriptEventHandlers.ts b/src/lib/project/loadScriptEventHandlers.ts index 4c6b577e8..cb9787794 100644 --- a/src/lib/project/loadScriptEventHandlers.ts +++ b/src/lib/project/loadScriptEventHandlers.ts @@ -49,6 +49,7 @@ export type ScriptEventPresetValue = { name: string; description?: string; groups?: string[] | string; + subGroups?: Record; values: Record; } @@ -58,6 +59,7 @@ export interface ScriptEventDef { name?: string; description?: string; groups?: string[] | string; + subGroups?: Record; deprecated?: boolean; isConditional?: boolean; editableSymbol?: boolean; diff --git a/src/store/features/scriptEventDefs/scriptEventDefsState.ts b/src/store/features/scriptEventDefs/scriptEventDefsState.ts index b880440da..f9abb1e62 100644 --- a/src/store/features/scriptEventDefs/scriptEventDefsState.ts +++ b/src/store/features/scriptEventDefs/scriptEventDefsState.ts @@ -30,6 +30,7 @@ const buildPresets = (lookup: ScriptEventDefs): ScriptEventDefs => { name: p.name, description: p.description ?? def.description, groups: p.groups ?? def.groups, + subGroups: p.subGroups ?? def.subGroups, }; }); }