diff options
| author | Markus Mittendrein <maxmitti@maxmitti.tk> | 2022-02-13 21:13:36 +0100 |
|---|---|---|
| committer | Markus Mittendrein <maxmitti@maxmitti.tk> | 2022-02-13 22:32:44 +0100 |
| commit | edd1359010ce32d5ff6a3b77fcb6bbe7e21b5703 (patch) | |
| tree | 82c00ef38730af6fa4dee2aaafc152922f2e7848 /System.c4g/DTScopedVars.c | |
| parent | 8bb8f4eea328e75b5a2e17fa82d9392df034e4bc (diff) | |
| download | ObjectsAppend-edd1359010ce32d5ff6a3b77fcb6bbe7e21b5703.tar.gz ObjectsAppend-edd1359010ce32d5ff6a3b77fcb6bbe7e21b5703.zip | |
Update to map based DTMenu
Diffstat (limited to 'System.c4g/DTScopedVars.c')
| -rw-r--r-- | System.c4g/DTScopedVars.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/System.c4g/DTScopedVars.c b/System.c4g/DTScopedVars.c index 0cde670..3165553 100644 --- a/System.c4g/DTScopedVars.c +++ b/System.c4g/DTScopedVars.c @@ -4,10 +4,12 @@ static const ScopedVar_Global = 1; static const ScopedVar_Local = 2; static const ScopedVar_ArrayIndex = 3; +static const ScopedVar_MapIndex = 4; global func GlobalVar(name) { return [ScopedVar_Global, name]; } global func LocalVar(name, object target) { return [ScopedVar_Local, name, target || this]; } global func ArrayVar(index, array scopedVar) { return [ScopedVar_ArrayIndex, scopedVar, index]; } +global func MapVar(index, array scopedVar) { return [ScopedVar_MapIndex, scopedVar, index]; } global func &ScopedVar(array variable) { @@ -46,6 +48,11 @@ global func &ScopedVar(array variable) } return ScopedVar(variable[1])[index]; } + else if(variable[0] == ScopedVar_MapIndex) + { + var index = variable[2]; + return ScopedVar(variable[1])[index]; + } else { if(this) |
