/* 文件名: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");