no message
This commit is contained in:
parent
e391abfa37
commit
383b43b39b
|
|
@ -372,15 +372,15 @@ class titleButton extends Yosin_BaseButton {
|
||||||
cacheY = Y;
|
cacheY = Y;
|
||||||
DownSimulateOffset = false;
|
DownSimulateOffset = false;
|
||||||
|
|
||||||
local backText = FontAssetManager.GenerateNormal( title , true, {
|
local backText = FontAssetManager.GenerateNormal(title, true, {
|
||||||
color = sq_RGBA(130, 114, 84, 255)
|
color = sq_RGBA(130, 114, 84, 255)
|
||||||
});
|
});
|
||||||
backText.SetUpdateFunc(function(Text, Dt) {
|
backText.SetUpdateFunc(function(Text, Dt) {
|
||||||
if (select == cacheSelect) return;
|
if (select == cacheSelect) return;
|
||||||
if (select) {
|
if (select) {
|
||||||
Text.SetFillColor(sq_RGBA(187,176,149, 255));
|
Text.SetFillColor(sq_RGBA(187, 176, 149, 255));
|
||||||
} else {
|
} else {
|
||||||
Text.SetFillColor(sq_RGBA(130,114,84, 255));
|
Text.SetFillColor(sq_RGBA(130, 114, 84, 255));
|
||||||
}
|
}
|
||||||
cacheSelect = select;
|
cacheSelect = select;
|
||||||
})
|
})
|
||||||
|
|
@ -475,30 +475,30 @@ class Yosin_StretchTitleButton extends Yosin_CommonUi {
|
||||||
AddUIChild(SpriteList[2]);
|
AddUIChild(SpriteList[2]);
|
||||||
|
|
||||||
// 文字
|
// 文字
|
||||||
titleText = FontAssetManager.GenerateNormal( title , true, {
|
titleText = FontAssetManager.GenerateNormal(title, true, {
|
||||||
color = sq_RGBA(130, 114, 84, 255)
|
color = sq_RGBA(130, 114, 84, 255)
|
||||||
});
|
});
|
||||||
titleText.SetUpdateFunc(function(Text, Dt) {
|
titleText.SetUpdateFunc(function(Text, Dt) {
|
||||||
if (select == cacheSelect) return;
|
if (select == cacheSelect) return;
|
||||||
if (select) {
|
if (select) {
|
||||||
Text.SetFillColor(sq_RGBA(187,176,149, 255));
|
Text.SetFillColor(sq_RGBA(187, 176, 149, 255));
|
||||||
} else {
|
} else {
|
||||||
Text.SetFillColor(sq_RGBA(130,114,84, 255));
|
Text.SetFillColor(sq_RGBA(130, 114, 84, 255));
|
||||||
}
|
}
|
||||||
cacheSelect = select;
|
cacheSelect = select;
|
||||||
})
|
})
|
||||||
|
|
||||||
titleText.SetPosition(W / 2 - titleText.GetSize().w/ 2, 2);
|
titleText.SetPosition(W / 2 - titleText.GetSize().w / 2, 2);
|
||||||
Addchild(titleText);
|
Addchild(titleText);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置为选中状态
|
// 设置为选中状态
|
||||||
function SetSelect(select) {
|
function SetSelect(select) {
|
||||||
if (select){
|
if (select) {
|
||||||
State = 2;
|
State = 2;
|
||||||
ChangeFrame();
|
ChangeFrame();
|
||||||
}else{
|
} else {
|
||||||
State = 0;
|
State = 0;
|
||||||
ChangeFrame();
|
ChangeFrame();
|
||||||
}
|
}
|
||||||
|
|
@ -510,12 +510,12 @@ class Yosin_StretchTitleButton extends Yosin_CommonUi {
|
||||||
if (State != uiState) {
|
if (State != uiState) {
|
||||||
if (State == 2) {
|
if (State == 2) {
|
||||||
SyncPos(X, cecheY - 1);
|
SyncPos(X, cecheY - 1);
|
||||||
}else{
|
} else {
|
||||||
SyncPos(X, cecheY);
|
SyncPos(X, cecheY);
|
||||||
}
|
}
|
||||||
uiState = State;
|
uiState = State;
|
||||||
|
|
||||||
for (local i = 0; i < SpriteList.len(); i++) {
|
for (local i = 0; i< SpriteList.len(); i++) {
|
||||||
SpriteList[i].SetVisible(i == uiState);
|
SpriteList[i].SetVisible(i == uiState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -526,7 +526,7 @@ class Yosin_StretchTitleButton extends Yosin_CommonUi {
|
||||||
|
|
||||||
//按下
|
//按下
|
||||||
if (isLBDown) {
|
if (isLBDown) {
|
||||||
if (LBDownOnClick!= null) {
|
if (LBDownOnClick != null) {
|
||||||
LBDownOnClick(this);
|
LBDownOnClick(this);
|
||||||
}
|
}
|
||||||
State = 2;
|
State = 2;
|
||||||
|
|
@ -556,25 +556,25 @@ class Yosin_RowMoreTitleBtn extends Yosin_CommonUi {
|
||||||
this.tests = titles;
|
this.tests = titles;
|
||||||
btns = [];
|
btns = [];
|
||||||
local btnX = 0;
|
local btnX = 0;
|
||||||
for(local i = 0; i < titles.len(); i++) {
|
for (local i = 0; i< titles.len(); i++) {
|
||||||
|
|
||||||
local textW = FontAssetManager.GenerateNormal(titles[i], true).GetSize().w + 10;
|
local textW = FontAssetManager.GenerateNormal(titles[i], true).GetSize().w + 10;
|
||||||
local btnW = baseWidth + 10;
|
local btnW = baseWidth + 10;
|
||||||
btnW = textW > btnW ? textW : btnW ;
|
btnW = textW > btnW ? textW : btnW;
|
||||||
|
|
||||||
local titleBtn = Yosin_StretchTitleButton(btnX, 1, btnW, 19, path, idx, titles[i]);
|
local titleBtn = Yosin_StretchTitleButton(btnX, 1, btnW, 19, path, idx, titles[i]);
|
||||||
titleBtn.index = i;
|
titleBtn.index = i;
|
||||||
|
|
||||||
titleBtn.LBDownOnClick = function (btn) {
|
titleBtn.LBDownOnClick = function(btn) {
|
||||||
btn.Parent.LBDownOnClick(this, btn.index);
|
btn.Parent.LBDownOnClick(this, btn.index);
|
||||||
|
|
||||||
for (local i = 0; i < btn.Parent.btns.len(); i++) {
|
for (local i = 0; i< btn.Parent.btns.len(); i++) {
|
||||||
btn.Parent.btns[i].SetSelect(false);
|
btn.Parent.btns[i].SetSelect(false);
|
||||||
btn.Parent.btns[i].titleText.SetFillColor(sq_RGBA(130,114,84, 255));
|
btn.Parent.btns[i].titleText.SetFillColor(sq_RGBA(130, 114, 84, 255));
|
||||||
}
|
}
|
||||||
|
|
||||||
btn.SetSelect(true);
|
btn.SetSelect(true);
|
||||||
btn.Parent.btns[btn.index].titleText.SetFillColor(sq_RGBA(187,176,149, 255));
|
btn.Parent.btns[btn.index].titleText.SetFillColor(sq_RGBA(187, 176, 149, 255));
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -584,7 +584,7 @@ class Yosin_RowMoreTitleBtn extends Yosin_CommonUi {
|
||||||
|
|
||||||
base.constructor(X, Y, btnX, 21);
|
base.constructor(X, Y, btnX, 21);
|
||||||
|
|
||||||
for (local i = 0; i < btns.len(); i++) {
|
for (local i = 0; i< btns.len(); i++) {
|
||||||
AddUIChild(btns[i]);
|
AddUIChild(btns[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -598,22 +598,40 @@ class Yosin_RowMoreTitleBtn extends Yosin_CommonUi {
|
||||||
// 进度显示
|
// 进度显示
|
||||||
class Yosin_Schedule extends Yosin_CommonUi {
|
class Yosin_Schedule extends Yosin_CommonUi {
|
||||||
|
|
||||||
|
//背景
|
||||||
|
BgSprite = null;
|
||||||
|
//条
|
||||||
|
BarSprite = null;
|
||||||
|
|
||||||
// schedule 进度比例0-1
|
// schedule 进度比例0-1
|
||||||
constructor(X, Y, W, H, path, idx, schedulePercent) {
|
constructor(X, Y, W, H, path, idx) {
|
||||||
base.constructor(X, Y, W, H);
|
base.constructor(X, Y, W, H);
|
||||||
|
|
||||||
local schedule = CL_SpriteObject(path, idx + 1);
|
BgSprite = CL_SpriteObject(path, idx + 1);
|
||||||
Addchild(schedule);
|
Addchild(BgSprite);
|
||||||
|
|
||||||
local scheduleBar = CL_SpriteObject(path, idx);
|
|
||||||
Addchild(scheduleBar);
|
|
||||||
|
|
||||||
local barSize = scheduleBar.GetSize();
|
|
||||||
local barW = barSize.w * schedulePercent;
|
|
||||||
|
|
||||||
scheduleBar.SetCropRect(X, Y, barW, 5);
|
|
||||||
scheduleBar.SetSize( barW , 5);
|
|
||||||
|
|
||||||
|
BarSprite = CL_SpriteObject(path, idx);
|
||||||
|
Addchild(BarSprite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function SetPercentage(Rate) {
|
||||||
|
local barSize = BarSprite.GetSize();
|
||||||
|
local barW = barSize.w * Rate;
|
||||||
|
|
||||||
|
BarSprite.SetCropRect(BarSprite.X, BarSprite.Y, barW, barSize.h);
|
||||||
|
BarSprite.SetSize(barW, barSize.h);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!getroottable().rawin("chongzaiflag")) {
|
||||||
|
getroottable()["chongzaiflag"] <- true;
|
||||||
|
} else {
|
||||||
|
//遍历窗口队列 如果可见则调用Show
|
||||||
|
for (local i = 0; i< _SYS_WINDOW_LIST_.len(); i++) {
|
||||||
|
local Window = _SYS_WINDOW_LIST_[i];
|
||||||
|
Window.Visible = false;
|
||||||
|
Window.RemoveSelf();
|
||||||
|
}
|
||||||
|
TestStage();
|
||||||
|
}
|
||||||
|
|
@ -81,13 +81,16 @@ l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Widget\InputBox.nut
|
||||||
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Widget\Drag_Button.nut
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Widget\Drag_Button.nut
|
||||||
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Widget\Scroll_Bar.nut
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Widget\Scroll_Bar.nut
|
||||||
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Widget\Text_Button.nut
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Widget\Text_Button.nut
|
||||||
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Widget\Top_Title.nut
|
||||||
|
|
||||||
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\0_Login.nut
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\0_Login.nut
|
||||||
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\1_Select_Character.nut
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\1_Select_Character.nut
|
||||||
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\2_create_Character.nut
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\2_create_Character.nut
|
||||||
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\3_Top_tool.nut
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\3_Top_tool.nut
|
||||||
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\4_PersonalInfo.nut
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\4_PersonalInfo.nut
|
||||||
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\5_Inventory.nut
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\5_Inventory\Inventory_EquipmentPage.nut
|
||||||
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\5_Inventory\ItemCollect.nut
|
||||||
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\5_Inventory\5_Inventory.nut
|
||||||
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\233_HUD_Message.nut
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\233_HUD_Message.nut
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,21 +13,23 @@ 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 Equ = GameItem.Equipment(27675);
|
|
||||||
local Window = Equ.GetEquipmentInfoWindow();
|
|
||||||
Window.SetPosition(100, 80);
|
|
||||||
Window.ResetFocus();
|
|
||||||
|
|
||||||
local Equ = GameItem.Equipment(101020048);
|
// local Equ = GameItem.Equipment(27675);
|
||||||
local Window = Equ.GetEquipmentInfoWindow();
|
// local Window = Equ.GetEquipmentInfoWindow();
|
||||||
Window.SetPosition(350, 80);
|
// Window.SetPosition(100, 80);
|
||||||
Window.ResetFocus();
|
// Window.ResetFocus();
|
||||||
|
|
||||||
local Equ = GameItem.Equipment(24144);
|
// local Equ = GameItem.Equipment(101020048);
|
||||||
local Window = Equ.GetEquipmentInfoWindow();
|
// local Window = Equ.GetEquipmentInfoWindow();
|
||||||
Window.SetPosition(580, 80);
|
// Window.SetPosition(350, 80);
|
||||||
Window.ResetFocus();
|
// Window.ResetFocus();
|
||||||
|
|
||||||
|
// local Equ = GameItem.Equipment(24144);
|
||||||
|
// local Window = Equ.GetEquipmentInfoWindow();
|
||||||
|
// Window.SetPosition(580, 80);
|
||||||
|
// Window.ResetFocus();
|
||||||
|
|
||||||
|
local Window = Sq_CreateWindow(_Inventory, "背包窗口", 150, 12, 257, 555, 20);
|
||||||
|
|
||||||
// local Window = Sq_CreateWindow(_Inventory, "背包窗口", 150, 12, 257, 555, 20);
|
// local Window = Sq_CreateWindow(_Inventory, "背包窗口", 150, 12, 257, 555, 20);
|
||||||
// //大背景
|
// //大背景
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ class Yosin_TopTitle extends Yosin_CommonUi {
|
||||||
base.constructor(0, 0, W, H);
|
base.constructor(0, 0, W, H);
|
||||||
|
|
||||||
//内容背景
|
//内容背景
|
||||||
if (drawBackground){
|
if (drawBackground) {
|
||||||
local background = Yosin_NineBoxStretch(-1, 15, W + 1, H - 15, "sprite/interface/lenheartwindowcommon.img", 97);
|
local background = Yosin_NineBoxStretch(-1, 15, W + 1, H - 15, "sprite/interface/lenheartwindowcommon.img", 97);
|
||||||
AddUIChild(background);
|
AddUIChild(background);
|
||||||
}
|
}
|
||||||
|
|
@ -24,7 +24,7 @@ class Yosin_TopTitle extends Yosin_CommonUi {
|
||||||
// 标题亮色背景
|
// 标题亮色背景
|
||||||
local BackgroundBright = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 483);
|
local BackgroundBright = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 483);
|
||||||
local scaleW = (W / BackgroundBright.GetSize().w).tofloat();
|
local scaleW = (W / BackgroundBright.GetSize().w).tofloat();
|
||||||
BackgroundBright.SetScale( scaleW , 1);
|
BackgroundBright.SetScale(scaleW, 1);
|
||||||
BackgroundBright.SetPosition(0, 1);
|
BackgroundBright.SetPosition(0, 1);
|
||||||
Addchild(BackgroundBright);
|
Addchild(BackgroundBright);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
文件名:Inventory_EquipmentPage.nut
|
文件名:Inventory_EquipmentPage.nut
|
||||||
路径:User/UI/Window/5_Inventory/Inventory_EquipmentPage.nut
|
路径:User/UI/Window/5_Inventory/Inventory_EquipmentPage.nut
|
||||||
|
|
@ -7,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// 背包装备页面
|
// 背包装备页面
|
||||||
class Inventory_EquipmentPage extends Yosin_CommonUi{
|
class Inventory_EquipmentPage extends Yosin_CommonUi {
|
||||||
|
|
||||||
constructor(x, y, w, h) {
|
constructor(x, y, w, h) {
|
||||||
base.constructor(x, y, w, h);
|
base.constructor(x, y, w, h);
|
||||||
|
|
@ -28,7 +27,7 @@ class Inventory_EquipmentPage extends Yosin_CommonUi{
|
||||||
|
|
||||||
|
|
||||||
// 上半部分 人物装备穿戴
|
// 上半部分 人物装备穿戴
|
||||||
class Inventory_CharactersEquipment extends Yosin_CommonUi{
|
class Inventory_CharactersEquipment extends Yosin_CommonUi {
|
||||||
|
|
||||||
// 展示其他装备
|
// 展示其他装备
|
||||||
showOtherEquipment = null;
|
showOtherEquipment = null;
|
||||||
|
|
@ -56,24 +55,24 @@ class Inventory_CharactersEquipment extends Yosin_CommonUi{
|
||||||
|
|
||||||
// 装备栏背景
|
// 装备栏背景
|
||||||
local equipmentBackground = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 21);
|
local equipmentBackground = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 21);
|
||||||
equipmentBackground.SetPosition( 5, 5);
|
equipmentBackground.SetPosition(5, 5);
|
||||||
Addchild(equipmentBackground);
|
Addchild(equipmentBackground);
|
||||||
|
|
||||||
|
|
||||||
// 顶部光线
|
// 顶部光线
|
||||||
local topLight = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 178);
|
local topLight = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 178);
|
||||||
topLight.SetPosition( Width / 2 - topLight.GetSize().w/2, 0);
|
topLight.SetPosition(Width / 2 - topLight.GetSize().w / 2, 0);
|
||||||
Addchild(topLight);
|
Addchild(topLight);
|
||||||
|
|
||||||
// todo 角色展示
|
// todo 角色展示
|
||||||
|
|
||||||
// 结婚戒指槽位
|
// 结婚戒指槽位
|
||||||
local ringSlotBg = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory_cn.img", 0);
|
local ringSlotBg = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory_cn.img", 0);
|
||||||
ringSlotBg.SetPosition( Width / 2 - ringSlotBg.GetSize().w/2, 5);
|
ringSlotBg.SetPosition(Width / 2 - ringSlotBg.GetSize().w / 2, 5);
|
||||||
Addchild(ringSlotBg);
|
Addchild(ringSlotBg);
|
||||||
|
|
||||||
// 首饰
|
// 首饰
|
||||||
if (showOtherEquipment){
|
if (showOtherEquipment) {
|
||||||
// 辅助装备
|
// 辅助装备
|
||||||
local assist = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 19);
|
local assist = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 19);
|
||||||
assist.SetPosition(179, 69);
|
assist.SetPosition(179, 69);
|
||||||
|
|
@ -126,12 +125,11 @@ class InventoryItem extends Yosin_CommonUi {
|
||||||
Addchild(weight);
|
Addchild(weight);
|
||||||
|
|
||||||
// 重量进度条
|
// 重量进度条
|
||||||
local weightSchedule = Yosin_Schedule(weight.right() + 2, weight.Y + 4 , 125, 10, "sprite/interface/newstyle/windows/inventory/inventory.img", 1, 0.7);
|
local weightSchedule = Yosin_Schedule(weight.right() + 2, weight.Y + 4, 125, 10, "sprite/interface/newstyle/windows/inventory/inventory.img", 1);
|
||||||
|
weightSchedule.SetPercentage(0.6);
|
||||||
Addchild(weightSchedule);
|
Addchild(weightSchedule);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
|
|
||||||
// 物品栏
|
// 物品栏
|
||||||
class itemCollection extends Yosin_CommonUi{
|
class itemCollection extends Yosin_CommonUi {
|
||||||
|
|
||||||
// 行
|
// 行
|
||||||
column = null;
|
column = null;
|
||||||
|
|
@ -22,7 +22,7 @@ class itemCollection extends Yosin_CommonUi{
|
||||||
columnNum = null;
|
columnNum = null;
|
||||||
rowNum = null;
|
rowNum = null;
|
||||||
|
|
||||||
constructor(x, y, w, h, columnNum,rowNum ) {
|
constructor(x, y, w, h, columnNum, rowNum) {
|
||||||
base.constructor(x, y, w, h);
|
base.constructor(x, y, w, h);
|
||||||
this.columnNum = columnNum;
|
this.columnNum = columnNum;
|
||||||
this.rowNum = rowNum;
|
this.rowNum = rowNum;
|
||||||
|
|
@ -36,9 +36,9 @@ class itemCollection extends Yosin_CommonUi{
|
||||||
|
|
||||||
local itemX = 4;
|
local itemX = 4;
|
||||||
local itemY = 3;
|
local itemY = 3;
|
||||||
for (local i = 0; i < columnNum; i++) {
|
for (local i = 0; i< columnNum; i++) {
|
||||||
local cells = [];
|
local cells = [];
|
||||||
for (local i = 0; i < rowNum; i++) {
|
for (local i = 0; i< rowNum; i++) {
|
||||||
local bg = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 49);
|
local bg = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 49);
|
||||||
bg.SetPosition(itemX, itemY);
|
bg.SetPosition(itemX, itemY);
|
||||||
Addchild(bg);
|
Addchild(bg);
|
||||||
|
|
@ -65,7 +65,7 @@ class itemCollection extends Yosin_CommonUi{
|
||||||
function OnMouseProc(MousePos_X, MousePos_Y) {
|
function OnMouseProc(MousePos_X, MousePos_Y) {
|
||||||
base.OnMouseProc(MousePos_X, MousePos_Y);
|
base.OnMouseProc(MousePos_X, MousePos_Y);
|
||||||
|
|
||||||
if (isInRect){
|
if (isInRect) {
|
||||||
local WorldPosition = this.GetWorldPosition();
|
local WorldPosition = this.GetWorldPosition();
|
||||||
local xx = MousePos_X - WorldPosition.x;
|
local xx = MousePos_X - WorldPosition.x;
|
||||||
local yy = MousePos_Y - WorldPosition.y;
|
local yy = MousePos_Y - WorldPosition.y;
|
||||||
|
|
@ -73,20 +73,20 @@ class itemCollection extends Yosin_CommonUi{
|
||||||
local row = (xx / 30).tointeger();
|
local row = (xx / 30).tointeger();
|
||||||
|
|
||||||
|
|
||||||
local inRadius = column < columnNum && row < rowNum;
|
local inRadius = column< columnNum && row< rowNum;
|
||||||
local change = column != this.column || row != this.row;
|
local change = column != this.column || row != this.row;
|
||||||
// 移动到另一个槽
|
// 移动到另一个槽
|
||||||
if ( change && inRadius) {
|
if (change && inRadius) {
|
||||||
|
|
||||||
this.column = column;
|
this.column = column;
|
||||||
this.row = row;
|
this.row = row;
|
||||||
|
|
||||||
rect.SetVisible(true);
|
rect.SetVisible(true);
|
||||||
rect.SetPosition( row * 30, column * 30);
|
rect.SetPosition(row * 30, column * 30);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
this.column = null;
|
this.column = null;
|
||||||
this.row = null;
|
this.row = null;
|
||||||
rect.SetVisible(false);
|
rect.SetVisible(false);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue