diff --git a/Base/CallBack/DrawMain.nut b/Base/CallBack/DrawMain.nut index 2de94a9..0373674 100644 --- a/Base/CallBack/DrawMain.nut +++ b/Base/CallBack/DrawMain.nut @@ -158,7 +158,15 @@ function L_drawMainCustomUI_All() { // if (WindowAddress != 0) print(format("%02X", WindowAddress)); // if (WindowAddress == 0x39F56000) print(i); // } + + // if (Clock() - getroottable().SINNU >= 10) { + // getroottable().SINNU = Clock(); + // L_sq_MoveTown(1, 1, 474, 249); + // } + + // print(sq_GetCurrentModuleType()); } +// getroottable().SINNU <- Clock(); // getroottable().Lsnzz <- Clock(); // dofile("sqr/Base/_Tool/Json.nut"); diff --git a/Base/UI/Lenheart_Each_Class.nut b/Base/UI/Lenheart_Each_Class.nut index 7890f98..0e3655c 100644 --- a/Base/UI/Lenheart_Each_Class.nut +++ b/Base/UI/Lenheart_Each_Class.nut @@ -212,12 +212,12 @@ class Lenheart_EachC extends LenheartNewUI_Windows { Width = 100; //高度 Height = (21 * Childrens.len()); - // //同步子对象坐标 - // foreach(winobj in Childrens) { - // winobj.X = Info.X; - // winobj.Y = Info.Y + (21 * Info.Count); + //同步子对象坐标 + foreach(pos, winobj in Childrens) { + winobj.X = Info.X; + winobj.Y = Info.Y + (21 * (Info.Count + pos)); - // } + } } } diff --git a/Base/UI/Lenheart_UI_Class.nut b/Base/UI/Lenheart_UI_Class.nut index 2dcbee0..f9a5c4a 100644 --- a/Base/UI/Lenheart_UI_Class.nut +++ b/Base/UI/Lenheart_UI_Class.nut @@ -535,8 +535,8 @@ function L_MouseCallBack(MouseState, MouseFlag, MousePos_X, MousePos_Y) { RunMouseLogic(MousePos_X, MousePos_Y); } - //判断是否悬停活动图标 - if (getroottable().rawin("EventList_Obj")) EventList_Obj.CheckInEvent(MousePos_X, MousePos_Y); + //判断是否悬停活动图标 没悬停在老窗口上 没在选图界面 + if (getroottable().rawin("EventList_Obj") && !CheackMouseInOldWindows() && sq_GetCurrentModuleType() != 2) EventList_Obj.CheckInEvent(MousePos_X, MousePos_Y); //如果渲染层级在下级 即A层 或者是 鼠标没有悬停在任何新窗口上时 执行判断 如果悬停在原生窗口 就解除鼠标锁定 如果点击 就改变渲染层级 @@ -611,10 +611,10 @@ function L_WindowsLogic(obj) { local WindowExistence = false; //遍历窗口队列 如果可见则调用Show 只要有一个可见就写入Flag foreach(Window in L_Windows_List) { - Window.Proc(obj); + if (sq_GetCurrentModuleType() != 2) Window.Proc(obj); if (Window.Visible) { - Window.Show(obj); - Window.TopShow(obj); + if (sq_GetCurrentModuleType() != 2) Window.Show(obj); + if (sq_GetCurrentModuleType() != 2) Window.TopShow(obj); if (!Window.rawin("NoWindow")) { WindowExistence = true; } @@ -638,23 +638,26 @@ function L_WindowsLogic(obj) { } } //如果按下ESC键要将所有的窗口关闭 - if (KeyPressNB.isKeyPress(48, "AllLenheartWindows")) { - local Flag = false; - foreach(Window in L_Windows_List) { - if (!Window.rawin("NoWindow")) { - Flag = true; - Window.CloseWindow(); + if (WindowExistence) { + if (KeyPressNB.isKeyPress(48, "AllLenheartWindows") || sq_GetCurrentModuleType() == 2) { + local Flag = false; + foreach(Window in L_Windows_List) { + if (!Window.rawin("NoWindow")) { + Flag = true; + Window.CloseWindow(); + } + } + if (Flag) { + getroottable().WindowsShowABFlag <- false; + //还原鼠标 + R_Mouse.Restore(); + L_Sq_CallFunc(0x11A8B60, "void", FFI_MS_CDECL, []); + // L_sq_MouseClick(); + Rindro_MouseClickFlag = 5; } } - if (Flag) { - getroottable().WindowsShowABFlag <- false; - //还原鼠标 - R_Mouse.Restore(); - L_Sq_CallFunc(0x11A8B60, "void", FFI_MS_CDECL, []); - // L_sq_MouseClick(); - Rindro_MouseClickFlag = 5; - } } + } //绘制下层回调 function L_DrawWindow_A() { @@ -951,6 +954,7 @@ class LenheartNewUI_BaseInput extends LenheartNewUI_CommonUi { class LenheartNewUI_SwitchButton extends LenheartNewUI_CommonUi { State = 0; ImgIndex = null; + ImgPath = "interface/lenheartwindowcommon.img"; constructor(X, Y) { LenheartNewUI_CommonUi.constructor(X, Y, 14, 15); @@ -959,25 +963,25 @@ class LenheartNewUI_SwitchButton extends LenheartNewUI_CommonUi { function Show(obj) { //不可用 if (State == 8) { - L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex + 3 : 141, X, Y + 1); + L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex + 3 : 141, X, Y + 1); } else { //悬停 if (isLBDown) { - L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex + 2 : 140, X, Y + 1); + L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex + 2 : 140, X, Y + 1); } //按下 else if (isInRect) { if (State == 0) - L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex + 1 : 139, X, Y); + L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex + 1 : 139, X, Y); if (State == 1) - L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex + 2 : 140, X, Y); + L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex + 2 : 140, X, Y); } //普通 else { if (State == 0) - L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex : 138, X, Y); + L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex : 138, X, Y); if (State == 1) - L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex + 2 : 140, X, Y); + L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex + 2 : 140, X, Y); } } diff --git a/Base/_Tool/Hacker_Class.nut b/Base/_Tool/Hacker_Class.nut index 194afc1..8143383 100644 --- a/Base/_Tool/Hacker_Class.nut +++ b/Base/_Tool/Hacker_Class.nut @@ -27,4 +27,19 @@ class _Rindro_Hacker { } } //初始化Hacker -Rindro_Haker <- _Rindro_Hacker(); \ No newline at end of file +if (!(getroottable().rawin("Rindro_Haker"))) Rindro_Haker <- _Rindro_Hacker(); + + +//重选角色时触发的回调函数(进入赛利亚房间) +OnSetCharacter_Control <- {} +Rindro_Haker.LoadHook(0x674350, ["pointer", "int"], + function(args) { + foreach(Func in OnSetCharacter_Control) { + Func(); + } + return null; + }, + function(args) { + + return null; + }); \ No newline at end of file diff --git a/Base/_Tool/Hacker_RegApi.nut b/Base/_Tool/Hacker_RegApi.nut index fb1696b..35b1c5f 100644 --- a/Base/_Tool/Hacker_RegApi.nut +++ b/Base/_Tool/Hacker_RegApi.nut @@ -38,5 +38,14 @@ class R_Utils { return Ret; } - + //获取一个指定装备的角色Ani + function GetCharacByEqu(Job, GrowType, Equ) { + local Obj = sq_CreateCharacter(Job, GrowType); + local ObjAddress = L_Sq_GetObjectAddress(Obj); + foreach(value in Equ) { + local ItemObject = L_sq_GetItem(value); + L_Sq_CallFunc(0x825570, "void", FFI_THISCALL, ["int", "int"], ObjAddress, ItemObject); + } + return Obj; + } } \ No newline at end of file diff --git a/DofileList.nut b/DofileList.nut index c4d7a33..fd019ff 100644 --- a/DofileList.nut +++ b/DofileList.nut @@ -55,4 +55,5 @@ dofile("sqr/Project/HudUi/HudUi.nut"); //百级UI dofile("sqr/Project/DamagePerSecond/DamagePerSecond.nut"); //秒伤统计 dofile("sqr/Project/CollectionBox/CollectionBox.nut"); //收集箱 dofile("sqr/Project/HorseGuessing/HorseGuessing.nut"); //骑士马战 -dofile("sqr/Project/SkinHub/SkinHub.nut"); //皮肤仓库 \ No newline at end of file +dofile("sqr/Project/SkinHub/SkinHub.nut"); //皮肤仓库 +dofile("sqr/Project/MarrySystem/MarrySystem.nut"); //结婚系统 \ No newline at end of file diff --git a/Project/DamagePerSecond/DamagePerSecond.nut b/Project/DamagePerSecond/DamagePerSecond.nut index ccc51d5..d5555b6 100644 --- a/Project/DamagePerSecond/DamagePerSecond.nut +++ b/Project/DamagePerSecond/DamagePerSecond.nut @@ -38,6 +38,7 @@ class longlong { function GetFormat(FType) { local Buf = L_sq_LongLongOperation(this.Value, FType, "format"); + if (Buf.len()< 2) return Buf + ".0"; local Value = Buf.slice(0, -1); local Unit = Buf.slice(-1); local RetStr = format(FType + Unit, Value.tofloat()); diff --git a/Project/HudUi/HudUi.nut b/Project/HudUi/HudUi.nut index d8f6406..1c837d9 100644 --- a/Project/HudUi/HudUi.nut +++ b/Project/HudUi/HudUi.nut @@ -204,7 +204,12 @@ class HudUiC extends LenheartNewUI_Windows { // local Window = sq_GetPopupWindowMainCotrol(74); // print(Window.IsWindowFocus()); + + + // asos = R_Utils.GetCharacByEqu(0, 0, [601550071, 601560067, 601570062, 601520061, 601500069, 601510068, 601530060, 601540069, 601580026, 27601]); + // asos = sq_CreateAICharacter(900); } + asos = null; function RegisterWidget() { //铃铛按钮 diff --git a/Project/MarrySystem/MarrySystem.nut b/Project/MarrySystem/MarrySystem.nut index 8b59d1d..d5a0687 100644 --- a/Project/MarrySystem/MarrySystem.nut +++ b/Project/MarrySystem/MarrySystem.nut @@ -6,6 +6,8 @@ */ dofile("sqr/Project/MarrySystem/MarrySystem_Request.nut"); +dofile("sqr/Project/MarrySystem/MarrySystem_Response.nut"); +dofile("sqr/Project/MarrySystem/MarrySystem_Preparation.nut"); class MarrySystemC extends Rindro_BaseToolClass { //调试模式 @@ -18,33 +20,69 @@ class MarrySystemC extends Rindro_BaseToolClass { // Visible = false; //包头 - OP = 20099000; + OP = 20078000; - //自身是否结婚 - IsMarryFlag = false; + //结婚状态 + MarryState = 0; //申请订婚窗口 - ApplyEngagementWindow = null; + RequestWindow = null; + //答复窗口 + ResponseWindow = null; + //准备婚礼窗口 + PreparationWindow = null; + + + //查看自己是否有结婚 - function CheckMarry() { + function CheckMarryState() { SendPackEx({ - op = OP + 1 + op = OP + 9 }); } - function CheckMarryCallBack(Chunk) { + function CheckMarryStateCallBack(Chunk) { local Jso = Json.Decode(Chunk); - IsMarryFlag = Jso.Flag; + MarryState = Jso.Flag; InitNpcEachButton(); } + //收到结婚请求 + function RequestMarryCallBack(Chunk) { + local Jso = Json.Decode(Chunk); + ResponseWindow.applicantName = Jso.applicantName; + ResponseWindow.applicantCid = Jso.applicantCid; + ResponseWindow.applicantUid = Jso.applicantUid; + ResponseWindow.Visible = true; + ResponseWindow.ResetFocus(); + } + + //打开准备婚礼窗口 + function OpenPreparationWindowCallBack(Chunk) { + local Jso = Json.Decode(Chunk); + PreparationWindow.Name1 = Jso.MyName; + PreparationWindow.Name2 = Jso.TargetName; + PreparationWindow.Visible = true; + PreparationWindow.ResetFocus(); + } + constructor() { - ApplyEngagementWindow = MarrySystem_RequestC("结婚系统_申请订婚窗口", ((getroottable().Rindro_Scr_Width - 329) / 2).tointeger(), 140, 329, 267, 28); + RequestWindow = MarrySystem_RequestC("结婚系统_申请订婚窗口", ((getroottable().Rindro_Scr_Width - 329) / 2).tointeger(), 180, 329, 166, 16); + ResponseWindow = MarrySystem_ResponseC("结婚系统_订婚答复窗口", ((getroottable().Rindro_Scr_Width - 329) / 2).tointeger(), 180, 329, 166, 16); + PreparationWindow = MarrySystem_PreparationC("结婚系统_准备婚礼窗口", ((getroottable().Rindro_Scr_Width - 256) / 2).tointeger(), 100, 260, 374, 28); + OnSetCharacter_Control.MarrySystem <- OnSetCharacter.bindenv(this); + Pack_Control.rawset(OP + 10, CheckMarryStateCallBack.bindenv(this)); + Pack_Control.rawset(OP + 4, RequestMarryCallBack.bindenv(this)); + Pack_Control.rawset(OP + 12, OpenPreparationWindowCallBack.bindenv(this)); + + + + CheckMarryState(); } function RegisterWidget() { @@ -66,7 +104,7 @@ class MarrySystemC extends Rindro_BaseToolClass { EachManager.RemoveEachForNpc(20013); //没结婚注册申请结婚按钮 - if (!IsMarryFlag) { + if (MarryState == 0) { EachManager.AddEachForNpc(20013, function(SThis) { //关闭按钮 local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3); @@ -76,16 +114,93 @@ class MarrySystemC extends Rindro_BaseToolClass { ApplyEngagementButton.OnClick = function(Button) { Button.Parent.CloseAllEach(); Button.Parent.CloseWindow(); - ApplyEngagementWindow.Visible = true; - ApplyEngagementWindow.ResetFocus(); + RequestWindow.Visible = true; + RequestWindow.ResetFocus(); }.bindenv(this); ApplyEngagementButton.SetCallBackFunc(function(Button) {}) SThis.AddChild(ApplyEngagementButton); }.bindenv(this)); } + //已订婚 未结婚 + else if (MarryState == 1) { + EachManager.AddEachForNpc(20013, function(SThis) { + //关闭按钮 + local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3); + ApplyEngagementButton.Icon = "interface2/popup_menu/popup_icon_cn.img"; + ApplyEngagementButton.IconIdx = 12; + ApplyEngagementButton.Str = "退婚"; + ApplyEngagementButton.OnClick = function(Button) { + Button.Parent.CloseAllEach(); + Button.Parent.CloseWindow(); + local T = { + op = OP + 7, + } + SendPackEx(T); + }.bindenv(this); + ApplyEngagementButton.SetCallBackFunc(function(Button) {}) + SThis.AddChild(ApplyEngagementButton); + //关闭按钮 + local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3); + ApplyEngagementButton.Icon = "interface2/popup_menu/popup_icon_cn.img"; + ApplyEngagementButton.IconIdx = 11; + ApplyEngagementButton.Str = "举办婚礼"; + ApplyEngagementButton.OnClick = function(Button) { + Button.Parent.CloseAllEach(); + Button.Parent.CloseWindow(); + local T = { + op = OP + 11, + } + SendPackEx(T); + }.bindenv(this); + ApplyEngagementButton.SetCallBackFunc(function(Button) {}) + SThis.AddChild(ApplyEngagementButton); + }.bindenv(this)); + } + //等待举行婚礼 + else if (MarryState == 2) { + EachManager.AddEachForNpc(20013, function(SThis) { + //关闭按钮 + local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3); + ApplyEngagementButton.Icon = "interface2/popup_menu/popup_icon_cn.img"; + ApplyEngagementButton.IconIdx = 13; + ApplyEngagementButton.Str = "进入礼堂"; + ApplyEngagementButton.OnClick = function(Button) { + Button.Parent.CloseAllEach(); + Button.Parent.CloseWindow(); + local T = { + op = OP + 15, + room = -1 + } + SendPackEx(T); + }.bindenv(this); + ApplyEngagementButton.SetCallBackFunc(function(Button) {}) + SThis.AddChild(ApplyEngagementButton); + }.bindenv(this)); + EachManager.AddEachForNpc(20014, function(SThis) { + //关闭按钮 + local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3); + ApplyEngagementButton.Icon = "interface2/popup_menu/popup_icon_cn.img"; + ApplyEngagementButton.IconIdx = 14; + ApplyEngagementButton.Str = "离开礼堂"; + ApplyEngagementButton.OnClick = function(Button) { + Button.Parent.CloseAllEach(); + Button.Parent.CloseWindow(); + local T = { + op = OP + 17 + } + SendPackEx(T); + }.bindenv(this); + ApplyEngagementButton.SetCallBackFunc(function(Button) {}) + SThis.AddChild(ApplyEngagementButton); + }.bindenv(this)); + } } + //重选角色回调 + function OnSetCharacter() { + CheckMarryState(); + } //逻辑入口 function Proc(obj) { @@ -104,4 +219,15 @@ function Lenheart_MarrySystem_Fun(obj) { } } -getroottable()["LenheartFuncTab"].rawset("MarrySystemFuncN", Lenheart_MarrySystem_Fun); \ No newline at end of file +getroottable()["LenheartFuncTab"].rawset("MarrySystemFuncN", Lenheart_MarrySystem_Fun); + + +// local asos = R_Utils.GetCharacByEqu(0, 0, [601550071, 601560067, 601570062, 601520061, 601500069, 601510068, 601530060, 601540069, 601580026, 101010035]); + +// local asos = sq_CreateAICharacter(900); +// asos.setCurrentPos(sq_getMyCharacter().getXPos() + 100, sq_getMyCharacter().getYPos(), 0); +// sq_AddObject(sq_getMyCharacter(), asos, OBJECTTYPE_VIRTUALCHARACTER, false); + +// local ItemObject = L_sq_GetItem(27675); +// // local ItemObject = L_sq_GetItem(27582); +// L_Sq_CallFunc(0x8265A0, "void", FFI_THISCALL, ["int","int","int"], L_Sq_GetObjectAddress(asos),ItemObject,0xFFFFFFFF); \ No newline at end of file diff --git a/Project/MarrySystem/MarrySystem_Preparation.nut b/Project/MarrySystem/MarrySystem_Preparation.nut new file mode 100644 index 0000000..ce5cc51 --- /dev/null +++ b/Project/MarrySystem/MarrySystem_Preparation.nut @@ -0,0 +1,202 @@ +/* +文件名:MarrySystem_Preparation.nut +路径:Project/MarrySystem/MarrySystem_Preparation.nut +创建日期:2024-10-03 22:43 +文件用途:准备婚礼窗口 +*/ +class MarrySystem_PreparationC extends LenheartNewUI_Windows { + //调试模式 + // DeBugMode = true; + + //不是窗口 + // NoWindow = true; + + //是否可见 + Visible = false; + + //包头 + OP = 20078000; + + //名字 + Name1 = "测试角色名字"; + Name2 = "测试角色名字"; + + //时间按钮 + NowTimeBtn = null; + littleTimeBtn = null; + longTimeBtn = null; + //时间Flag + TimeFlag = 0; + + //婚礼等级按钮 + //普通 + NormalBtn = null; + //高级 + AdvancedBtn = null; + //豪华 + LuxuryBtn = null; + //婚礼等级Flag + MarryLevelFlag = -1; + + + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + Childrens = []; + //注册控件 + RegisterWidget(); + + LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + } + + function RegisterWidget() { + //关闭按钮 + local CloseButton = LenheartNewUI_BaseButton(244, 0, 11, 12, "interface/lenheartwindowcommon.img", 276); + CloseButton.OnClick = function() { + this.Visible = false; + }.bindenv(this); + Childrens.append(CloseButton); + + + NowTimeBtn = LenheartNewUI_SwitchButtonText(24, 138, "现在"); + NowTimeBtn.ImgIndex = 358; + NowTimeBtn.SetTextPos(12, 2); + NowTimeBtn.Width = 50; + NowTimeBtn.Height = 16; + NowTimeBtn.OnClick = function() { + TimeFlag = 0; + }.bindenv(this); + NowTimeBtn.SetCallBackFunc(function(Button) { + if (TimeFlag == 0) Button.State = 1; + else Button.State = 0; + }.bindenv(this)); + AddChild(NowTimeBtn); + + littleTimeBtn = LenheartNewUI_SwitchButtonText(96, 138, "20分钟"); + littleTimeBtn.ImgIndex = 358; + littleTimeBtn.SetTextPos(12, 2); + littleTimeBtn.Width = 50; + littleTimeBtn.Height = 16; + littleTimeBtn.OnClick = function() { + TimeFlag = 1; + }.bindenv(this); + littleTimeBtn.SetCallBackFunc(function(Button) { + if (TimeFlag == 1) Button.State = 1; + else Button.State = 0; + }.bindenv(this)); + AddChild(littleTimeBtn); + + longTimeBtn = LenheartNewUI_SwitchButtonText(174, 138, "30分钟"); + longTimeBtn.ImgIndex = 358; + longTimeBtn.SetTextPos(12, 2); + longTimeBtn.Width = 50; + longTimeBtn.Height = 16; + longTimeBtn.OnClick = function() { + TimeFlag = 2; + }.bindenv(this); + longTimeBtn.SetCallBackFunc(function(Button) { + if (TimeFlag == 2) Button.State = 1; + else Button.State = 0; + }.bindenv(this)); + AddChild(longTimeBtn); + + NormalBtn = LenheartNewUI_SwitchButton(28, 202); + NormalBtn.ImgPath = "interface2/wedding/weddingreservationpopupui.img"; + NormalBtn.ImgIndex = 2; + NormalBtn.Width = 200; + NormalBtn.Height = 39; + NormalBtn.OnClick = function() { + MarryLevelFlag = 0; + }.bindenv(this); + NormalBtn.SetCallBackFunc(function(Button) { + if (MarryLevelFlag == 0) Button.State = 1; + else Button.State = 0; + }.bindenv(this)); + AddChild(NormalBtn); + + AdvancedBtn = LenheartNewUI_SwitchButton(28, 242); + AdvancedBtn.ImgPath = "interface2/wedding/weddingreservationpopupui.img"; + AdvancedBtn.ImgIndex = 6; + AdvancedBtn.Width = 200; + AdvancedBtn.Height = 39; + AdvancedBtn.OnClick = function() { + MarryLevelFlag = 1; + }.bindenv(this); + AdvancedBtn.SetCallBackFunc(function(Button) { + if (MarryLevelFlag == 1) Button.State = 1; + else Button.State = 0; + }.bindenv(this)); + AddChild(AdvancedBtn); + + LuxuryBtn = LenheartNewUI_SwitchButton(28, 282); + LuxuryBtn.ImgPath = "interface2/wedding/weddingreservationpopupui.img"; + LuxuryBtn.ImgIndex = 10; + LuxuryBtn.Width = 200; + LuxuryBtn.Height = 39; + LuxuryBtn.OnClick = function() { + MarryLevelFlag = 2; + }.bindenv(this); + LuxuryBtn.SetCallBackFunc(function(Button) { + if (MarryLevelFlag == 2) Button.State = 1; + else Button.State = 0; + }.bindenv(this)); + AddChild(LuxuryBtn); + + //确认按钮 + local ConfirmButton = LenheartNewUI_ButtonText(55, 338, 15, " 确 认"); + ConfirmButton.DWidth = 18; + ConfirmButton.Width = 74; + ConfirmButton.SetTextOffset(-4, 1); + ConfirmButton.OnClick = function() { + local T = { + op = OP + 13, + Time = TimeFlag, + Level = MarryLevelFlag + } + SendPackEx(T); + R_Utils.PlaySound("BUTTON_06"); + CloseWindow(); + }.bindenv(this); + AddChild(ConfirmButton); + + + //取消按钮 + local CancelButton = LenheartNewUI_ButtonText(131, 338, 15, " 取 消"); + CancelButton.DWidth = 18; + CancelButton.Width = 74; + CancelButton.SetTextOffset(-4, 1); + CancelButton.OnClick = function() { + CloseWindow(); + }.bindenv(this); + AddChild(CancelButton); + } + + //绘制主界面 + function DrawMain(obj) { + //标题栏 + L_sq_DrawButton(X - 2, Y, 252, "interface/lenheartwindowcommon.img", 609, 2, 7); + //绘制窗口名字 + L_sq_DrawCode("申请举办婚礼", X + 95, Y + 4, sq_RGBA(134, 120, 79, 255), 0, 1); + //Item信息框一般为211的宽度 + L_sq_DrawWindow(X, Y + 16, 240, 316, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13); + + //绘制背景 + L_sq_DrawImg("interface2/wedding/weddingreservationpopupui.img", 0, X + 16, Y + 36); + //绘制爱心 + L_sq_DrawImg("interface2/wedding/weddingreservationpopupui.img", 1, X + 120, Y + 80); + //绘制姓名 + L_sq_DrawCode(Name1, X + 110 - LenheartTextClass.GetStringLength(Name1), Y + 79, sq_RGBA(134, 120, 79, 255), 0, 1); + L_sq_DrawCode(Name2, X + 146, Y + 79, sq_RGBA(134, 120, 79, 255), 0, 1); + } + + function Show(obj) { + DrawMain(obj); + LenheartNewUI_Windows.Show(obj); + + } + + //逻辑入口 + function Proc(obj) { + LenheartNewUI_Windows.SyncPos(X, Y); + } + +} +getroottable().rawdelete("MarrySystem_Obj"); \ No newline at end of file diff --git a/Project/MarrySystem/MarrySystem_Request.nut b/Project/MarrySystem/MarrySystem_Request.nut index 9542caf..5359bed 100644 --- a/Project/MarrySystem/MarrySystem_Request.nut +++ b/Project/MarrySystem/MarrySystem_Request.nut @@ -11,6 +11,9 @@ class MarrySystem_RequestC extends LenheartNewUI_Windows { //不是窗口 // NoWindow = true; + //包头 + OP = 20078000; + //是否可见 Visible = false; @@ -26,33 +29,35 @@ class MarrySystem_RequestC extends LenheartNewUI_Windows { function RegisterWidget() { //关闭按钮 - local CloseButton = LenheartNewUI_BaseButton(308, 3, 11, 12, "interface/lenheartwindowcommon.img", 276); + local CloseButton = LenheartNewUI_BaseButton(312, 0, 11, 12, "interface/lenheartwindowcommon.img", 276); CloseButton.OnClick = function() { this.Visible = false; }.bindenv(this); Childrens.append(CloseButton); - InputObject = LenheartNewUI_BaseInput(83, 190, 160, 20); + InputObject = LenheartNewUI_BaseInput(83, 90, 160, 20); AddChild(InputObject); //确认按钮 - local ConfirmButton = LenheartNewUI_ButtonText(83, 220, 15, "确认申请"); + local ConfirmButton = LenheartNewUI_ButtonText(83, 120, 15, "确认申请"); ConfirmButton.DWidth = 18; ConfirmButton.Width = 74; ConfirmButton.SetTextOffset(-4, 1); ConfirmButton.OnClick = function() { local T = { - op = 20055005, + op = OP + 3, Name = InputObject.str, } SendPackEx(T); + R_Utils.PlaySound("BUTTON_06"); + CloseWindow(); }.bindenv(this); AddChild(ConfirmButton); //取消按钮 - local CancelButton = LenheartNewUI_ButtonText(174, 220, 15, " 取 消"); + local CancelButton = LenheartNewUI_ButtonText(174, 120, 15, " 取 消"); CancelButton.DWidth = 18; CancelButton.Width = 74; CancelButton.SetTextOffset(-4, 1); @@ -67,16 +72,22 @@ class MarrySystem_RequestC extends LenheartNewUI_Windows { //绘制窗口底 // L_sq_DrawWindow(X, Y, 347, 160, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13); + //标题栏 + L_sq_DrawButton(X - 1, Y, 320, "interface/lenheartwindowcommon.img", 609, 2, 7); + //绘制窗口名字 + L_sq_DrawCode("申请订婚", X + 142, Y + 4, sq_RGBA(134, 120, 79, 255), 0, 1); + //Item信息框一般为211的宽度 + L_sq_DrawWindow(X - 1, Y + 16, 312, 120, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13); //绘制窗口 - L_sq_DrawImg("marrysystem.img", 0, X, Y); + // L_sq_DrawImg("marrysystem.img", 0, X, Y); local Str = "请输入你想要与之订婚的角色名。"; //绘制文字 - L_sq_DrawCode(Str, X + 80, Y + 150, sq_RGBA(255, 255, 255, 250), 0, 1); + L_sq_DrawCode(Str, X + 80, Y + 50, sq_RGBA(255, 255, 255, 250), 0, 1); local Str = "(直接点击想要订婚的角色,可自动输入名称。)"; //绘制文字 - L_sq_DrawCode(Str, X + 53, Y + 166, sq_RGBA(255, 255, 255, 250), 0, 1); + L_sq_DrawCode(Str, X + 53, Y + 66, sq_RGBA(255, 255, 255, 250), 0, 1); } function Show(obj) { @@ -88,17 +99,14 @@ class MarrySystem_RequestC extends LenheartNewUI_Windows { //逻辑入口 function Proc(obj) { LenheartNewUI_Windows.SyncPos(X, Y); + + local Str = L_Sq_GetPlayerEachName(); + if (Str.len() > 0 && InputObject.str.len() == 0) { + // InputObject.SetStr(Str); + InputObject.str = Str; + InputObject.SetStr(Str); + } } } -getroottable().rawdelete("MarrySystem_Obj"); - -// function Lenheart_MarrySystem_Request_Fun(obj) { -// local RootTab = getroottable(); -// if (!RootTab.rawin("MarrySystem_Request_Obj")) { -// RootTab.rawset("MarrySystem_Request_Obj", true); -// LenheartNewUI_CreateWindow(MarrySystem_RequestC, "结婚系统请求窗口", ((getroottable().Rindro_Scr_Width - 329) / 2).tointeger(), 140, 329, 267, 28); -// } -// } - -// getroottable()["LenheartFuncTab"].rawset("MarrySystem_RequestFuncN", Lenheart_MarrySystem_Request_Fun); \ No newline at end of file +getroottable().rawdelete("MarrySystem_Obj"); \ No newline at end of file diff --git a/Project/MarrySystem/MarrySystem_Response.nut b/Project/MarrySystem/MarrySystem_Response.nut new file mode 100644 index 0000000..7a18ddb --- /dev/null +++ b/Project/MarrySystem/MarrySystem_Response.nut @@ -0,0 +1,112 @@ +/* +文件名:MarrySystem_Response.nut +路径:Project/MarrySystem/MarrySystem_Response.nut +创建日期:2024-10-01 10:32 +文件用途:结婚答复 +*/ +class MarrySystem_ResponseC extends LenheartNewUI_Windows { + //调试模式 + // DeBugMode = true; + + //不是窗口 + // NoWindow = true; + + //是否可见 + Visible = false; + + //包头 + OP = 20078000; + + //申请人 + applicantName = "瓜瓜"; + //申请人CID + applicantCid = -1; + //申请人UID + applicantUid = -1; + + + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + Childrens = []; + //注册控件 + RegisterWidget(); + + LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + } + + function RegisterWidget() { + // //关闭按钮 + // local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276); + // CloseButton.OnClick = function() { + // this.Visible = false; + // }.bindenv(this); + // Childrens.append(CloseButton); + + //确认按钮 + local ConfirmButton = LenheartNewUI_ButtonText(83, 120, 15, "同意请求"); + ConfirmButton.DWidth = 18; + ConfirmButton.Width = 74; + ConfirmButton.SetTextOffset(-4, 1); + ConfirmButton.OnClick = function() { + local T = { + op = OP + 5, + applicantCid = this.applicantCid, + applicantUid = this.applicantUid, + Flag = 1 + } + SendPackEx(T); + R_Utils.PlaySound("BUTTON_06"); + CloseWindow(); + }.bindenv(this); + AddChild(ConfirmButton); + + + //取消按钮 + local CancelButton = LenheartNewUI_ButtonText(174, 120, 15, " 拒 绝"); + CancelButton.DWidth = 18; + CancelButton.Width = 74; + CancelButton.SetTextOffset(-4, 1); + CancelButton.OnClick = function() { + local T = { + op = OP + 5, + applicantCid = this.applicantCid, + applicantUid = this.applicantUid, + Flag = 0 + } + SendPackEx(T); + R_Utils.PlaySound("BUTTON_07"); + CloseWindow(); + }.bindenv(this); + AddChild(CancelButton); + } + + //绘制主界面 + function DrawMain(obj) { + + //标题栏 + L_sq_DrawButton(X - 1, Y, 320, "interface/lenheartwindowcommon.img", 609, 2, 7); + //绘制窗口名字 + L_sq_DrawCode("申请订婚", X + 142, Y + 4, sq_RGBA(134, 120, 79, 255), 0, 1); + //Item信息框一般为211的宽度 + L_sq_DrawWindow(X - 1, Y + 16, 312, 120, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13); + + + //绘制窗口 + L_sq_DrawImg("interface2/wedding/common.img", 8, X + 64, Y + 34); + + local Str = "玩家 [" + applicantName + "] 想要与您订婚,是否同意?" + L_sq_DrawCode(Str, X + 80 - LenheartTextClass.GetStringLength(applicantName) / 2, Y + 88, sq_RGBA(255, 255, 255, 250), 0, 1); + } + + function Show(obj) { + DrawMain(obj); + LenheartNewUI_Windows.Show(obj); + + } + + //逻辑入口 + function Proc(obj) { + LenheartNewUI_Windows.SyncPos(X, Y); + } + +} +getroottable().rawdelete("MarrySystem_Obj"); \ No newline at end of file