mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-13 15:34:40 +01:00
Regular ScriptLib update! (#2349)
* Regular ScriptLib update! * Move RefreshGroup down to debug * Update SetGadgetEnableInteract
This commit is contained in:
@@ -1105,6 +1105,12 @@ public class ScriptLib {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int MoveAvatarByPointArrayWithTemplate(int uid, int pointarray_id, int[] routelist, int var4, LuaTable var5){
|
||||||
|
logger.warn("[LUA] Call unimplemented MoveAvatarByPointArrayWithTemplate with {} {} {} {} {}", uid, pointarray_id, routelist, var4, printTable(var5));
|
||||||
|
//TODO implement var5 contains int speed
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
public int MovePlayerToPos(LuaTable var1){
|
public int MovePlayerToPos(LuaTable var1){
|
||||||
logger.warn("[LUA] Call unchecked MovePlayerToPos with {}", printTable(var1));
|
logger.warn("[LUA] Call unchecked MovePlayerToPos with {}", printTable(var1));
|
||||||
//TODO implement var1 contains int[] uid_list, Position pos, int radius, Position rot
|
//TODO implement var1 contains int[] uid_list, Position pos, int radius, Position rot
|
||||||
@@ -1262,6 +1268,7 @@ public class ScriptLib {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int SetWeatherAreaState(int var1, int var2) {
|
public int SetWeatherAreaState(int var1, int var2) {
|
||||||
|
logger.debug("[LUA] Call SetWeatherAreaState with {} {}", var1, var2);
|
||||||
this.getSceneScriptManager().getScene().getPlayers()
|
this.getSceneScriptManager().getScene().getPlayers()
|
||||||
.forEach(p -> p.setWeather(var1, ClimateType.getTypeByValue(var2)));
|
.forEach(p -> p.setWeather(var1, ClimateType.getTypeByValue(var2)));
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1405,6 +1412,11 @@ public class ScriptLib {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int SetPlayerInteractOption(String var1){
|
||||||
|
logger.warn("[LUA] Call unimplemented SetPlayerInteractOption {}", var1);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
public int UnlockForce(int force){
|
public int UnlockForce(int force){
|
||||||
logger.debug("[LUA] Call UnlockForce {}", force);
|
logger.debug("[LUA] Call UnlockForce {}", force);
|
||||||
getSceneScriptManager().getScene().unlockForce(force);
|
getSceneScriptManager().getScene().unlockForce(force);
|
||||||
@@ -1552,7 +1564,7 @@ public class ScriptLib {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int GetRegionConfigId(LuaTable var1){
|
public int GetRegionConfigId(LuaTable var1){
|
||||||
logger.warn("[LUA] Call untested GetRegionConfigId with {}", printTable(var1));
|
logger.debug("[LUA] Call GetRegionConfigId with {}", printTable(var1));
|
||||||
var EntityId = var1.get("region_eid").toint();
|
var EntityId = var1.get("region_eid").toint();
|
||||||
var entity = getSceneScriptManager().getScene().getScriptManager().getRegionById(EntityId);
|
var entity = getSceneScriptManager().getScene().getScriptManager().getRegionById(EntityId);
|
||||||
if (entity == null){
|
if (entity == null){
|
||||||
@@ -1657,9 +1669,11 @@ public class ScriptLib {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int SetGadgetEnableInteract(int groupId, int configId, boolean enable) {
|
public int SetGadgetEnableInteract(int groupId, int configId, boolean enable) {
|
||||||
EntityGadget gadget = getCurrentEntityGadget();
|
logger.debug("[LUA] Call SetGadgetEnableInteract with {} {} {}", groupId, configId, enable);
|
||||||
if(gadget.getGroupId() != groupId || gadget.getConfigId() != configId) return -1;
|
var entity = getSceneScriptManager().getScene().getEntityByConfigId(configId, groupId);
|
||||||
|
if (!(entity instanceof EntityGadget gadget)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
gadget.setInteractEnabled(enable);
|
gadget.setInteractEnabled(enable);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user