111
This commit is contained in:
190
LenheartCallBack/Sq_RecoveryCallBack.nut
Normal file
190
LenheartCallBack/Sq_RecoveryCallBack.nut
Normal file
@@ -0,0 +1,190 @@
|
||||
/*
|
||||
文件名:Sq_RecoveryCallBack.nut
|
||||
路径:LenheartCallBack/Sq_RecoveryCallBack.nut
|
||||
创建日期:2022-11-03 02:04
|
||||
文件用途:回收功能CallBack
|
||||
*/
|
||||
|
||||
/*
|
||||
11D24F0
|
||||
|
||||
|
||||
*/
|
||||
|
||||
//设置回收模式
|
||||
function Sq_RecoveryTypeSetCallBack(Type) {
|
||||
getroottable().rawset("RecoverySystemType", Type);
|
||||
}
|
||||
|
||||
//鼠标位置回调
|
||||
function Sq_Set_Inventory_M_Pos(This) {
|
||||
//print(This);
|
||||
//在回收模式中
|
||||
if (getroottable().rawin("RecoverySystemState") && getroottable()["RecoverySystemState"] == true) {
|
||||
local StaticPos = L_sq_RA(This + 0x310);
|
||||
if (StaticPos >= 0) {
|
||||
if (KeyPress.isKeyPress(7)) {
|
||||
local Time = TimeSTL("RecoveryCD", 1000);
|
||||
if (Time.Get() == false || Time.Get() == 1000) {
|
||||
Time.Reset();
|
||||
Time.Start();
|
||||
local Type = getroottable()["RecoverySystemType"];
|
||||
|
||||
local SendType = 0;
|
||||
local SendPos = 0;
|
||||
|
||||
//回收物品栏
|
||||
if (Type >= 1 && Type <= 5) {
|
||||
SendPos = 9 + ((Type - 1) * 48);
|
||||
}
|
||||
|
||||
//回收时装
|
||||
else if (Type == 6) {
|
||||
SendType = 1;
|
||||
}
|
||||
//回收徽章
|
||||
else if (Type == 7) {
|
||||
SendType = 0;
|
||||
SendPos = 249;
|
||||
}
|
||||
//回收宠物
|
||||
else if (Type == 8) {
|
||||
SendType = 7;
|
||||
}
|
||||
//回收宠物装备
|
||||
else if (Type == 9) {
|
||||
SendType = 7;
|
||||
SendPos = 140;
|
||||
}
|
||||
//回收宠物消耗品
|
||||
else if (Type == 10) {
|
||||
SendType = 7;
|
||||
SendPos = 189;
|
||||
}
|
||||
|
||||
// local RecoverySomething = Json_STL("RecoverySomething");
|
||||
// RecoverySomething.Put("op", 20003001);
|
||||
// RecoverySomething.Put("Type", SendType);
|
||||
// RecoverySomething.Put("Pos", StaticPos + SendPos);
|
||||
// local str = RecoverySomething.GetString();
|
||||
// L_sq_SendPackType(130);
|
||||
// L_sq_SendPackWChar(str);
|
||||
// L_sq_SendPack();
|
||||
// RecoverySomething.Delete();
|
||||
|
||||
local RecoverySomething = Json_STL("RecoverySomething");
|
||||
RecoverySomething.Put("op", 20003107);
|
||||
RecoverySomething.Put("Type", SendType);
|
||||
RecoverySomething.Put("Pos", StaticPos + SendPos);
|
||||
local str = RecoverySomething.GetString();
|
||||
L_sq_SendPackType(130);
|
||||
L_sq_SendPackWChar(str);
|
||||
L_sq_SendPack();
|
||||
RecoverySomething.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//在装备强化模式中
|
||||
if (getroottable().rawin("UpgradeObj") && getroottable()["UpgradeObj"].Sw == true && getroottable()["UpgradeObj"].State == true) {
|
||||
local StaticPos = L_sq_RA(This + 0x310);
|
||||
if (StaticPos >= 0) {
|
||||
if (getroottable().rawin("MouseObject")) {
|
||||
local Mobj = getroottable()["MouseObject"];
|
||||
if (Mobj.LbEvent) {
|
||||
print(11);
|
||||
local UpGradeSomething = Json_STL("UpGradeSomething");
|
||||
UpGradeSomething.Put("op", 20018001);
|
||||
UpGradeSomething.Put("Pos", StaticPos + 9);
|
||||
local str = UpGradeSomething.GetString();
|
||||
L_sq_SendPackType(130);
|
||||
L_sq_SendPackWChar(str);
|
||||
L_sq_SendPack();
|
||||
UpGradeSomething.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function GetRecoveryPPos(Type) {
|
||||
if (Type == 1) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function Sq_RecoveryCallBack(x, y) {
|
||||
//print(x);
|
||||
//print(IMouse.GetXPos());
|
||||
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 5, 5, x, y, 42, 23) && IMouse.isButtonUpEvent()) {
|
||||
getroottable().rawset("RecoverySystemState", true);
|
||||
getroottable().rawset("RecoverySystemSwitch", true);
|
||||
}
|
||||
|
||||
/*
|
||||
//如果背包拓展偏移值不存在
|
||||
if (!getroottable().rawin("InventorySize") || getroottable()["InventorySize"] == -1) {
|
||||
if (!Pack_Control.rawin("InventorySize_switch")) {
|
||||
local GetInventorySize = Json_STL("GetInventorySize");
|
||||
GetInventorySize.Put("op", 607);
|
||||
local str = GetInventorySize.GetString();
|
||||
L_sq_SendPackType(130);
|
||||
L_sq_SendPackWChar(str);
|
||||
L_sq_SendPack();
|
||||
GetInventorySize.Delete();
|
||||
Pack_Control.rawset("InventorySize_switch", 1);
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
*/
|
||||
/*
|
||||
local InventoryWindow = sq_GetPopupWindowMainCotrol(64);
|
||||
if (InventoryWindow) {
|
||||
local X = InventoryWindow.GetXPos();
|
||||
local Y = InventoryWindow.GetYPos();
|
||||
for (local i = 0; i < 8; i++) {
|
||||
for (local z = 0; z < 6; z++) {
|
||||
//sq_DrawBox(X + (i * 30), Y + 206 + (z * 30), 28, 28, 0xffffffff);
|
||||
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X + (i * 30), Y + 206 + (z * 30), 28, 28)) {
|
||||
//Sout("指向的行数: %L 指向的列数: %L", i.tostring(), z.tostring());
|
||||
if (KeyPress.isKeyPress(7)) {
|
||||
local Pos = (i + 9) + (z * 8);
|
||||
|
||||
local RecoveryEqu = Json_STL("RecoveryEqu");
|
||||
RecoveryEqu.Put("op", 10052001);
|
||||
RecoveryEqu.Put("POS", Pos);
|
||||
local str = RecoveryEqu.GetString();
|
||||
L_sq_SendPackType(130);
|
||||
L_sq_SendPackWChar(str);
|
||||
L_sq_SendPack();
|
||||
RecoveryEqu.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
function RecoverySystem(obj) {
|
||||
//如果在回收状态 改变鼠标
|
||||
if (getroottable().rawin("RecoverySystemState") && getroottable()["RecoverySystemState"] == true && sq_GetPopupWindowMainCotrol(64)) {
|
||||
IMouse.SetMouseTask(13);
|
||||
if (IMouse.isButtonUpEvent()) getroottable().rawset("RecoverySystemState", false);
|
||||
} else //否则就设置一次归零
|
||||
{
|
||||
getroottable().rawset("RecoverySystemState", false);
|
||||
if (getroottable().rawin("RecoverySystemSwitch") && getroottable()["RecoverySystemSwitch"] == true) {
|
||||
IMouse.SetMouseTask(0);
|
||||
getroottable().rawset("RecoverySystemSwitch", false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user