Skip to content

Commit

Permalink
Update IF_TRUE/IF_FALSE presets
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismaltby committed Apr 18, 2024
1 parent 4165fe3 commit 93862a2
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 35 deletions.
14 changes: 10 additions & 4 deletions appData/templates/gbhtml/project.gbsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2251,10 +2251,13 @@
"args": {
"variable": "2",
"condition": {
"type": "not",
"value": {
"type": "eq",
"valueA": {
"type": "variable",
"value": "2"
},
"valueB": {
"type": "false"
}
}
},
Expand Down Expand Up @@ -2330,10 +2333,13 @@
"args": {
"variable": "2",
"condition": {
"type": "not",
"value": {
"type": "eq",
"valueA": {
"type": "variable",
"value": "2"
},
"valueB": {
"type": "false"
}
}
},
Expand Down
84 changes: 60 additions & 24 deletions appData/templates/gbs2/project.gbsproj
Original file line number Diff line number Diff line change
Expand Up @@ -898,10 +898,13 @@
"variable": "10",
"__collapseElse": false,
"condition": {
"type": "not",
"value": {
"type": "eq",
"valueA": {
"type": "variable",
"value": "10"
},
"valueB": {
"type": "false"
}
}
},
Expand Down Expand Up @@ -1006,10 +1009,13 @@
"variable": "10",
"__collapseElse": false,
"condition": {
"type": "not",
"value": {
"type": "eq",
"valueA": {
"type": "variable",
"value": "10"
},
"valueB": {
"type": "false"
}
}
},
Expand Down Expand Up @@ -1131,10 +1137,13 @@
"variable": "10",
"__collapseElse": false,
"condition": {
"type": "not",
"value": {
"type": "eq",
"valueA": {
"type": "variable",
"value": "10"
},
"valueB": {
"type": "false"
}
}
},
Expand Down Expand Up @@ -1256,10 +1265,13 @@
"variable": "10",
"__collapseElse": false,
"condition": {
"type": "not",
"value": {
"type": "eq",
"valueA": {
"type": "variable",
"value": "10"
},
"valueB": {
"type": "false"
}
}
},
Expand Down Expand Up @@ -8993,10 +9005,13 @@
"args": {
"variable": "14",
"condition": {
"type": "not",
"value": {
"type": "eq",
"valueA": {
"type": "variable",
"value": "14"
},
"valueB": {
"type": "false"
}
}
},
Expand Down Expand Up @@ -9073,10 +9088,13 @@
"args": {
"variable": "14",
"condition": {
"type": "not",
"value": {
"type": "eq",
"valueA": {
"type": "variable",
"value": "14"
},
"valueB": {
"type": "false"
}
}
},
Expand Down Expand Up @@ -11252,10 +11270,13 @@
"variable": "1",
"__collapseElse": false,
"condition": {
"type": "not",
"value": {
"type": "eq",
"valueA": {
"type": "variable",
"value": "1"
},
"valueB": {
"type": "false"
}
}
},
Expand Down Expand Up @@ -34300,10 +34321,13 @@
"__disableElse": true,
"__collapse": false,
"condition": {
"type": "not",
"value": {
"type": "eq",
"valueA": {
"type": "variable",
"value": "L0"
},
"valueB": {
"type": "false"
}
}
},
Expand Down Expand Up @@ -35142,10 +35166,13 @@
"__collapseElse": false,
"__disableElse": true,
"condition": {
"type": "not",
"value": {
"type": "eq",
"valueA": {
"type": "variable",
"value": "L0"
},
"valueB": {
"type": "false"
}
}
},
Expand Down Expand Up @@ -42394,10 +42421,13 @@
"variable": "L0",
"__collapseElse": false,
"condition": {
"type": "not",
"value": {
"type": "eq",
"valueA": {
"type": "variable",
"value": "L0"
},
"valueB": {
"type": "false"
}
}
},
Expand Down Expand Up @@ -42492,10 +42522,13 @@
"variable": "L0",
"__collapseElse": false,
"condition": {
"type": "not",
"value": {
"type": "eq",
"valueA": {
"type": "variable",
"value": "L0"
},
"valueB": {
"type": "false"
}
}
},
Expand Down Expand Up @@ -42590,10 +42623,13 @@
"variable": "17",
"__collapseElse": false,
"condition": {
"type": "not",
"value": {
"type": "eq",
"valueA": {
"type": "variable",
"value": "17"
},
"valueB": {
"type": "false"
}
}
},
Expand Down
17 changes: 13 additions & 4 deletions src/lib/events/eventIf.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ module.exports = {
},
values: {
condition: {
type: "variable",
value: "LAST_VARIABLE",
type: "eq",
valueA: {
type: "variable",
value: "LAST_VARIABLE",
},
valueB: {
type: "true",
},
},
},
},
Expand All @@ -101,11 +107,14 @@ module.exports = {
},
values: {
condition: {
type: "not",
value: {
type: "eq",
valueA: {
type: "variable",
value: "LAST_VARIABLE",
},
valueB: {
type: "false",
},
},
},
},
Expand Down
7 changes: 5 additions & 2 deletions src/lib/project/migrateProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2022,11 +2022,14 @@ export const migrateFrom330r2To330r3Event = (
args: {
...event.args,
condition: {
type: "not",
value: {
type: "eq",
valueA: {
type: "variable",
value: event.args.variable,
},
valueB: {
type: "false",
},
},
},
});
Expand Down
6 changes: 5 additions & 1 deletion test/migrate/migrate300releases.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,11 @@ test("should migrate EVENT_IF_FALSE to EVENT_IF, keeping conditional branches as
expect(migrateFrom330r2To330r3Event(oldEvent)).toMatchObject({
command: "EVENT_IF",
args: {
condition: { type: "not", value: { type: "variable", value: "L2" } },
condition: {
type: "eq",
valueA: { type: "variable", value: "L2" },
valueB: { type: "false" },
},
},
children: oldEvent.children,
});
Expand Down

0 comments on commit 93862a2

Please sign in to comment.