Skip to content

Commit

Permalink
Replace VariableSetTrue and VariableSetFalse with presets for Variabl…
Browse files Browse the repository at this point in the history
…eSetToValue (needs migration script)
  • Loading branch information
chrismaltby committed Apr 11, 2024
1 parent d02c83f commit f690889
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,8 @@
"EVENT_GROUP_RESET": "Reset",
"EVENT_GROUP_FLAGS": "Flags",
"EVENT_GROUP_ACTIONS" : "Actions",
"EVENT_GROUP_BOOLEAN": "Boolean",
"EVENT_GROUP_COUNTER": "Counter",

"// 10": "Menu -----------------------------------------------------",

Expand Down
4 changes: 4 additions & 0 deletions src/lib/events/eventVariableDec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default;

const id = "EVENT_DEC_VALUE";
const groups = ["EVENT_GROUP_VARIABLES"];
const subGroups = {
EVENT_GROUP_VARIABLES: "EVENT_GROUP_COUNTER",
};

const autoLabel = (fetchArg) => {
return l10n("EVENT_DEC_VALUE_LABEL", { variable: fetchArg("variable") });
Expand All @@ -27,6 +30,7 @@ module.exports = {
description: l10n("EVENT_DEC_VALUE_DESC"),
autoLabel,
groups,
subGroups,
fields,
compile,
};
4 changes: 4 additions & 0 deletions src/lib/events/eventVariableInc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ const l10n = require("../helpers/l10n").default;

const id = "EVENT_INC_VALUE";
const groups = ["EVENT_GROUP_VARIABLES"];
const subGroups = {
EVENT_GROUP_VARIABLES: "EVENT_GROUP_COUNTER",
};

const autoLabel = (fetchArg) => {
return l10n("EVENT_INC_VALUE_LABEL", { variable: fetchArg("variable") });
Expand All @@ -27,6 +30,7 @@ module.exports = {
description: l10n("EVENT_INC_VALUE_DESC"),
autoLabel,
groups,
subGroups,
fields,
compile,
};
1 change: 1 addition & 0 deletions src/lib/events/eventVariableSetToFalse.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ module.exports = {
groups,
fields,
compile,
deprecated: true,
};
1 change: 1 addition & 0 deletions src/lib/events/eventVariableSetToTrue.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ module.exports = {
groups,
fields,
compile,
deprecated: true,
};
28 changes: 28 additions & 0 deletions src/lib/events/eventVariableSetToValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,32 @@ module.exports = {
groups,
fields,
compile,
presets: [
{
id: "EVENT_SET_TRUE",
name: l10n("EVENT_SET_TRUE"),
description: l10n("EVENT_SET_TRUE_DESC"),
subGroups: {
EVENT_GROUP_VARIABLES: "EVENT_GROUP_BOOLEAN",
},
values: {
value: {
type: "true",
},
},
},
{
id: "EVENT_SET_FALSE",
name: l10n("EVENT_SET_FALSE"),
description: l10n("EVENT_SET_FALSE_DESC"),
subGroups: {
EVENT_GROUP_VARIABLES: "EVENT_GROUP_BOOLEAN",
},
values: {
value: {
type: "false",
},
},
},
],
};

0 comments on commit f690889

Please sign in to comment.