111
This commit is contained in:
202
Project/MarrySystem/MarrySystem_Preparation.nut
Normal file
202
Project/MarrySystem/MarrySystem_Preparation.nut
Normal file
@@ -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");
|
||||
Reference in New Issue
Block a user