diff --git a/ImagePacks2/!HUD_超时空之战.NPK b/ImagePacks2/!HUD_超时空之战.NPK index e590104..8b26882 100644 Binary files a/ImagePacks2/!HUD_超时空之战.NPK and b/ImagePacks2/!HUD_超时空之战.NPK differ diff --git a/ImagePacks2/!超时空.NPK b/ImagePacks2/!超时空.NPK index 13cc49e..47b1fde 100644 Binary files a/ImagePacks2/!超时空.NPK and b/ImagePacks2/!超时空.NPK differ diff --git a/Plugins/Lenheart.dll b/Plugins/Lenheart.dll index eecfbbf..cc03916 100644 Binary files a/Plugins/Lenheart.dll and b/Plugins/Lenheart.dll differ diff --git a/Plugins/Lenheart.iobj b/Plugins/Lenheart.iobj index 850d9e5..d829255 100644 Binary files a/Plugins/Lenheart.iobj and b/Plugins/Lenheart.iobj differ diff --git a/Plugins/Lenheart.ipdb b/Plugins/Lenheart.ipdb index bba9720..26933ee 100644 Binary files a/Plugins/Lenheart.ipdb and b/Plugins/Lenheart.ipdb differ diff --git a/Plugins/Lenheart.pdb b/Plugins/Lenheart.pdb index 5dce7aa..de1653f 100644 Binary files a/Plugins/Lenheart.pdb and b/Plugins/Lenheart.pdb differ diff --git a/sqr.7z b/sqr.7z new file mode 100644 index 0000000..3a028fe Binary files /dev/null and b/sqr.7z differ diff --git a/sqr/DrawMainCustomUi/DrawMainCustomUi_All.nut b/sqr/DrawMainCustomUi/DrawMainCustomUi_All.nut index 0e4b725..ece4c5b 100644 --- a/sqr/DrawMainCustomUi/DrawMainCustomUi_All.nut +++ b/sqr/DrawMainCustomUi/DrawMainCustomUi_All.nut @@ -347,8 +347,9 @@ function drawMainCustomUI_All(obj) { if (exception != "cannot open the file") print("Reloading Script Fail !!! \n" + exception); } +// print(L_sq_RAB(0x1B46886)); - + // print(L_sq_GetCharacterAttribute(0x1c, 21)); if (KeyPress.isKeyPress(77)) { /* diff --git a/sqr/Plugins/AvatarShape/AvatarShape.nut b/sqr/Plugins/AvatarShape/AvatarShape.nut index c8a4ceb..e35395f 100644 --- a/sqr/Plugins/AvatarShape/AvatarShape.nut +++ b/sqr/Plugins/AvatarShape/AvatarShape.nut @@ -265,7 +265,7 @@ class AvatarShapeC extends BasicsDrawTool { RootTab["AvatarShapeCObj"].X = Buffer.Get("Xpos"); RootTab["AvatarShapeCObj"].Y = Buffer.Get("Ypos"); - for (local i = 0; i < 1000; i++) { + for (local i = 0; i< 1000; i++) { local gToubu = Buffer.Get("info->" + i + "->Toubu"); if (gToubu == false) break; local gMaozi = Buffer.Get("info->" + i + "->Maozi"); diff --git a/sqr/Plugins/BuffSwitching/BuffSwitching.nut b/sqr/Plugins/BuffSwitching/BuffSwitching.nut index 8b17fce..5e6c3c9 100644 --- a/sqr/Plugins/BuffSwitching/BuffSwitching.nut +++ b/sqr/Plugins/BuffSwitching/BuffSwitching.nut @@ -383,14 +383,14 @@ class BuffSwitchingSystem extends BasicsDrawTool { Buffer.Parse(Chunk, 0, false); local RootTab = getroottable(); if (RootTab.rawin("BuffSwitchingObj")) { - for (local i = 0; i < Buffer.Get("Acount"); i++) { + for (local i = 0; i< Buffer.Get("Acount"); i++) { local Pos = Buffer.Get("Apos->" + i); - if (Pos < 0) continue; + if (Pos< 0) continue; local Id = Buffer.Get("Aid->" + i); local Type = Buffer.Get("AType->" + i); RootTab["BuffSwitchingObj"].SwitchingSendPack(Pos, Id, Type, 1, i, 0); } - for (local q = 0; q < Buffer.Get("Ecount"); q++) { + for (local q = 0; q< Buffer.Get("Ecount"); q++) { local Pos = Buffer.Get("Epos->" + q); local Id = Buffer.Get("Eid->" + q); local Type = Buffer.Get("EType->" + q); @@ -512,7 +512,7 @@ class BuffSwitchingSystem extends BasicsDrawTool { L_sq_DrawCode("装扮", BaseX + 423, BaseY + 221, sq_RGBA(247, 214, 90, 250), 1, 1); L_sq_DrawCode("宠物", BaseX + 530, BaseY + 221, sq_RGBA(247, 214, 90, 250), 1, 1); - for (local r = 0; r < 3; r++) { + for (local r = 0; r< 3; r++) { local PartyButton = BuffSwitchingButtonPro(obj, "BuffSwitchingPartyButton" + r, BaseX + 222 + 10, BaseY + 86 + 42 + (r * 23), "common/buffswitching/party.ani", 24, 14, 0 + (r * 2)); PartyButton.SetRectEnble(true, "BuffSwitchingPartyButtonr" + r, BaseX + 222 + 10, BaseY + 86 + 42 + (r * 23), "common/buffswitching/party.ani", 1 + (r * 2)); PartyButton.SetCustomClickEnble(true, "BuffSwitchingPartyButtonc" + r, BaseX + 222 + 10, BaseY + 86 + 43 + (r * 23), "common/buffswitching/party.ani", 1 + (r * 2)); @@ -571,7 +571,7 @@ class BuffSwitchingSystem extends BasicsDrawTool { { //装备 - for (local i = 0; i < 12; i++) { + for (local i = 0; i< 12; i++) { local z = i; if (i == 9 || i == 10) z = i + 1; if (i == 11) z = i + 4; @@ -580,7 +580,7 @@ class BuffSwitchingSystem extends BasicsDrawTool { } { //时装 - for (local q = 0; q < 10; q++) { + for (local q = 0; q< 10; q++) { local z = q + 1; if (q >= 7) z = q + 2; if (AvaData[q] != 0) L_Sq_DrawItem(BaseX + 370 + ((z % 4) * 33), BaseY + 240 + ((z / 4) * 33), AvaData[q], 1, 0, 0, 0); @@ -752,7 +752,7 @@ function Sq_SwitchingCallBack(x, y) { local BaseY = y - 200 - 83; local obj = sq_GetMyMasterCharacter(); - if(!obj)return; + if (!obj) return; local OpenButton = BuffSwitchingButtonPro(obj, "BuffSwitchingOpenButton", BaseX, BaseY, "common/buffswitching/main.ani", 55, 55, 14); OpenButton.SetRectEnble(true, "BuffSwitchingOpenButtonr", BaseX, BaseY, "common/buffswitching/main.ani", 15); OpenButton.SetCustomClickEnble(true, "BuffSwitchingOpenButtonc", BaseX, BaseY, "common/buffswitching/main.ani", 16); diff --git a/sqr/Plugins/CollectBooks/CollectBooks.nut b/sqr/Plugins/CollectBooks/CollectBooks.nut index 831fb9c..2f315e6 100644 --- a/sqr/Plugins/CollectBooks/CollectBooks.nut +++ b/sqr/Plugins/CollectBooks/CollectBooks.nut @@ -448,7 +448,7 @@ class CollectBooksLineC extends BasicsDrawTool { strarr.append(strbuff); Bpos = Npos + 1; } - for (local z = 0; z < strarr.len(); z++) { + for (local z = 0; z< strarr.len(); z++) { L_sq_DrawCode(strarr[z], x, y + (z * 14), rgba, mb, jc); } } @@ -459,7 +459,7 @@ class CollectBooksLineC extends BasicsDrawTool { //12个的时候597 //单个长36 local Spacing = (597 - (ItemArr.len() * 36)) / (ItemArr.len() - 1); - for (local i = 0; i < ItemArr.len(); i++) { + for (local i = 0; i< ItemArr.len(); i++) { L_sq_DrawImg("interface2/yosin/shoujitujian.img", 7, X + 6 + (i * Spacing + (i * 36)), Y + 27); L_Sq_DrawItem(X + 9 + (i * Spacing + (i * 36)), Y + 30, ItemArr[i].Id, 1, 0, 0, 0); if (!ItemArr[i].IsHave) { @@ -477,7 +477,7 @@ class CollectBooksLineC extends BasicsDrawTool { local StrColor = sq_RGBA(174, 174, 174, 250); if (Completion) StrColor = sq_RGBA(255, 177, 0, 250) L_sq_DrawImg("interface2/yosin/shoujitujian.img", 10, X + 320, Y + 100 + 34); - for (local i = 0; i < AttributeArr.len(); i++) { + for (local i = 0; i< AttributeArr.len(); i++) { //空属性 跳过绘制并且-1行 if (AttributeArr[i] == 0) { JumpRealLine++; @@ -625,7 +625,7 @@ class CollectBooksC extends BasicsDrawTool { if (RootTab.rawin("CollectBooksCObj")) { local Tobj = RootTab["CollectBooksCObj"]; Tobj.MosaicAnimotionArr = []; - for (local i = 0; i < 15; i++) { + for (local i = 0; i< 15; i++) { local X = Buffer.Get("Ani->" + i + "->x") if (!X) break; local Y = Buffer.Get("Ani->" + i + "->y") @@ -658,16 +658,16 @@ class CollectBooksC extends BasicsDrawTool { Tobj.CollectBooksLineBuf = [0, 0, 0, 0]; Tobj.MaxPage = Buffer.Get("MaxPage"); local Count = Buffer.Get("CollectLineCount"); - for (local i = 0; i < Count; i++) { + for (local i = 0; i< Count; i++) { local AbArr = []; - for (local q = 0; q < 22; q++) { + for (local q = 0; q< 22; q++) { local AttributeBuffer = Buffer.Get("CollectLineAttribute->" + i + "->buff->" + q); AbArr.append(AttributeBuffer); } Tobj.CollectLineAttributeObject.append(AbArr); local EquArr = []; - for (local w = 0; w < 12; w++) { + for (local w = 0; w< 12; w++) { local gName = Buffer.Get("CollectLineDrawS->" + i + "->collectLineDrawList->" + w + "->ItemName"); if (!gName) break; local gId = Buffer.Get("CollectLineDrawS->" + i + "->collectLineDrawList->" + w + "->ItemId"); @@ -715,7 +715,7 @@ class CollectBooksC extends BasicsDrawTool { if (RootTab.rawin("CollectBooksCObj")) { local Tobj = RootTab["CollectBooksCObj"]; Tobj.CollectAttributeObject = []; - for (local i = 0; i < 22; i++) { + for (local i = 0; i< 22; i++) { Tobj.CollectAttributeObject.append(Buffer.Get("buffs->" + i)); } Tobj.BookButtonState = false; @@ -739,7 +739,7 @@ class CollectBooksC extends BasicsDrawTool { if (RootTab.rawin("CollectBooksCObj")) { local Tobj = RootTab["CollectBooksCObj"]; Tobj.CollectAttributeObject = []; - for (local i = 0; i < 22; i++) { + for (local i = 0; i< 22; i++) { Tobj.CollectAttributeObject.append(Buffer.Get("buffs->" + i)); } } @@ -802,7 +802,7 @@ class CollectBooksC extends BasicsDrawTool { //属性显示页 if (AbtiButtonState && CollectAttributeObject) { - for (local r = 0; r < 22; r++) { + for (local r = 0; r< 22; r++) { L_sq_DrawCode(TabName[r] + " " + CollectAttributeObject[r], X + 20 + ((r / 10) * 170), Y + 64 + ((r % 10) * 17), sq_RGBA(255, 255, 255, 250), 1, 1); } } @@ -812,7 +812,7 @@ class CollectBooksC extends BasicsDrawTool { L_sq_DrawCode(PageTitle.Name, X + PageTitle.X, Y + PageTitle.Y, sq_RGBA(184, 249, 114, 250), 2, 1); - for (local i = 0; i < CollectLineObject.len(); i++) { + for (local i = 0; i< CollectLineObject.len(); i++) { if (CollectBooksLineBuf[i] == 0) CollectBooksLineBuf[i] = CollectBooksLineC(CollectLineNameObject[i], CollectLineObject[i], CollectLineAttributeObject[i]); CollectBooksLineBuf[i].Show(X + 14, Y + 60 + (i * 80)); @@ -842,7 +842,7 @@ class CollectBooksC extends BasicsDrawTool { RightButton.Show(); if (RightButton.isLBActive()) { obj.sq_PlaySound("CLICK_BUTTON2"); - if (NowPage < MaxPage) + if (NowPage< MaxPage) NowPage++; local T = { op = Myop + 1, @@ -851,14 +851,14 @@ class CollectBooksC extends BasicsDrawTool { SendPack(T); } - for (local w = 0; w < 4; w++) { + for (local w = 0; w< 4; w++) { if (CollectBooksLineBuf[w] != 0) CollectBooksLineBuf[w].ShowStr(X + 14, Y + 60 + (w * 80)); } //如果镶嵌动画存在 if (MosaicAnimotionArr) { local AnimotionLen = MosaicAnimotionArr.len(); - for (local ai = 0; ai < AnimotionLen; ai++) { + for (local ai = 0; ai< AnimotionLen; ai++) { local ani = T_DrawDynamicAni(obj, "common/collectbooks/iconslot_01.ani", MosaicAnimotionArr[ai].Ax, MosaicAnimotionArr[ai].Ay, "CollectBooksAnimotions" + ai); if (sq_IsEnd(ani)) { sq_Rewind(ani); diff --git a/sqr/Plugins/Fate_Select/Fate_Select.nut b/sqr/Plugins/Fate_Select/Fate_Select.nut index 90d6923..9291c30 100644 --- a/sqr/Plugins/Fate_Select/Fate_Select.nut +++ b/sqr/Plugins/Fate_Select/Fate_Select.nut @@ -350,7 +350,7 @@ class Fate_Select_SmallPowerCard extends BasicsDrawTool { strarr.append(strbuff); Bpos = Npos + 1; } - for (local z = 0; z < strarr.len(); z++) { + for (local z = 0; z< strarr.len(); z++) { L_sq_DrawCode(strarr[z], x, y + (z * 14), rgba, mb, jc); } } @@ -431,7 +431,7 @@ class Fate_SelectC extends BasicsDrawTool { Tobj.BOSSId = null; Tobj.LevelTimeInfo = []; Tobj.BOSSId = {}; - for (local i = 0; i < 50; i++) { + for (local i = 0; i< 50; i++) { local TimeBuf = Buffer.Get("Time->" + i); Tobj.LevelTimeInfo.append(TimeBuf * 1000); local BossId = Buffer.Get("BOSSId->" + i); @@ -493,7 +493,7 @@ class Fate_SelectC extends BasicsDrawTool { if (RootTab.rawin("Fate_SelectCObj")) { local Tobj = RootTab["Fate_SelectCObj"]; - for (local i = 0; i < 5; i++) { + for (local i = 0; i< 5; i++) { local Img = Buffer.Get("SkillPack->" + i + "->Img"); local Idx = Buffer.Get("SkillPack->" + i + "->Idx"); local Str = Buffer.Get("SkillPack->" + i + "->Str"); @@ -536,7 +536,7 @@ class Fate_SelectC extends BasicsDrawTool { // BOSSId.rawset(62721, true); // BOSSId.rawset(62780, true); - for (local i = 0; i < 50; i++) { + for (local i = 0; i< 50; i++) { local TimeObj = TimeSTL("FateTimeObj" + i, 1100); TimeObj.Delete(); } @@ -578,7 +578,7 @@ class Fate_SelectC extends BasicsDrawTool { T_DrawStayAni(obj, "common/dungeon/fate_select/goldselectframe.ani", 0, 0, 1, "powerselectmainlight"); //绘制能力选择卡牌 local RootTab = getroottable(); - for (local i = 0; i < 5; i++) { + for (local i = 0; i< 5; i++) { PowerSelect[i].Show(obj); //常驻检测 if ((PowerSelect[i].isLBActive() || KeyPressNB.isKeyPress((32 + i), "Fate_SelectQu" + (32 + i))) && SelectTiming == 1) { @@ -650,7 +650,7 @@ class Fate_SelectC extends BasicsDrawTool { //同步时间 function SyncTime(obj) { - if (NowLevel < 50) { + if (NowLevel< 50) { local Time = LevelTimeInfo[NowLevel]; if (TimeObj) { local Nt = TimeObj.Get(); @@ -712,7 +712,7 @@ class Fate_SelectC extends BasicsDrawTool { function SyncMonsterDie(obj) { local objectManager = obj.getObjectManager(); local CollisionObjectNumber = objectManager.getCollisionObjectNumber(); - for (local i = 0; i < CollisionObjectNumber; i += 1) { + for (local i = 0; i< CollisionObjectNumber; i += 1) { local object = objectManager.getCollisionObject(i); if (object && object.isObjectType(OBJECTTYPE_ACTIVE) && obj.isEnemy(object) && object.isInDamagableState(obj) && object.getTeam() != 0) { local activeObj = sq_GetCNRDObjectToActiveObject(object); @@ -796,7 +796,7 @@ class Fate_SelectC extends BasicsDrawTool { function DrawCustomNum(obj, xPos, yPos, num, str, Interval, OneDeviation) { local len = (num.tostring()).len(); - for (local i = 0; i < len; i++) { + for (local i = 0; i< len; i++) { local one = 0; local DrawNum = (num.tostring()).slice(i, i + 1); if (i != (len - 1)) one += OneDeviation * abs(i - (len - 1)); @@ -808,7 +808,7 @@ class Fate_SelectC extends BasicsDrawTool { function fateDrawCustomTimeNum(obj, xPos, yPos, num, str, Interval, OneDeviation) { - for (local i = 0; i < 4; i++) { + for (local i = 0; i< 4; i++) { local Idx = num.slice(0 + i, 1 + i); local ani = obj.getVar().GetAnimationMap(Idx + str, str + Idx + ".ani"); sq_AnimationProc(ani); @@ -820,7 +820,7 @@ class Fate_SelectC extends BasicsDrawTool { function PauseWorld(obj, Type, Time) { local objectManager = obj.getObjectManager(); - for (local i = 0; i < objectManager.getCollisionObjectNumber(); i += 1) { + for (local i = 0; i< objectManager.getCollisionObjectNumber(); i += 1) { local object = objectManager.getCollisionObject(i); sq_SetPause(object, Type, Time); } @@ -1043,7 +1043,7 @@ class Fate_SelectC extends BasicsDrawTool { //销毁特效 function DestroyPassiveObject(obj, Index) { local ballCount = obj.getMyPassiveObjectCount(Index); - for (local i = 0; i < ballCount; ++i) { + for (local i = 0; i< ballCount; ++i) { local magicBall = obj.getMyPassiveObject(Index, i) if (!magicBall) continue; diff --git a/sqr/Plugins/Fate_Select/Fate_Selectold.nut b/sqr/Plugins/Fate_Select/Fate_Selectold.nut index 28f178e..9ad2dcc 100644 --- a/sqr/Plugins/Fate_Select/Fate_Selectold.nut +++ b/sqr/Plugins/Fate_Select/Fate_Selectold.nut @@ -326,7 +326,7 @@ class Fate_Select_SmallPowerCard extends BasicsDrawTool { strarr.append(strbuff); Bpos = Npos + 1; } - for (local z = 0; z < strarr.len(); z++) { + for (local z = 0; z< strarr.len(); z++) { L_sq_DrawCode(strarr[z], x, y + (z * 14), rgba, mb, jc); } } @@ -406,7 +406,7 @@ class Fate_SelectC extends BasicsDrawTool { Tobj.BOSSId = null; Tobj.LevelTimeInfo = []; Tobj.BOSSId = {}; - for (local i = 0; i < 50; i++) { + for (local i = 0; i< 50; i++) { local TimeBuf = Buffer.Get("Time->" + i); Tobj.LevelTimeInfo.append(TimeBuf * 1000); local BossId = Buffer.Get("BOSSId->" + i); @@ -468,7 +468,7 @@ class Fate_SelectC extends BasicsDrawTool { if (RootTab.rawin("Fate_SelectCObj")) { local Tobj = RootTab["Fate_SelectCObj"]; - for (local i = 0; i < 5; i++) { + for (local i = 0; i< 5; i++) { local Img = Buffer.Get("SkillPack->" + i + "->Img"); local Idx = Buffer.Get("SkillPack->" + i + "->Idx"); local Str = Buffer.Get("SkillPack->" + i + "->Str"); @@ -511,7 +511,7 @@ class Fate_SelectC extends BasicsDrawTool { // BOSSId.rawset(62721, true); // BOSSId.rawset(62780, true); - for (local i = 0; i < 50; i++) { + for (local i = 0; i< 50; i++) { local TimeObj = TimeSTL("FateTimeObj" + i, 1100); TimeObj.Delete(); } @@ -530,7 +530,7 @@ class Fate_SelectC extends BasicsDrawTool { T_DrawStayAni(obj, "common/dungeon/fate_select/goldselectframe.ani", 0, 0, 1, "powerselectmainlight"); //绘制能力选择卡牌 local RootTab = getroottable(); - for (local i = 0; i < 5; i++) { + for (local i = 0; i< 5; i++) { PowerSelect[i].Show(obj); //常驻检测 if (PowerSelect[i].isLBActive() && SelectTiming == 1) { @@ -603,7 +603,7 @@ class Fate_SelectC extends BasicsDrawTool { //同步时间 function SyncTime(obj) { - if (NowLevel < 50) { + if (NowLevel< 50) { local Time = LevelTimeInfo[NowLevel]; if (TimeObj) { local Nt = TimeObj.Get(); @@ -660,7 +660,7 @@ class Fate_SelectC extends BasicsDrawTool { function SyncMonsterDie(obj) { local objectManager = obj.getObjectManager(); local CollisionObjectNumber = objectManager.getCollisionObjectNumber(); - for (local i = 0; i < CollisionObjectNumber; i += 1) { + for (local i = 0; i< CollisionObjectNumber; i += 1) { local object = objectManager.getCollisionObject(i); if (object && object.isObjectType(OBJECTTYPE_ACTIVE) && obj.isEnemy(object) && object.isInDamagableState(obj) && object.getTeam() != 0) { local activeObj = sq_GetCNRDObjectToActiveObject(object); @@ -742,7 +742,7 @@ class Fate_SelectC extends BasicsDrawTool { function DrawCustomNum(obj, xPos, yPos, num, str, Interval, OneDeviation) { local len = (num.tostring()).len(); - for (local i = 0; i < len; i++) { + for (local i = 0; i< len; i++) { local one = 0; local DrawNum = (num.tostring()).slice(i, i + 1); if (i != (len - 1)) one += OneDeviation * abs(i - (len - 1)); @@ -754,7 +754,7 @@ class Fate_SelectC extends BasicsDrawTool { function fateDrawCustomTimeNum(obj, xPos, yPos, num, str, Interval, OneDeviation) { - for (local i = 0; i < 4; i++) { + for (local i = 0; i< 4; i++) { local Idx = num.slice(0 + i, 1 + i); local ani = obj.getVar().GetAnimationMap(Idx + str, str + Idx + ".ani"); sq_AnimationProc(ani); @@ -766,7 +766,7 @@ class Fate_SelectC extends BasicsDrawTool { function PauseWorld(obj, Type, Time) { local objectManager = obj.getObjectManager(); - for (local i = 0; i < objectManager.getCollisionObjectNumber(); i += 1) { + for (local i = 0; i< objectManager.getCollisionObjectNumber(); i += 1) { local object = objectManager.getCollisionObject(i); sq_SetPause(object, Type, Time); } @@ -984,7 +984,7 @@ class Fate_SelectC extends BasicsDrawTool { //销毁特效 function DestroyPassiveObject(obj, Index) { local ballCount = obj.getMyPassiveObjectCount(Index); - for (local i = 0; i < ballCount; ++i) { + for (local i = 0; i< ballCount; ++i) { local magicBall = obj.getMyPassiveObject(Index, i) if (!magicBall) continue; diff --git a/sqr/Plugins/Fiendwar/Fiendwar.nut b/sqr/Plugins/Fiendwar/Fiendwar.nut index f15b1f2..e3c4a5e 100644 --- a/sqr/Plugins/Fiendwar/Fiendwar.nut +++ b/sqr/Plugins/Fiendwar/Fiendwar.nut @@ -12,6 +12,9 @@ class FiendwarTotal extends BasicsDrawTool { town_index 城镇编号 channel_index 频道编号 */ + MyCid = null; + IsCaptain = null; + function GetInstance() { return getroottable()["FiendwarCObj"]; @@ -73,10 +76,11 @@ function LenheartFiendwar(obj) { // LenheartNewUI_CreateWindow(FiendwarHallCreatePartyC, "超时空创建队伍窗口", 290, 220, 284, 154, 18); // LenheartNewUI_CreateWindow(FiendwarHallMyPartyEditC, "超时空我的队伍编队窗口", 105, 40, 294, 192, 18); // LenheartNewUI_CreateWindow(FiendwarHallMyPartyC, "超时空我的队伍窗口", 430, 15, 354, 290, 18); - // LenheartNewUI_CreateWindow(FiendwarHallApplyJoinC, "超时空申请加入队伍窗口", 542, 348, 244, 240, 18); + // LenheartNewUI_CreateWindow(FiendwarHallApplyJoinC, "超时空申请加入队伍窗口", 542, 348, 257, 240, 18); + // LenheartNewUI_CreateWindow(FiendwarHallPlayerInteractiveC, "测试", 100, 100, 100, 21, 0); } if (getroottable().rawin("LenheartFuncTab")) { diff --git a/sqr/Plugins/Fiendwar/FiendwarHall.nut b/sqr/Plugins/Fiendwar/FiendwarHall.nut index 788fc81..d45779d 100644 --- a/sqr/Plugins/Fiendwar/FiendwarHall.nut +++ b/sqr/Plugins/Fiendwar/FiendwarHall.nut @@ -114,8 +114,10 @@ class FiendwarHallC extends LenheartNewUI_Windows { Win.Visible = false; } + //获取攻坚队信息回调 function GetTeamInfoCallBack(Chunk) { Sout("收到包 : \n %L", Chunk); + local Jso = Json.Decode(Chunk); local Win = LenheartNewUI_CreateWindow(FiendwarHallMyPartyC, "超时空我的队伍窗口", 430, 15, 354, 290, 18); Win.Visible = true; @@ -125,7 +127,14 @@ class FiendwarHallC extends LenheartNewUI_Windows { Win.TeamName = Jso.team.TeamName; Win.TeamID = Jso.team.TeamId; foreach(_index, MemberObj in Jso.team.characNum) { + //说明我在这个攻坚队里 + if (Jso.cid == MemberObj.CID) { + Win.IsMyTeam = true; + //存个全局 + getroottable().rawset("FiendwarHallMyPartyTeamId", Jso.team.TeamId); + } local T = { + PartyId = Jso.team.TeamId, TeamId = MemberObj.TeamNum, Level = MemberObj.PlayerLevel.tostring(), Name = MemberObj.PlayerName, @@ -133,13 +142,24 @@ class FiendwarHallC extends LenheartNewUI_Windows { Job = MemberObj.PlayerJob, StkHasFlag = MemberObj.isPrepare, EquVos = MemberObj.equVos, - Captain = MemberObj.CaptainBool + Captain = MemberObj.CaptainBool, + Cid = MemberObj.CID, + PlayerSession = MemberObj.PlayerSession } local TeamBuf = FiendwarHallMyPartyMemberC(T); Win.Childrens.append(TeamBuf); Win.MembersList.append(TeamBuf); } + local Fo = FiendwarTotal.GetInstance(); + Fo.MyCid = Jso.cid; + //说明是队长 + if (Jso.cid == Jso.team.captainCid) { + Win.IsCaptain = true; + Fo.IsCaptain = true; + } + //刷新界面 + Win.RegisterWidget(); } function GetAllTeamCall() { @@ -186,7 +206,7 @@ class FiendwarHallC extends LenheartNewUI_Windows { //关闭按钮 local CloseButton = LenheartNewUI_BaseButton(457, 0, 11, 12, "interface/lenheartwindowcommon.img", 276); CloseButton.OnClick = function() { - this.Visible = false; + CloseWindow(); }.bindenv(this); Childrens.append(CloseButton); @@ -295,6 +315,7 @@ class FiendwarHallC extends LenheartNewUI_Windows { MyPartyButton.OnClick = function() { local Win = LenheartNewUI_CreateWindow(FiendwarHallCreatePartyC, "超时空创建队伍窗口", 290, 220, 284, 154, 18); Win.Visible = true; + Win.ResetFocus(); }.bindenv(this); Childrens.append(MyPartyButton); diff --git a/sqr/Plugins/Fiendwar/FiendwarHallApplyJoin.nut b/sqr/Plugins/Fiendwar/FiendwarHallApplyJoin.nut index 1b3cc8b..1e50a7a 100644 --- a/sqr/Plugins/Fiendwar/FiendwarHallApplyJoin.nut +++ b/sqr/Plugins/Fiendwar/FiendwarHallApplyJoin.nut @@ -2,6 +2,8 @@ class FiendwarHallApplyJoinC extends LenheartNewUI_Windows { //调试模式 // DeBugMode = true; + //角色对象 + Charc = null; //角色等级 Level = "100级"; //角色名称 @@ -58,44 +60,21 @@ class FiendwarHallApplyJoinC extends LenheartNewUI_Windows { ] constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + Childrens = []; RequestJoinTeamArr = []; - AvatarArr = [{ - layer = 0, - dressImg = "character/swordman/equipment/avatar/skin/sm_body0004.img", - dressImgInt = 90, - pos = [-232, -333, 0] - }, { - layer = 260, - dressImg = "character/swordman/equipment/avatar/face/sm_face16700b.img", - dressImgInt = 90, - pos = [-232, -333, 0] - }, { - layer = 800, - dressImg = "character/swordman/equipment/avatar/hair/sm_hair18300b.img", - dressImgInt = 90, - pos = [-232, -333, 0] - }, { - layer = 2000, - dressImg = "character/swordman/equipment/avatar/hair/sm_hair18300a.img", - dressImgInt = 90, - pos = [-232, -333, 0] - }, { - layer = 2100, - dressImg = "character/swordman/equipment/avatar/cap/sm_cap19800a.img", - dressImgInt = 90, - pos = [-232, -333, 0] - }]; + LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); } function InitInfo() { - local CJoinTeamArr = clone(RequestJoinTeamArr); - CJoinTeamArr.reverse(); + // local CJoinTeamArr = clone(RequestJoinTeamArr); + // CJoinTeamArr.reverse(); - local InfoObj = CJoinTeamArr[NowSelectJoinIndex]; + local InfoObj = RequestJoinTeamArr[NowSelectJoinIndex]; + Charc = InfoObj.Charc; //角色等级 Level = InfoObj.Level; //角色名称 @@ -114,6 +93,8 @@ class FiendwarHallApplyJoinC extends LenheartNewUI_Windows { Combat = InfoObj.Combat; //通过次数 ClearanceCount = InfoObj.ClearanceCount; + //头像 + AvatarArr = InfoObj.AvatarArr; Childrens = []; //注册控件 @@ -121,14 +102,21 @@ class FiendwarHallApplyJoinC extends LenheartNewUI_Windows { InitFlag = true; } + function PopOne() { + if (RequestJoinTeamArr.len() > 1) { + RequestJoinTeamArr.remove(0); + InitInfo(); + } else { + RequestJoinTeamArr = []; + CloseWindow(); + } + } + function RegisterWidget() { //关闭按钮 local CloseButton = LenheartNewUI_BaseButton(244, 0, 11, 12, "interface/lenheartwindowcommon.img", 276); CloseButton.OnClick = function() { - if (RequestJoinTeamArr.len() > 0) { - RequestJoinTeamArr.pop(); - Init(); - } else this.Visible = false; + PopOne(); }.bindenv(this); Childrens.append(CloseButton); @@ -149,23 +137,42 @@ class FiendwarHallApplyJoinC extends LenheartNewUI_Windows { //确认按钮 local OkButton = LenheartNewUI_ButtonText(74, 192, -1, "是"); OkButton.SetTextOffset(3, 2); + OkButton.OnClick = function() { + local T = { + op = 20063003, + teamsId = getroottable().rawget("FiendwarHallMyPartyTeamId"), + charac = Charc + } + BasicsDrawTool.SendPackEx(T); + PopOne(); + }.bindenv(this); Childrens.append(OkButton); //拒绝按钮 - local OkButton = LenheartNewUI_ButtonText(130, 192, -1, "否"); - OkButton.SetTextOffset(3, 2); - Childrens.append(OkButton); + local NoButton = LenheartNewUI_ButtonText(130, 192, -1, "否"); + NoButton.SetTextOffset(3, 2); + NoButton.OnClick = function() { + local T = { + op = 20063019, + charac = Charc.cid + } + BasicsDrawTool.SendPackEx(T); + PopOne(); + }.bindenv(this); + Childrens.append(NoButton); //左翻页按钮 local LeftButton = LenheartNewUI_BaseButton(90, 220, 15, 15, "interface/lenheartwindowcommon.img", 34); LeftButton.OnClick = function() { if (NowSelectJoinIndex > 0) NowSelectJoinIndex--; + InitInfo(); }.bindenv(this); Childrens.append(LeftButton); //右翻页按钮 local RightButton = LenheartNewUI_BaseButton(154, 220, 15, 15, "interface/lenheartwindowcommon.img", 38); RightButton.OnClick = function() { - if (NowSelectJoinIndex< RequestJoinTeamArr.len()) NowSelectJoinIndex++; + if (NowSelectJoinIndex< RequestJoinTeamArr.len() - 1) NowSelectJoinIndex++; + InitInfo(); }.bindenv(this); Childrens.append(RightButton); } @@ -185,13 +192,13 @@ class FiendwarHallApplyJoinC extends LenheartNewUI_Windows { L_sq_DrawImg("hud/fiendwarl.img", 14, X + 8, Y + 40); //绘制角色头像 if (AvatarArr) { + foreach(AvatarObj in AvatarArr) { - local AXpos = AvatarObj.pos[0] + X + OffsetArr[Job][0] - 8; - local AYpos = AvatarObj.pos[1] + Y + OffsetArr[Job][1] + 40; + local AXpos = AvatarObj.D[0] + X + OffsetArr[Job][0] - 8; + local AYpos = AvatarObj.D[1] + Y + OffsetArr[Job][1] + 40; setClip(AXpos + OffsetArr[Job][2], AYpos + OffsetArr[Job][3], AXpos + OffsetArr[Job][2] + 22, AYpos + OffsetArr[Job][3] + 18); //开始裁切 - L_sq_DrawImg(AvatarObj.dressImg, AvatarObj.dressImgInt, AXpos, AYpos); + L_sq_DrawImg("character/" + AvatarObj.B + ".img", AvatarObj.C, AXpos, AYpos); releaseClip(); //裁切结束 - // } } } //绘制角色等级 @@ -237,4 +244,5 @@ class FiendwarHallApplyJoinC extends LenheartNewUI_Windows { LenheartNewUI_Windows.SyncPos(X, Y); } + } \ No newline at end of file diff --git a/sqr/Plugins/Fiendwar/FiendwarHallCreateParty.nut b/sqr/Plugins/Fiendwar/FiendwarHallCreateParty.nut index fff9157..9c35dca 100644 --- a/sqr/Plugins/Fiendwar/FiendwarHallCreateParty.nut +++ b/sqr/Plugins/Fiendwar/FiendwarHallCreateParty.nut @@ -17,6 +17,14 @@ class FiendwarHallCreatePartyC extends LenheartNewUI_Windows { constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { Childrens = []; + + //关闭按钮 + local CloseButton = LenheartNewUI_BaseButton(266, 2, 11, 12, "interface/lenheartwindowcommon.img", 276); + CloseButton.OnClick = function() { + CloseWindow(); + }.bindenv(this); + Childrens.append(CloseButton); + local OkButton = LenheartNewUI_ButtonText(78, 124, 5, "确定"); OkButton.SetTextOffset(0, 1); OkButton.OnClick = function() { @@ -27,7 +35,7 @@ class FiendwarHallCreatePartyC extends LenheartNewUI_Windows { items = [L_sq_GetCharacterAttribute(0x1c, 21), L_sq_GetCharacterAttribute(0x1c, 15), L_sq_GetCharacterAttribute(0x1c, 14), L_sq_GetCharacterAttribute(0x1c, 13)], } BasicsDrawTool.SendPackEx(T); - this.Visible = false; + CloseWindow(); } }.bindenv(this); Childrens.append(OkButton); @@ -35,7 +43,7 @@ class FiendwarHallCreatePartyC extends LenheartNewUI_Windows { local CloseButton = LenheartNewUI_ButtonText(144, 124, 5, "取消"); CloseButton.SetTextOffset(0, 1); CloseButton.OnClick = function() { - this.Visible = false; + CloseWindow(); }.bindenv(this); Childrens.append(CloseButton); diff --git a/sqr/Plugins/Fiendwar/FiendwarHallMyParty.nut b/sqr/Plugins/Fiendwar/FiendwarHallMyParty.nut index 709a9d2..d01d46a 100644 --- a/sqr/Plugins/Fiendwar/FiendwarHallMyParty.nut +++ b/sqr/Plugins/Fiendwar/FiendwarHallMyParty.nut @@ -20,7 +20,7 @@ class FiendwarHallMyPartyEdit_BaseButton extends LenheartNewUI_BaseButton { isLBDown = false; } } - +//编队窗口 class FiendwarHallMyPartyEditC extends LenheartNewUI_Windows { //调试模式 // DeBugMode = true; @@ -40,7 +40,7 @@ class FiendwarHallMyPartyEditC extends LenheartNewUI_Windows { //关闭按钮 local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276); CloseButton.OnClick = function() { - this.Visible = false; + CloseWindow(); }.bindenv(this); Childrens.append(CloseButton); @@ -67,7 +67,7 @@ class FiendwarHallMyPartyEditC extends LenheartNewUI_Windows { local CloseButton = LenheartNewUI_ButtonText(150, 158, 5, "关闭"); CloseButton.SetTextOffset(0, 1); CloseButton.OnClick = function() { - this.Visible = false; + CloseWindow(); }.bindenv(this); Childrens.append(CloseButton); @@ -97,7 +97,7 @@ class FiendwarHallMyPartyEditC extends LenheartNewUI_Windows { } if (PartyMarkFlag != 0) { - L_sq_WA(0x1b46898, 2); + L_sq_WA(0x1b46898, 16); } } @@ -113,7 +113,216 @@ class FiendwarHallMyPartyEditC extends LenheartNewUI_Windows { } } +//角色交互按钮需要传递参数所以重写 +class FiendwarHallPlayerInteractive_BaseButton extends LenheartNewUI_BaseButton { + OnShow = null; + + constructor(X, Y, W, H, Path, Idx) { + + LenheartNewUI_BaseButton.constructor(X, Y, W, H, Path, Idx); + } + + //鼠标左键弹起回调 + function OnMouseLbUp(MousePos_X, MousePos_Y) { + Y--; + if (isLBDown && OnClick) { + OnClick(); + } + isLBDown = false; + local Each = LenheartNewUI_CreateWindow(FiendwarHallPlayerInteractiveC, "超时空玩家交互", X, Y, 100, 21, 0); + Each.Visible = false; + } + + function Show(obj) { + //不可用 + if (State == 8) { + L_sq_DrawImg(Path, Idx + 3, X, Y + 1); + } else { + //按下 + if (isLBDown) { + Y++; + L_sq_DrawImg(Path, (Idx * 2) + 2, X, Y); + } + //悬停 + else if (isInRect) { + L_sq_DrawImg(Path, (Idx * 2) + 1, X, Y); + } + //普通 + else { + L_sq_DrawImg(Path, 0, X, Y); + } + } + if (OnShow) OnShow(X, Y); + } +} +//角色交互类 +class FiendwarHallPlayerInteractiveC extends LenheartNewUI_Windows { + // DeBugMode = true; + + HandBoxColor = [ + 0xff717272, + 0xff7b2a29, + 0xff874e0d, + 0xff8b8108, + 0xff658e2d, + 0xff0f5c8a, + 0xff27238f, + 0xff4e2491, + 0xff932586, + ] + + //X Y 裁切开始X Y 裁切结束X Y + OffsetArr = [ + //男鬼剑士 + [45, 103, 230, 231], + //女格斗家 + [56, 102, 235, 279], + //男神枪手 + [52, 130, 238, 246], + //女魔法师 + [55, 87, 234, 293], + //男圣职者 + [42, 115, 223, 200], + //女神枪手 + [52, 119, 226, 209], + //暗夜使者 + [56, 102, 225, 226], + //男格斗家 + [50, 114, 239, 216], + //男魔法师 + [54, 103, 236, 276], + //黑暗武士 + [46, 102, 229, 232], + //缔造者 + [56, 86, 235, 293], + ] + InfoObj = null; + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + Childrens = []; + LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + } + + //初始化Flag 初始化以后才显示 + InitInfoFlag = false; + + function InitInfo() { + Childrens = []; + //还原标签数量 + InitIndexFlag = 1; + //还原高度 + Height = 21; + //还原可见性 + Visible = true; + //置顶窗口 + ResetFocus(); + RegisterWidget(); + InitInfoFlag = true; + } + + InitIndexFlag = 1; + + function RegisterWidget() { + //是团长才能委任 + if (FiendwarTotal.GetInstance().IsCaptain && !("IsMyself" in InfoObj)) { + //委任团长按钮 + local GiveMasterButton = FiendwarHallPlayerInteractive_BaseButton(0, 0 + (InitIndexFlag * 21), 100, 21, "interface2/popup_menu/popup_back.img", 0); + GiveMasterButton.OnShow = function(X, Y) { + L_sq_DrawImg("interface2/popup_menu/popup_icon_character.img", 11, X, Y + 2); + L_sq_DrawCode("委任团长", X + 36, Y + 5, sq_RGBA(104, 213, 237, 255), 0, 1); + } + GiveMasterButton.OnClick = function() { + + }.bindenv(this); + Childrens.append(GiveMasterButton); + InitIndexFlag++; + Height += 21; + } + + //查看信息按钮 + local CheckInfoButton = FiendwarHallPlayerInteractive_BaseButton(0, 0 + (InitIndexFlag * 21), 100, 21, "interface2/popup_menu/popup_back.img", 0); + CheckInfoButton.OnShow = function(X, Y) { + L_sq_DrawImg("interface2/popup_menu/popup_icon_character.img", 10, X, Y + 2); + L_sq_DrawCode("查看信息", X + 36, Y + 5, sq_RGBA(104, 213, 237, 255), 0, 1); + } + CheckInfoButton.OnClick = function() { + local obj = sq_GetMyMasterCharacter(); + obj.sq_PlaySound("CLICK_BUTTON1"); + L_sq_SendPackType(8); + L_sq_SendPackWord(InfoObj.PlayerSession); + L_sq_SendPackByte(3); + L_sq_SendPack(); + getroottable().WindowsShowABFlag <- false; //让原生窗口置顶 + }.bindenv(this); + Childrens.append(CheckInfoButton); + InitIndexFlag++; + Height += 21; + + if (!("IsMyself" in InfoObj)) { + //交易按钮 + local TransactionButton = FiendwarHallPlayerInteractive_BaseButton(0, 0 + (InitIndexFlag * 21), 100, 21, "interface2/popup_menu/popup_back.img", 0); + TransactionButton.OnShow = function(X, Y) { + L_sq_DrawImg("interface2/popup_menu/popup_icon_character.img", 0, X, Y + 2); + L_sq_DrawCode("交易", X + 46, Y + 5, sq_RGBA(104, 213, 237, 255), 0, 1); + } + TransactionButton.OnClick = function() { + local obj = sq_GetMyMasterCharacter(); + obj.sq_PlaySound("CLICK_BUTTON1"); + L_sq_SendPackType(10); + L_sq_SendPackWord(InfoObj.PlayerSession); + L_sq_SendPackByte(1); + L_sq_SendPackDWord(22053); + L_sq_SendPack(); + getroottable().WindowsShowABFlag <- false; //让原生窗口置顶 + }.bindenv(this); + Childrens.append(TransactionButton); + InitIndexFlag++; + Height += 21; + + + //攻坚队员强退按钮 + local KickMemberButton = FiendwarHallPlayerInteractive_BaseButton(0, 0 + (InitIndexFlag * 21), 100, 21, "interface2/popup_menu/popup_back.img", 4); + KickMemberButton.OnShow = function(X, Y) { + L_sq_DrawImg("interface2/popup_menu/popup_icon_warning.img", 3, X, Y + 2); + L_sq_DrawCode("攻坚队员强退", X + 24, Y + 5, sq_RGBA(255, 50, 50, 255), 0, 1); + } + KickMemberButton.OnClick = function() { + local obj = sq_GetMyMasterCharacter(); + obj.sq_PlaySound("CLICK_BUTTON1"); + local T = { + op = 20063021, + teamsId = InfoObj.PartyId, + charCid = InfoObj.Cid + } + BasicsDrawTool.SendPackEx(T); + }.bindenv(this); + Childrens.append(KickMemberButton); + InitIndexFlag++; + Height += 21; + } + } + + function Show(obj) { + if (!InitInfoFlag) return; + L_sq_DrawImg("interface2/popup_menu/popup_back.img", 0, X, Y); + //绘制角色名 + L_sq_DrawCode(InfoObj.Name, X + 61 - LenheartTextClass.GetStringLength(InfoObj.Name) / 2, Y + 4, sq_RGBA(169, 255, 171, 255), 0, 1); + //绘制头像 + foreach(AvatarObj in InfoObj.EquVos) { + local AXpos = AvatarObj.D[0] + X + OffsetArr[InfoObj.Job][0] - 40; + local AYpos = AvatarObj.D[1] + Y + OffsetArr[InfoObj.Job][1]; + setClip(AXpos + OffsetArr[InfoObj.Job][2], AYpos + OffsetArr[InfoObj.Job][3], AXpos + OffsetArr[InfoObj.Job][2] + 22, AYpos + OffsetArr[InfoObj.Job][3] + 18); //开始裁切 + L_sq_DrawImg("character/" + AvatarObj.B + ".img", AvatarObj.C, AXpos, AYpos); + releaseClip(); //裁切结束 + } + + LenheartNewUI_Windows.Show(obj); + } + + function Proc(obj) { + LenheartNewUI_Windows.SyncPos(X, Y); + } +} //队员显示类 @@ -178,6 +387,20 @@ class FiendwarHallMyPartyMemberC extends LenheartNewUI_CommonUi { Obj.SelectState = false; } SelectState = !SelectState; + + + local Each = LenheartNewUI_CreateWindow(FiendwarHallPlayerInteractiveC, "超时空玩家交互", 0, 0, 100, 21, 0); + //改变鼠标坐标 + Each.X = MousePos_X; + Each.Y = MousePos_Y; + //赋值对象参数 + Each.InfoObj = InfoObj; + //对象不是我才能点开交互按钮 + if (InfoObj.Cid == FiendwarTotal.GetInstance().MyCid) { + Each.InfoObj.IsMyself <- true; + } + //刷新UI + Each.InitInfo(); } LenheartNewUI_CommonUi.constructor(10, 82, this.Width, this.Height); @@ -235,6 +458,15 @@ class FiendwarHallMyPartyMemberC extends LenheartNewUI_CommonUi { L_sq_DrawImg("hud/fiendwarl.img", 13, X, Y); } } + + MousePos_X = 0; + MousePos_Y = 0; + //鼠标事件回调 + function OnMouseProc(Flag, gMousePos_X, gMousePos_Y) { + this.MousePos_X = gMousePos_X; + this.MousePos_Y = gMousePos_Y; + LenheartNewUI_CommonUi.OnMouseProc(Flag, gMousePos_X, gMousePos_Y); + } } @@ -252,15 +484,18 @@ class FiendwarHallMyPartyC extends LenheartNewUI_Windows { //是否是我的攻坚队 IsMyTeam = false; + //是否是队长 + IsCaptain = false; //收到请求加入攻坚队包 function JoinTeamCallBack(Chunk) { - Sout("收到请求加入包 : \n\n\n %L", Chunk); + // Sout("收到请求加入包 : \n\n\n %L", Chunk); local Jso = Json.Decode(Chunk); - local win = LenheartNewUI_CreateWindow(FiendwarHallApplyJoinC, "超时空申请加入队伍窗口", 542, 348, 244, 240, 18); - + local win = LenheartNewUI_CreateWindow(FiendwarHallApplyJoinC, "超时空申请加入队伍窗口", 542, 348, 257, 240, 18); + win.Visible = true; local T = { + Charc = Jso.charac, //角色对象 Level = Jso.charac.PlayerLevel, Name = Jso.charac.PlayerName, Job = Jso.charac.PlayerJob, @@ -277,42 +512,30 @@ class FiendwarHallMyPartyC extends LenheartNewUI_Windows { win.RequestJoinTeamArr.append(T); win.InitInfo(); } else win.RequestJoinTeamArr.append(T); - - print(win.RequestJoinTeamArr.len()); } constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { Childrens = []; //注册控件 - RegisterWidget(); + // RegisterWidget(); LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); - //测试数据 - // MembersList = []; - // for (local i = 0; i< 8; i++) { - // local T = { - // TeamId = i + 1, - // Level = "100", - // Name = "玩家" + i, - // JobName = "银月", - // Job = i, - // StkHasFlag = i % 2 - // EquVos = JobAniArr[i] - // } - // local TeamBuf = FiendwarHallMyPartyMemberC(T); - // Childrens.append(TeamBuf); - // MembersList.append(TeamBuf); - // } Pack_Control.rawset(20063006, JoinTeamCallBack.bindenv(this)); } function RegisterWidget() { + //清楚老的按钮在刷新 + foreach(CIndex, Child in Childrens) { + if (!(Child instanceof FiendwarHallMyPartyMemberC)) { + Childrens.remove(CIndex); + } + } //关闭按钮 local CloseButton = LenheartNewUI_BaseButton(336, 0, 11, 12, "interface/lenheartwindowcommon.img", 276); CloseButton.OnClick = function() { - this.Visible = false; + CloseWindow(); }.bindenv(this); Childrens.append(CloseButton); @@ -373,27 +596,28 @@ class FiendwarHallMyPartyC extends LenheartNewUI_Windows { Childrens.append(StageButton); + if (IsCaptain) { + //队伍编制按钮 + local PartyEditButton = LenheartNewUI_ButtonText(10, 268, 5, "队伍编制"); + PartyEditButton.SetTextOffset(-12, 1); + PartyEditButton.OnClick = function() { + local win = LenheartNewUI_CreateWindow(FiendwarHallMyPartyEditC, "超时空我的队伍编队窗口", 105, 40, 294, 192, 18); + win.Visible = true; + }.bindenv(this); + Childrens.append(PartyEditButton); - //队伍编制按钮 //TODO 需要先知道自己是不是队长只有队长才可以编队 - local PartyEditButton = LenheartNewUI_ButtonText(10, 268, 5, "队伍编制"); - PartyEditButton.SetTextOffset(-12, 1); - PartyEditButton.OnClick = function() { - local win = LenheartNewUI_CreateWindow(FiendwarHallMyPartyEditC, "超时空我的队伍编队窗口", 105, 40, 294, 192, 18); - win.Visible = true; - }.bindenv(this); - Childrens.append(PartyEditButton); + //修改信息按钮 + local FqButton = LenheartNewUI_ButtonText(100, 267, 5, "修改信息"); + FqButton.State = 8; + FqButton.SetTextOffset(-12, 1); + Childrens.append(FqButton); - //修改信息按钮 - local FqButton = LenheartNewUI_ButtonText(100, 267, 5, "修改信息"); - FqButton.State = 8; - FqButton.SetTextOffset(-12, 1); - Childrens.append(FqButton); - - //队伍招募按钮 - local FqButton1 = LenheartNewUI_ButtonText(160, 267, 5, "队伍招募"); - FqButton1.State = 8; - FqButton1.SetTextOffset(-12, 1); - Childrens.append(FqButton1); + //队伍招募按钮 + local FqButton1 = LenheartNewUI_ButtonText(160, 267, 5, "队伍招募"); + FqButton1.State = 8; + FqButton1.SetTextOffset(-12, 1); + Childrens.append(FqButton1); + } //退出按钮 local ExitButton = LenheartNewUI_ButtonText(220, 268, 5, "退出"); @@ -448,4 +672,25 @@ class FiendwarHallMyPartyC extends LenheartNewUI_Windows { LenheartNewUI_Windows.SyncPos(X, Y); } + + + /* + # override # " + * @函数作用: + * @参数 name + * @返回值 + */ + //鼠标左键弹起回调 + function OnMouseLbUp(MousePos_X, MousePos_Y) { + foreach(Window in Childrens) { + Window.OnMouseLbUp(MousePos_X, MousePos_Y); + } + LenheartNewUI_Windows.OnMouseLbUp(MousePos_X, MousePos_Y); + //判断没有点到具体角色就隐藏 + if (!sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y + 80, Width, MembersList.len() * 21)) { + //交互窗口需要隐藏 + local Each = LenheartNewUI_CreateWindow(FiendwarHallPlayerInteractiveC, "超时空玩家交互", X, Y, 100, 21, 0); + Each.Visible = false; + } + } } \ No newline at end of file diff --git a/sqr/Plugins/MarrySystem/MarrySystem.nut b/sqr/Plugins/MarrySystem/MarrySystem.nut index 45820f7..fa8d7c8 100644 --- a/sqr/Plugins/MarrySystem/MarrySystem.nut +++ b/sqr/Plugins/MarrySystem/MarrySystem.nut @@ -204,7 +204,7 @@ class MarrySystemC extends BasicsDrawTool { Tobj.PrintAbTab = []; Tobj.AbTab = null; Tobj.AbTab = []; - for (local i = 0; i < 20; i++) { + for (local i = 0; i< 20; i++) { local buf = Buffer.Get("attribute->" + i); if (!buf && i == 0) break; Tobj.PrintAbTab.append(buf); @@ -277,7 +277,7 @@ class MarrySystemC extends BasicsDrawTool { Tobj.PrintAbTab = null; Tobj.PrintAbTab = []; - for (local i = 0; i < 20; i++) { + for (local i = 0; i< 20; i++) { local buf = Buffer.Get("attribute->" + i); if (!buf && i == 0) break; Tobj.PrintAbTab.append(buf); @@ -416,7 +416,7 @@ class MarrySystemC extends BasicsDrawTool { //绘制属性 function DrawAttribute(obj) { if (PrintAbTab) { - for (local i = 0; i < 20; i++) { + for (local i = 0; i< 20; i++) { L_sq_DrawCode(TabName[i] + " " + PrintAbTab[i], X + 20 + ((i / 10) * 170), Y + 264 + ((i % 10) * 17), sq_RGBA(255, 255, 255, 250), 1, 1); } } @@ -473,7 +473,7 @@ class MarrySystemC extends BasicsDrawTool { MainState = false; } - if(obj.isDead()){ + if (obj.isDead()) { DgnAddBuff = false; } } diff --git a/sqr/Plugins/NewUpgrade/NewUpgrade.nut b/sqr/Plugins/NewUpgrade/NewUpgrade.nut index ef747de..40a9907 100644 --- a/sqr/Plugins/NewUpgrade/NewUpgrade.nut +++ b/sqr/Plugins/NewUpgrade/NewUpgrade.nut @@ -243,7 +243,7 @@ class UpgradeC extends BasicsDrawTool { local Size = Buffer.Get("size"); if (Size && Size > 0) { - for (local i = 0; i < Size; i++) { + for (local i = 0; i< Size; i++) { local barr = { name = Buffer.Get("upgradeitem->" + i + "->name"), id = Buffer.Get("upgradeitem->" + i + "->id"), diff --git a/sqr/Plugins/Ptst/Ptst.nut b/sqr/Plugins/Ptst/Ptst.nut index 9d613e7..7d293a5 100644 --- a/sqr/Plugins/Ptst/Ptst.nut +++ b/sqr/Plugins/Ptst/Ptst.nut @@ -387,7 +387,7 @@ class PtstItem extends BasicsDrawTool { strarr.append(strbuff); Bpos = Npos + 1; } - for (local z = 0; z < strarr.len(); z++) { + for (local z = 0; z< strarr.len(); z++) { L_sq_DrawCode(strarr[z], x, y + (z * 14), rgba, mb, jc); } } @@ -408,7 +408,7 @@ class PtstItem extends BasicsDrawTool { local X4 = 0; //属强线偏移 local X5 = 0; //全属强线偏移 MCount = 0; - for (local y = 0; y < Attribute.len(); y++) { + for (local y = 0; y< Attribute.len(); y++) { local gType = Attribute[y][0]; //防御力 if (gType == 9 || gType == 10) X1 = 1; @@ -447,7 +447,7 @@ class PtstItem extends BasicsDrawTool { T_DrawStayAni(obj, "common/ptst/main.ani", dx, dy + 19, 26, "PtstItemInfoMainXiana"); //绘制中 - for (local i = 0; i < line; i++) { + for (local i = 0; i< line; i++) { T_DrawStayAni(obj, "common/ptst/main.ani", dx, dy + 19 + 14 + (i * 14), 27, "PtstItemInfoMainZhong"); } //绘制底 @@ -487,7 +487,7 @@ class PtstItem extends BasicsDrawTool { local RGBA; //根据不同的属性绘制不同颜色字体 //防御属性 - for (; o < Attribute.len(); o++) { + for (; o< Attribute.len(); o++) { local gType = Attribute[o][0]; //如果不属于防御属性就终止 if (gType != 9 && gType != 10) break; @@ -507,10 +507,10 @@ class PtstItem extends BasicsDrawTool { } //四维属性 - for (; o < Attribute.len(); o++) { + for (; o< Attribute.len(); o++) { local gType = Attribute[o][0]; //如果不属于四维属性就终止 - if (gType < 2 || gType > 5) break; + if (gType< 2 || gType > 5) break; RGBA = sq_RGBA(141, 140, 109, 250); local gTabName = TabName[gType]; @@ -521,10 +521,10 @@ class PtstItem extends BasicsDrawTool { } //三攻属性 - for (; o < Attribute.len(); o++) { + for (; o< Attribute.len(); o++) { local gType = Attribute[o][0]; //如果不属于三攻属性就终止 - if (gType < 6 || gType > 8) break; + if (gType< 6 || gType > 8) break; RGBA = sq_RGBA(255, 255, 216, 200); local gTabName = TabName[gType]; @@ -534,17 +534,17 @@ class PtstItem extends BasicsDrawTool { if (o == (Attribute.len() - 1 - MCount)) return; } - if ((SGS || SWS) && (o < Attribute.len())) { + if ((SGS || SWS) && (o< Attribute.len())) { //绘制线 T_DrawStayAni(obj, "common/ptst/main.ani", dx, cy + (XianCount * 14) + ((o - 1) * 15), 29, "PtstItemInfoMainXianT"); XianCount++; } //三速属性 - for (; o < Attribute.len(); o++) { + for (; o< Attribute.len(); o++) { local gType = Attribute[o][0]; //如果不属于三速属性就终止 - if (gType < 11 || gType > 16) break; + if (gType< 11 || gType > 16) break; RGBA = sq_RGBA(166, 215, 136, 250); local gTabName = TabName[gType]; @@ -561,10 +561,10 @@ class PtstItem extends BasicsDrawTool { } //属强属性 - for (; o < Attribute.len(); o++) { + for (; o< Attribute.len(); o++) { local gType = Attribute[o][0]; //如果不属于属强属性就终止 - if (gType < 17 || gType > 20) break; + if (gType< 17 || gType > 20) break; RGBA = sq_RGBA(240, 230, 135, 250); local gTabName = TabName[gType]; @@ -577,7 +577,7 @@ class PtstItem extends BasicsDrawTool { if (SQS) XianCount++; //全属强属性 - for (; o < Attribute.len(); o++) { + for (; o< Attribute.len(); o++) { local gType = Attribute[o][0]; //如果不属于全属强属性就终止 if (gType != 21) break; @@ -743,7 +743,7 @@ class PtstSlot extends BasicsDrawTool { } //如果左键按下 写入可移动状态 - if (Item && isLBDown(obj) && Tobj.MoveModel == null && slot < 88) { + if (Item && isLBDown(obj) && Tobj.MoveModel == null && slot< 88) { Tobj.MoveModel = SlotName; } @@ -967,12 +967,12 @@ class PtstC extends BasicsDrawTool { } */ - for (local w = 0; w < 3; w++) { + for (local w = 0; w< 3; w++) { local dataarrsize = Buffer.Get("data->" + w + "->dataarrsize"); if (dataarrsize) { local dataarr = []; - for (local z = 0; z < dataarrsize; z++) { + for (local z = 0; z< dataarrsize; z++) { local arrbuufer = []; local a = Buffer.Get("data->" + w + "->stk_ab->" + z + "->0"); local b = Buffer.Get("data->" + w + "->stk_ab->" + z + "->1"); @@ -989,12 +989,12 @@ class PtstC extends BasicsDrawTool { } } - for (local u = 0; u < 9; u++) { + for (local u = 0; u< 9; u++) { local dataarrsize = Buffer.Get("fdata->" + u + "->dataarrsize"); if (dataarrsize) { local dataarr = []; - for (local z = 0; z < dataarrsize; z++) { + for (local z = 0; z< dataarrsize; z++) { local arrbuufer = []; local a = Buffer.Get("fdata->" + u + "->stk_ab->" + z + "->0"); local b = Buffer.Get("fdata->" + u + "->stk_ab->" + z + "->1"); @@ -1044,7 +1044,7 @@ class PtstC extends BasicsDrawTool { local Tobj = RootTab["PtstObj"]; Tobj.MaxPage = Buffer.Get("slotpage"); Tobj.ColorArr = []; - for (local i = 0; i < 8; i++) { + for (local i = 0; i< 8; i++) { local arrbuffer = [] arrbuffer.append(Buffer.Get("color" + i + "->0")); arrbuffer.append(Buffer.Get("color" + i + "->1")); @@ -1095,14 +1095,14 @@ class PtstC extends BasicsDrawTool { //Tobj.SlotArr = []; local Count = Buffer.Get("count"); - for (local z = 0; z < 24; z++) { + for (local z = 0; z< 24; z++) { Tobj.SlotB[z].Item = null; } - for (local i = 0; i < Count; i++) { + for (local i = 0; i< Count; i++) { local SlotPos = Buffer.Get("data->" + i + "->slot"); local dataarrsize = Buffer.Get("data->" + i + "->dataarrsize"); local dataarr = []; - for (local z = 0; z < dataarrsize; z++) { + for (local z = 0; z< dataarrsize; z++) { local arrbuufer = []; local a = Buffer.Get("data->" + i + "->stk_ab->" + z + "->0"); local b = Buffer.Get("data->" + i + "->stk_ab->" + z + "->1"); @@ -1211,7 +1211,7 @@ class PtstC extends BasicsDrawTool { if (RightButton.isLBActive()) { //页码增加 - if (NowPage < MaxPage) NowPage++; + if (NowPage< MaxPage) NowPage++; //清空槽对象 SlotB = []; SlotB = null; @@ -1228,7 +1228,7 @@ class PtstC extends BasicsDrawTool { { if (!SlotB || SlotB.len() <= 0) return; //第一图层 - for (local q = 0; q < 24; q++) { + for (local q = 0; q< 24; q++) { SlotB[q].Show(obj, X - 120 + 137 + ((q % 8) * 28), Y - 50 + 346 + ((q / 8) * 31), q); } @@ -1247,7 +1247,7 @@ class PtstC extends BasicsDrawTool { A_Slot2.Show(obj, X - 120 + 120 + 140, Y - 50 + 50 + 153, 92); //第二图层 - for (local u = 0; u < 24; u++) { + for (local u = 0; u< 24; u++) { SlotB[u].ItemShow(obj); } C_Slot0.ItemShow(obj); @@ -1264,7 +1264,7 @@ class PtstC extends BasicsDrawTool { A_Slot1.ItemShow(obj); A_Slot2.ItemShow(obj); - for (local z = 0; z < 24; z++) { + for (local z = 0; z< 24; z++) { SlotB[z].ItemMoveShow(obj); } C_Slot0.ItemMoveShow(obj); @@ -1383,7 +1383,7 @@ class PtstC extends BasicsDrawTool { SlotB = []; SlotB.resize(24); } - for (local i = 0; i < 24; i++) { + for (local i = 0; i< 24; i++) { if (SlotB[i] == null) SlotB[i] = PtstSlot(5); } @@ -1427,6 +1427,4 @@ function Ptst(obj) { RootTab["PtstObj"].Proc(obj); RootTab["PtstObj"].Draw(obj); } -} - - +} \ No newline at end of file diff --git a/sqr/Plugins/RaidAuction/RaidAuction.nut b/sqr/Plugins/RaidAuction/RaidAuction.nut index 2c6fa47..43acc44 100644 --- a/sqr/Plugins/RaidAuction/RaidAuction.nut +++ b/sqr/Plugins/RaidAuction/RaidAuction.nut @@ -231,7 +231,7 @@ class RAIDAUCTIONC extends BasicsDrawTool { RootTab["RAIDAUCTIONObj"].AuctionPack = null; RootTab["RAIDAUCTIONObj"].AuctionPack = []; - for (local i = 0; i < 5; i++) { + for (local i = 0; i< 5; i++) { local Gid = Buffer.Get("auctionpack->" + i + "->id"); if (Gid == false) break; local Gcount = Buffer.Get("auctionpack->" + i + "->count"); @@ -368,7 +368,7 @@ class RAIDAUCTIONC extends BasicsDrawTool { local a = 1; if (count == 0) return a; local b = 10; - for (local i = 0; i < count - 1; i++) { + for (local i = 0; i< count - 1; i++) { b *= b; } return a * b; @@ -376,7 +376,7 @@ class RAIDAUCTIONC extends BasicsDrawTool { //绘制按钮 function DrawAuctionButton(obj) { - for (local i = 0; i < 3; i++) { + for (local i = 0; i< 3; i++) { local Button = RAIDAUCTIONButtonPro(obj, "Raid_AuctionButton" + i, X + 28 + (i * 98), Y + 266, "common/raid_auction/yosin/tbjp.ani", 77, 24, 0); Button.SetRectEnble(true, "Raid_AuctionButtonr" + i, X + 28 + (i * 98), Y + 266, "common/raid_auction/yosin/tbjp.ani", 1); Button.SetCustomClickEnble(true, "Raid_AuctionButtonc" + i, X + 28 + (i * 98), Y + 266, "common/raid_auction/yosin/tbjp.ani", 2); diff --git a/sqr/Plugins/ServerAuction/ServerAuction.nut b/sqr/Plugins/ServerAuction/ServerAuction.nut index 0dcfc37..8888bd5 100644 --- a/sqr/Plugins/ServerAuction/ServerAuction.nut +++ b/sqr/Plugins/ServerAuction/ServerAuction.nut @@ -269,7 +269,7 @@ class ServerAuctionC extends BasicsDrawTool { RootTab["ServerAuctionCObj"].AuctionPack = null; RootTab["ServerAuctionCObj"].AuctionPack = []; - for (local i = 0; i < 5; i++) { + for (local i = 0; i< 5; i++) { local Gid = Buffer.Get("auctionpack->" + i + "->id"); if (Gid == false) break; local Gcount = Buffer.Get("auctionpack->" + i + "->count"); @@ -391,7 +391,7 @@ class ServerAuctionC extends BasicsDrawTool { local a = 1; if (count == 0) return a; local b = 10; - for (local i = 0; i < count - 1; i++) { + for (local i = 0; i< count - 1; i++) { b *= b; } return a * b; @@ -399,7 +399,7 @@ class ServerAuctionC extends BasicsDrawTool { //绘制按钮 function DrawAuctionButton(obj) { - for (local i = 0; i < 3; i++) { + for (local i = 0; i< 3; i++) { local Button = ServerAuctionPro(obj, "Server_AuctionButton" + i, X + 28 + (i * 98), Y + 266 + 68, "common/server_auction/qfjp.ani", 77, 24, 0); Button.SetRectEnble(true, "Server_AuctionButtonr" + i, X + 28 + (i * 98), Y + 266 + 68, "common/server_auction/qfjp.ani", 1); Button.SetCustomClickEnble(true, "Server_AuctionButtonc" + i, X + 28 + (i * 98), Y + 266 + 68, "common/server_auction/qfjp.ani", 2); diff --git a/sqr/Tool/ClassTool.nut b/sqr/Tool/ClassTool.nut index d8104fb..3bd1f6d 100644 --- a/sqr/Tool/ClassTool.nut +++ b/sqr/Tool/ClassTool.nut @@ -636,19 +636,19 @@ class LenheartButton extends LenheartcommonUiC { function Show() { //不可用 if (State == 8) { - L_sq_DrawButton(X, Y + 1, this.DWidth, Path, Idx + 9,FillWidth,FirstWidth); + L_sq_DrawButton(X, Y + 1, this.DWidth, Path, Idx + 9, FillWidth, FirstWidth); } else { //按下 if (isLBDown()) { - L_sq_DrawButton(X, Y + 1, this.DWidth, Path, Idx + 3,FillWidth,FirstWidth); + L_sq_DrawButton(X, Y + 1, this.DWidth, Path, Idx + 3, FillWidth, FirstWidth); } //悬停 else if (isInRect()) { - L_sq_DrawButton(X, Y, this.DWidth, Path, Idx + 3,FillWidth,FirstWidth); + L_sq_DrawButton(X, Y, this.DWidth, Path, Idx + 3, FillWidth, FirstWidth); } //普通 else { - L_sq_DrawButton(X, Y, this.DWidth, Path, Idx,FillWidth,FirstWidth); + L_sq_DrawButton(X, Y, this.DWidth, Path, Idx, FillWidth, FirstWidth); } } } @@ -1037,35 +1037,34 @@ class Json { Str += Key.tostring(); Str += "\""; Str += ":"; - + if (typeof(Value) == "string") { - print(Value.len()); - Sout("中文字符串為: %L",Value); + // print(Value.len()); + // Sout("中文字符串為: %L", Value); Str += "\""; Str += Value; Str += "\""; } else if (typeof(Value) == "table") { Str += Json.Encode(Value); - } else if (typeof(Value) == "array") { + } else if (typeof(Value) == "array") { Str += "["; foreach(ArrObj in Value) { - if(typeof(ArrObj) == "table")Str += Json.Encode(Value); - else{ + if (typeof(ArrObj) == "table") Str += Json.Encode(Value); + else { Str += ArrObj; Str += ","; } } - Str = Str.slice(0,Str.len() - 1); + Str = Str.slice(0, Str.len() - 1); Str += "]"; - }else Str += Value; + } else Str += Value; if (Pos != Size) Str += ","; } Str += "}"; return Str; } - function Decode(Str) - { + function Decode(Str) { Str = L_sq_DecondeJson(Str); local Str = "local _M = " + Str + ";\n return _M;\n"; local Func = compilestring(Str); diff --git a/sqr/Tool/UiClassTool.nut b/sqr/Tool/UiClassTool.nut index 73eebbc..e2b6f72 100644 --- a/sqr/Tool/UiClassTool.nut +++ b/sqr/Tool/UiClassTool.nut @@ -4,15 +4,71 @@ 创建日期:2024-03-20 11:27 文件用途:UI */ + +//新窗口队列 +L_Windows_List <- []; + +//如果根空间没有选定AB层的Flag 就新建一个 默认是false 渲染在下层 +if (!("WindowsShowABFlag" in getroottable())) { + getroottable().WindowsShowABFlag <- false; +} +//是否鼠标悬停在窗口上 +if (!("WindowsHoverFlag" in getroottable())) { + getroottable().WindowsHoverFlag <- false; +} +//用于查询是否鼠标悬停在原生窗口上的Flag 以下编号代表着没有悬停其他均为悬停在原生窗口 +NotOldWindowsMap <- {} +NotOldWindowsMap.rawset(92, 1); +NotOldWindowsMap.rawset(79, 1); +NotOldWindowsMap.rawset(2396, 1); +NotOldWindowsMap.rawset(3877, 1); +NotOldWindowsMap.rawset(3878, 1); +NotOldWindowsMap.rawset(3873, 1); +NotOldWindowsMap.rawset(3874, 1); +NotOldWindowsMap.rawset(3858, 1); +NotOldWindowsMap.rawset(3871, 1); +NotOldWindowsMap.rawset(3857, 1); +NotOldWindowsMap.rawset(3861, 1); +NotOldWindowsMap.rawset(3862, 1); +// NotOldWindowsMap.rawset(-1, 1); +NotOldWindowsMap.rawset(93, 1); +NotOldWindowsMap.rawset(94, 1); +NotOldWindowsMap.rawset(95, 1); +NotOldWindowsMap.rawset(96, 1); +NotOldWindowsMap.rawset(97, 1); +NotOldWindowsMap.rawset(98, 1); +NotOldWindowsMap.rawset(99, 1); +NotOldWindowsMap.rawset(100, 1); +NotOldWindowsMap.rawset(101, 1); +NotOldWindowsMap.rawset(114, 1); +NotOldWindowsMap.rawset(88, 1); +NotOldWindowsMap.rawset(102, 1); +NotOldWindowsMap.rawset(108, 1); +NotOldWindowsMap.rawset(109, 1); +NotOldWindowsMap.rawset(103, 1); +NotOldWindowsMap.rawset(104, 1); +NotOldWindowsMap.rawset(110, 1); +NotOldWindowsMap.rawset(111, 1); +NotOldWindowsMap.rawset(105, 1); +NotOldWindowsMap.rawset(106, 1); +NotOldWindowsMap.rawset(112, 1); +NotOldWindowsMap.rawset(113, 1); +NotOldWindowsMap.rawset(107, 1); +NotOldWindowsMap.rawset(87, 1); +NotOldWindowsMap.rawset(86, 1); +NotOldWindowsMap.rawset(80, 1); +NotOldWindowsMap.rawset(81, 1); +NotOldWindowsMap.rawset(82, 1); +NotOldWindowsMap.rawset(83, 1); +NotOldWindowsMap.rawset(4067, 1); +// NotOldWindowsMap.rawset(130, 1); +NotOldWindowsMap.rawset(122, 1); + //基础窗口类 class LenheartNewUI_BaseWindow extends BasicsDrawTool { - //子控件 Childrens = null; - constructor() { - //子控件 - // Childrens = []; - } + constructor() {} //鼠标事件回调 function OnMouseProc(Flag, MousePos_X, MousePos_Y) { foreach(Window in Childrens) { @@ -50,7 +106,6 @@ class LenheartNewUI_BaseWindow extends BasicsDrawTool { } } - function Show(obj) { foreach(Window in Childrens) { Window.Show(obj); @@ -64,9 +119,9 @@ class LenheartNewUI_BaseWindow extends BasicsDrawTool { } } - +//窗口类 class LenheartNewUI_Windows extends LenheartNewUI_BaseWindow { - //MyObjectId + //窗口名称 ObjectId = null; //可用性 Visible = true; @@ -92,10 +147,6 @@ class LenheartNewUI_Windows extends LenheartNewUI_BaseWindow { //移动Flag MoveFlag = false; - YMouseSw = true; - //焦点 - Focus = true; - constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { ObjectId = gObjectId; //宽度 @@ -110,48 +161,42 @@ class LenheartNewUI_Windows extends LenheartNewUI_BaseWindow { //Y坐标 Y = gY; - Init(); + ResetFocus(); //调用原生方法 LenheartNewUI_BaseWindow.constructor(); } + //加入窗口队列 并且切换到最上层窗口 function ResetFocus() { foreach(Index, WindowObj in L_Windows_List) { if (WindowObj.ObjectId == this.ObjectId) L_Windows_List.remove(Index); - WindowObj.Focus = false; } - this.Focus = true; L_Windows_List.append(this); + //切换上层显示 + getroottable().WindowsShowABFlag <- true; } - - //加入窗口队列 - function Init() { - ResetFocus(); - } - - //设定鼠标逻辑 - function LockMouse(MousePos_X, MousePos_Y) { - if (!Visible) return; - if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) { - IMouse.LockMouseClick(); - YMouseSw = false; - L_sq_WA(0x1b46898, 1); - IMouse.LockState <- true; - } else { - if (YMouseSw == false && sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, 0, 0, 800, 600) && !MoveFlag) { - IMouse.ReleaseMouseClick(); - YMouseSw = true; - L_sq_WA(0x1b46898, 0); - IMouse.LockState <- false; - } + //关闭窗口 -并没有销毁只是隐藏 + function CloseWindow() { + this.Visible = false; + if (L_sq_RAB(0x1B46886)) { + L_sq_WAB(0x1B46886, 0); } + L_sq_WA(0x1b46898, 0); + } + //销毁窗口 + function DestroyWindow() { + foreach(Index, WindowObj in L_Windows_List) { + if (WindowObj.ObjectId == this.ObjectId) L_Windows_List.remove(Index); + } + if (L_sq_RAB(0x1B46886)) { + L_sq_WAB(0x1B46886, 0); + } + L_sq_WA(0x1b46898, 0); } function Show(obj) { if (!Visible) return; - // L_sq_DrawImg("interface2/yosin/tbjp.img", 4, X, Y + 1); - //调用原生方法 LenheartNewUI_BaseWindow.Show(obj); if (DeBugMode) DeBug(obj); @@ -165,8 +210,7 @@ class LenheartNewUI_Windows extends LenheartNewUI_BaseWindow { //override function OnMouseProc(Flag, MousePos_X, MousePos_Y) { if (!Visible) return; - //设定鼠标逻辑 - if (!MoveFlag) LockMouse(MousePos_X, MousePos_Y); + //设定拖动逻辑 if (Flag == 1) { if (MoveFlag) { //左键拖动 @@ -257,60 +301,58 @@ function LenheartNewUI_CreateWindow(ClassName, gObjectId, gX, gY, gWidth, gHeigh function CheackMouseInNewWindows(MousePos_X, MousePos_Y) { local Flag = false; foreach(Window in L_Windows_List) { + if (!Window.Visible) continue; if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, Window.X, Window.Y, Window.Width, Window.Height)) { Flag = true; + getroottable().WindowsHoverFlag <- true; return Flag; } } + getroottable().WindowsHoverFlag <- false; return Flag; } - - -//鼠标事件 -/* -a1 -常规状态 200 -左键点击 201 -左键松开 202 -右键点击 204 -右键松开 205 -滚轮滚动事件 20a -看a2 如果是ff880000 向下 如果是780000 向上 -中建按下没有事件 - -鼠标事件为200 并且a2 = 1 为左键拖动 a2=2为右键拖动 中建按下拖动a2 =10 - -a2=3的时候代表2个键一起按下 事件代表后按下的键*/ - -//如果根空间没有选定AB层的Flag 就新建一个 默认是false 渲染在下层 -if (!("WindowsShowABFlag" in getroottable())) { - getroottable().WindowsShowABFlag <- false; +//遍历是否悬停在原生窗口上 +function CheackMouseInOldWindows() { + if (!NotOldWindowsMap.rawin(L_sq_RA(0x1A32950))) { + return true; + } + return false; } +//设定鼠标逻辑 +function RunMouseLogic(MousePos_X, MousePos_Y) { + //解锁鼠标 如果鼠标已处于锁定状态 并且没有悬停在任何窗口上 解锁鼠标 + if (L_sq_RAB(0x1B46886)) { + if (!CheackMouseInNewWindows(MousePos_X, MousePos_Y)) L_sq_WAB(0x1B46886, 0); + else if (CheackMouseInOldWindows() && !getroottable().WindowsShowABFlag) L_sq_WAB(0x1B46886, 0); + } + //锁定鼠标 如果鼠标处于未锁定状态 并且悬停在任意一个窗口上 + else if (!L_sq_RAB(0x1B46886) && CheackMouseInNewWindows(MousePos_X, MousePos_Y)) { + //如果没有悬停任何原生窗口直接锁 + if (!CheackMouseInOldWindows()) { + L_sq_WAB(0x1B46886, 1); + } + //如果有悬停原生窗口 就要判断AB层 + else { + if (getroottable().WindowsShowABFlag) L_sq_WAB(0x1B46886, 1); + } + } +} + + function L_MouseCallBack(MouseState, MouseFlag, MousePos_X, MousePos_Y) { + if (MouseState == 0x200) { + //常规事件就要设定鼠标是否锁定逻辑 + RunMouseLogic(MousePos_X, MousePos_Y); + } //如果渲染层级在下级 即A层 或者是 鼠标没有悬停在任何新窗口上时 执行判断 如果悬停在原生窗口 就解除鼠标锁定 如果点击 就改变渲染层级 if (!getroottable().WindowsShowABFlag || !CheackMouseInNewWindows(MousePos_X, MousePos_Y)) { - if (L_sq_RA(0x1A32950) != 92 && L_sq_RA(0x1A32950) != 2396 - // && L_sq_RA(0x1A32950) != 3877 //小地图 - // && - // L_sq_RA(0x1A32950) != 3878 //小地图 - // && - // L_sq_RA(0x1A32950) != 3873 //小地图 - // && - // L_sq_RA(0x1A32950) != 3874 //小地图 - ) { - if ("LockState" in IMouse) { - if (IMouse.LockState) { - IMouse.ReleaseMouseClick(); - IMouse.LockState <- false; - } - } + if (CheackMouseInOldWindows()) { //如果点击了原生窗口 就把渲染队列改成下 if (MouseState == 0x201) getroottable().WindowsShowABFlag <- false; return; } } - //克隆一遍窗口列表 local WindowListF = clone(L_Windows_List); WindowListF.reverse(); @@ -357,8 +399,11 @@ function L_MouseCallBack(MouseState, MouseFlag, MousePos_X, MousePos_Y) { } } -// if (!getroottable().rawin("L_Windows_List")) -L_Windows_List <- []; +function L_OpenOldWindowCallBack(WindowIndex) { + print(WindowIndex); + //将新窗口渲染队列改为下层 + getroottable().WindowsShowABFlag <- false; +} //窗口逻辑入口 function L_WindowsLogic(obj) { @@ -386,7 +431,6 @@ function L_WindowsLogic(obj) { if (KeyPressNB.isKeyPress(48, "AllLenheartWindows")) { foreach(Window in L_Windows_List) { Window.Visible = false; - Window.YMouseSw = true; } L_sq_WA(0x1b46898, 0); IMouse.ReleaseMouseClick(); @@ -407,8 +451,6 @@ function L_DrawWindow_B() { //B层只在上层渲染 if (getroottable().WindowsShowABFlag) L_WindowsLogic(obj); - //因为图层太高会盖掉鼠标 所以重新画一个 - L_sq_DrawImg("interface/newstyle/windows/cursor.img", 0, IMouse.GetXPos(), IMouse.GetYPos()); } class LenheartNewUI_CommonUi extends LenheartNewUI_BaseWindow {