mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-09 04:03:21 +08:00
Set event source for group variable changes to the variable name (#2231)
This commit is contained in:
parent
30d093f348
commit
4ec274f5c5
@ -403,7 +403,7 @@ public class ScriptLib {
|
|||||||
|
|
||||||
val old = variables.getOrDefault(var, value);
|
val old = variables.getOrDefault(var, value);
|
||||||
variables.put(var, value);
|
variables.put(var, value);
|
||||||
getSceneScriptManager().callEvent(new ScriptArgs(groupId, EventType.EVENT_VARIABLE_CHANGE, value, old));
|
getSceneScriptManager().callEvent(new ScriptArgs(groupId, EventType.EVENT_VARIABLE_CHANGE, value, old).setEventSource(var));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -418,7 +418,7 @@ public class ScriptLib {
|
|||||||
variables.put(var, old + value);
|
variables.put(var, old + value);
|
||||||
logger.debug("[LUA] Call ChangeGroupVariableValue with {},{}",
|
logger.debug("[LUA] Call ChangeGroupVariableValue with {},{}",
|
||||||
old, old+value);
|
old, old+value);
|
||||||
getSceneScriptManager().callEvent(new ScriptArgs(groupId, EventType.EVENT_VARIABLE_CHANGE, old+value, old));
|
getSceneScriptManager().callEvent(new ScriptArgs(groupId, EventType.EVENT_VARIABLE_CHANGE, old+value, old).setEventSource(var));
|
||||||
return LuaValue.ZERO;
|
return LuaValue.ZERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user