This commit is contained in:
2024-10-01 10:12:27 +08:00
parent 16be225768
commit 8c2522f366
11 changed files with 520 additions and 37 deletions

View File

@@ -23,15 +23,15 @@ class HorseGuessing_KnightInfoC extends LenheartNewUI_Windows {
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
Childrens = [];
AniList = [];
for (local i = 0; i< 13; i++) {
local obj = sq_getMyCharacter();
local ani = obj.getVar().GetAnimationMap("common/horseguessing/knight" + i + ".ani", "common/horseguessing/knight" + i + ".ani");
AniList.append({
ani = ani,
flag = false
});
}
// AniList = [];
// for (local i = 0; i< 13; i++) {
// local obj = sq_getMyCharacter();
// local ani = obj.getVar().GetAnimationMap("common/horseguessing/knight" + i + ".ani", "common/horseguessing/knight" + i + ".ani");
// AniList.append({
// ani = ani,
// flag = false
// });
// }
//注册控件
RegisterWidget();
@@ -127,13 +127,13 @@ class HorseGuessing_KnightInfoC extends LenheartNewUI_Windows {
InputObject.SetStr(Parent.ResidueCoin.tostring());
}
//在城镇的时候才播放
if (sq_GetCurrentModuleType() == 1) {
foreach(value in AniList) {
sq_AnimationProc(value.ani);
sq_drawCurrentFrame(value.ani, -600, 0, true);
}
}
// //在城镇的时候才播放
// if (sq_GetCurrentModuleType() == 1) {
// foreach(value in AniList) {
// sq_AnimationProc(value.ani);
// sq_drawCurrentFrame(value.ani, -600, 0, true);
// }
// }
}

View File

@@ -168,6 +168,9 @@ class HudUiC extends LenheartNewUI_Windows {
//干掉废弃的深渊悬停提示
MemoryTool.WirteByteArr(0xE6D90C, [0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90]);
//修复点击邮箱会乱跳鼠标
L_sq_WAB(0x11BD16E, 0xEB);
}
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {

View File

@@ -0,0 +1,107 @@
/*
文件名:MarrySystem.nut
路径:Project/MarrySystem/MarrySystem.nut
创建日期:2024-10-01 00:01
文件用途:结婚系统
*/
dofile("sqr/Project/MarrySystem/MarrySystem_Request.nut");
class MarrySystemC extends Rindro_BaseToolClass {
//调试模式
// DeBugMode = true;
//不是窗口
// NoWindow = true;
//是否可见
// Visible = false;
//包头
OP = 20099000;
//自身是否结婚
IsMarryFlag = false;
//申请订婚窗口
ApplyEngagementWindow = null;
//查看自己是否有结婚
function CheckMarry() {
SendPackEx({
op = OP + 1
});
}
function CheckMarryCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
IsMarryFlag = Jso.Flag;
InitNpcEachButton();
}
constructor() {
ApplyEngagementWindow = MarrySystem_RequestC("结婚系统_申请订婚窗口", ((getroottable().Rindro_Scr_Width - 329) / 2).tointeger(), 140, 329, 267, 28);
}
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);
}
//注册NPC按钮
function InitNpcEachButton() {
local EachManager = getroottable()["L_Each_Obj"];
//先清空注册
EachManager.RemoveEachForNpc(20013);
//没结婚注册申请结婚按钮
if (!IsMarryFlag) {
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 = 10;
ApplyEngagementButton.Str = "申请结婚";
ApplyEngagementButton.OnClick = function(Button) {
Button.Parent.CloseAllEach();
Button.Parent.CloseWindow();
ApplyEngagementWindow.Visible = true;
ApplyEngagementWindow.ResetFocus();
}.bindenv(this);
ApplyEngagementButton.SetCallBackFunc(function(Button) {})
SThis.AddChild(ApplyEngagementButton);
}.bindenv(this));
}
}
//逻辑入口
function Proc(obj) {
}
}
getroottable().rawdelete("MarrySystem_Obj");
function Lenheart_MarrySystem_Fun(obj) {
local RootTab = getroottable();
if (!RootTab.rawin("MarrySystem_Obj")) {
RootTab.rawset("MarrySystem_Obj", MarrySystemC());
} else {
RootTab["MarrySystem_Obj"].Proc(obj);
}
}
getroottable()["LenheartFuncTab"].rawset("MarrySystemFuncN", Lenheart_MarrySystem_Fun);

View File

@@ -0,0 +1,104 @@
/*
文件名:MarrySystem_Request.nut
路径:Project/MarrySystem/MarrySystem_Request.nut
创建日期:2024-10-01 00:03
文件用途:结婚请求窗口
*/
class MarrySystem_RequestC extends LenheartNewUI_Windows {
//调试模式
// DeBugMode = true;
//不是窗口
// NoWindow = true;
//是否可见
Visible = false;
InputObject = null;
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
Childrens = [];
//注册控件
RegisterWidget();
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
}
function RegisterWidget() {
//关闭按钮
local CloseButton = LenheartNewUI_BaseButton(308, 3, 11, 12, "interface/lenheartwindowcommon.img", 276);
CloseButton.OnClick = function() {
this.Visible = false;
}.bindenv(this);
Childrens.append(CloseButton);
InputObject = LenheartNewUI_BaseInput(83, 190, 160, 20);
AddChild(InputObject);
//确认按钮
local ConfirmButton = LenheartNewUI_ButtonText(83, 220, 15, "确认申请");
ConfirmButton.DWidth = 18;
ConfirmButton.Width = 74;
ConfirmButton.SetTextOffset(-4, 1);
ConfirmButton.OnClick = function() {
local T = {
op = 20055005,
Name = InputObject.str,
}
SendPackEx(T);
}.bindenv(this);
AddChild(ConfirmButton);
//取消按钮
local CancelButton = LenheartNewUI_ButtonText(174, 220, 15, " 取 消");
CancelButton.DWidth = 18;
CancelButton.Width = 74;
CancelButton.SetTextOffset(-4, 1);
CancelButton.OnClick = function() {
CloseWindow();
}.bindenv(this);
AddChild(CancelButton);
}
//绘制主界面
function DrawMain(obj) {
//绘制窗口底
// L_sq_DrawWindow(X, Y, 347, 160, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
//绘制窗口
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);
local Str = "(直接点击想要订婚的角色,可自动输入名称。)";
//绘制文字
L_sq_DrawCode(Str, X + 53, Y + 166, 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");
// 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);