1
This commit is contained in:
@@ -8,6 +8,9 @@
|
||||
dofile("sqr/Project/MarrySystem/MarrySystem_Request.nut");
|
||||
dofile("sqr/Project/MarrySystem/MarrySystem_Response.nut");
|
||||
dofile("sqr/Project/MarrySystem/MarrySystem_Preparation.nut");
|
||||
dofile("sqr/Project/MarrySystem/MarrySystem_OpenAuditoriumList.nut");
|
||||
dofile("sqr/Project/MarrySystem/MarrySystem_ActionAni.nut");
|
||||
dofile("sqr/Project/MarrySystem/MarrySystem_Room.nut");
|
||||
|
||||
class MarrySystemC extends Rindro_BaseToolClass {
|
||||
//调试模式
|
||||
@@ -21,6 +24,8 @@ class MarrySystemC extends Rindro_BaseToolClass {
|
||||
|
||||
//包头
|
||||
OP = 20078000;
|
||||
//配置
|
||||
Config = null;
|
||||
|
||||
//结婚状态
|
||||
MarryState = 0;
|
||||
@@ -31,9 +36,31 @@ class MarrySystemC extends Rindro_BaseToolClass {
|
||||
ResponseWindow = null;
|
||||
//准备婚礼窗口
|
||||
PreparationWindow = null;
|
||||
//礼堂列表窗口
|
||||
OpenAuditoriumList = null;
|
||||
//婚礼演出脚本对象
|
||||
MarriageScript = null;
|
||||
|
||||
//我的结婚时间
|
||||
MyMarryTime = null;
|
||||
MyMarryTimeFlag = null;
|
||||
|
||||
//婚房逻辑
|
||||
MarrySystemRoomObject = null;
|
||||
|
||||
//请求配置
|
||||
function GetConfig() {
|
||||
SendPackEx({
|
||||
op = OP + 777
|
||||
});
|
||||
}
|
||||
|
||||
function GetConfigCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
Config = {};
|
||||
Config.Town <- Jso.town;
|
||||
Config.Area <- Jso.area;
|
||||
}
|
||||
|
||||
|
||||
//查看自己是否有结婚
|
||||
@@ -68,20 +95,48 @@ class MarrySystemC extends Rindro_BaseToolClass {
|
||||
PreparationWindow.ResetFocus();
|
||||
}
|
||||
|
||||
constructor() {
|
||||
//打开礼堂列表窗口
|
||||
function OpenAuditoriumListWindowCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
|
||||
OpenAuditoriumList.List = Jso.info;
|
||||
OpenAuditoriumList.Visible = true;
|
||||
OpenAuditoriumList.ResetFocus();
|
||||
}
|
||||
|
||||
//进入礼堂信息包
|
||||
function OnEnterAuditoriumInfoCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
MyMarryTime = Jso.time;
|
||||
MyMarryTimeFlag = Clock();
|
||||
}
|
||||
|
||||
//结婚动画包
|
||||
function ActionCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
MarriageScript.Init(Jso.info);
|
||||
}
|
||||
|
||||
constructor() {
|
||||
|
||||
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);
|
||||
OpenAuditoriumList = MarrySystem_OpenAuditoriumListC("结婚系统_礼堂列表窗口", ((getroottable().Rindro_Scr_Width - 474) / 2).tointeger(), 100, 474, 354, 28);
|
||||
MarriageScript = MarrySystem_ActionAniC();
|
||||
MarrySystemRoomObject = MarrySystem_Room();
|
||||
|
||||
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));
|
||||
Pack_Control.rawset(OP + 20, OpenAuditoriumListWindowCallBack.bindenv(this));
|
||||
Pack_Control.rawset(OP + 22, OnEnterAuditoriumInfoCallBack.bindenv(this));
|
||||
Pack_Control.rawset(OP + 34, ActionCallBack.bindenv(this));
|
||||
Pack_Control.rawset(OP + 778, GetConfigCallBack.bindenv(this));
|
||||
|
||||
|
||||
|
||||
GetConfig();
|
||||
CheckMarryState();
|
||||
}
|
||||
|
||||
@@ -195,6 +250,25 @@ class MarrySystemC extends Rindro_BaseToolClass {
|
||||
SThis.AddChild(ApplyEngagementButton);
|
||||
}.bindenv(this));
|
||||
}
|
||||
|
||||
//无论如何都添加礼堂列表
|
||||
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 = 23;
|
||||
ApplyEngagementButton.Str = "礼堂列表";
|
||||
ApplyEngagementButton.OnClick = function(Button) {
|
||||
Button.Parent.CloseAllEach();
|
||||
Button.Parent.CloseWindow();
|
||||
local T = {
|
||||
op = OP + 19,
|
||||
}
|
||||
SendPackEx(T);
|
||||
}.bindenv(this);
|
||||
ApplyEngagementButton.SetCallBackFunc(function(Button) {})
|
||||
SThis.AddChild(ApplyEngagementButton);
|
||||
}.bindenv(this));
|
||||
}
|
||||
|
||||
//重选角色回调
|
||||
@@ -202,14 +276,100 @@ class MarrySystemC extends Rindro_BaseToolClass {
|
||||
CheckMarryState();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//逻辑入口
|
||||
function Proc(obj) {
|
||||
// print(getroottable().Camera_Pos);
|
||||
|
||||
//判断在礼堂房间
|
||||
if (Config && L_sq_GetTownIndex() == Config.Town && L_sq_GetRegionIndex() == Config.Area) {
|
||||
if (MyMarryTimeFlag && MyMarryTime) {
|
||||
L_sq_DrawImg("map/church/chn_church_count_number.img", 0, 720 - getroottable().Camera_Pos.X, 72 - getroottable().Camera_Pos.Y);
|
||||
DrawMarryTime(obj, MyMarryTime - ((Clock() / 1000) - (MyMarryTimeFlag / 1000)));
|
||||
}
|
||||
}
|
||||
|
||||
MarriageScript.Show(obj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
TimeFlag = Clock();
|
||||
|
||||
//攻坚时间
|
||||
function DrawMarryTime(obj, RealTime) {
|
||||
local X = 720 - getroottable().Camera_Pos.X;
|
||||
local Y = 114 - getroottable().Camera_Pos.Y;
|
||||
|
||||
local seconds = RealTime;
|
||||
local minutes = seconds / 60;
|
||||
|
||||
seconds %= 60;
|
||||
if (seconds< 0 && minutes< 0) return;
|
||||
seconds = format("%02d", seconds).slice(-2);
|
||||
minutes = format("%02d", minutes).slice(-2);
|
||||
|
||||
local X1 = -15;
|
||||
local X2 = X1 + 18;
|
||||
|
||||
local Offset = 0;
|
||||
Offset += 46;
|
||||
L_sq_DrawImg("map/church/chn_church_count_number.img", minutes.slice(0, 1).tointeger() + 1, X + X1 + Offset, Y + 28);
|
||||
L_sq_DrawImg("map/church/chn_church_count_number.img", minutes.slice(1).tointeger() + 1, X + X2 + Offset, Y + 28);
|
||||
Offset += 46;
|
||||
L_sq_DrawImg("map/church/chn_church_count_number.img", seconds.slice(0, 1).tointeger() + 1, X + X1 + Offset, Y + 28);
|
||||
L_sq_DrawImg("map/church/chn_church_count_number.img", seconds.slice(1).tointeger() + 1, X + X2 + Offset, Y + 28);
|
||||
}
|
||||
|
||||
}
|
||||
getroottable().rawdelete("MarrySystem_Obj");
|
||||
|
||||
|
||||
// local ReadPath = L_sq_P2I(Memory.allocUtf8String("equipment/equipment.lst").C_Object);
|
||||
// local Reader = Memory.alloc(409600);
|
||||
// local ReadBuffer = L_sq_P2I(Reader.C_Object);
|
||||
// print(format("%02x", ReadBuffer));
|
||||
// L_Sq_CallFunc(0x11A2030, "int", FFI_FASTCALL, ["int", "int", "int", "int", "int", "int"], 0x1D17638, 0, ReadPath, ReadBuffer, 0x100000, 0x19DAF4);
|
||||
|
||||
|
||||
// L_Sq_CallFunc(0x112A9F0, "int", FFI_THISCALL, ["int", "int", "int", "int","int", "int", "int"], L_sq_RA(0x1A5FAE4), AniPath, pATH2, 1,0,0,0);
|
||||
|
||||
// local ItemObject = L_sq_GetItem(601500069);
|
||||
// print(format("%02x", ItemObject));
|
||||
|
||||
// local ThisC = L_Sq_CallFunc(0x11A5990, "int", FFI_THISCALL, ["int"], 508);
|
||||
// print(format("%02x", ThisC));
|
||||
// local AniPath = L_sq_P2I(Memory.allocUtf8String("character/swordman/animation/attack1.ani").C_Object);
|
||||
//TTTAni <- L_Sq_CallFunc(0x108F8B0, "int", FFI_THISCALL, ["int", "int", "int", "int"], ThisC, AniPath, 1, 0);
|
||||
|
||||
// local AniPath = L_sq_P2I(Memory.allocUtf8String("character/swordman/animation/attack1.ani").C_Object);
|
||||
// TTTAni <- L_Sq_CallFunc(0x112A9F0, "int", FFI_THISCALL, ["int", "int", "int", "int", "int", "int", "int"], 0x19dc64, AniPath, 1695745, 1, 0, 0, 0);
|
||||
|
||||
|
||||
// Rindro_Haker.LoadHook(0x65de50, ["int", "int"],
|
||||
// function(args) {
|
||||
// // print(format("%02x", args[0]));
|
||||
// // local AniPath = NativePointer(L_sq_I2P(args[0])).readUnicodeString();
|
||||
// print(format("%02x", args[0]));
|
||||
// // print(args[2]);
|
||||
// return null;
|
||||
// },
|
||||
// function(args) {
|
||||
// // print(666);
|
||||
// // print(format("%02x", args.pop()));
|
||||
// // TTTAni <- args.pop();
|
||||
// return null;
|
||||
// });
|
||||
|
||||
|
||||
|
||||
// local ItemObject = R_Utils.GetEquPath(601500069);
|
||||
// print(NativePointer(L_sq_I2P(ItemObject)).readUnicodeString());
|
||||
|
||||
|
||||
|
||||
|
||||
function Lenheart_MarrySystem_Fun(obj) {
|
||||
local RootTab = getroottable();
|
||||
if (!RootTab.rawin("MarrySystem_Obj")) {
|
||||
@@ -217,11 +377,17 @@ function Lenheart_MarrySystem_Fun(obj) {
|
||||
} else {
|
||||
RootTab["MarrySystem_Obj"].Proc(obj);
|
||||
}
|
||||
|
||||
// if (TTTAni) {
|
||||
// print(format("%02x", TTTAni));
|
||||
// L_Sq_CallFunc(0x1091890, "char", FFI_THISCALL, ["int"], TTTAni);
|
||||
// L_Sq_CallFunc(0x108B770, "int", FFI_THISCALL, ["int", "int", "int", "int", "int", "int"], TTTAni, L_sq_RA(0x1B45B94), 200, 200, 0, 0);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
320
Project/MarrySystem/MarrySystem_ActionAni.nut
Normal file
320
Project/MarrySystem/MarrySystem_ActionAni.nut
Normal file
@@ -0,0 +1,320 @@
|
||||
/*
|
||||
文件名:MarrySystem_ActionAni.nut
|
||||
路径:Project/MarrySystem/MarrySystem_ActionAni.nut
|
||||
创建日期:2024-10-07 19:12
|
||||
文件用途:
|
||||
*/
|
||||
class MarrySystem_ActionAniC extends Rindro_BaseToolClass {
|
||||
//调试模式
|
||||
// DeBugMode = true;
|
||||
|
||||
//不是窗口
|
||||
// NoWindow = true;
|
||||
|
||||
//是否可见
|
||||
// Visible = false;
|
||||
|
||||
Flag = false;
|
||||
|
||||
//演出时间
|
||||
ActTimer = null;
|
||||
|
||||
//幕布
|
||||
Canvas = false;
|
||||
|
||||
|
||||
//新郎
|
||||
Groom = null;
|
||||
//新娘
|
||||
Bride = null;
|
||||
//观众
|
||||
Visitors = null;
|
||||
|
||||
FireworkPath = ["common/firework/chn_heart_firework_blue_dodge.ani",
|
||||
"common/firework/chn_heart_firework_blue_normal.ani",
|
||||
"common/firework/chn_heart_firework_pink_dodge_01.ani",
|
||||
"common/firework/chn_heart_firework_pink_dodge.ani",
|
||||
"common/firework/chn_heart_firework_pink_normal_01.ani",
|
||||
"common/firework/chn_heart_firework_pink_normal.ani",
|
||||
"common/firework/chn_heart_firework_purple_dodge.ani",
|
||||
"common/firework/chn_heart_firework_purple_normal.ani",
|
||||
"common/firework/chn_heart_firework_red_dodge.ani",
|
||||
"common/firework/chn_heart_firework_red_normal.ani",
|
||||
"common/firework/chn_heart_firework_sky_dodge_01.ani",
|
||||
"common/firework/chn_heart_firework_sky_dodge.ani",
|
||||
"common/firework/chn_heart_firework_sky_normal_01.ani",
|
||||
"common/firework/chn_heart_firework_sky_normal.ani",
|
||||
"common/firework/chn_heart_firework_yellow_dodge_01.ani",
|
||||
"common/firework/chn_heart_firework_yellow_dodge.ani",
|
||||
"common/firework/chn_heart_firework_yellow_normal_01.ani",
|
||||
"common/firework/chn_heart_firework_yellow_normal.ani",
|
||||
"common/firework/chn_heehee_firework_dodge.ani",
|
||||
"common/firework/chn_heehee_firework_normal.ani"
|
||||
];
|
||||
|
||||
FireworkAni = null;
|
||||
|
||||
|
||||
constructor() {
|
||||
Visitors = [];
|
||||
FireworkAni = [];
|
||||
|
||||
}
|
||||
|
||||
function Init(Info) {
|
||||
Groom = null;
|
||||
//新娘
|
||||
Bride = null;
|
||||
//观众
|
||||
Visitors = [];
|
||||
ActTimer = Clock();
|
||||
Canvas = false;
|
||||
|
||||
|
||||
for (local i = 0; i< Info.len(); i++) {
|
||||
local Object = {};
|
||||
local InfoConfig = Info[i];
|
||||
Object.Charc <- Rindro_Draw_Character(InfoConfig.job, InfoConfig.avatar, "rest.ani", null);
|
||||
Object.Name <- InfoConfig.name;
|
||||
if (i == 0) Groom = Object;
|
||||
else if (i == 1) Bride = Object;
|
||||
else {
|
||||
Visitors.append(Object);
|
||||
}
|
||||
}
|
||||
|
||||
InitFirework();
|
||||
|
||||
Flag = true;
|
||||
}
|
||||
|
||||
function InitFirework() {
|
||||
FireworkAni = [];
|
||||
for (local i = 0; i< 12; i++) {
|
||||
FireworkAni.append({
|
||||
ani = Rindro_Animation(FireworkPath[sq_getRandom(0, FireworkPath.len() - 1)]),
|
||||
pos = {
|
||||
x = sq_getRandom(0, 1066),
|
||||
y = sq_getRandom(0, 800)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function ShowMessageBox(X, Y, STR) {
|
||||
local StrDrawLen = LenheartTextClass.GetStringLength(STR);
|
||||
local WLen = ((StrDrawLen - 30) / 12) + 1;
|
||||
local HLen = (StrDrawLen / 110);
|
||||
|
||||
WLen = WLen > 7 ? 7 : WLen;
|
||||
//Item信息框一般为211的宽度
|
||||
L_sq_DrawImg("interface/messageballoon.img", 49, X + (30 + (WLen * 12)) * 0.7, Y + 16 + ((HLen + 1) * 13));
|
||||
L_sq_DrawWindow(X, Y, 30 + (WLen * 12), 21 + (HLen * 13), "interface/messageballoon.img", 40, 9, 12, 9, 13);
|
||||
//绘制字符串
|
||||
local Buf = L_sq_GetStringDrawArray(STR, 123);
|
||||
|
||||
foreach(Line, Str in Buf) {
|
||||
L_sq_DrawCode(Str, X + 8, Y + 8 + (Line * 14), sq_RGBA(255, 255, 255, 255), 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
function ShowMessageAct(CT, TimeFlag, X, Y, Str) {
|
||||
if (CT >= TimeFlag && CT <= TimeFlag + 3000) {
|
||||
ShowMessageBox(X, Y, Str);
|
||||
}
|
||||
return TimeFlag + 3000;
|
||||
}
|
||||
|
||||
function Show(obj) {
|
||||
if (!Flag) return;
|
||||
local CT = Clock() - ActTimer;
|
||||
|
||||
DrawAuditoriumMap(obj);
|
||||
|
||||
//画新郎
|
||||
if (Groom) {
|
||||
Groom.Charc.Draw(680, 360);
|
||||
}
|
||||
//画新娘
|
||||
if (Bride) {
|
||||
Bride.Charc.Draw(686, 400);
|
||||
}
|
||||
|
||||
//画宾客
|
||||
foreach(Pos, Object in Visitors) {
|
||||
Object.Charc.Draw(100 + ((Pos / 2) * 80), 350 + ((Pos % 2) * 60));
|
||||
}
|
||||
|
||||
local TimeFlag = 5000;
|
||||
TimeFlag = ShowMessageAct(CT, TimeFlag, 810, 175, format("[%s]和[%s]的婚礼现在开始!", Groom.Name, Bride.Name));
|
||||
TimeFlag = ShowMessageAct(CT, TimeFlag, 810, 135, "婚姻是神圣的仪式,也是爱情和相互信任的升华,他需要的不仅是爱,更是双方一生一世的信赖。");
|
||||
TimeFlag = ShowMessageAct(CT, TimeFlag, 810, 155, "在这里,我们两位新人将在来宾的见证下完成这最重要的承诺。");
|
||||
TimeFlag = ShowMessageAct(CT, TimeFlag, 810, 155, "新郎,你愿意接受这个女人成为你的合法妻子并永远爱她吗?");
|
||||
TimeFlag = ShowMessageAct(CT, TimeFlag, 630, 195, "是的,我愿意!");
|
||||
TimeFlag = ShowMessageAct(CT, TimeFlag, 810, 155, "新娘,你愿意接受这个男人成为你的合法丈夫并永远爱他吗?");
|
||||
TimeFlag = ShowMessageAct(CT, TimeFlag, 671, 215, "...");
|
||||
TimeFlag = ShowMessageAct(CT, TimeFlag, 611, 215, "(害羞)我......我愿意!");
|
||||
TimeFlag = ShowMessageAct(CT, TimeFlag, 810, 155, "好,我以神的名义宣布新郎新娘正式结为夫妻。");
|
||||
TimeFlag = ShowMessageAct(CT, TimeFlag, 810, 155, "请所有的来宾一起祝福这对新人~");
|
||||
|
||||
if (CT >= TimeFlag && CT <= (TimeFlag + 5000)) {
|
||||
{
|
||||
L_sq_DrawImg("interface2/wedding/screenshot_bg.img", 0, 0, 0, 1, sq_RGBA(255, 255, 255, 250), getroottable().Rindro_Scr_Width / 800.0, 1.0);
|
||||
for (local i = 0; i< 12; i++) {
|
||||
local Info = FireworkAni[i];
|
||||
Info.ani.Draw(Info.pos.x, Info.pos.y);
|
||||
if (i == 11 && Info.ani.IsUsability == false) {
|
||||
InitFirework();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (CT >= (TimeFlag + 5000)) {
|
||||
Groom = null;
|
||||
//新娘
|
||||
Bride = null;
|
||||
//观众
|
||||
Visitors = [];
|
||||
ActTimer = Clock();
|
||||
Canvas = false;
|
||||
Flag = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ShowMessageBox(810, 135, "婚姻是神圣的仪式,也是爱情和相互信任的升华,他需要的不仅是爱,更是双方一生一世的信赖。");
|
||||
// ShowMessageBox(810, 155, "在这里,我们两位新人将在来宾的见证下完成这最重要的承诺。");
|
||||
// ShowMessageBox(810, 155, "新郎,你愿意接受这个女人成为你的合法妻子并永远爱她吗?");
|
||||
// ShowMessageBox(680, 155, "是的,我愿意!");
|
||||
// ShowMessageBox(810, 155, "新娘,你愿意接受这个男人成为你的合法丈夫并永远爱他吗?");
|
||||
// ShowMessageBox(686, 195, "...");
|
||||
// ShowMessageBox(686, 195, "(害羞)我......我愿意!");
|
||||
// ShowMessageBox(810, 155, "好,我以神的名义宣布新郎新娘正式结为夫妻。");
|
||||
// ShowMessageBox(810, 155, "请所有的来宾一起祝福这对新人~");
|
||||
|
||||
|
||||
|
||||
// {
|
||||
// L_sq_DrawImg("interface2/wedding/screenshot_bg.img", 0, 0, 0, 1, sq_RGBA(255, 255, 255, 250), getroottable().Rindro_Scr_Width / 800.0, 1.0);
|
||||
// for (local i = 0; i< 12; i++) {
|
||||
// local Info = FireworkAni[i];
|
||||
// Info.ani.Draw(Info.pos.x, Info.pos.y);
|
||||
// if (i == 11 && Info.ani.IsUsability == false) {
|
||||
// InitFirework();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
if (!Canvas) {
|
||||
local AlphaValue = sq_GetUniformVelocity(250, 0, CT - 2000, 3000);
|
||||
//先画一个黑色背景
|
||||
L_sq_DrawImg("marrysystem.img", 1, 0, 0, 1, sq_RGBA(255, 255, 255, AlphaValue), 1.0, 1.0);
|
||||
|
||||
if (CT >= 5000) {
|
||||
Canvas = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
ScriptMapPath = "map/cataclysm/town/church/";
|
||||
MapXpos = 0;
|
||||
MapYpos = 47;
|
||||
|
||||
function DrawAuditoriumMap(obj) {
|
||||
//先画一个黑色背景
|
||||
L_sq_DrawImg("marrysystem.img", 1, 0, 0);
|
||||
|
||||
//画地板
|
||||
L_sq_DrawImg("Map/Church/ChurchTile.img", 1, 0 + MapXpos, -73);
|
||||
L_sq_DrawImg("Map/Church/ChurchTile.img", 0, (224 * 1) + MapXpos, -80);
|
||||
L_sq_DrawImg("Map/Church/ChurchTile.img", 1, (224 * 2) + MapXpos, -80);
|
||||
L_sq_DrawImg("Map/Church/ChurchTile.img", 1, (224 * 3) + MapXpos, -80);
|
||||
L_sq_DrawImg("Map/Church/ChurchTile.img", 0, (224 * 4) + MapXpos, -80);
|
||||
|
||||
for (local i = 0; i< 2; i++) {
|
||||
L_sq_DrawImg("Map/Church/ChurchTileEx.img", 0, (224 * 0) + MapXpos, 467 + (i * 120));
|
||||
L_sq_DrawImg("Map/Church/ChurchTileEx.img", 0, (224 * 1) + MapXpos, 467 + (i * 120));
|
||||
L_sq_DrawImg("Map/Church/ChurchTileEx.img", 0, (224 * 2) + MapXpos, 467 + (i * 120));
|
||||
L_sq_DrawImg("Map/Church/ChurchTileEx.img", 0, (224 * 3) + MapXpos, 467 + (i * 120));
|
||||
L_sq_DrawImg("Map/Church/ChurchTileEx.img", 0, (224 * 4) + MapXpos, 467 + (i * 120));
|
||||
}
|
||||
|
||||
//画地图
|
||||
//closeback
|
||||
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 153, 123);
|
||||
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 288, 126);
|
||||
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 420, 126);
|
||||
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 79, 117);
|
||||
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 211, 117);
|
||||
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 346, 118);
|
||||
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 482, 118);
|
||||
DrawMapAni(obj, "Animation/chn_organ.ani", 790, 145);
|
||||
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 582, 628);
|
||||
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 176, 628);
|
||||
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 312, 628);
|
||||
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 447, 628);
|
||||
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 721, 628);
|
||||
DrawMapAni(obj, "Animation/chn_ribbon_silk.ani", 863, 628);
|
||||
|
||||
//normal
|
||||
DrawMapAni(obj, "Animation/chn_light_normal.ani", 833, 27);
|
||||
DrawMapAni(obj, "Animation/chn_light_dodge.ani", 833, 27);
|
||||
DrawMapAni(obj, "Animation/chn_light_normal.ani", 153, 29);
|
||||
DrawMapAni(obj, "Animation/chn_light_dodge.ani", 153, 29);
|
||||
|
||||
DrawMapAni(obj, "Animation/chn_big_Carpet.ani", 617, 332);
|
||||
DrawMapAni(obj, "Animation/chn_big_Carpet.ani", 393, 332);
|
||||
DrawMapAni(obj, "Animation/chn_big_Carpet.ani", 169, 332);
|
||||
DrawMapAni(obj, "Animation/chn_big_Carpet.ani", -55, 332);
|
||||
DrawMapAni(obj, "Animation/chn_big_Carpet.ani", 1065, 332);
|
||||
DrawMapAni(obj, "Animation/chn_big_Carpet.ani", 841, 332);
|
||||
|
||||
DrawNpc(obj, "npc/animation/chn_npc_father.ani", 888, 375, "MarryMapNpc" + 2);
|
||||
|
||||
DrawMapAni(obj, "Animation/chn_bridesmaid_normal_in_church.ani", 576, 37);
|
||||
DrawMapAni(obj, "Animation/chn_chair.ani", 131, 232);
|
||||
DrawMapAni(obj, "Animation/chn_chair.ani", 302, 232);
|
||||
DrawMapAni(obj, "Animation/chn_chair.ani", 481, 232);
|
||||
DrawMapAni(obj, "Animation/chn_flower_bigpot.ani", 838, 269);
|
||||
DrawMapAni(obj, "Animation/chn_flower_tunnel.ani", 907, 323);
|
||||
DrawMapAni(obj, "Animation/chn_flower_bigpot.ani", 959, 359);
|
||||
DrawMapAni(obj, "Animation/chn_table.ani", 832, 373);
|
||||
DrawMapAni(obj, "Animation/chn_tablering_dodge.ani", 832, 373);
|
||||
DrawMapAni(obj, "Animation/chn_chair.ani", 971, 535);
|
||||
DrawMapAni(obj, "Animation/chn_chair.ani", 661, 535);
|
||||
DrawMapAni(obj, "Animation/chn_chair.ani", 114, 535);
|
||||
DrawMapAni(obj, "Animation/chn_chair.ani", 485, 535);
|
||||
DrawMapAni(obj, "Animation/chn_chair.ani", 297, 535);
|
||||
DrawMapAni(obj, "Animation/chn_chair.ani", 817, 535);
|
||||
|
||||
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 373, 617);
|
||||
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 507, 617);
|
||||
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 641, 617);
|
||||
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 102, 617);
|
||||
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 234, 617);
|
||||
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 783, 617);
|
||||
DrawMapAni(obj, "Animation/chn_flower_stand.ani", 923, 617);
|
||||
|
||||
//画NPC
|
||||
DrawNpc(obj, "npc/Animation/chn_giftbox_in_church.ani", 691, 240, "MarryMapNpc" + 1);
|
||||
}
|
||||
|
||||
function DrawNpc(obj, aniFileName, x, y, aniname) {
|
||||
local ani = obj.getVar().GetAnimationMap(aniname, aniFileName);
|
||||
ani.setImageRateFromOriginal(-1.0, 1.0);
|
||||
sq_AnimationProc(ani);
|
||||
sq_drawCurrentFrame(ani, x, y, true);
|
||||
return ani;
|
||||
}
|
||||
|
||||
function DrawMapAni(obj, Path, X, Y) {
|
||||
T_DrawDynamicAni(obj, ScriptMapPath + Path, X + MapXpos, Y + MapYpos, "MarryMapAni" + Path);
|
||||
}
|
||||
}
|
||||
getroottable().rawdelete("MarrySystem_Obj");
|
||||
195
Project/MarrySystem/MarrySystem_OpenAuditoriumList.nut
Normal file
195
Project/MarrySystem/MarrySystem_OpenAuditoriumList.nut
Normal file
@@ -0,0 +1,195 @@
|
||||
/*
|
||||
文件名:MarrySystem_OpenAuditoriumList.nut
|
||||
路径:Project/MarrySystem/MarrySystem_OpenAuditoriumList.nut
|
||||
创建日期:2024-10-05 13:20
|
||||
文件用途:打开礼堂列表
|
||||
*/
|
||||
class LenheartNewUI_MarrySystem_OpenAuditoriumListButton extends LenheartNewUI_CommonUi {
|
||||
State = 0;
|
||||
BaseIdx = 29;
|
||||
DWidth = null;
|
||||
Path = null;
|
||||
Idx = null;
|
||||
Info = null;
|
||||
|
||||
|
||||
constructor(X, Y, W, H, Path, Idx) {
|
||||
this.DWidth = W;
|
||||
this.Path = Path;
|
||||
this.Idx = Idx;
|
||||
LenheartNewUI_CommonUi.constructor(X, Y, W, H);
|
||||
|
||||
}
|
||||
|
||||
function SetFrame(gPath, gIdx) {
|
||||
if (gPath) Path = gPath;
|
||||
Idx = gIdx;
|
||||
}
|
||||
|
||||
function Show(obj) {
|
||||
//不可用
|
||||
if (State == 8) {
|
||||
L_sq_DrawImg(Path, Idx + 3, X, Y + 1);
|
||||
} else {
|
||||
//按下
|
||||
if (isLBDown) {
|
||||
L_sq_DrawImg(Path, Idx + 2, X, Y);
|
||||
}
|
||||
//悬停
|
||||
else if (isInRect) {
|
||||
L_sq_DrawImg(Path, Idx + 1, X, Y);
|
||||
}
|
||||
//普通
|
||||
else {
|
||||
L_sq_DrawImg(Path, Idx, X, Y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
class MarrySystem_OpenAuditoriumListC extends LenheartNewUI_Windows {
|
||||
//调试模式
|
||||
// DeBugMode = true;
|
||||
|
||||
//不是窗口
|
||||
// NoWindow = true;
|
||||
|
||||
//是否可见
|
||||
Visible = false;
|
||||
|
||||
//包头
|
||||
OP = 20078000;
|
||||
|
||||
//列表
|
||||
List = null;
|
||||
|
||||
//滚动Flag
|
||||
WheelFalg = 0;
|
||||
|
||||
function Time2Str(Time) {
|
||||
if (Time< 0) return "已开始";
|
||||
local str = "";
|
||||
local minutes = Time / 60;
|
||||
local seconds = (Time % 60);
|
||||
str += minutes + "分";
|
||||
str += seconds + "秒";
|
||||
return str;
|
||||
}
|
||||
|
||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||
Childrens = [];
|
||||
List = {};
|
||||
//注册控件
|
||||
RegisterWidget();
|
||||
|
||||
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||
}
|
||||
|
||||
function RegisterWidget() {
|
||||
//关闭按钮
|
||||
local CloseButton = LenheartNewUI_BaseButton(458, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||
CloseButton.OnClick = function() {
|
||||
this.Visible = false;
|
||||
}.bindenv(this);
|
||||
Childrens.append(CloseButton);
|
||||
|
||||
for (local i = 0; i< 11; i++) {
|
||||
local ButtonBuf = LenheartNewUI_MarrySystem_OpenAuditoriumListButton(412, 112 + (i * 21), 51, 17, "interface2/wedding/weddingcardreceive.img", 7);
|
||||
ButtonBuf.Info = i;
|
||||
ButtonBuf.OnClickEx = function(Button) {
|
||||
local T = {
|
||||
op = OP + 15,
|
||||
room = List[Button.Info + WheelFalg][0]
|
||||
}
|
||||
SendPackEx(T);
|
||||
CloseWindow();
|
||||
}.bindenv(this);
|
||||
ButtonBuf.SetCallBackFunc(function(Button) {
|
||||
//有索引信息才显示
|
||||
if (Button.Info<(List.len() - WheelFalg)) {
|
||||
local DrawInfo = List[Button.Info + WheelFalg];
|
||||
//绘制举办者名字
|
||||
L_sq_DrawCode(DrawInfo[1], Button.X - 330 - LenheartTextClass.GetStringLength(DrawInfo[1]) / 2, Button.Y + 2, sq_RGBA(134, 120, 79, 255), 0, 1);
|
||||
L_sq_DrawImg("interface2/wedding/weddingreservationpopupui.img", 1, Button.X - 310, Button.Y + 2);
|
||||
L_sq_DrawCode(DrawInfo[5], Button.X - 285, Button.Y + 2, sq_RGBA(134, 120, 79, 255), 0, 1);
|
||||
|
||||
//绘制频道
|
||||
L_sq_DrawCode(DrawInfo[8], Button.X - 186, Button.Y + 2, sq_RGBA(134, 120, 79, 255), 0, 1);
|
||||
|
||||
//绘制举办时间
|
||||
local Time = Sq_Time();
|
||||
local TimeStr = Time2Str(DrawInfo[9] + ((DrawInfo[2] + 1) * 10 * 60) - Time);
|
||||
L_sq_DrawCode(TimeStr, Button.X - 100 - LenheartTextClass.GetStringLength(TimeStr) / 2, Button.Y + 2, sq_RGBA(134, 120, 79, 255), 0, 1);
|
||||
|
||||
//绘制人数
|
||||
local CountStr = DrawInfo[7].tostring();
|
||||
L_sq_DrawCode(CountStr, Button.X - 20 - LenheartTextClass.GetStringLength(CountStr) / 2, Button.Y + 2, sq_RGBA(134, 120, 79, 255), 0, 1);
|
||||
|
||||
Button.Visible = true;
|
||||
} else {
|
||||
Button.Visible = false;
|
||||
}
|
||||
}.bindenv(this));
|
||||
Childrens.append(ButtonBuf);
|
||||
}
|
||||
}
|
||||
|
||||
//绘制主界面
|
||||
function DrawMain(obj) {
|
||||
//Item信息框一般为211的宽度
|
||||
L_sq_DrawWindow(X, Y + 10, 540 * 0.85, 340 * 0.9, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||
L_sq_DrawWindow(X + 6, Y + 19, 528 * 0.85, 47, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||
L_sq_DrawWindow(X + 6, Y + 79, 528 * 0.85, 236, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||
|
||||
//标题栏
|
||||
L_sq_DrawButton(X - 1, Y, 466, "interface/lenheartwindowcommon.img", 609, 2, 7);
|
||||
|
||||
//绘制窗口名字
|
||||
L_sq_DrawCode("婚礼礼堂列表", X + 200, Y + 3, sq_RGBA(134, 120, 79, 255), 0, 1);
|
||||
|
||||
L_sq_DrawImg("interface2/wedding/weddingcardreceive.img", 10, X + 108, Y + 35);
|
||||
|
||||
sq_DrawBox(X + 10, Y + 87, 198, 17, sq_RGBA(134, 120, 79, 255), 1);
|
||||
L_sq_DrawCode("婚礼举办者", X + 80, Y + 90, sq_RGBA(221, 197, 147, 255), 0, 1);
|
||||
|
||||
sq_DrawBox(X + 210, Y + 87, 40, 17, sq_RGBA(134, 120, 79, 255), 1);
|
||||
L_sq_DrawCode("频道", X + 219, Y + 90, sq_RGBA(221, 197, 147, 255), 0, 1);
|
||||
|
||||
sq_DrawBox(X + 252, Y + 87, 122, 17, sq_RGBA(134, 120, 79, 255), 1);
|
||||
L_sq_DrawCode("举办时间", X + 289, Y + 90, sq_RGBA(221, 197, 147, 255), 0, 1);
|
||||
|
||||
|
||||
sq_DrawBox(X + 376, Y + 87, 32, 17, sq_RGBA(134, 120, 79, 255), 1);
|
||||
L_sq_DrawCode("人数", X + 380, Y + 90, sq_RGBA(221, 197, 147, 255), 0, 1);
|
||||
|
||||
sq_DrawBox(X + 410, Y + 87, 54, 17, sq_RGBA(134, 120, 79, 255), 1);
|
||||
L_sq_DrawCode("参加婚礼", X + 414, Y + 90, sq_RGBA(221, 197, 147, 255), 0, 1);
|
||||
|
||||
}
|
||||
|
||||
function Show(obj) {
|
||||
DrawMain(obj);
|
||||
LenheartNewUI_Windows.Show(obj);
|
||||
|
||||
}
|
||||
|
||||
//逻辑入口
|
||||
function Proc(obj) {
|
||||
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||
}
|
||||
|
||||
//override
|
||||
//鼠标滚轮事件回调
|
||||
function OnMouseWheel(Flag, MousePos_X, MousePos_Y) {
|
||||
|
||||
if (Flag) {
|
||||
if (WheelFalg > 0) WheelFalg--;
|
||||
} else {
|
||||
if (WheelFalg<(List.len() - 11)) WheelFalg++;
|
||||
}
|
||||
|
||||
//调用原生方法
|
||||
LenheartNewUI_Windows.OnMouseWheel(Flag, MousePos_X, MousePos_Y);
|
||||
}
|
||||
|
||||
}
|
||||
getroottable().rawdelete("MarrySystem_Obj");
|
||||
23
Project/MarrySystem/MarrySystem_Room.nut
Normal file
23
Project/MarrySystem/MarrySystem_Room.nut
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
文件名:MarrySystem_Room.nut
|
||||
路径:Project/MarrySystem/MarrySystem_Room.nut
|
||||
创建日期:2024-10-28 20:22
|
||||
文件用途:婚房逻辑
|
||||
*/
|
||||
class MarrySystem_Room {
|
||||
|
||||
WorldMapImg = null;
|
||||
|
||||
constructor() {
|
||||
|
||||
DrawTownCallBackFunc.MarrySystem_Room <- Draw.bindenv(this);
|
||||
|
||||
WorldMapImg = Rindro_Image("worldmap.img");
|
||||
}
|
||||
|
||||
function Draw() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
getroottable().rawdelete("MarrySystem_Obj");
|
||||
Reference in New Issue
Block a user