Merge branch 'main' into base-fnf-port-remake
This commit is contained in:
@@ -283,7 +283,7 @@ class Script extends FlxBasic implements IFlxDestroyable {
|
||||
public function get(variable:String):Dynamic {return null;}
|
||||
|
||||
/**
|
||||
* Gets the variable `variable` from the script's variables.
|
||||
* Sets the variable `variable` from the script's variables.
|
||||
* @param variable Name of the variable.
|
||||
* @return Variable (or null if it doesn't exists)
|
||||
*/
|
||||
|
||||
@@ -75,34 +75,13 @@ class EventMacro {
|
||||
// add a "set this" expr for each variable
|
||||
for(v in values) {
|
||||
var name = v.name;
|
||||
exprs.push({
|
||||
pos: Context.currentPos(),
|
||||
expr: EBinop(OpAssign, {
|
||||
pos: Context.currentPos(),
|
||||
expr: EField({
|
||||
pos: Context.currentPos(),
|
||||
expr: EConst(CIdent("this"))
|
||||
}, name)
|
||||
}, {
|
||||
pos: Context.currentPos(),
|
||||
expr: EConst(CIdent(name))
|
||||
})
|
||||
});
|
||||
exprs.push(macro this.$name = $i{name});
|
||||
}
|
||||
|
||||
// add a "set this" expr to reset each private/hidden variables
|
||||
for(v in hiddenValues) {
|
||||
var name = v.name;
|
||||
exprs.push({
|
||||
pos: Context.currentPos(),
|
||||
expr: EBinop(OpAssign, {
|
||||
pos: Context.currentPos(),
|
||||
expr: EField({
|
||||
pos: Context.currentPos(),
|
||||
expr: EConst(CIdent("this"))
|
||||
}, name)
|
||||
}, v.expr)
|
||||
});
|
||||
exprs.push(macro this.$name = ${v.expr});
|
||||
}
|
||||
|
||||
exprs.push(macro return this);
|
||||
|
||||
Reference in New Issue
Block a user