parent
1edf3151f5
commit
5788cf7985
|
|
@ -279,8 +279,6 @@ class Yosin_NineBoxStretch extends Yosin_CommonUi {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//拼接按钮
|
//拼接按钮
|
||||||
class Yosin_SplicingButton extends Yosin_CommonUi {
|
class Yosin_SplicingButton extends Yosin_CommonUi {
|
||||||
//按钮状态
|
//按钮状态
|
||||||
|
|
@ -358,63 +356,6 @@ class Yosin_SplicingButton extends Yosin_CommonUi {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 窗口顶部标题
|
|
||||||
class Yosin_TopTitle extends Yosin_CommonUi {
|
|
||||||
|
|
||||||
constructor(W, H, title, drawBackground = true) {
|
|
||||||
base.constructor(0, 0, W, H);
|
|
||||||
|
|
||||||
//内容背景
|
|
||||||
if (drawBackground){
|
|
||||||
local background = Yosin_NineBoxStretch(-1, 15, W + 1, H - 15, "sprite/interface/lenheartwindowcommon.img", 97);
|
|
||||||
AddUIChild(background);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 标题背景
|
|
||||||
local Background = Yosin_EmeStretch(0, 0, W, 22, "sprite/interface/lenheartwindowcommon.img", 609);
|
|
||||||
Addchild(Background);
|
|
||||||
|
|
||||||
// 标题亮色背景
|
|
||||||
local BackgroundBright = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 483);
|
|
||||||
local scaleW = (W / BackgroundBright.GetSize().w).tofloat();
|
|
||||||
BackgroundBright.SetScale( scaleW , 1);
|
|
||||||
BackgroundBright.SetPosition(0, 1);
|
|
||||||
Addchild(BackgroundBright);
|
|
||||||
|
|
||||||
|
|
||||||
// 标题
|
|
||||||
local titleTextActor = FontAssetManager.GenerateNormal(title, true, {
|
|
||||||
color = sq_RGBA(206, 189, 140, 255)
|
|
||||||
});
|
|
||||||
local titleX = W / 2 - titleTextActor.GetSize().w / 2;
|
|
||||||
// 绘制标题
|
|
||||||
titleTextActor.SetPosition(titleX, 2);
|
|
||||||
Addchild(titleTextActor);
|
|
||||||
|
|
||||||
local closeBtn = Yosin_BaseButton(W - 20, 4, 12, 12, "sprite/interface/lenheartwindowcommon.img", 544);
|
|
||||||
closeBtn.DownSimulateOffset = false;
|
|
||||||
closeBtn.OnClick = function(btn) {
|
|
||||||
|
|
||||||
}
|
|
||||||
AddUIChild(closeBtn);
|
|
||||||
|
|
||||||
local topBtn = Yosin_BaseButton(W - 40, 2, 13, 13, "sprite/interface/lenheartwindowcommon.img", 455);
|
|
||||||
topBtn.DownSimulateOffset = false;
|
|
||||||
topBtn.OnClick = function(btn) {
|
|
||||||
|
|
||||||
}
|
|
||||||
AddUIChild(topBtn);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 标题按钮
|
// 标题按钮
|
||||||
class titleButton extends Yosin_BaseButton {
|
class titleButton extends Yosin_BaseButton {
|
||||||
|
|
||||||
|
|
@ -453,10 +394,10 @@ class titleButton extends Yosin_BaseButton {
|
||||||
//状态更改 刷新精灵帧
|
//状态更改 刷新精灵帧
|
||||||
if (State != SpriteState) {
|
if (State != SpriteState) {
|
||||||
if (State == 2) {
|
if (State == 2) {
|
||||||
Y -= 1;
|
Y = cacheY - 1;
|
||||||
SyncPos(X, Y);
|
SyncPos(X, Y);
|
||||||
} else if (SpriteState == 2) {
|
} else if (SpriteState == 2) {
|
||||||
Y += 1;
|
Y = cacheY;
|
||||||
SyncPos(X, Y);
|
SyncPos(X, Y);
|
||||||
}
|
}
|
||||||
SpriteState = State;
|
SpriteState = State;
|
||||||
|
|
@ -608,11 +549,12 @@ class Yosin_StretchTitleButton extends Yosin_CommonUi {
|
||||||
class Yosin_RowMoreTitleBtn extends Yosin_CommonUi {
|
class Yosin_RowMoreTitleBtn extends Yosin_CommonUi {
|
||||||
|
|
||||||
LBDownOnClick = null;
|
LBDownOnClick = null;
|
||||||
btns = [];
|
btns = null;
|
||||||
tests = [];
|
tests = null;
|
||||||
|
|
||||||
constructor(X, Y, titles, selectIndex = 0, baseWidth = 34, path = "sprite/interface/lenheartwindowcommon.img", idx = 160) {
|
constructor(X, Y, titles, path, idx, selectIndex = 0, baseWidth = 34) {
|
||||||
this.tests = titles;
|
this.tests = titles;
|
||||||
|
btns = [];
|
||||||
local btnX = 0;
|
local btnX = 0;
|
||||||
for(local i = 0; i < titles.len(); i++) {
|
for(local i = 0; i < titles.len(); i++) {
|
||||||
|
|
||||||
|
|
@ -651,3 +593,23 @@ class Yosin_RowMoreTitleBtn extends Yosin_CommonUi {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 进度显示
|
||||||
|
class Yosin_Schedule extends Yosin_CommonUi {
|
||||||
|
|
||||||
|
constructor(X, Y, W, H, path, idx) {
|
||||||
|
base.constructor(X, Y, W, H);
|
||||||
|
|
||||||
|
local schedule = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 164);
|
||||||
|
schedule.SetPosition(0, 0);
|
||||||
|
|
||||||
|
AddUIChild(schedule);
|
||||||
|
|
||||||
|
local scheduleBar = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 165);
|
||||||
|
scheduleBar.SetPosition(1, 1);
|
||||||
|
AddUIChild(scheduleBar);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,12 +77,18 @@ e:\Yosin&Kiwano_DOF\sqr\User\UI\Widget\InputBox.nut
|
||||||
e:\Yosin&Kiwano_DOF\sqr\User\UI\Widget\Drag_Button.nut
|
e:\Yosin&Kiwano_DOF\sqr\User\UI\Widget\Drag_Button.nut
|
||||||
e:\Yosin&Kiwano_DOF\sqr\User\UI\Widget\Scroll_Bar.nut
|
e:\Yosin&Kiwano_DOF\sqr\User\UI\Widget\Scroll_Bar.nut
|
||||||
e:\Yosin&Kiwano_DOF\sqr\User\UI\Widget\Text_Button.nut
|
e:\Yosin&Kiwano_DOF\sqr\User\UI\Widget\Text_Button.nut
|
||||||
|
e:\Yosin&Kiwano_DOF\sqr\User\UI\Widget\Top_Title.nut
|
||||||
|
|
||||||
|
|
||||||
e:\Yosin&Kiwano_DOF\sqr\User\UI\Window\0_Login.nut
|
e:\Yosin&Kiwano_DOF\sqr\User\UI\Window\0_Login.nut
|
||||||
e:\Yosin&Kiwano_DOF\sqr\User\UI\Window\1_Select_Character.nut
|
e:\Yosin&Kiwano_DOF\sqr\User\UI\Window\1_Select_Character.nut
|
||||||
e:\Yosin&Kiwano_DOF\sqr\User\UI\Window\2_create_Character.nut
|
e:\Yosin&Kiwano_DOF\sqr\User\UI\Window\2_create_Character.nut
|
||||||
e:\Yosin&Kiwano_DOF\sqr\User/UI/Window/3_Top_tool.nut
|
e:\Yosin&Kiwano_DOF\sqr\User\UI\Window\3_Top_tool.nut
|
||||||
e:\Yosin&Kiwano_DOF\sqr\User/UI/Window/4_PersonalInfo.nut
|
e:\Yosin&Kiwano_DOF\sqr\User\UI\Window\4_PersonalInfo.nut
|
||||||
|
e:\Yosin&Kiwano_DOF\sqr\User\UI\Window\5_Inventory\5_Inventory.nut
|
||||||
|
e:\Yosin&Kiwano_DOF\sqr\User\UI\Window\5_Inventory\Inventory_EquipmentPage.nut
|
||||||
|
e:\Yosin&Kiwano_DOF\sqr\User\UI\Window\5_Inventory\ItemCollect.nut
|
||||||
|
|
||||||
e:\Yosin&Kiwano_DOF\sqr\User\UI\Window\233_HUD_Message.nut
|
e:\Yosin&Kiwano_DOF\sqr\User\UI\Window\233_HUD_Message.nut
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,86 +11,21 @@ function TestStage() {
|
||||||
|
|
||||||
|
|
||||||
// local Window = Sq_CreateWindow(_Login_Window, "登录界面窗口", 0, 0, 1066, 600, 0);
|
// local Window = Sq_CreateWindow(_Login_Window, "登录界面窗口", 0, 0, 1066, 600, 0);
|
||||||
|
// local Window = Sq_CreateWindow(_Select_Character_Window, "选择角色窗口", 0, 0, 1066, 600, 0);
|
||||||
|
// local Window = Sq_CreateWindow(_CreateCharacter, "创建角色界面窗口", 0, 0, 1066, 600, 0);
|
||||||
|
|
||||||
|
|
||||||
// //大背景
|
|
||||||
// local BackGround = CL_SpriteObject("sprite/interface2/charactercreatever2/characterbackground.img", 14);
|
|
||||||
// T.Addchild(BackGround);
|
|
||||||
|
|
||||||
// //登录按钮文本
|
|
||||||
// local TextActor = TextActor(0, {
|
|
||||||
// color = sq_RGBA(186, 147, 97, 255)
|
|
||||||
// });
|
|
||||||
// TextActor.SetText("测试文字");
|
|
||||||
// TextActor.SetPosition(200, 200);
|
|
||||||
// TextActor.SetZOrder(1000000);
|
|
||||||
// TextActor.SetOutline();
|
|
||||||
// T.Addchild(TextActor);
|
|
||||||
|
|
||||||
// local Fontobj = Font();
|
|
||||||
|
|
||||||
// local TownObj = Town(1);
|
// local TownObj = Town(1);
|
||||||
|
|
||||||
|
|
||||||
// // local MapObj = Map("map/cataclysm/town/seria_room/elvengard.map");
|
|
||||||
// // // local MapObj = Map("map/cataclysm/town/hendonmyre/new_backstreet_2.map");
|
|
||||||
// // // local MapObj = Map("map/cataclysm/town/seria_room/elvengard.map");
|
|
||||||
// // // local MapObj = Map("map/cataclysm/town/sainthorn_heaven/sainthorn_heaven_ship_rear_down.map");
|
|
||||||
// // T.Addchild(MapObj);
|
|
||||||
|
|
||||||
// local Charc = GameObject.CreateCharacter(0, [101590007, 27675, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023]);
|
// local Charc = GameObject.CreateCharacter(0, [101590007, 27675, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023]);
|
||||||
// // Charc.SetPosition(356, 250, 0);
|
// Charc.SetPosition(356, 250, 0);
|
||||||
// // Charc.SetAnimation("RestAni");
|
// Charc.SetAnimation("RestAni");
|
||||||
// TownObj.AddObject(Charc, true);
|
// TownObj.AddObject(Charc, true);
|
||||||
|
|
||||||
|
|
||||||
local Window = Sq_CreateWindow(_Select_Character_Window, "选择角色界面窗口", 0, 0, 1066, 600, 0);
|
// local infoWindow = Sq_CreateWindow(_PersonalInfo, "个人信息窗口", 250, 60, 286, 530, 20);
|
||||||
local T = {
|
|
||||||
loginImg = 1,
|
|
||||||
charac = [{
|
|
||||||
lv = 90,
|
|
||||||
name = "倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒",
|
|
||||||
job = 0,
|
|
||||||
equip = [101020001, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023, 609590003]
|
|
||||||
}, {
|
|
||||||
lv = 90,
|
|
||||||
name = "倾泪寒222",
|
|
||||||
job = 0,
|
|
||||||
equip = [101020023, 601500059, 601550059, 601560057, 601570052, 601520051, 601500059, 601510058, 601530050, 601540059, 601580022, 609590003]
|
|
||||||
}, {
|
|
||||||
lv = 90,
|
|
||||||
name = "Kina",
|
|
||||||
job = 0,
|
|
||||||
equip = [101020026, 601500058, 601550058, 601560056, 601570051, 601520050, 601500058, 601510057, 601530049, 601540058, 601580021, 609590003]
|
|
||||||
}, {
|
|
||||||
lv = 90,
|
|
||||||
name = "测试角色",
|
|
||||||
job = 0,
|
|
||||||
equip = [101020037, 601500061, 601550061, 601560059, 601570054, 601520053, 601500061, 601510060, 601530052, 601540061, 601580024, 609590003]
|
|
||||||
}, {
|
|
||||||
lv = 90,
|
|
||||||
name = "测试角色2号",
|
|
||||||
job = 0,
|
|
||||||
equip = [601020007, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023, 609590003]
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
Window.Init(T);
|
|
||||||
|
|
||||||
// local Actorobj = Actor();
|
local Window = Sq_CreateWindow(_Inventory, "背包窗口", 150, 12, 259, 555, 20);
|
||||||
// Actorobj.ShowBorder(true);
|
// Window.SetScale(0.92, 0.92);
|
||||||
// Actorobj.SetSize(1500, 100);
|
|
||||||
// local Name = FontAssetManager.GenerateNormal("是的呢参加考试你打", true, {
|
|
||||||
// color = sq_RGBA(209, 185, 148, 255),
|
|
||||||
// alignment = TextAlign.Center,
|
|
||||||
// wrap_width = 50
|
|
||||||
// });
|
|
||||||
// Name.ShowBorder(true);
|
|
||||||
// Name.SetSize(1500, 100);
|
|
||||||
// Name.SetPosition(200, 200);
|
|
||||||
// Actorobj.Addchild(Name);
|
|
||||||
// T.Addchild(Actorobj);
|
|
||||||
|
|
||||||
// print(ObjectCount);
|
|
||||||
|
|
||||||
// Sq_CreateWindow(_CreateCharacter, "创建角色界面窗口", 0, 0, 1066, 600, 0);
|
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
/*
|
||||||
|
文件名:Top_Title.nut
|
||||||
|
路径:User/UI/Widget/Top_Title.nut
|
||||||
|
创建日期:2025-01-06 14:00
|
||||||
|
文件用途: 窗口顶部标题
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 窗口顶部标题
|
||||||
|
class Yosin_TopTitle extends Yosin_CommonUi {
|
||||||
|
|
||||||
|
constructor(W, H, title, drawBackground = true) {
|
||||||
|
base.constructor(0, 0, W, H);
|
||||||
|
|
||||||
|
//内容背景
|
||||||
|
if (drawBackground){
|
||||||
|
local background = Yosin_NineBoxStretch(-1, 15, W + 1, H - 15, "sprite/interface/lenheartwindowcommon.img", 97);
|
||||||
|
AddUIChild(background);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 标题背景
|
||||||
|
local Background = Yosin_EmeStretch(0, 0, W, 22, "sprite/interface/lenheartwindowcommon.img", 609);
|
||||||
|
Addchild(Background);
|
||||||
|
|
||||||
|
// 标题亮色背景
|
||||||
|
local BackgroundBright = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 483);
|
||||||
|
local scaleW = (W / BackgroundBright.GetSize().w).tofloat();
|
||||||
|
BackgroundBright.SetScale( scaleW , 1);
|
||||||
|
BackgroundBright.SetPosition(0, 1);
|
||||||
|
Addchild(BackgroundBright);
|
||||||
|
|
||||||
|
|
||||||
|
// 标题
|
||||||
|
local titleTextActor = FontAssetManager.GenerateNormal(title, true, {
|
||||||
|
color = sq_RGBA(206, 189, 140, 255)
|
||||||
|
});
|
||||||
|
local titleX = W / 2 - titleTextActor.GetSize().w / 2;
|
||||||
|
// 绘制标题
|
||||||
|
titleTextActor.SetPosition(titleX, 2);
|
||||||
|
Addchild(titleTextActor);
|
||||||
|
|
||||||
|
local closeBtn = Yosin_BaseButton(W - 20, 4, 12, 12, "sprite/interface/lenheartwindowcommon.img", 544);
|
||||||
|
closeBtn.DownSimulateOffset = false;
|
||||||
|
closeBtn.OnClick = function(btn) {
|
||||||
|
|
||||||
|
}
|
||||||
|
AddUIChild(closeBtn);
|
||||||
|
|
||||||
|
local topBtn = Yosin_BaseButton(W - 40, 2, 13, 13, "sprite/interface/lenheartwindowcommon.img", 455);
|
||||||
|
topBtn.DownSimulateOffset = false;
|
||||||
|
topBtn.OnClick = function(btn) {
|
||||||
|
|
||||||
|
}
|
||||||
|
AddUIChild(topBtn);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -5,13 +5,11 @@
|
||||||
文件用途: 个人信息
|
文件用途: 个人信息
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// 个人信息 250, 60, 286, 530
|
// local infoWindow = Sq_CreateWindow(_PersonalInfo, "个人信息窗口", 250, 60, 286, 530, 20);
|
||||||
|
// todo 图和尺寸比例都需要修改
|
||||||
|
// todo Yosin_Window 和 Yosin_CommonUi 会有性能开销需要检查
|
||||||
class _PersonalInfo extends Yosin_Window {
|
class _PersonalInfo extends Yosin_Window {
|
||||||
|
|
||||||
roleTitleBtn = null;
|
|
||||||
dressUpTitleBtn = null;
|
|
||||||
stoneTitleBtn = null;
|
|
||||||
|
|
||||||
|
|
||||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
|
@ -24,42 +22,19 @@ class _PersonalInfo extends Yosin_Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
function RegisterWidget() {
|
function RegisterWidget() {
|
||||||
// 角色按钮
|
|
||||||
roleTitleBtn = titleButton(10, 25, 40, 19, "sprite/interface/lenheartwindowcommon.img", 82, "角色");
|
|
||||||
AddUIChild(roleTitleBtn);
|
|
||||||
// 装扮/宠物按钮
|
|
||||||
dressUpTitleBtn = titleButton(roleTitleBtn.right() + 1, 25, 71, 19, "sprite/interface/lenheartwindowcommon.img", 86, "装扮/宠物");
|
|
||||||
AddUIChild(dressUpTitleBtn);
|
|
||||||
// 护石按钮
|
|
||||||
stoneTitleBtn = titleButton(dressUpTitleBtn.right() + 1, 25, 40, 19, "sprite/interface/lenheartwindowcommon.img", 82, "护石");
|
|
||||||
AddUIChild(stoneTitleBtn);
|
|
||||||
|
|
||||||
roleTitleBtn.LBDownOnClick = function (btn) {
|
|
||||||
titleClick(btn);
|
|
||||||
}.bindenv(this);
|
|
||||||
dressUpTitleBtn.LBDownOnClick = function (btn) {
|
|
||||||
titleClick(btn);
|
|
||||||
}.bindenv(this);
|
|
||||||
stoneTitleBtn.LBDownOnClick = function (btn) {
|
|
||||||
titleClick(btn);
|
|
||||||
}.bindenv(this);
|
|
||||||
|
|
||||||
|
// 标题按钮
|
||||||
|
local titlesBtn = Yosin_RowMoreTitleBtn(10, 25, ["角色", "装扮/宠物", "护石"],"sprite/interface/lenheartwindowcommon.img", 160);
|
||||||
|
AddUIChild(titlesBtn);
|
||||||
|
|
||||||
|
titlesBtn.LBDownOnClick = function(btns, index) {
|
||||||
|
};
|
||||||
|
|
||||||
// 角色信息
|
// 角色信息
|
||||||
local roleInfo = roleInfo("个人角色信息", roleTitleBtn.X, roleTitleBtn.bottom() + 2 );
|
local roleInfo = roleInfo("个人角色信息", 10, titlesBtn.bottom() + 2 );
|
||||||
AddUIChild(roleInfo);
|
AddUIChild(roleInfo);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function titleClick(btn) {
|
|
||||||
btn.Parent.roleTitleBtn.select = false;
|
|
||||||
btn.Parent.dressUpTitleBtn.select = false;
|
|
||||||
btn.Parent.stoneTitleBtn.select = false;
|
|
||||||
btn.select = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//逻辑入口
|
//逻辑入口
|
||||||
|
|
@ -113,7 +88,7 @@ class roleInfo extends Yosin_Window {
|
||||||
equipmentBackground.SetPosition(7.5, 8);
|
equipmentBackground.SetPosition(7.5, 8);
|
||||||
Addchild(equipmentBackground);
|
Addchild(equipmentBackground);
|
||||||
|
|
||||||
// 中间装备背景
|
// 结婚戒指槽位
|
||||||
local centerBackground = CL_SpriteObject("sprite/interface2/profile/profile.img", 77);
|
local centerBackground = CL_SpriteObject("sprite/interface2/profile/profile.img", 77);
|
||||||
centerBackground.SetPosition( 124 , 10);
|
centerBackground.SetPosition( 124 , 10);
|
||||||
Addchild(centerBackground);
|
Addchild(centerBackground);
|
||||||
|
|
@ -145,7 +120,7 @@ class roleInfo extends Yosin_Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 属性
|
||||||
function RegisterPropertyItems() {
|
function RegisterPropertyItems() {
|
||||||
// 属性
|
// 属性
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
/*
|
|
||||||
文件名:5_Inventory.nut
|
|
||||||
路径:User/UI/Window/5_Inventory.nut
|
|
||||||
创建日期:2025-01-02 12:37
|
|
||||||
文件用途: 背包窗口
|
|
||||||
*/
|
|
||||||
|
|
||||||
class _Inventory extends Yosin_Window {
|
|
||||||
|
|
||||||
item = null;
|
|
||||||
dressUpTitleBtn = null;
|
|
||||||
petTitleBtn = null;
|
|
||||||
stoneTitleBtn = null;
|
|
||||||
|
|
||||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
|
||||||
base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
|
||||||
|
|
||||||
// local title = Yosin_TopTitle(gWidth, gHeight, "装备栏(I)");
|
|
||||||
// AddUIChild(title);
|
|
||||||
|
|
||||||
local item2 = Yosin_EmeStretch(100, 100, 80, 25, "sprite/interface/lenheartwindowcommon.img", 160);
|
|
||||||
Addchild(item2);
|
|
||||||
|
|
||||||
//注册控件
|
|
||||||
RegisterWidget();
|
|
||||||
}
|
|
||||||
|
|
||||||
function RegisterWidget() {
|
|
||||||
|
|
||||||
//, "装扮", "宠物", "护石"
|
|
||||||
local titlesBtn = Yosin_RowMoreTitleBtn(10, 25, ["物品栏"]);
|
|
||||||
AddUIChild(titlesBtn);
|
|
||||||
|
|
||||||
titlesBtn.LBDownOnClick = function(btns, index) {
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
local item = Yosin_SplicingButton(10, 50, 80, 25, "sprite/interface/lenheartwindowcommon.img", 160, true, false);
|
|
||||||
AddUIChild(item);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//逻辑入口
|
|
||||||
function Proc(Dt) {
|
|
||||||
SyncPos(X, Y);
|
|
||||||
base.Proc(Dt);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
/*
|
||||||
|
文件名:5_Inventory.nut
|
||||||
|
路径:User/UI/Window/5_Inventory/5_Inventory.nut
|
||||||
|
创建日期:2025-01-06 14:06
|
||||||
|
文件用途: 背包窗口
|
||||||
|
*/
|
||||||
|
|
||||||
|
//local Window = Sq_CreateWindow(_Inventory, "背包窗口", 150, 12, 259, 555, 20);
|
||||||
|
class _Inventory extends Yosin_Window {
|
||||||
|
|
||||||
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
|
||||||
|
local title = Yosin_TopTitle(gWidth, gHeight, "装备栏(I)");
|
||||||
|
Addchild(title);
|
||||||
|
|
||||||
|
//注册控件
|
||||||
|
RegisterWidget();
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterWidget() {
|
||||||
|
|
||||||
|
//标题按钮
|
||||||
|
local titlesBtn = Yosin_RowMoreTitleBtn(10, 25, ["物品栏", "装扮", "宠物", "护石"],"sprite/interface/lenheartwindowcommon.img", 160);
|
||||||
|
AddUIChild(titlesBtn);
|
||||||
|
|
||||||
|
titlesBtn.LBDownOnClick = function(btns, index) {
|
||||||
|
print(index);
|
||||||
|
};
|
||||||
|
|
||||||
|
//物品栏 装备页
|
||||||
|
local equipmentPage = Inventory_EquipmentPage( 0, titlesBtn.bottom() + 4, 300, Height - titlesBtn.bottom() - 4);
|
||||||
|
// local inventoryItem = InventoryItem( 0, titlesBtn.bottom() + 4, 300, 100);
|
||||||
|
AddUIChild(equipmentPage);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(Dt) {
|
||||||
|
SyncPos(X, Y);
|
||||||
|
base.Proc(Dt);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,131 @@
|
||||||
|
|
||||||
|
/*
|
||||||
|
文件名:Inventory_EquipmentPage.nut
|
||||||
|
路径:User/UI/Window/5_Inventory/Inventory_EquipmentPage.nut
|
||||||
|
创建日期:2025-01-06 13:50
|
||||||
|
文件用途: 背包装备页面
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 背包装备页面
|
||||||
|
class Inventory_EquipmentPage extends Yosin_CommonUi{
|
||||||
|
|
||||||
|
constructor(x, y, w, h) {
|
||||||
|
base.constructor(x, y, w, h);
|
||||||
|
|
||||||
|
|
||||||
|
// 人物装备
|
||||||
|
local charactersEquipment = Inventory_CharactersEquipment(0, 0);
|
||||||
|
AddUIChild(charactersEquipment);
|
||||||
|
|
||||||
|
// 物品栏
|
||||||
|
local item = InventoryItem(0, charactersEquipment.bottom(), Width, Height - charactersEquipment.bottom());
|
||||||
|
AddUIChild(item);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 上半部分 人物装备穿戴
|
||||||
|
class Inventory_CharactersEquipment extends Yosin_CommonUi{
|
||||||
|
|
||||||
|
// 展示其他装备
|
||||||
|
showOtherEquipment = null;
|
||||||
|
// 允许更换装备
|
||||||
|
allowChangeEquipment = null;
|
||||||
|
|
||||||
|
constructor(x, y) {
|
||||||
|
local w = 248;
|
||||||
|
local h = 179;
|
||||||
|
base.constructor(x, y, w, h);
|
||||||
|
|
||||||
|
showOtherEquipment = true;
|
||||||
|
allowChangeEquipment = true;
|
||||||
|
|
||||||
|
RegisterBackground();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 背景
|
||||||
|
function RegisterBackground() {
|
||||||
|
// 背景图
|
||||||
|
local bgimg = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventorybackground.img", 0);
|
||||||
|
bgimg.SetPosition(0, 0);
|
||||||
|
Addchild(bgimg);
|
||||||
|
|
||||||
|
|
||||||
|
// 装备栏背景
|
||||||
|
local equipmentBackground = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 21);
|
||||||
|
equipmentBackground.SetPosition( 5, 5);
|
||||||
|
Addchild(equipmentBackground);
|
||||||
|
|
||||||
|
|
||||||
|
// 顶部光线
|
||||||
|
local topLight = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 178);
|
||||||
|
topLight.SetPosition( Width / 2 - topLight.GetSize().w/2, 0);
|
||||||
|
Addchild(topLight);
|
||||||
|
|
||||||
|
// todo 角色展示
|
||||||
|
|
||||||
|
// 结婚戒指槽位
|
||||||
|
local ringSlotBg = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory_cn.img", 0);
|
||||||
|
ringSlotBg.SetPosition( Width / 2 - ringSlotBg.GetSize().w/2, 5);
|
||||||
|
Addchild(ringSlotBg);
|
||||||
|
|
||||||
|
// 首饰
|
||||||
|
if (showOtherEquipment){
|
||||||
|
// 辅助装备
|
||||||
|
local assist = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 19);
|
||||||
|
assist.SetPosition(179, 69);
|
||||||
|
Addchild(assist);
|
||||||
|
|
||||||
|
// 耳环
|
||||||
|
local earrings = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 122);
|
||||||
|
earrings.SetPosition(179, 102);
|
||||||
|
Addchild(earrings);
|
||||||
|
|
||||||
|
// 魔法石
|
||||||
|
local MagicStone = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 20);
|
||||||
|
MagicStone.SetPosition(211, 101);
|
||||||
|
Addchild(MagicStone);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 物品栏
|
||||||
|
class InventoryItem extends Yosin_CommonUi {
|
||||||
|
|
||||||
|
constructor(gX, gY, gWidth, gHeight) {
|
||||||
|
base.constructor(gX, gY, gWidth, gHeight);
|
||||||
|
|
||||||
|
//物品分类按钮
|
||||||
|
local itemBtns = Yosin_RowMoreTitleBtn(10, 4, ["装备", "消耗品", "材料", "任务"], "sprite/interface/lenheartwindowcommon.img", 160);
|
||||||
|
AddUIChild(itemBtns);
|
||||||
|
|
||||||
|
itemBtns.LBDownOnClick = function(btns, index) {
|
||||||
|
print(index);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 物品栏
|
||||||
|
local itemCollection = itemCollection(5, itemBtns.bottom(), 247, 244, 7, 8);
|
||||||
|
AddUIChild(itemCollection);
|
||||||
|
|
||||||
|
// 重量
|
||||||
|
local weight = FontAssetManager.GenerateNormal("重量", true, {
|
||||||
|
color = sq_RGBA(160, 132, 75, 255)
|
||||||
|
});
|
||||||
|
weight.SetPosition(itemCollection.X + 8, itemCollection.bottom() - 25);
|
||||||
|
Addchild(weight);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,96 @@
|
||||||
|
/*
|
||||||
|
文件名:ItemCollect.nut
|
||||||
|
路径:User/UI/Window/5_Inventory/ItemCollect.nut
|
||||||
|
创建日期:2025-01-06 13:50
|
||||||
|
文件用途: 物品栏
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 物品栏
|
||||||
|
class itemCollection extends Yosin_CommonUi{
|
||||||
|
|
||||||
|
// 行
|
||||||
|
column = null;
|
||||||
|
// 列
|
||||||
|
row = null;
|
||||||
|
items = null;
|
||||||
|
|
||||||
|
// 悬浮时显示的框
|
||||||
|
rect = null;
|
||||||
|
|
||||||
|
columnNum = null;
|
||||||
|
rowNum = null;
|
||||||
|
|
||||||
|
constructor(x, y, w, h, columnNum,rowNum ) {
|
||||||
|
base.constructor(x, y, w, h);
|
||||||
|
this.columnNum = columnNum;
|
||||||
|
this.rowNum = rowNum;
|
||||||
|
|
||||||
|
items = [];
|
||||||
|
|
||||||
|
local background = Yosin_NineBoxStretch(-3, -3, w + 6, h + 6, "sprite/interface/lenheartwindowcommon.img", 97);
|
||||||
|
AddUIChild(background);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
local itemX = 4;
|
||||||
|
local itemY = 3;
|
||||||
|
for (local i = 0; i < columnNum; i++) {
|
||||||
|
local cells = [];
|
||||||
|
for (local i = 0; i < rowNum; i++) {
|
||||||
|
local bg = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 49);
|
||||||
|
bg.SetPosition(itemX, itemY);
|
||||||
|
Addchild(bg);
|
||||||
|
|
||||||
|
itemX += 30;
|
||||||
|
cells.push(bg);
|
||||||
|
|
||||||
|
}
|
||||||
|
items.push(cells);
|
||||||
|
itemX = 3;
|
||||||
|
itemY += 30;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rect = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 131);
|
||||||
|
rect.SetVisible(false);
|
||||||
|
Addchild(rect);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//override
|
||||||
|
//鼠标事件回调
|
||||||
|
function OnMouseProc(MousePos_X, MousePos_Y) {
|
||||||
|
base.OnMouseProc(MousePos_X, MousePos_Y);
|
||||||
|
|
||||||
|
if (isInRect){
|
||||||
|
local WorldPosition = this.GetWorldPosition();
|
||||||
|
local xx = MousePos_X - WorldPosition.x;
|
||||||
|
local yy = MousePos_Y - WorldPosition.y;
|
||||||
|
local column = (yy / 30).tointeger();
|
||||||
|
local row = (xx / 30).tointeger();
|
||||||
|
|
||||||
|
|
||||||
|
local inRadius = column < columnNum && row < rowNum;
|
||||||
|
local change = column != this.column || row != this.row;
|
||||||
|
// 移动到另一个槽
|
||||||
|
if ( change && inRadius) {
|
||||||
|
|
||||||
|
this.column = column;
|
||||||
|
this.row = row;
|
||||||
|
|
||||||
|
rect.SetVisible(true);
|
||||||
|
rect.SetPosition( row * 30, column * 30);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
this.column = null;
|
||||||
|
this.row = null;
|
||||||
|
rect.SetVisible(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -244,5 +244,23 @@
|
||||||
},
|
},
|
||||||
"User/UI/Window/4_PersonalInfo.nut": {
|
"User/UI/Window/4_PersonalInfo.nut": {
|
||||||
"description": "个人信息窗口"
|
"description": "个人信息窗口"
|
||||||
|
},
|
||||||
|
"User/UI/Window/6_EquipmentShow.nut": {
|
||||||
|
"description": "装备穿戴展示栏"
|
||||||
|
},
|
||||||
|
"User/UI/Window/6_EquipmentAndItemCollect.nut": {
|
||||||
|
"description": "装备和物品列表展示"
|
||||||
|
},
|
||||||
|
"User/UI/Window/5_Inventory/5_Inventory.nut": {
|
||||||
|
"description": "背包窗口"
|
||||||
|
},
|
||||||
|
"User/UI/Window/5_Inventory/Inventory_EquipmentPage.nut": {
|
||||||
|
"description": "背包装备页面"
|
||||||
|
},
|
||||||
|
"User/UI/Window/5_Inventory/ItemCollect.nut": {
|
||||||
|
"description": "物品栏"
|
||||||
|
},
|
||||||
|
"User/UI/Widget/Top_Title.nut": {
|
||||||
|
"description": "窗口顶部标题"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue