114 lines
3.0 KiB
Plaintext
114 lines
3.0 KiB
Plaintext
|
|
/*
|
||
|
|
文件名:WarehouseLock.nut
|
||
|
|
路径:Project/WarehouseLock/WarehouseLock.nut
|
||
|
|
创建日期:2025-12-20 02:08
|
||
|
|
文件用途:仓库锁
|
||
|
|
*/
|
||
|
|
class WarehouseLockC extends LenheartNewUI_Windows {
|
||
|
|
//调试模式
|
||
|
|
// DeBugMode = true;
|
||
|
|
|
||
|
|
//不是窗口
|
||
|
|
// NoWindow = true;
|
||
|
|
|
||
|
|
//是否可见
|
||
|
|
Visible = false;
|
||
|
|
|
||
|
|
Img = Rindro_Image("safety/warehouse.img");
|
||
|
|
|
||
|
|
//输入框
|
||
|
|
InputObject = null;
|
||
|
|
|
||
|
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||
|
|
Childrens = [];
|
||
|
|
//注册控件
|
||
|
|
RegisterWidget();
|
||
|
|
|
||
|
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
Pack_Control.rawset(21008010, function(Chunk) {
|
||
|
|
Visible = true;
|
||
|
|
Sq_Memory_WriteByteArr(L_sq_I2P(0xFCF380), [0xC3]);
|
||
|
|
}.bindenv(this));
|
||
|
|
|
||
|
|
Pack_Control.rawset(21008002, function(Chunk) {
|
||
|
|
Visible = false;
|
||
|
|
Sq_Memory_WriteByteArr(L_sq_I2P(0xFCF380), [0x55]);
|
||
|
|
}.bindenv(this));
|
||
|
|
|
||
|
|
SendPackEx({
|
||
|
|
op = 21008009,
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
function RegisterWidget() {
|
||
|
|
//关闭按钮
|
||
|
|
local CloseButton = LenheartNewUI_BaseButton(322, 4, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||
|
|
CloseButton.OnClick = function() {
|
||
|
|
this.Visible = false;
|
||
|
|
}.bindenv(this);
|
||
|
|
Childrens.append(CloseButton);
|
||
|
|
|
||
|
|
InputObject = LenheartNewUI_BaseInput(88, 126, 152, 20);
|
||
|
|
AddChild(InputObject);
|
||
|
|
|
||
|
|
//确认按钮
|
||
|
|
local ConfirmButton = LenheartNewUI_ButtonText(131, 156, 15, "验证");
|
||
|
|
ConfirmButton.DWidth = 18;
|
||
|
|
ConfirmButton.Width = 74;
|
||
|
|
ConfirmButton.SetTextOffset(7, 1);
|
||
|
|
ConfirmButton.OnClickEx = function(Btn) {
|
||
|
|
local T = {
|
||
|
|
op = 21008001,
|
||
|
|
passwd = InputObject.str
|
||
|
|
}
|
||
|
|
SendPackEx(T);
|
||
|
|
this.Visible = false;
|
||
|
|
}.bindenv(this);
|
||
|
|
AddChild(ConfirmButton);
|
||
|
|
}
|
||
|
|
|
||
|
|
//绘制主界面
|
||
|
|
function DrawMain(obj) {
|
||
|
|
//背景框
|
||
|
|
DrawNineBox(X, Y, 336, 206, "interface/lenheartwindowcommon.img", 213);
|
||
|
|
//标题
|
||
|
|
DrawWindowTitle(339);
|
||
|
|
//绘制标题名
|
||
|
|
L_sq_DrawCode("公告", X + 156, Y + 5, sq_RGBA(230, 200, 155, 255), 0, 1);
|
||
|
|
|
||
|
|
|
||
|
|
Img.DrawPng(0, X + 8, Y + 32);
|
||
|
|
}
|
||
|
|
|
||
|
|
function Show(obj) {
|
||
|
|
DrawMain(obj);
|
||
|
|
LenheartNewUI_Windows.Show(obj);
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
//逻辑入口
|
||
|
|
function Proc(obj) {
|
||
|
|
LenheartNewUI_Windows.SyncPos(X, Y);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
L_Windows_List <- [];
|
||
|
|
getroottable().rawdelete("LenheartPluginsInitFlag");
|
||
|
|
getroottable().rawdelete("EventList_Obj")
|
||
|
|
getroottable().rawdelete("WarehouseLock_Obj");
|
||
|
|
|
||
|
|
|
||
|
|
function Lenheart_WarehouseLock_Fun(obj) {
|
||
|
|
local RootTab = getroottable();
|
||
|
|
if (!RootTab.rawin("WarehouseLock_Obj")) {
|
||
|
|
RootTab.rawset("WarehouseLock_Obj", true);
|
||
|
|
LenheartNewUI_CreateWindow(WarehouseLockC, "仓库锁窗口", ((getroottable().Rindro_Scr_Width - 336) / 2).tointeger(), 180, 336, 206, 28);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
getroottable()["LenheartFuncTab"].rawset("WarehouseLockFuncN", Lenheart_WarehouseLock_Fun);
|