Commit Graph

13 Commits

Author SHA1 Message Date
Florian Rival d1385e5fc2 Fix completions in expressions not being case insensitive and limited for objects/variables/properties/parameters (#5742) 2023-10-10 10:48:33 +02:00
Florian Rival a0925c79c3 Add a new simplified way to use variables in expressions, and automate renaming of variables in events (#5580)
* You can now simply write the name of the scene or global variable in an expression to use it: `1 + MyVariable` (instead of `1 + Variable(MyVariable)`).
* Objects can also have their variables accessed like this: `MyObject.MyVariable` (instead of `MyObject.Variable(MyVariable)`.
* This also works for properties inside functions of behaviors or custom objects. For example, you can write `Speed` instead of `Object.Behavior::PropertySpeed()`.
* This syntax will also handle all types of variables without the need to write ToString. For example, you can now write "Score: " + CoinsEarned instead of "Score: " + ToString(Variable(CoinsEarned)).
* This syntax will only work (and autocompletions will be shown) if you add the variable in the variables editor of the scene, the project or in the variables of the object. It's a good practice to always declare your variables here and give them a default value - do it to benefit from this new simplified syntax, which will make your formulas and expressions much more readable.
* When you rename a variable in an editor, it will now rename the variables everywhere in the events of the project. This makes it much easier to change the name of a variable if you find a better one. Note that this works for "rootæ variables, but not variables inside structures or arrays.
2023-09-21 18:56:12 +02:00
D8H 763aa0aa25 Show expression errors directly in the event sheet (#3823) 2022-06-03 23:02:51 +02:00
Clément Pasteau cf5c8ae631 Improve Expression autocomplete for functions 2021-10-18 13:22:01 +02:00
Clément Pasteau e653639366 Improve Expression autocomplete (#3167)
Improve Expression Autocomplete to be more intuitive
2021-10-14 15:08:18 +02:00
D8H 4f9154549b Add autocompletion in expressions for scene names, layer names and parameters with choices (#2702) 2021-06-05 14:27:28 +01:00
Florian Rival 0749c64002 Add proper support for completions of number|string expressions
Don't show in changelog
2021-03-03 20:06:23 +00:00
Florian Rival 6526e8ad8a Allow to enter numbers when accessing to a variable child with brackets notation (e.g: MyVariable[2]) (#2380) 2021-02-22 14:29:06 +01:00
Florian Rival 66b3ec1686 Rename IsInformative to IsExact in ExpressionCompletionFinder 2020-03-23 23:32:33 +01:00
Florian Rival f1730c239d Add type to ExpressionCompletionDescription::ForObject 2020-03-16 23:08:05 +01:00
Florian Rival faa02d4459 Add proper handling of closing parenthesis in ExpressionCompletionFinder 2020-03-11 17:41:52 +00:00
Florian Rival 22c6a57394 Improve completions from ExpressionCompletionFinder 2020-03-02 22:11:31 +00:00
Florian Rival ca6f11b55a Support for describing completions to display for an expression (#1447) 2020-02-22 14:27:43 +00:00