2025-11-20更新 by Davi
This commit is contained in:
43
CallBack/History_Log/History_Log.md
Normal file
43
CallBack/History_Log/History_Log.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# History_Log 回调函数文档
|
||||
|
||||
**回调说明**:
|
||||
`History_Log`类用于处理游戏中的历史日志
|
||||
|
||||
---
|
||||
|
||||
**注册方法**:
|
||||
- 物品减少:`Cb_History_Log_Func["Item-"] <- function (SUser, Data) {}`
|
||||
- 物品增加:`Cb_History_Log_Func["Item+"] <- function (SUser, Data) {}`
|
||||
|
||||
**例子**:
|
||||
|
||||
```squirrel
|
||||
Cb_History_Log_Func["Item-"] <- function (SUser, Data) {
|
||||
local itemId = Data[15].tointeger();
|
||||
local itemCount = Data[17].tointeger();
|
||||
local reason = Data[18].tointeger();
|
||||
}
|
||||
```
|
||||
or
|
||||
```squirrel
|
||||
Cb_History_Log_Func["Item+"] <- function (SUser, Data) {
|
||||
local itemId = Data[15].tointeger();
|
||||
local itemCount = Data[17].tointeger();
|
||||
local reason = Data[18].tointeger();
|
||||
}
|
||||
```
|
||||
or
|
||||
```squirrel
|
||||
function Test_Function(SUser)
|
||||
{
|
||||
print("上线");
|
||||
}
|
||||
Cb_reach_game_world_Func["Test"] <- Test_Function;
|
||||
```
|
||||
or
|
||||
```squirrel
|
||||
Cb_reach_game_world_Func.Test <- function (SUser)
|
||||
{
|
||||
print("上线");
|
||||
};
|
||||
```
|
||||
Reference in New Issue
Block a user