1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

GDScript: Allow enum values to be set to constant expressions

Also allow them to access previous values wihout referencing the enum.
This commit is contained in:
George Marques
2020-08-18 17:44:20 -03:00
parent 99d4ea8c79
commit 35176247af
4 changed files with 96 additions and 16 deletions

View File

@@ -405,7 +405,10 @@ public:
struct EnumNode : public Node {
struct Value {
IdentifierNode *identifier = nullptr;
LiteralNode *custom_value = nullptr;
ExpressionNode *custom_value = nullptr;
EnumNode *parent_enum = nullptr;
int index = -1;
bool resolved = false;
int value = 0;
int line = 0;
int leftmost_column = 0;