From ed606f570f6aaa3352a009fbba65f3ee22ac2e4d Mon Sep 17 00:00:00 2001 From: WONIU Date: Wed, 8 Jan 2025 17:37:15 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E5=8F=AA=E6=9C=892?= =?UTF-8?q?=E5=9B=BE=E7=9A=84=E6=8C=89=E9=92=AE=20=E8=83=8C=E5=8C=85?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sqr/Core/UI_Class/UI_Widget.nut | 181 +++++++----------- .../5_Inventory/Inventory_EquipmentPage.nut | 14 +- 2 files changed, 80 insertions(+), 115 deletions(-) diff --git a/sqr/Core/UI_Class/UI_Widget.nut b/sqr/Core/UI_Class/UI_Widget.nut index 8cf9a09..d2d6f39 100644 --- a/sqr/Core/UI_Class/UI_Widget.nut +++ b/sqr/Core/UI_Class/UI_Widget.nut @@ -141,6 +141,79 @@ class Yosin_BaseButton extends Yosin_CommonUi { } } + +// 2图按钮 +class Yosin_TwoImgButton extends Yosin_CommonUi { + + //按钮状态 + State = 0; + Path = null; + Idx = null; + + Sprite = null; + NormalSpriteFrame = null; + SlectSpriteFrame = null; + SpriteState = -1; + + //按下时的模拟偏移 + DownSimulateOffset = true; + + constructor(X, Y, W, H, Path, Idx) { + this.Path = Path; + this.Idx = Idx; + base.constructor(X, Y, W, H); + + Sprite = CL_SpriteObject(); + Addchild(Sprite); + + NormalSpriteFrame = CL_SpriteFrameObject(this.Path, this.Idx); + SlectSpriteFrame = CL_SpriteFrameObject(this.Path, this.Idx + 1); + } + + function ChangeFrame() { + //状态更改 刷新精灵帧 + if (State != SpriteState) { + //按下时模拟偏移的Flag 如果按下 调整Y坐标向下一个单位 + if (DownSimulateOffset) { + if (State == 2) { + Y += 1; + SyncPos(X, Y); + } else if (SpriteState == 2) { + Y -= 1; + SyncPos(X, Y); + } + } + SpriteState = State; + Sprite.SetFrame(State != 0 ? SlectSpriteFrame : NormalSpriteFrame ); + Sprite.SetPosition(0, 0); + } + } + + function Proc(Dt) { + //不可用 + if (State == 3) { + + } else { + //按下 + if (isLBDown) { + State = 2; + } + //悬停 + else if (isInRect) { + State = 1; + } + //普通 + else { + State = 0; + } + } + ChangeFrame(); + } + +} + + + //三分法拉伸 class Yosin_EmeStretch extends Yosin_CommonUi { @@ -297,114 +370,6 @@ function Yosin_NineBoxStretch(X, Y, width, height, path, imgId) { return Canvas; } - -// //九宫格拉伸 -// class Yosin_NineBoxStretch extends Yosin_CommonUi { - -// constructor(X, Y, W, H, Path, Idx) { -// base.constructor(X, Y, W, H); -// DrawBackground(W, H, Path, Idx); -// } - - -// // 绘制 -// function DrawBackground(width, height, path, imgId) { - - -// // 创建画布 -// local Canvas = CL_CanvasObject(); -// // 重设大小并清空 -// Canvas.ResizeAndClear(width, height); -// // 开始绘制 -// Canvas.BeginDraw(); - -// // 左上角 -// // local backgroundTopLeft = CL_SpriteObject(path, imgId); -// local backgroundTopLeft = CL_SpriteObject(path, imgId); -// // 上边 -// local backgroundTop = CL_SpriteObject(path, imgId + 1); -// // 右上角 -// local backgroundTopRight = CL_SpriteObject(path, imgId + 2); -// // 左边 -// local backgroundLeft = CL_SpriteObject(path, imgId + 3); -// // 中间 -// local backgroundCenter = CL_SpriteObject(path, imgId + 4); -// // 右边 -// local backgroundRight = CL_SpriteObject(path, imgId + 5); -// // 左下角 -// local backgroundBottomLeft = CL_SpriteObject(path, imgId + 6); -// // 下边 -// local backgroundBottom = CL_SpriteObject(path, imgId + 7); -// // 右下角 -// local backgroundBottomRight = CL_SpriteObject(path, imgId + 8); - - -// // 左上角 -// Canvas.DrawSprite(backgroundTopLeft); - -// local TopLeftSize = backgroundTopLeft.GetSize(); -// local TopLeftBottom = TopLeftSize.h; -// local TopLeftRight = TopLeftSize.w; - -// // 中间图片大小 -// local centerImgSize = backgroundCenter.GetSize(); -// local centerImgWidth = centerImgSize.w; -// local centerImgHeight = centerImgSize.h; - -// local centerWidth = width - backgroundTopLeft.GetSize().w - backgroundTopRight.GetSize().w; -// local centerHeight = height - backgroundTopLeft.GetSize().h - backgroundBottomLeft.GetSize().h; - - -// local scaleW = (centerWidth - 1).tofloat() / centerImgWidth.tofloat(); -// local scaleH = (centerHeight - 1).tofloat() / centerImgHeight.tofloat(); - -// // 上边 -// backgroundTop.SetScale(scaleW, 1); -// backgroundTop.SetPosition(TopLeftRight + 1, 0); -// Canvas.DrawSprite(backgroundTop); - -// // 右上角 -// backgroundTopRight.SetPosition(width - backgroundTopRight.GetSize().w, 0); -// Canvas.DrawSprite(backgroundTopRight); - -// // 左边 -// backgroundLeft.SetScale(1, scaleH); -// backgroundLeft.SetPosition(0, TopLeftBottom + 1); -// Canvas.DrawSprite(backgroundLeft); - -// // 中间 -// backgroundCenter.SetScale(scaleW, scaleH); -// // Addchild(backgroundCenter); -// backgroundCenter.SetPosition(TopLeftRight + 1, backgroundLeft.Y); -// Canvas.DrawSprite(backgroundCenter); - -// // 右边 -// backgroundRight.SetScale(1, scaleH); -// backgroundRight.SetPosition(width - backgroundRight.GetSize().w, backgroundCenter.Y); -// Canvas.DrawSprite(backgroundRight); - -// // 左下角 -// backgroundBottomLeft.SetPosition(0, height - backgroundBottomLeft.GetSize().h); -// Canvas.DrawSprite(backgroundBottomLeft); - -// // 下边 -// backgroundBottom.SetScale(scaleW, 1); -// backgroundBottom.SetPosition(TopLeftRight + 1, backgroundBottomLeft.Y); -// Canvas.DrawSprite(backgroundBottom); - -// // 右下角 -// backgroundBottomRight.SetPosition(width - backgroundBottomRight.GetSize().w, backgroundBottomLeft.Y); -// Canvas.DrawSprite(backgroundBottomRight ); - -// // 结束绘制 -// Canvas.EndDraw(); -// // 添加画布 -// Addchild(Canvas); - -// } - -// } - //拼接按钮 class Yosin_SplicingButton extends Yosin_CommonUi { //按钮状态 diff --git a/sqr/User/UI/Window/5_Inventory/Inventory_EquipmentPage.nut b/sqr/User/UI/Window/5_Inventory/Inventory_EquipmentPage.nut index a0f89b9..dba56b7 100644 --- a/sqr/User/UI/Window/5_Inventory/Inventory_EquipmentPage.nut +++ b/sqr/User/UI/Window/5_Inventory/Inventory_EquipmentPage.nut @@ -70,28 +70,28 @@ class Inventory_CharactersEquipment extends Yosin_CommonUi { // 添加按钮 function AddButton() { // 称号 - local designation = Yosin_BaseButton(2, Height - 30, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 50); + local designation = Yosin_TwoImgButton(2, Height - 30, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 50); //点击事件回调 // permutationBtn.OnClick = function(Button) { // }.bindenv(this); AddUIChild(designation); // 增益强化 - local intensify = Yosin_BaseButton(designation.right() +2, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 128); + local intensify = Yosin_TwoImgButton(designation.right() +2, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 128); AddUIChild(intensify); // 皮肤仓库 - local skin = Yosin_BaseButton(intensify.right() + 2, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 134); + local skin = Yosin_TwoImgButton(intensify.right() + 2, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 134); AddUIChild(skin); // 穿戴中的装备 - local wear = Yosin_BaseButton(Width - 29, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 172); + local wear = Yosin_TwoImgButton(Width - 29, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 172); AddUIChild(wear); // 装备特性 - local peculiarity = Yosin_BaseButton(wear.X - 21, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 203); + local peculiarity = Yosin_TwoImgButton(wear.X - 21, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 203); AddUIChild(peculiarity); // 未央环境装备 - // local permutationBtn = Yosin_BaseButton(peculiarity.X - 21, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 128); - // AddUIChild(permutationBtn); + local weiyangBtn = Yosin_TwoImgButton(peculiarity.X - 21, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory_cn.img", 26); + AddUIChild(weiyangBtn); } From aacdde2ae768947ee1234eb8f0f11ff093b6e5a9 Mon Sep 17 00:00:00 2001 From: WONIU Date: Thu, 9 Jan 2025 22:24:28 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E7=94=BB=E5=B8=83=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + sqr/SquirrelFileConfig.cfg | 97 ----- sqr/User/UI/Window/4_PersonalInfo.nut | 311 ---------------- .../Window/4_Personalinfo/4_PersonalInfo.nut | 47 +++ .../Personalinfo_RoleInfoPage.nut | 346 ++++++++++++++++++ sqr/folder-alias.json | 14 +- 6 files changed, 407 insertions(+), 409 deletions(-) delete mode 100644 sqr/SquirrelFileConfig.cfg delete mode 100644 sqr/User/UI/Window/4_PersonalInfo.nut create mode 100644 sqr/User/UI/Window/4_Personalinfo/4_PersonalInfo.nut create mode 100644 sqr/User/UI/Window/4_Personalinfo/Personalinfo_RoleInfoPage.nut diff --git a/.gitignore b/.gitignore index 496bdc1..9ec2dda 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ Yosin_Engine.pdb *.pvf sqr/.vscode/launch.json Music/ +sqr/SquirrelFileConfig.cfg diff --git a/sqr/SquirrelFileConfig.cfg b/sqr/SquirrelFileConfig.cfg deleted file mode 100644 index 4cf035c..0000000 --- a/sqr/SquirrelFileConfig.cfg +++ /dev/null @@ -1,97 +0,0 @@ -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\ENUM\ENUM_KEY.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\ENUM\enum_system.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseTool\BaseTool.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseTool\Math.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseTool\String.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseTool\BlobExClass.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseTool\JsonClass\JsonClass.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseTool\JsonClass\Json.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseClass\ScriptManager\ScriptManager.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseClass\ScriptManager\InitAni.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseClass\Game_Window_Class.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseClass\BaseObject.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseClass\AudioClass.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseClass\StageClass.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseClass\ActorObject.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseClass\LayerObject.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseClass\UserStorage.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseClass\CanvasObject.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseClass\SpriteObject\SpriteFrameClass.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseClass\SpriteObject\SpriteClass.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseClass\TextObject\Font.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseClass\TextObject\TextActor.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\BaseClass\AnimationClass\AnimationClass.nut - -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\ExtraCalss\Socket\Socket.nut - -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\Game_Proc\Game_Proc.nut - -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\InputClass\InputClass.nut - -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\UI_Class\UI_Cursor.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\UI_Class\UI_Core.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\Core\UI_Class\UI_Widget.nut - - -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\_ENUM\global_object.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\_ENUM\enum_music.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\_ENUM\enum_packet.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\_ENUM\enum_game.nut - -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Socket\Socket.nut - -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Asset\AssetManager.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Asset\FontAsset.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Asset\Character\Animation.nut - -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Asset\Item\Item.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Asset\Item\Equipment.nut - -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Controller\Controller.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Controller\ObjectController.nut - -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Object\StateMachine\StateMachineClass.nut - -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Object\Object\BaseObject.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Object\Object\AnimationObject.nut - -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Object\Map\TileObject.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Object\Map\MapCamera.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Object\Map\TownObject.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Object\Map\MapObject.nut - -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Object\ActiveObject\GameObjectClass.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Object\ActiveObject\StaticObjectClass.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Object\ActiveObject\ActiveObjectClass.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Object\ActiveObject\PassiveObjectClass.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Object\ActiveObject\MonsterObjectClass.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Object\ActiveObject\NpcObjectClass.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Object\ActiveObject\CharacterObjectClass.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Object\ActiveObject\CharacterObjectClass_AI.nut - -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Socket\Socket.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Socket\Packet.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Socket\FunctionalPack.nut - -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Stage\LodingStage.nut -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\Stage\TestStage.nut - -l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Widget\IMouse.nut -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\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\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\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\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\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\main.nut \ No newline at end of file diff --git a/sqr/User/UI/Window/4_PersonalInfo.nut b/sqr/User/UI/Window/4_PersonalInfo.nut deleted file mode 100644 index b3ff64c..0000000 --- a/sqr/User/UI/Window/4_PersonalInfo.nut +++ /dev/null @@ -1,311 +0,0 @@ -/* -文件名:4_PersonalInfo.nut -路径:User/UI/Window/4_PersonalInfo.nut -创建日期:2024-12-26 00:32 -文件用途: 个人信息 -*/ - -// local infoWindow = Sq_CreateWindow(_PersonalInfo, "个人信息窗口", 250, 60, 286, 530, 20); -// todo 图和尺寸比例都需要修改 -// todo Yosin_Window 和 Yosin_CommonUi 会有性能开销需要检查 -class _PersonalInfo extends Yosin_Window { - - - constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { - base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); - - local title = Yosin_TopTitle(gWidth, gHeight, "个人信息(M)"); - AddUIChild(title); - - //注册控件 - RegisterWidget(); - } - - function RegisterWidget() { - - // 标题按钮 - local titlesBtn = Yosin_RowMoreTitleBtn(10, 25, ["角色", "装扮/宠物", "护石"],"sprite/interface/lenheartwindowcommon.img", 160); - AddUIChild(titlesBtn); - - titlesBtn.LBDownOnClick = function(btns, index) { - }; - - // 角色信息 - local roleInfo = roleInfo("个人角色信息", 10, titlesBtn.bottom() + 2 ); - AddUIChild(roleInfo); - } - - - - //逻辑入口 - function Proc(Dt) { - SyncPos(X, Y); - base.Proc(Dt); - } - -} - - -// 角色信息 -class roleInfo extends Yosin_Window { - - //是否为独立窗口 - IsIndependent = false; - - brown = sq_RGBA(160, 132, 75, 255); - green = sq_RGBA(74, 161, 87, 255); - - btn = null; - - constructor(gObjectId, gX, gY) { - base.constructor(gObjectId, gX, gY, 266, 355, 0); - - //注册控件 - RegisterWidget(); - } - - function RegisterWidget() { - // 背景 - local backGround = CL_SpriteObject("sprite/interface2/profile/profile.img", 60); - Addchild(backGround); - - // 装备 - RegisterEquipment(); - // 名称 等级 其他 - RegisterNameAndOther(); - // 属性 - RegisterPropertyItems(); - // 底部四个按钮 - RegisterBottomButton(); - - - } - - // 装备 - function RegisterEquipment() { - // 装备背景 - local equipmentBackground = CL_SpriteObject("sprite/interface2/profile/profile.img", 14); - equipmentBackground.SetPosition(7.5, 8); - Addchild(equipmentBackground); - - // 结婚戒指槽位 - local centerBackground = CL_SpriteObject("sprite/interface2/profile/profile.img", 77); - centerBackground.SetPosition( 124 , 10); - Addchild(centerBackground); - - - } - - - - // 名称 等级 其他 - function RegisterNameAndOther() { - // 冒险家名望 - local adventurerFame = CL_SpriteObject("sprite/interface2/profile/profile_icon.img", 53); - adventurerFame.SetPosition(70, 185); - Addchild(adventurerFame); - - local adventurerFameText = FontAssetManager.GenerateNormal("冒险家名望", true, { - color = brown - }); - adventurerFameText.SetPosition(adventurerFame.right() + 5, adventurerFame.Y); - Addchild(adventurerFameText); - - // 冒险家名望数值 - local adventurerFameNum = FontAssetManager.GenerateNormal("7", true, { - color = green - }); - adventurerFameNum.SetPosition(adventurerFameText.right() + 5, adventurerFameText.Y); - Addchild(adventurerFameNum); - } - - - // 属性 - function RegisterPropertyItems() { - // 属性 - - // 生命 - local life = roleInfoPropertyItem(0, 213, 0, "生命", "100"); - Addchild(life); - // 魔法 - local magic = roleInfoPropertyItem(life.right() + 16, life.Y, 1, "魔法", "100"); - Addchild(magic); - // 物理防御力 - local physicalDefense = roleInfoPropertyItem(life.X, life.bottom(), 8, "物理防御力", "100", false); - Addchild(physicalDefense); - // 魔法防御力 - local magicDefense = roleInfoPropertyItem(physicalDefense.right() + 16, physicalDefense.Y, 9, "魔法防御力", "100"); - Addchild(magicDefense); - - // 力量 - local strength = roleInfoPropertyItem(life.X, physicalDefense.bottom(), 2, "力量", "100"); - Addchild(strength); - // 智力 - local intelligence = roleInfoPropertyItem(strength.right() + 16, strength.Y, 3, "智力", "100"); - Addchild(intelligence); - // 体力 - local vitality = roleInfoPropertyItem(strength.X, strength.bottom(), 4, "体力", "100"); - Addchild(vitality); - // 精神 - local spirit = roleInfoPropertyItem(vitality.right() + 16, vitality.Y, 5, "精神", "100"); - Addchild(spirit); - // 物理攻击力 - local physicalATK = roleInfoPropertyItem(life.X, spirit.bottom(), 6, "物理攻击力", "100"); - Addchild(physicalATK); - // 魔法攻击力 - local magicATK = roleInfoPropertyItem(physicalATK.right() + 16, physicalATK.Y, 7, "魔法攻击力", "100"); - Addchild(magicATK); - // 物理暴击 - local physicalCrit = roleInfoPropertyItem(life.X, magicATK.bottom(), 10, "物理暴击", "100"); - Addchild(physicalCrit); - // 魔法暴击 - local magicCrit = roleInfoPropertyItem(physicalCrit.right() + 16, physicalCrit.Y, 11, "魔法暴击", "100"); - Addchild(magicCrit); - // 独立攻击 - local independentAttack = roleInfoPropertyItem(life.X, magicCrit.bottom(), 12, "独立攻击", "100"); - Addchild(independentAttack); - - // 攻击速度 - local attackSpeed = roleInfoPropertyItem(life.X, independentAttack.bottom(), 13, "攻击速度", "100"); - Addchild(attackSpeed); - // 释放速度 - local releaseSpeed = roleInfoPropertyItem(attackSpeed.right() + 16, attackSpeed.Y, 14, "释放速度", "100"); - Addchild(releaseSpeed); - // 移动速度 - local moveSpeed = roleInfoPropertyItem(life.X, releaseSpeed.bottom(), 15, "移动速度", "100"); - Addchild(moveSpeed); - - // 攻击属性 - local attackProperty = roleInfoPropertyItem(life.X, moveSpeed.bottom(), 16, "攻击属性", "火(0)/冰(0)/光(0)/暗(0)", true, 260); - Addchild(attackProperty); - } - - - // 底部四个按钮 - function RegisterBottomButton() { - // 副职业 - local subJob = otherButton(0, 401, 62, "副职业", false); - AddUIChild(subJob); - subJob.OnClick = function (btn) { - //todo 打开副职业面板 - print(11111); - }.bindenv(this); - - local separation = CL_SpriteObject("sprite/interface2/profile/profile.img", 70 ); - separation.SetPosition(subJob.right(), subJob.Y + 7.5); - Addchild(separation); - - // 战斗分析 - local battleAnalysis = otherButton(subJob.right() + 1, subJob.Y, 64, "战斗分析"); - AddUIChild(battleAnalysis); - battleAnalysis.OnClick = function (btn) { - //todo 打开面板 - print(11111); - }.bindenv(this); - - local separationOne = CL_SpriteObject("sprite/interface2/profile/profile.img", 70 ); - separationOne.SetPosition(battleAnalysis.right(), battleAnalysis.Y + 7.5); - Addchild(separationOne); - - // 决斗信息 // 根据决斗场等级 显示 sprite/interface2/pvp02/pvprank_icon/tier_icon.img 24 - local duelInfo = otherButton(battleAnalysis.right() + 1, battleAnalysis.Y, 14, "决斗信息", true); - AddUIChild(duelInfo); - duelInfo.OnClick = function (btn) { - //todo 打开面板 - print(11111); - }.bindenv(this); - - local separationTwo = CL_SpriteObject("sprite/interface2/profile/profile.img", 70 ); - separationTwo.SetPosition(duelInfo.right(), duelInfo.Y + 7.5); - Addchild(separationTwo); - - // 详细信息 - local detailedInformation = otherButton(duelInfo.right() + 1, duelInfo.Y, 66, "详细信息"); - AddUIChild(detailedInformation); - detailedInformation.OnClick = function (btn) { - //todo 打开面板 - print(11111); - }.bindenv(this); - } - - //逻辑入口 - function Proc(Dt) { - SyncPos(X, Y); - base.Proc(Dt); - } - -} - -// 属性项 -class roleInfoPropertyItem extends Yosin_CommonUi { - - // additionReaction 属性是否有加成 加成为绿色 不加成灰色 - constructor(gX, gY, idx, title, numText, additionReaction = true, width = 120) { - base.constructor(gX, gY, width, 18); - - local titlecolor = additionReaction ? sq_RGBA(160, 132, 75, 255) : sq_RGBA(79, 79, 79, 255); - local numColor = additionReaction ? sq_RGBA(75, 161, 85, 255) : sq_RGBA(79, 79, 79, 255); - - local icon = CL_SpriteObject("sprite/interface2/profile/profile_icon.img", idx); - icon.SetPosition(5, 0); - Addchild(icon); - - // 属性名称 - local property = FontAssetManager.GenerateNormal(title, true, { - color = titlecolor - }); - property.SetPosition(icon.right() + 5, icon.Y); - Addchild(property); - - // 属性数值 - local propertyNum = FontAssetManager.GenerateNormal(numText, true, { - color = numColor - }); - local numX = width - propertyNum.GetSize().w; - propertyNum.SetPosition( numX, icon.Y); - Addchild(propertyNum); - - - } - - - //逻辑入口 - function Proc(Dt) { - SyncPos(X, Y); - base.Proc(Dt); - } - -} - - -// 其他面板按钮 -class otherButton extends Yosin_CommonUi { - - // 是否启用按钮 - enabled = true; - // pvp 是否是pvp 按钮 - constructor(gX, gY, idx, title, pvp = false, enabled = true, ) { - base.constructor(gX, gY, 65, 65); - - this.enabled = enabled; - - local titlecolor = enabled? sq_RGBA(160, 132, 75, 255) : sq_RGBA(79, 79, 79, 255); - // 属性名称 - local property = FontAssetManager.GenerateNormal(title, true, { - color = titlecolor - }); - property.SetPosition( 32 - property.GetSize().w / 2 , 45 ); - Addchild(property); - - local path = pvp? "sprite/interface2/profile/profile_pvp_icon.img" : "sprite/interface2/profile/profile.img"; - local icon = CL_SpriteObject(path, enabled ? idx : idx +1 ); - icon.SetPosition(32 - icon.GetSize().w / 2, 45/2 - icon.GetSize().h / 2 + 3 ); - Addchild(icon); - - - - } - -} - - diff --git a/sqr/User/UI/Window/4_Personalinfo/4_PersonalInfo.nut b/sqr/User/UI/Window/4_Personalinfo/4_PersonalInfo.nut new file mode 100644 index 0000000..89ef8bc --- /dev/null +++ b/sqr/User/UI/Window/4_Personalinfo/4_PersonalInfo.nut @@ -0,0 +1,47 @@ +/* +文件名:4_PersonalInfo.nut +路径:User/UI/Window/4_Personalinfo/4_PersonalInfo.nut +创建日期:2025-01-09 13:55 +文件用途: 个人信息窗口 +*/ + +// local infoWindow = Sq_CreateWindow(_PersonalInfo, "个人信息窗口", 250, 60, 286, 530, 20); +// todo 图和尺寸比例都需要修改 +// todo Yosin_Window 和 Yosin_CommonUi 会有性能开销需要检查 +class _PersonalInfo extends Yosin_Window { + + + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + + local title = Yosin_TopTitle(gWidth, gHeight, "个人信息(M)"); + AddUIChild(title); + + //注册控件 + RegisterWidget(); + } + + function RegisterWidget() { + + // 标题按钮 + local titlesBtn = Yosin_RowMoreTitleBtn(10, 25, 252, ["角色", "装扮/宠物", "护石"], "sprite/interface/lenheartwindowcommon.img", 160); + AddUIChild(titlesBtn); + + titlesBtn.LBDownOnClick = function(btns, index) { + }; + + // 角色信息 + local roleInfo = roleInfoPage(10, titlesBtn.bottom() + 2 ); + AddUIChild(roleInfo); + } + + + + //逻辑入口 + function Proc(Dt) { + SyncPos(X, Y); + base.Proc(Dt); + } + +} + diff --git a/sqr/User/UI/Window/4_Personalinfo/Personalinfo_RoleInfoPage.nut b/sqr/User/UI/Window/4_Personalinfo/Personalinfo_RoleInfoPage.nut new file mode 100644 index 0000000..9218897 --- /dev/null +++ b/sqr/User/UI/Window/4_Personalinfo/Personalinfo_RoleInfoPage.nut @@ -0,0 +1,346 @@ + +/* +文件名:Personalinfo_RoleInfoPage.nut +路径:User/UI/Window/4_Personalinfo/Personalinfo_RoleInfoPage.nut +创建日期:2025-01-09 13:51 +文件用途: 个人信息-角色信息页面 +*/ + + + +// 角色信息 +class roleInfoPage extends Yosin_CommonUi { + + brown = sq_RGBA(160, 132, 75, 255); + green = sq_RGBA(74, 161, 87, 255); + + Canvas = null; + + constructor(gX, gY) { + local w = 266; + local h = 355; + base.constructor( gX, gY, w, h); + + + // 创建画布 + Canvas = CL_CanvasObject(); + // 重设大小并清空 + Canvas.ResizeAndClear(w, h); + // 开始绘制 + Canvas.BeginDraw(); + + // 绘制 + DrawWidget(); + + // 结束绘制 + Canvas.EndDraw(); + // 添加画布 + Addchild(Canvas); + } + + function DrawWidget() { + // 背景 + local backGround = CL_SpriteFrameObject("sprite/interface2/profile/profile.img", 60); + Canvas.DrawSpriteFrame(backGround, 0, 0); + + // 上半部分 装备展示 + local equipment = Personalinfo_CharactersEquipment(0, 0); + Canvas.DrawSprite(equipment); + + // 名称 等级 其他 + RegisterNameAndOther(); + // 属性 + // RegisterPropertyItems(); + + // 底部四个按钮 + RegisterBottomButton(); + + + } + + + // 名称 等级 其他 + function RegisterNameAndOther() { + // 冒险家名望 + local adventurerFame = CL_SpriteFrameObject("sprite/interface2/profile/profile_icon.img", 53); + Canvas.DrawSpriteFrame(adventurerFame, 70, 185); + + local adventurerFameText = FontAssetManager.GenerateNormal("冒险家名望", true, { + color = brown + }); + Canvas.DrawActor(adventurerFameText, adventurerFame.right() + 5, adventurerFame.Y); + + // 冒险家名望数值 + local adventurerFameNum = FontAssetManager.GenerateNormal("7", true, { + color = green + }); + Canvas.DrawActor(adventurerFameNum, adventurerFameText.right() + 5, adventurerFameText.Y); + } + + + // 属性 + function RegisterPropertyItems() { + // 属性 + + // 生命 + local life = roleInfoPropertyItem.Draw( 0, "生命", "100"); + Canvas.DrawSprite(life, 0, 213); + // 魔法 + local magic = roleInfoPropertyItem.Draw( 1, "魔法", "100"); + Canvas.DrawSprite(magic, life.right() + 16, life.Y); + // 物理防御力 + local physicalDefense = roleInfoPropertyItem.Draw( "物理防御力", "100", false); + Canvas.DrawSprite(physicalDefense, life.X, life.bottom(), 8); + // 魔法防御力 + local magicDefense = roleInfoPropertyItem.Draw( 9, "魔法防御力", "100"); + Canvas.DrawSprite(magicDefense, physicalDefense.right() + 16, physicalDefense.Y); + + // 力量 + local strength = roleInfoPropertyItem.Draw( 2, "力量", "100"); + Canvas.DrawSprite(strength, life.X, physicalDefense.bottom()); + // 智力 + local intelligence = roleInfoPropertyItem.Draw( 3, "智力", "100"); + Canvas.DrawSprite(intelligence, strength.right() + 16, strength.Y); + // 体力 + local vitality = roleInfoPropertyItem.Draw( 4, "体力", "100"); + Canvas.DrawSprite(vitality, strength.X, strength.bottom()); + // 精神 + local spirit = roleInfoPropertyItem.Draw( 5, "精神", "100"); + Canvas.DrawSprite(spirit, vitality.right() + 16, vitality.Y); + // 物理攻击力 + local physicalATK = roleInfoPropertyItem.Draw( 6, "物理攻击力", "100"); + Canvas.DrawSprite(physicalATK, life.X, spirit.bottom()); + // 魔法攻击力 + local magicATK = roleInfoPropertyItem.Draw( 7, "魔法攻击力", "100"); + Canvas.DrawSprite(magicATK, physicalATK.right() + 16, physicalATK.Y); + // 物理暴击 + local physicalCrit = roleInfoPropertyItem.Draw( 10, "物理暴击", "100"); + Canvas.DrawSprite(physicalCrit, life.X, magicATK.bottom()); + // 魔法暴击 + local magicCrit = roleInfoPropertyItem.Draw( 11, "魔法暴击", "100"); + Canvas.DrawSprite(magicCrit, physicalCrit.right() + 16, physicalCrit.Y); + // 独立攻击 + local independentAttack = roleInfoPropertyItem.Draw( 12, "独立攻击", "100"); + Canvas.DrawSprite(independentAttack, life.X, magicCrit.bottom()); + + // 攻击速度 + local attackSpeed = roleInfoPropertyItem.Draw(13, "攻击速度", "100"); + Canvas.DrawSprite(attackSpeed, life.X, independentAttack.bottom()); + // 释放速度 + local releaseSpeed = roleInfoPropertyItem.Draw( 14, "释放速度", "100"); + Canvas.DrawSprite(releaseSpeed, attackSpeed.right() + 16, attackSpeed.Y); + // 移动速度 + local moveSpeed = roleInfoPropertyItem.Draw( 15, "移动速度", "100"); + Canvas.DrawSprite(moveSpeed, life.X, releaseSpeed.bottom()); + + // 攻击属性 + local attackProperty = roleInfoPropertyItem.Draw( 16, "攻击属性", "火(0)/冰(0)/光(0)/暗(0)", true, 260); + Canvas.DrawSprite(attackProperty, life.X, moveSpeed.bottom()); + } + + + // 底部四个按钮 + function RegisterBottomButton() { + // 副职业 + local subJob = otherButton(0, 401, 62, "副职业", false); + AddUIChild(subJob); + subJob.OnClick = function (btn) { + //todo 打开副职业面板 + print(11111); + }.bindenv(this); + + local separation = CL_SpriteObject("sprite/interface2/profile/profile.img", 70 ); + separation.SetPosition(subJob.right(), subJob.Y + 7.5); + Addchild(separation); + + // 战斗分析 + local battleAnalysis = otherButton(subJob.right() + 1, subJob.Y, 64, "战斗分析"); + AddUIChild(battleAnalysis); + battleAnalysis.OnClick = function (btn) { + //todo 打开面板 + print(11111); + }.bindenv(this); + + local separationOne = CL_SpriteObject("sprite/interface2/profile/profile.img", 70 ); + separationOne.SetPosition(battleAnalysis.right(), battleAnalysis.Y + 7.5); + Addchild(separationOne); + + // 决斗信息 // 根据决斗场等级 显示 sprite/interface2/pvp02/pvprank_icon/tier_icon.img 24 + local duelInfo = otherButton(battleAnalysis.right() + 1, battleAnalysis.Y, 14, "决斗信息", true); + AddUIChild(duelInfo); + duelInfo.OnClick = function (btn) { + //todo 打开面板 + print(11111); + }.bindenv(this); + + local separationTwo = CL_SpriteObject("sprite/interface2/profile/profile.img", 70 ); + separationTwo.SetPosition(duelInfo.right(), duelInfo.Y + 7.5); + Addchild(separationTwo); + + // 详细信息 + local detailedInformation = otherButton(duelInfo.right() + 1, duelInfo.Y, 66, "详细信息"); + AddUIChild(detailedInformation); + detailedInformation.OnClick = function (btn) { + //todo 打开面板 + print(11111); + }.bindenv(this); + } + + //逻辑入口 + function Proc(Dt) { + SyncPos(X, Y); + base.Proc(Dt); + } + +} + +// 属性项 +class roleInfoPropertyItem{ + + // additionReaction 属性是否有加成 加成为绿色 不加成灰色 + function Draw(idx, title, numText, additionReaction = true, width = 120) { + + // 创建画布 + local Canvas = CL_CanvasObject(); + // 重设大小并清空 + Canvas.ResizeAndClear(width, 18); + // 开始绘制 + Canvas.BeginDraw(); + + local titlecolor = additionReaction ? sq_RGBA(160, 132, 75, 255) : sq_RGBA(79, 79, 79, 255); + local numColor = additionReaction ? sq_RGBA(75, 161, 85, 255) : sq_RGBA(79, 79, 79, 255); + + local icon = CL_SpriteFrameObject("sprite/interface2/profile/profile_icon.img", idx); + Canvas.DrawSpriteFrame(icon, 5, 0); + + // 属性名称 + local property = FontAssetManager.GenerateNormal(title, true, { + color = titlecolor + }); + Canvas.DrawActor(property, icon.right() + 5, icon.Y); + + // 属性数值 + local propertyNum = FontAssetManager.GenerateNormal(numText, true, { + color = numColor + }); + local numX = width - propertyNum.GetSize().w; + Canvas.DrawActor(property, numX, icon.Y); + + // 结束绘制 + Canvas.EndDraw(); + + return Canvas; + } + +} + + +// 其他面板按钮 +class otherButton extends Yosin_CommonUi { + + // 是否启用按钮 + enabled = true; + // pvp 是否是pvp 按钮 + constructor(gX, gY, idx, title, pvp = false, enabled = true, ) { + base.constructor(gX, gY, 65, 65); + + this.enabled = enabled; + + local titlecolor = enabled? sq_RGBA(160, 132, 75, 255) : sq_RGBA(79, 79, 79, 255); + // 属性名称 + local property = FontAssetManager.GenerateNormal(title, true, { + color = titlecolor + }); + property.SetPosition( 32 - property.GetSize().w / 2 , 45 ); + Addchild(property); + + local path = pvp? "sprite/interface2/profile/profile_pvp_icon.img" : "sprite/interface2/profile/profile.img"; + local icon = CL_SpriteObject(path, enabled ? idx : idx +1 ); + icon.SetPosition(32 - icon.GetSize().w / 2, 45/2 - icon.GetSize().h / 2 + 3 ); + Addchild(icon); + + } + +} + + + + + +// 上半部分 人物装备穿戴 +class Personalinfo_CharactersEquipment extends Yosin_CommonUi { + + // 展示其他装备 + showOtherEquipment = null; + // 允许更换装备 + allowChangeEquipment = null; + // 画布 + Canvas = null; + + constructor(x, y) { + local w = 248; + local h = 179; + base.constructor(x, y, w, h); + + showOtherEquipment = false; + allowChangeEquipment = false; + + // 创建画布 + Canvas = CL_CanvasObject(); + // 重设大小并清空 + Canvas.ResizeAndClear(w, h); + // 设置填充画刷 用于绘制边框和线条 + // Canvas.SetFillBrush(sq_RGBA(59, 56, 57, 250)); + // 设置轮廓画刷 用于绘制边框和线条 + // Canvas.SetStrokeBrush(sq_RGBA(59, 56, 57, 250)); + // 开始绘制 + Canvas.BeginDraw(); + + // 绘制背景 + DrawBackground(); + + // 结束绘制 + Canvas.EndDraw(); + // 添加画布 + Addchild(Canvas); + } + + + // 背景 + function DrawBackground() { + + // 装备栏背景 + local equipmentBackground = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 21); + Canvas.DrawSpriteFrame(equipmentBackground, 5, 5); + + + // 顶部光线 + local topLight = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 178); + Canvas.DrawSpriteFrame(topLight, Width / 2 - topLight.GetSize().w / 2, 0); + + // todo 角色展示 + + // 结婚戒指槽位 + local ringSlotBg = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory_cn.img", 0); + Canvas.DrawSpriteFrame(ringSlotBg, Width / 2 - ringSlotBg.GetSize().w / 2, 5); + + // todo 根据是否装备 显示装备 + if (showOtherEquipment) { + // 辅助装备 + local assist = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 19); + Canvas.DrawSpriteFrame(assist, 179, 69); + + // 耳环 + local earrings = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 122); + Canvas.DrawSpriteFrame(earrings, 179, 102); + + // 魔法石 + local MagicStone = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 20); + Canvas.DrawSpriteFrame(MagicStone, 211, 101); + + } + + } + + +} \ No newline at end of file diff --git a/sqr/folder-alias.json b/sqr/folder-alias.json index 7e0c18b..8d7ef1e 100644 --- a/sqr/folder-alias.json +++ b/sqr/folder-alias.json @@ -259,7 +259,7 @@ }, "User/UI/Widget/Top_Title.nut": { "description": "窗口顶部标题" - }, + }, "User/Socket/Packet.nut": { "description": "数据包类" }, @@ -271,5 +271,17 @@ }, "Core/BaseClass/AudioClass.nut": { "description": "音频类" + }, + "User/UI/Window/5_Inventory": { + "description": "背包" + }, + "User/UI/Window/4_Personalinfo": { + "description": "个人信息" + }, + "User/UI/Window/4_Personalinfo/4_PersonalInfo.nut": { + "description": "个人信息窗口" + }, + "User/UI/Window/4_Personalinfo/Personalinfo_RoleInfoPage.nut": { + "description": "个人信息页" } } \ No newline at end of file From 2f555aab9685dc0b318a3298b4fbd2198d3bcdd3 Mon Sep 17 00:00:00 2001 From: WONIU Date: Fri, 10 Jan 2025 21:51:50 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E7=94=BB=E5=B8=83=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Window/4_Personalinfo/4_PersonalInfo.nut | 2 +- .../Personalinfo_RoleInfoPage.nut | 310 +++++++++++++----- 2 files changed, 229 insertions(+), 83 deletions(-) diff --git a/sqr/User/UI/Window/4_Personalinfo/4_PersonalInfo.nut b/sqr/User/UI/Window/4_Personalinfo/4_PersonalInfo.nut index 89ef8bc..b613bbc 100644 --- a/sqr/User/UI/Window/4_Personalinfo/4_PersonalInfo.nut +++ b/sqr/User/UI/Window/4_Personalinfo/4_PersonalInfo.nut @@ -24,7 +24,7 @@ class _PersonalInfo extends Yosin_Window { function RegisterWidget() { // 标题按钮 - local titlesBtn = Yosin_RowMoreTitleBtn(10, 25, 252, ["角色", "装扮/宠物", "护石"], "sprite/interface/lenheartwindowcommon.img", 160); + local titlesBtn = Yosin_RowMoreTitleBtn(10, 25, 266, ["角色", "装扮/宠物", "护石"], "sprite/interface/lenheartwindowcommon.img", 160); AddUIChild(titlesBtn); titlesBtn.LBDownOnClick = function(btns, index) { diff --git a/sqr/User/UI/Window/4_Personalinfo/Personalinfo_RoleInfoPage.nut b/sqr/User/UI/Window/4_Personalinfo/Personalinfo_RoleInfoPage.nut index 9218897..2e7ef27 100644 --- a/sqr/User/UI/Window/4_Personalinfo/Personalinfo_RoleInfoPage.nut +++ b/sqr/User/UI/Window/4_Personalinfo/Personalinfo_RoleInfoPage.nut @@ -18,7 +18,7 @@ class roleInfoPage extends Yosin_CommonUi { constructor(gX, gY) { local w = 266; - local h = 355; + local h = 465; base.constructor( gX, gY, w, h); @@ -36,6 +36,15 @@ class roleInfoPage extends Yosin_CommonUi { Canvas.EndDraw(); // 添加画布 Addchild(Canvas); + + + // 名称变更记录按钮 + local nameChangeRecordBtn = Yosin_BaseButton(70, 7, 18, 17, "sprite/interface/newstyle/windows/inventory/inventory.img", 106); + nameChangeRecordBtn.DownSimulateOffset = false; + AddUIChild(nameChangeRecordBtn); + + // 底部四个按钮 + RegisterBottomButton(); } function DrawWidget() { @@ -44,37 +53,70 @@ class roleInfoPage extends Yosin_CommonUi { Canvas.DrawSpriteFrame(backGround, 0, 0); // 上半部分 装备展示 - local equipment = Personalinfo_CharactersEquipment(0, 0); + local equipment = Personalinfo_CharactersEquipment(); Canvas.DrawSprite(equipment); // 名称 等级 其他 RegisterNameAndOther(); // 属性 - // RegisterPropertyItems(); - - // 底部四个按钮 - RegisterBottomButton(); - + RegisterPropertyItems(); } // 名称 等级 其他 function RegisterNameAndOther() { - // 冒险家名望 - local adventurerFame = CL_SpriteFrameObject("sprite/interface2/profile/profile_icon.img", 53); - Canvas.DrawSpriteFrame(adventurerFame, 70, 185); + // 名称 + local nameY = 130; + local name = FontAssetManager.GenerateNormal("账号名称", true, { + color = sq_RGBA(161, 240, 163, 255) + }); + Canvas.DrawActor(name, Width / 2 - name.GetSize().w / 2, nameY); + // 等级 + local level = FontAssetManager.GenerateNormal("2级 角色名称", true, { + color = green + }); + Canvas.DrawActor(level, Width / 2 - level.GetSize().w / 2, nameY + 15); + + // 角色定位 + local jobType = CL_SpriteFrameObject("sprite/interface2/profile/profile.img", 74); + + // 职业 + local job = FontAssetManager.GenerateNormal("[剑魂]", true, { + color = brown + }); + + local jobSize = job.GetSize(); + local iconX = Width / 2 - (jobSize.w + 12) / 2; + Canvas.DrawSpriteFrame(jobType, iconX, nameY + 33); + Canvas.DrawActor(job, iconX + 12, nameY + 30); + + + + + // 冒险家名望Icon + local adventurerFameY = 187; + local adventurerFameX = 70; + local adventurerFame = CL_SpriteFrameObject("sprite/interface2/profile/profile_icon.img", 53); + local adventurerFameRight = adventurerFameX + adventurerFame.GetSize().w; + + Canvas.DrawSpriteFrame(adventurerFame, adventurerFameX, adventurerFameY); + + + // 冒险家名望 local adventurerFameText = FontAssetManager.GenerateNormal("冒险家名望", true, { color = brown }); - Canvas.DrawActor(adventurerFameText, adventurerFame.right() + 5, adventurerFame.Y); + local adventurerFameTextRight = adventurerFameRight + 5 + adventurerFameText.GetSize().w; + + Canvas.DrawActor(adventurerFameText, adventurerFameRight + 5, 185); // 冒险家名望数值 local adventurerFameNum = FontAssetManager.GenerateNormal("7", true, { color = green }); - Canvas.DrawActor(adventurerFameNum, adventurerFameText.right() + 5, adventurerFameText.Y); + Canvas.DrawActor(adventurerFameNum, adventurerFameTextRight + 5, 185); } @@ -82,60 +124,92 @@ class roleInfoPage extends Yosin_CommonUi { function RegisterPropertyItems() { // 属性 + local leftListX = 0; + local rightListX = 132; + local rowY = 213; + local rowH = 18; + // 生命 - local life = roleInfoPropertyItem.Draw( 0, "生命", "100"); - Canvas.DrawSprite(life, 0, 213); + local life = roleInfoPropertyItem( 0, "生命", "100"); + Canvas.DrawSprite(life, leftListX, rowY); // 魔法 - local magic = roleInfoPropertyItem.Draw( 1, "魔法", "100"); - Canvas.DrawSprite(magic, life.right() + 16, life.Y); + local magic = roleInfoPropertyItem( 1, "魔法", "100"); + Canvas.DrawSprite(magic, rightListX, rowY); + + rowY += rowH; + // 物理防御力 - local physicalDefense = roleInfoPropertyItem.Draw( "物理防御力", "100", false); - Canvas.DrawSprite(physicalDefense, life.X, life.bottom(), 8); + local physicalDefense = roleInfoPropertyItem(8, "物理防御力", "100", false); + Canvas.DrawSprite(physicalDefense, leftListX, rowY); + // 魔法防御力 - local magicDefense = roleInfoPropertyItem.Draw( 9, "魔法防御力", "100"); - Canvas.DrawSprite(magicDefense, physicalDefense.right() + 16, physicalDefense.Y); + local magicDefense = roleInfoPropertyItem( 9, "魔法防御力", "100"); + Canvas.DrawSprite(magicDefense, rightListX, rowY); + + rowY += rowH; // 力量 - local strength = roleInfoPropertyItem.Draw( 2, "力量", "100"); - Canvas.DrawSprite(strength, life.X, physicalDefense.bottom()); + local strength = roleInfoPropertyItem( 2, "力量", "100"); + Canvas.DrawSprite(strength, leftListX, rowY); // 智力 - local intelligence = roleInfoPropertyItem.Draw( 3, "智力", "100"); - Canvas.DrawSprite(intelligence, strength.right() + 16, strength.Y); + local intelligence = roleInfoPropertyItem( 3, "智力", "100"); + Canvas.DrawSprite(intelligence, rightListX, rowY); + + rowY += rowH; + // 体力 - local vitality = roleInfoPropertyItem.Draw( 4, "体力", "100"); - Canvas.DrawSprite(vitality, strength.X, strength.bottom()); + local vitality = roleInfoPropertyItem( 4, "体力", "100"); + Canvas.DrawSprite(vitality, leftListX, rowY); // 精神 - local spirit = roleInfoPropertyItem.Draw( 5, "精神", "100"); - Canvas.DrawSprite(spirit, vitality.right() + 16, vitality.Y); + local spirit = roleInfoPropertyItem( 5, "精神", "100"); + Canvas.DrawSprite(spirit, rightListX, rowY); + + rowY += rowH; + // 物理攻击力 - local physicalATK = roleInfoPropertyItem.Draw( 6, "物理攻击力", "100"); - Canvas.DrawSprite(physicalATK, life.X, spirit.bottom()); + local physicalATK = roleInfoPropertyItem( 6, "物理攻击力", "100"); + Canvas.DrawSprite(physicalATK, leftListX, rowY); // 魔法攻击力 - local magicATK = roleInfoPropertyItem.Draw( 7, "魔法攻击力", "100"); - Canvas.DrawSprite(magicATK, physicalATK.right() + 16, physicalATK.Y); + local magicATK = roleInfoPropertyItem( 7, "魔法攻击力", "100"); + Canvas.DrawSprite(magicATK, rightListX, rowY); + + rowY += rowH; + // 物理暴击 - local physicalCrit = roleInfoPropertyItem.Draw( 10, "物理暴击", "100"); - Canvas.DrawSprite(physicalCrit, life.X, magicATK.bottom()); + local physicalCrit = roleInfoPropertyItem( 10, "物理暴击", "100"); + Canvas.DrawSprite(physicalCrit, leftListX, rowY); // 魔法暴击 - local magicCrit = roleInfoPropertyItem.Draw( 11, "魔法暴击", "100"); - Canvas.DrawSprite(magicCrit, physicalCrit.right() + 16, physicalCrit.Y); + local magicCrit = roleInfoPropertyItem( 11, "魔法暴击", "100"); + Canvas.DrawSprite(magicCrit, rightListX, rowY); + + + rowY += rowH; + // 独立攻击 - local independentAttack = roleInfoPropertyItem.Draw( 12, "独立攻击", "100"); - Canvas.DrawSprite(independentAttack, life.X, magicCrit.bottom()); + local independentAttack = roleInfoPropertyItem( 12, "独立攻击", "100"); + Canvas.DrawSprite(independentAttack, leftListX, rowY); + + rowY += rowH; // 攻击速度 - local attackSpeed = roleInfoPropertyItem.Draw(13, "攻击速度", "100"); - Canvas.DrawSprite(attackSpeed, life.X, independentAttack.bottom()); + local attackSpeed = roleInfoPropertyItem(13, "攻击速度", "100"); + Canvas.DrawSprite(attackSpeed, leftListX, rowY); + // 释放速度 - local releaseSpeed = roleInfoPropertyItem.Draw( 14, "释放速度", "100"); - Canvas.DrawSprite(releaseSpeed, attackSpeed.right() + 16, attackSpeed.Y); + local releaseSpeed = roleInfoPropertyItem( 14, "释放速度", "100"); + Canvas.DrawSprite(releaseSpeed, rightListX, rowY); + + rowY += rowH; + // 移动速度 - local moveSpeed = roleInfoPropertyItem.Draw( 15, "移动速度", "100"); - Canvas.DrawSprite(moveSpeed, life.X, releaseSpeed.bottom()); + local moveSpeed = roleInfoPropertyItem( 15, "移动速度", "100"); + Canvas.DrawSprite(moveSpeed, leftListX, rowY); + + rowY += rowH; // 攻击属性 - local attackProperty = roleInfoPropertyItem.Draw( 16, "攻击属性", "火(0)/冰(0)/光(0)/暗(0)", true, 260); - Canvas.DrawSprite(attackProperty, life.X, moveSpeed.bottom()); + local attackProperty = roleInfoPropertyItem(16, "攻击属性", "火(0)/冰(0)/光(0)/暗(0)", true, 260); + Canvas.DrawSprite(attackProperty, leftListX, rowY); } @@ -195,43 +269,80 @@ class roleInfoPage extends Yosin_CommonUi { } // 属性项 -class roleInfoPropertyItem{ +class roleInfoPropertyItem extends CL_CanvasObject { // additionReaction 属性是否有加成 加成为绿色 不加成灰色 - function Draw(idx, title, numText, additionReaction = true, width = 120) { + constructor(idx, title, numText, additionReaction = true, width = 125) { + local w = width; + local h = 18; + base.constructor(); - // 创建画布 - local Canvas = CL_CanvasObject(); // 重设大小并清空 - Canvas.ResizeAndClear(width, 18); + ResizeAndClear(w, 18); // 开始绘制 - Canvas.BeginDraw(); + BeginDraw(); local titlecolor = additionReaction ? sq_RGBA(160, 132, 75, 255) : sq_RGBA(79, 79, 79, 255); local numColor = additionReaction ? sq_RGBA(75, 161, 85, 255) : sq_RGBA(79, 79, 79, 255); + local iconX = 5; local icon = CL_SpriteFrameObject("sprite/interface2/profile/profile_icon.img", idx); - Canvas.DrawSpriteFrame(icon, 5, 0); + local iconRight = iconX + icon.GetSize().w; + DrawSpriteFrame(icon, iconX, h/ 2 - icon.GetSize().h / 2); + // 属性名称 local property = FontAssetManager.GenerateNormal(title, true, { color = titlecolor }); - Canvas.DrawActor(property, icon.right() + 5, icon.Y); + DrawActor(property, iconRight + 5, 0); // 属性数值 local propertyNum = FontAssetManager.GenerateNormal(numText, true, { color = numColor }); - local numX = width - propertyNum.GetSize().w; - Canvas.DrawActor(property, numX, icon.Y); + local numX = w - propertyNum.GetSize().w; + DrawActor(propertyNum, numX, 0); // 结束绘制 - Canvas.EndDraw(); - - return Canvas; + EndDraw(); } + // additionReaction 属性是否有加成 加成为绿色 不加成灰色 + // function Draw(idx, title, numText, additionReaction = true, width = 120) { + + // // 创建画布 + // local Canvas = CL_CanvasObject(); + // // 重设大小并清空 + // Canvas.ResizeAndClear(width, 18); + // // 开始绘制 + // Canvas.BeginDraw(); + + // local titlecolor = additionReaction ? sq_RGBA(160, 132, 75, 255) : sq_RGBA(79, 79, 79, 255); + // local numColor = additionReaction ? sq_RGBA(75, 161, 85, 255) : sq_RGBA(79, 79, 79, 255); + + // local icon = CL_SpriteFrameObject("sprite/interface2/profile/profile_icon.img", idx); + // Canvas.DrawSpriteFrame(icon, 5, 0); + + // // 属性名称 + // local property = FontAssetManager.GenerateNormal(title, true, { + // color = titlecolor + // }); + // Canvas.DrawActor(property, icon.right() + 5, icon.Y); + + // // 属性数值 + // local propertyNum = FontAssetManager.GenerateNormal(numText, true, { + // color = numColor + // }); + // local numX = width - propertyNum.GetSize().w; + // Canvas.DrawActor(property, numX, icon.Y); + + // // 结束绘制 + // Canvas.EndDraw(); + + // return Canvas; + // } + } @@ -240,6 +351,11 @@ class otherButton extends Yosin_CommonUi { // 是否启用按钮 enabled = true; + + iconX = null; + iconY = null; + icon = null; + // pvp 是否是pvp 按钮 constructor(gX, gY, idx, title, pvp = false, enabled = true, ) { base.constructor(gX, gY, 65, 65); @@ -255,12 +371,29 @@ class otherButton extends Yosin_CommonUi { Addchild(property); local path = pvp? "sprite/interface2/profile/profile_pvp_icon.img" : "sprite/interface2/profile/profile.img"; - local icon = CL_SpriteObject(path, enabled ? idx : idx +1 ); - icon.SetPosition(32 - icon.GetSize().w / 2, 45/2 - icon.GetSize().h / 2 + 3 ); + icon = CL_SpriteObject(path, enabled ? idx : idx +1 ); + + iconX = 32 - icon.GetSize().w / 2; + iconY = 45 / 2 - icon.GetSize().h / 2 + 3; + icon.SetPosition( iconX , iconY ); Addchild(icon); } + function Proc(DT) { + // if (isLBDown){ + // SyncPos(X, cacheY + 1); + // }else{ + // SyncPos(X, cacheY); + // } + if (isLBDown){ + icon.SetPosition( iconX , iconY + 1 ); + }else{ + icon.SetPosition( iconX , iconY ); + } + } + + } @@ -268,79 +401,92 @@ class otherButton extends Yosin_CommonUi { // 上半部分 人物装备穿戴 -class Personalinfo_CharactersEquipment extends Yosin_CommonUi { +class Personalinfo_CharactersEquipment extends CL_CanvasObject { // 展示其他装备 showOtherEquipment = null; // 允许更换装备 allowChangeEquipment = null; - // 画布 - Canvas = null; + // // 画布 + // Canvas = null; - constructor(x, y) { + constructor() { local w = 248; local h = 179; - base.constructor(x, y, w, h); + base.constructor(); - showOtherEquipment = false; + showOtherEquipment = true; allowChangeEquipment = false; // 创建画布 - Canvas = CL_CanvasObject(); + CL_CanvasObject(); // 重设大小并清空 - Canvas.ResizeAndClear(w, h); + ResizeAndClear(w, h); // 设置填充画刷 用于绘制边框和线条 // Canvas.SetFillBrush(sq_RGBA(59, 56, 57, 250)); // 设置轮廓画刷 用于绘制边框和线条 // Canvas.SetStrokeBrush(sq_RGBA(59, 56, 57, 250)); // 开始绘制 - Canvas.BeginDraw(); + BeginDraw(); // 绘制背景 - DrawBackground(); + DrawBackground(w); // 结束绘制 - Canvas.EndDraw(); - // 添加画布 - Addchild(Canvas); + EndDraw(); } // 背景 - function DrawBackground() { + function DrawBackground(Width) { // 装备栏背景 local equipmentBackground = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 21); - Canvas.DrawSpriteFrame(equipmentBackground, 5, 5); + DrawSpriteFrame(equipmentBackground, 5, 5); // 顶部光线 local topLight = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 178); - Canvas.DrawSpriteFrame(topLight, Width / 2 - topLight.GetSize().w / 2, 0); + DrawSpriteFrame(topLight, Width / 2 - topLight.GetSize().w / 2, 0); + // DrawSpriteFrame(topLight, 0, 0); // todo 角色展示 // 结婚戒指槽位 local ringSlotBg = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory_cn.img", 0); - Canvas.DrawSpriteFrame(ringSlotBg, Width / 2 - ringSlotBg.GetSize().w / 2, 5); + DrawSpriteFrame(ringSlotBg, Width / 2 - ringSlotBg.GetSize().w / 2, 5); // todo 根据是否装备 显示装备 if (showOtherEquipment) { // 辅助装备 local assist = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 19); - Canvas.DrawSpriteFrame(assist, 179, 69); + DrawSpriteFrame(assist, 179, 69); // 耳环 local earrings = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 122); - Canvas.DrawSpriteFrame(earrings, 179, 102); + DrawSpriteFrame(earrings, 179, 102); // 魔法石 local MagicStone = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 20); - Canvas.DrawSpriteFrame(MagicStone, 211, 101); + DrawSpriteFrame(MagicStone, 211, 101); } } -} \ No newline at end of file +} + + + +// 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(); +// } \ No newline at end of file From b12d4ed3a0e05d5d69f5958baaddf89f2a6eaf9d Mon Sep 17 00:00:00 2001 From: WONIU Date: Sat, 11 Jan 2025 01:27:48 +0800 Subject: [PATCH 4/4] =?UTF-8?q?1=20=E8=83=8C=E5=8C=85=20=E5=B0=86=E9=92=B1?= =?UTF-8?q?=E5=8C=85=20Item=20=E7=A7=BB=E5=8A=A8=E5=88=B0=E8=83=8C?= =?UTF-8?q?=E5=8C=85=E5=B1=82=202=20=E8=83=8C=E5=8C=85=20=E5=B0=86?= =?UTF-8?q?=E4=B9=A6=E6=9C=AC=E6=8C=89=E9=92=AE=20=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E5=88=B0=E8=A3=85=E5=A4=87=E9=A1=B5=E9=9D=A2=E5=B1=82=203=20?= =?UTF-8?q?=E5=B0=86=20=E7=89=A9=E5=93=81=E6=A0=8Fitem=20=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E5=88=B0=E8=A3=85=E5=A4=87=E9=A1=B5=E9=9D=A2=E5=B1=82?= =?UTF-8?q?=204=20=E4=BF=AE=E6=94=B9=E4=B9=9D=E6=A0=BC=E6=8B=89=E4=BC=B8?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=9A=84=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sqr/Core/UI_Class/UI_Widget.nut | 4 +- sqr/User/Asset/Item/Equipment.nut | 2 +- sqr/User/Stage/TestStage.nut | 2 +- sqr/User/UI/Widget/Top_Title.nut | 20 +- sqr/User/UI/Window/1_Select_Character.nut | 3 +- sqr/User/UI/Window/233_HUD_Message.nut | 15 +- sqr/User/UI/Window/2_Create_Character.nut | 7 +- .../Window/4_Personalinfo/4_PersonalInfo.nut | 2 - .../Personalinfo_RoleInfoPage.nut | 41 --- .../UI/Window/5_Inventory/5_Inventory.nut | 105 ++++++- .../5_Inventory/Inventory_EquipmentPage.nut | 264 +++++------------- .../UI/Window/5_Inventory/ItemCollect.nut | 22 +- 12 files changed, 211 insertions(+), 276 deletions(-) diff --git a/sqr/Core/UI_Class/UI_Widget.nut b/sqr/Core/UI_Class/UI_Widget.nut index e610967..dec28bf 100644 --- a/sqr/Core/UI_Class/UI_Widget.nut +++ b/sqr/Core/UI_Class/UI_Widget.nut @@ -200,12 +200,10 @@ class Yosin_EmeStretch extends Yosin_CommonUi { // 九宫格拉伸 -function Yosin_NineBoxStretch(X, Y, width, height, path, imgId) { - +function Yosin_NineBoxStretch(width, height, path, imgId) { // 创建画布 local Canvas = CL_CanvasObject(); - Canvas.SetPosition(X, Y); // 重设大小并清空 Canvas.ResizeAndClear(width, height); // 开始绘制 diff --git a/sqr/User/Asset/Item/Equipment.nut b/sqr/User/Asset/Item/Equipment.nut index 2fe10ad..e1c345c 100644 --- a/sqr/User/Asset/Item/Equipment.nut +++ b/sqr/User/Asset/Item/Equipment.nut @@ -50,7 +50,7 @@ class GameItem.EquipmentInfo extends Yosin_Window { Init(); - local background = Yosin_NineBoxStretch(0, 0, 211, RealCanvasHeight + 10, "sprite/interface/lenheartwindowcommon.img", 213); + local background = Yosin_NineBoxStretch(211, RealCanvasHeight + 10, "sprite/interface/lenheartwindowcommon.img", 213); background.SetZOrder(-1); Addchild(background); } diff --git a/sqr/User/Stage/TestStage.nut b/sqr/User/Stage/TestStage.nut index 6673542..f51f03c 100644 --- a/sqr/User/Stage/TestStage.nut +++ b/sqr/User/Stage/TestStage.nut @@ -37,7 +37,7 @@ function TestStage() { // ClientCharacter = Charc; - // local Window = Sq_CreateWindow(_Inventory, "背包窗口", 150, 12, 257, 555, 20); + local Window = Sq_CreateWindow(_Inventory, "背包窗口", 150, 12, 257, 548, 20); // Window.equipmentPage.Item.ItemCollection.SetItemList([{ // ItemId = 27675 diff --git a/sqr/User/UI/Widget/Top_Title.nut b/sqr/User/UI/Widget/Top_Title.nut index 9267560..57f9425 100644 --- a/sqr/User/UI/Widget/Top_Title.nut +++ b/sqr/User/UI/Widget/Top_Title.nut @@ -13,19 +13,27 @@ class Yosin_TopTitle extends Yosin_CommonUi { //内容背景 if (drawBackground) { - local background = Yosin_NineBoxStretch(0, 15, W + 4, H - 15, "sprite/interface/lenheartwindowcommon.img", 97); + local background = Yosin_NineBoxStretch( W, H, "sprite/interface/lenheartwindowcommon.img", 97); + background.SetPosition(0, 0); Addchild(background); } - // 标题背景 - local Background = Yosin_EmeStretch(0, 0, W + 3, 22, "sprite/interface/lenheartwindowcommon.img", 609); - Addchild(Background); + // 绘制标题背景 + local titleX = drawBackground ? 2 : 0; + local titleW = drawBackground ? W - 4 : W; + local titleBackground = Yosin_EmeStretch(titleX, 0, titleW, 20, "sprite/interface/lenheartwindowcommon.img", 609); + titleBackground.SetScale(1, 1.3); + Addchild(titleBackground); - // 标题亮色背景 + // 标题背景光 local BackgroundBright = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 483); - local scaleW = (Background.GetSize().w / BackgroundBright.GetSize().w).tofloat(); + local BackgroundBrightSize = BackgroundBright.GetSize(); + // 计算光的缩放比例 + local scaleW = (W / BackgroundBrightSize.w).tofloat(); + BackgroundBright.SetScale(scaleW, 1); BackgroundBright.SetPosition(0, 1); + Addchild(BackgroundBright); diff --git a/sqr/User/UI/Window/1_Select_Character.nut b/sqr/User/UI/Window/1_Select_Character.nut index 9108a41..b2a0d25 100644 --- a/sqr/User/UI/Window/1_Select_Character.nut +++ b/sqr/User/UI/Window/1_Select_Character.nut @@ -549,7 +549,8 @@ class _Select_Character_Window extends Yosin_Window { ChangeBackground(Info.loginImg); //角色遮罩栏 - CharacterMaskBox = Yosin_NineBoxStretch(-4, 320, 1074, 680, "sprite/interface/lenheartwindowcommon.img", 0); + CharacterMaskBox = Yosin_NineBoxStretch(1074, 680, "sprite/interface/lenheartwindowcommon.img", 0); + CharacterMaskBox.SetPosition(-4, 320); Addchild(CharacterMaskBox); diff --git a/sqr/User/UI/Window/233_HUD_Message.nut b/sqr/User/UI/Window/233_HUD_Message.nut index 8af48f9..6dcacd2 100644 --- a/sqr/User/UI/Window/233_HUD_Message.nut +++ b/sqr/User/UI/Window/233_HUD_Message.nut @@ -72,19 +72,28 @@ class _Yosin_MessageBox extends Yosin_Window { } function RegisterWidget() { + //背景 - local background = Yosin_NineBoxStretch(-1, 15, cacheW + 1, cacheH, "sprite/interface/lenheartwindowcommon.img", 97); + local background = Yosin_NineBoxStretch( cacheW + 1, cacheH, "sprite/interface/lenheartwindowcommon.img", 97); + background.SetPosition(-1, 15); Addchild(background); - local twoBackground = Yosin_NineBoxStretch(4, 20, cacheW - 8, cacheH - 36, "sprite/interface/lenheartwindowcommon.img", 97); + + //文字背景 + local twoBackground = Yosin_NineBoxStretch( cacheW - 8, cacheH - 36, "sprite/interface/lenheartwindowcommon.img", 97); + twoBackground.SetPosition(4, 20); Addchild(twoBackground); // 绘制标题背景 local titleBackground = Yosin_EmeStretch(0, 0, cacheW, 20, "sprite/interface/lenheartwindowcommon.img", 609); + titleBackground.SetScale(1, 1.2); AddUIChild(titleBackground); + // 标题背景光 local BackgroundBright = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 483); - local scaleW = (cacheW / BackgroundBright.GetSize().w).tofloat(); + local BackgroundBrightSize = BackgroundBright.GetSize(); + local scaleW = (cacheW / BackgroundBrightSize.w).tofloat(); BackgroundBright.SetScale(scaleW, 1); + BackgroundBright.SetPosition( 0, 1); Addchild(BackgroundBright); //确认按钮 diff --git a/sqr/User/UI/Window/2_Create_Character.nut b/sqr/User/UI/Window/2_Create_Character.nut index 2238b65..fbfa445 100644 --- a/sqr/User/UI/Window/2_Create_Character.nut +++ b/sqr/User/UI/Window/2_Create_Character.nut @@ -791,11 +791,8 @@ class _create_Character_enterName extends Yosin_Window { base.constructor("输入角色名称", 0, 0, 1066, 600, 0); //背景 - local background = Yosin_NineBoxStretch(-2, 0, 1070, 604, "sprite/interface/lenheartwindowcommon.img", 97); - Addchild(background); - - //背景 - local background = Yosin_NineBoxStretch(413, 228, 240, 140, "sprite/interface/lenheartwindowcommon.img", 97); + local background = Yosin_NineBoxStretch( 240, 140, "sprite/interface/lenheartwindowcommon.img", 97); + background.SetPosition(413, 228); Addchild(background); // 标题文字 diff --git a/sqr/User/UI/Window/4_Personalinfo/4_PersonalInfo.nut b/sqr/User/UI/Window/4_Personalinfo/4_PersonalInfo.nut index b613bbc..b583b7d 100644 --- a/sqr/User/UI/Window/4_Personalinfo/4_PersonalInfo.nut +++ b/sqr/User/UI/Window/4_Personalinfo/4_PersonalInfo.nut @@ -6,8 +6,6 @@ */ // local infoWindow = Sq_CreateWindow(_PersonalInfo, "个人信息窗口", 250, 60, 286, 530, 20); -// todo 图和尺寸比例都需要修改 -// todo Yosin_Window 和 Yosin_CommonUi 会有性能开销需要检查 class _PersonalInfo extends Yosin_Window { diff --git a/sqr/User/UI/Window/4_Personalinfo/Personalinfo_RoleInfoPage.nut b/sqr/User/UI/Window/4_Personalinfo/Personalinfo_RoleInfoPage.nut index 2e7ef27..1a1b77f 100644 --- a/sqr/User/UI/Window/4_Personalinfo/Personalinfo_RoleInfoPage.nut +++ b/sqr/User/UI/Window/4_Personalinfo/Personalinfo_RoleInfoPage.nut @@ -308,41 +308,6 @@ class roleInfoPropertyItem extends CL_CanvasObject { EndDraw(); } - // additionReaction 属性是否有加成 加成为绿色 不加成灰色 - // function Draw(idx, title, numText, additionReaction = true, width = 120) { - - // // 创建画布 - // local Canvas = CL_CanvasObject(); - // // 重设大小并清空 - // Canvas.ResizeAndClear(width, 18); - // // 开始绘制 - // Canvas.BeginDraw(); - - // local titlecolor = additionReaction ? sq_RGBA(160, 132, 75, 255) : sq_RGBA(79, 79, 79, 255); - // local numColor = additionReaction ? sq_RGBA(75, 161, 85, 255) : sq_RGBA(79, 79, 79, 255); - - // local icon = CL_SpriteFrameObject("sprite/interface2/profile/profile_icon.img", idx); - // Canvas.DrawSpriteFrame(icon, 5, 0); - - // // 属性名称 - // local property = FontAssetManager.GenerateNormal(title, true, { - // color = titlecolor - // }); - // Canvas.DrawActor(property, icon.right() + 5, icon.Y); - - // // 属性数值 - // local propertyNum = FontAssetManager.GenerateNormal(numText, true, { - // color = numColor - // }); - // local numX = width - propertyNum.GetSize().w; - // Canvas.DrawActor(property, numX, icon.Y); - - // // 结束绘制 - // Canvas.EndDraw(); - - // return Canvas; - // } - } @@ -381,11 +346,6 @@ class otherButton extends Yosin_CommonUi { } function Proc(DT) { - // if (isLBDown){ - // SyncPos(X, cacheY + 1); - // }else{ - // SyncPos(X, cacheY); - // } if (isLBDown){ icon.SetPosition( iconX , iconY + 1 ); }else{ @@ -448,7 +408,6 @@ class Personalinfo_CharactersEquipment extends CL_CanvasObject { // 顶部光线 local topLight = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 178); DrawSpriteFrame(topLight, Width / 2 - topLight.GetSize().w / 2, 0); - // DrawSpriteFrame(topLight, 0, 0); // todo 角色展示 diff --git a/sqr/User/UI/Window/5_Inventory/5_Inventory.nut b/sqr/User/UI/Window/5_Inventory/5_Inventory.nut index 177d572..aa2e042 100644 --- a/sqr/User/UI/Window/5_Inventory/5_Inventory.nut +++ b/sqr/User/UI/Window/5_Inventory/5_Inventory.nut @@ -5,7 +5,7 @@ 文件用途: 背包窗口 */ -//local Window = Sq_CreateWindow(_Inventory, "背包窗口", 150, 12, 262, 555, 20); +// local Window = Sq_CreateWindow(_Inventory, "背包窗口", 150, 12, 262, 548, 20); class _Inventory extends Yosin_Window { equipmentPage = null; @@ -25,7 +25,7 @@ class _Inventory extends Yosin_Window { Addchild(title); //关闭按钮 - local closeBtn = Yosin_BaseButton(Width - 15, 4, 12, 12, "sprite/interface/lenheartwindowcommon.img", 544); + local closeBtn = Yosin_BaseButton(Width - 20, 4, 12, 12, "sprite/interface/lenheartwindowcommon.img", 544); closeBtn.DownSimulateOffset = false; closeBtn.SetZOrder(1); closeBtn.OnClick = function(btn) { @@ -40,25 +40,118 @@ class _Inventory extends Yosin_Window { } AddUIChild(topBtn); - //标题按钮 - local titlesBtn = Yosin_RowMoreTitleBtn(5, 22, 252, ["物品栏", "装扮", "宠物", "护石"], "sprite/interface/lenheartwindowcommon.img", 160); + //分页按钮 + local titlesBtn = Yosin_RowMoreTitleBtn(5, 25, 250, ["物品栏", "装扮", "宠物", "护石"], "sprite/interface/lenheartwindowcommon.img", 160); AddUIChild(titlesBtn); titlesBtn.LBDownOnClick = function(btns, index) { print(index); }; + + //物品栏 装备页 - equipmentPage = Inventory_EquipmentPage(2, titlesBtn.bottom() + 4, 300, Height - titlesBtn.bottom() - 4); + equipmentPage = Inventory_EquipmentPage(2, titlesBtn.bottom(), 300, 441); AddUIChild(equipmentPage); + // 添加设置物品栏的按钮 + AddItemCollectSetBtn(); + + // 钱包 + AddMoneyItem(); + } + + // 添加设置物品栏的按钮 + function AddItemCollectSetBtn() { + // 排列按钮 + local permutationBtn = Yosin_BaseButton(226, 467, 28, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 73); + AddUIChild(permutationBtn); + + // 设置 + local setBtn = Yosin_BaseButton(permutationBtn.X - 20, permutationBtn.Y, 18, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 77); + AddUIChild(setBtn); + + // 搜索 + local saerchBtn = Yosin_BaseButton(setBtn.X - 24, permutationBtn.Y, 23, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 94); + AddUIChild(saerchBtn); + } + + // 钱包 + function AddMoneyItem() { + + local txtColor = sq_RGBA(130, 105, 61, 255); + + local bg = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 27); + bg.SetPosition(7, Height - 55); + Addchild(bg); + + // 复活币个数 + local ReviveNum = FontAssetManager.GenerateNormal("23434个", true, { + color = txtColor + }); + ReviveNum.SetPosition(120 - ReviveNum.GetSize().w + bg.X , bg.Y + 2); + Addchild(ReviveNum); + + + // 胜利的证明 + local winNum = FontAssetManager.GenerateNormal("23434个", true, { + color = txtColor + }); + winNum.SetPosition(245 - winNum.GetSize().w + bg.X, bg.Y + 2); + Addchild(winNum); + + + + // 商城 + local storeBtn = Yosin_BaseButton(1 + bg.X, bg.Y + 25, 23, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 3); + //点击事件回调 + // storeBtn.OnClick = function(Button) { + // }.bindenv(this); + AddUIChild(storeBtn); + + + // 点券 + local storeNum = FontAssetManager.GenerateNormal("23434点券", true, { + color = txtColor + }); + storeNum.SetPosition( bg.X + 120 - storeNum.GetSize().w , bg.Y + 27); + Addchild(storeNum); + + // 金币按钮 + local moneyBtn = Yosin_BaseButton(126 + bg.X, storeBtn.Y, 23, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 7); + //点击事件回调 + // moneyBtn.OnClick = function(Button) { + // }.bindenv(this); + AddUIChild(moneyBtn); + + // 金币数量 + local storeNum = FontAssetManager.GenerateNormal("23434金币", true, { + color = txtColor + }); + storeNum.SetPosition( bg.X + 245 - storeNum.GetSize().w, bg.Y + 27); + Addchild(storeNum); } + + + //逻辑入口 function Proc(Dt) { SyncPos(X, Y); base.Proc(Dt); } -} \ No newline at end of file +} + +// 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(); +// } \ No newline at end of file diff --git a/sqr/User/UI/Window/5_Inventory/Inventory_EquipmentPage.nut b/sqr/User/UI/Window/5_Inventory/Inventory_EquipmentPage.nut index 2d14ccb..5331239 100644 --- a/sqr/User/UI/Window/5_Inventory/Inventory_EquipmentPage.nut +++ b/sqr/User/UI/Window/5_Inventory/Inventory_EquipmentPage.nut @@ -8,71 +8,32 @@ // 背包装备页面 class Inventory_EquipmentPage extends Yosin_CommonUi { - Item = null; + // Item = null; + + ItemCollection = null; constructor(x, y, w, h) { base.constructor(x, y, w, h); // 人物装备 - local charactersEquipment = Inventory_CharactersEquipment(5, 0); - AddUIChild(charactersEquipment); + local charactersEquipment = Inventory_CharactersEquipment(); + charactersEquipment.SetPosition(5, 0); + Addchild(charactersEquipment); + + // 添加书本按钮 + AddBookButton(); // 物品栏 - Item = InventoryItem(0, charactersEquipment.bottom(), Width, Height - charactersEquipment.bottom()); - AddUIChild(Item); + AddItem(); } -} - - - -// 上半部分 人物装备穿戴 -class Inventory_CharactersEquipment extends Yosin_CommonUi { - - // 展示其他装备 - showOtherEquipment = null; - // 允许更换装备 - allowChangeEquipment = null; - // 画布 - Canvas = null; - - constructor(x, y) { - local w = 248; - local h = 179; - base.constructor(x, y, w, h); - - showOtherEquipment = true; - allowChangeEquipment = true; - - // 创建画布 - Canvas = CL_CanvasObject(); - // 重设大小并清空 - Canvas.ResizeAndClear(w, h); - // 设置填充画刷 用于绘制边框和线条 - // Canvas.SetFillBrush(sq_RGBA(59, 56, 57, 250)); - // 设置轮廓画刷 用于绘制边框和线条 - // Canvas.SetStrokeBrush(sq_RGBA(59, 56, 57, 250)); - // 开始绘制 - Canvas.BeginDraw(); - - // 绘制背景 - DrawBackground(); - - // 结束绘制 - Canvas.EndDraw(); - // 添加画布 - Addchild(Canvas); - - - AddButton(); - } // 添加按钮 - function AddButton() { + function AddBookButton() { // 称号 - local designation = Yosin_BaseButton(2, Height - 30, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 50); + local designation = Yosin_BaseButton(7, 145, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 50); //点击事件回调 // permutationBtn.OnClick = function(Button) { // }.bindenv(this); @@ -86,77 +47,20 @@ class Inventory_CharactersEquipment extends Yosin_CommonUi { AddUIChild(skin); // 穿戴中的装备 - local wear = Yosin_BaseButton(Width - 29, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 172); + local wear = Yosin_BaseButton(225, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 172); AddUIChild(wear); // 装备特性 local peculiarity = Yosin_BaseButton(wear.X - 21, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 203); AddUIChild(peculiarity); // 未央环境装备 - // local permutationBtn = Yosin_BaseButton(peculiarity.X - 21, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 128); - // AddUIChild(permutationBtn); - - + local permutationBtn = Yosin_BaseButton(peculiarity.X - 21, designation.Y, 18, 20 "sprite/interface/newstyle/windows/inventory/inventory.img", 128); + AddUIChild(permutationBtn); } - - // 背景 - function DrawBackground() { - - // 背景图 - local bgimg = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventorybackground.img", 0); - // 画布绘制背景 - Canvas.DrawSpriteFrame(bgimg, 0, 0); - - - // 装备栏背景 - local equipmentBackground = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 21); - Canvas.DrawSpriteFrame(equipmentBackground, 5, 5); - - - // 顶部光线 - local topLight = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 178); - Canvas.DrawSpriteFrame(topLight, Width / 2 - topLight.GetSize().w / 2, 0); - - // todo 角色展示 - - // 结婚戒指槽位 - local ringSlotBg = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory_cn.img", 0); - Canvas.DrawSpriteFrame(ringSlotBg, Width / 2 - ringSlotBg.GetSize().w / 2, 5); - - // 首饰 - if (showOtherEquipment) { - // 辅助装备 - local assist = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 19); - Canvas.DrawSpriteFrame(assist, 179, 69); - - // 耳环 - local earrings = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 122); - Canvas.DrawSpriteFrame(earrings, 179, 102); - - // 魔法石 - local MagicStone = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 20); - Canvas.DrawSpriteFrame(MagicStone, 211, 101); - - } - - } - - -} - - - - - -// 物品栏 -class InventoryItem extends Yosin_CommonUi { - ItemCollection = null; - - constructor(gX, gY, gWidth, gHeight) { - base.constructor(gX, gY, gWidth, gHeight); - + // 添加物品栏 + function AddItem() { //物品分类按钮 - local itemBtns = Yosin_RowMoreTitleBtn(3, 4, 252, ["装备", "消耗品", "材料", "副职业", "任务"], "sprite/interface/lenheartwindowcommon.img", 160); + local itemBtns = Yosin_RowMoreTitleBtn(5, 182, 248, ["装备", "消耗品", "材料", "副职业", "任务"], "sprite/interface/lenheartwindowcommon.img", 160); AddUIChild(itemBtns); itemBtns.LBDownOnClick = function(btns, index) { @@ -164,11 +68,12 @@ class InventoryItem extends Yosin_CommonUi { }; // 物品栏边框 - local itemBg = Yosin_NineBoxStretch(2, itemBtns.bottom(), 253, 245, "sprite/interface/lenheartwindowcommon.img", 97); + local itemBg = Yosin_NineBoxStretch(253, 245, "sprite/interface/lenheartwindowcommon.img", 97); + itemBg.SetPosition(2, itemBtns.bottom()); Addchild(itemBg); // 物品栏 - ItemCollection = _ItemCollection(itemBg.X + 7, itemBg.Y + 7, 7); + ItemCollection = _ItemCollection(itemBg.X + 7, itemBg.Y + 3, 7); AddUIChild(ItemCollection); @@ -185,110 +90,77 @@ class InventoryItem extends Yosin_CommonUi { weightSchedule.SetPercentage(0.6); Addchild(weightSchedule); - // 排列按钮 - local permutationBtn = Yosin_BaseButton(itemBg.right() - 30, itemBgBottom - 26, 28, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 73); - AddUIChild(permutationBtn); - - // 设置 - local setBtn = Yosin_BaseButton(permutationBtn.X - 20, permutationBtn.Y, 18, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 77); - AddUIChild(setBtn); - - // 搜索 - local saerchBtn = Yosin_BaseButton(setBtn.X - 24, permutationBtn.Y, 23, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 94); - AddUIChild(saerchBtn); - - - - - - - // 复活币 - local moneyItem = MoneyItem(5, itemBgBottom + 3, 3); - AddUIChild(moneyItem); - - } - - function SetItemList(gItemList) { - ItemCollection.SetItemList(gItemList); } } -// 金币相关数值 -class MoneyItem extends Yosin_CommonUi { - constructor(x, y, idx) { + +// 上半部分 人物装备穿戴 +class Inventory_CharactersEquipment extends CL_CanvasObject { + + constructor() { local w = 248; - local h = 49; - base.constructor(x, y, w, h); + local h = 179; + base.constructor(); - local txtColor = sq_RGBA(130, 105, 61, 255); + // 创建画布 + CL_CanvasObject(); + // 重设大小并清空 + ResizeAndClear(w, h); + // 开始绘制 + BeginDraw(); - local bg = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 27); - Addchild(bg); + // 绘制背景 + DrawBackground(w); - // 复活币个数 - local ReviveNum = FontAssetManager.GenerateNormal("23434个", true, { - color = txtColor - }); - ReviveNum.SetPosition(120 - ReviveNum.GetSize().w, 2); - Addchild(ReviveNum); + // 结束绘制 + EndDraw(); + } - // 胜利的证明 - local winNum = FontAssetManager.GenerateNormal("23434个", true, { - color = txtColor - }); - winNum.SetPosition(245 - winNum.GetSize().w, 2); - Addchild(winNum); + // 背景 + function DrawBackground(Width) { + + // 背景图 + local bgimg = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventorybackground.img", 0); + // 画布绘制背景 + DrawSpriteFrame(bgimg, 0, 0); + + // 装备栏背景 + local equipmentBackground = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 21); + DrawSpriteFrame(equipmentBackground, 5, 5); + // 顶部光线 + local topLight = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 178); + DrawSpriteFrame(topLight, Width / 2 - topLight.GetSize().w / 2, 0); - // 商城 - local storeBtn = Yosin_BaseButton(1, 25, 23, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 3); - // local storeBtn = Yosin_BaseButton(0, 0, 23, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 3); - //点击事件回调 - // storeBtn.OnClick = function(Button) { - // }.bindenv(this); - AddUIChild(storeBtn); + // todo 角色展示 + + // 结婚戒指槽位 + local ringSlotBg = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory_cn.img", 0); + DrawSpriteFrame(ringSlotBg, Width / 2 - ringSlotBg.GetSize().w / 2, 5); - // 点券 - local storeNum = FontAssetManager.GenerateNormal("23434点券", true, { - color = txtColor - }); - storeNum.SetPosition(120 - storeNum.GetSize().w, 27); - Addchild(storeNum); - - // 金币按钮 - local moneyBtn = Yosin_BaseButton(126, storeBtn.Y, 23, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 7); - //点击事件回调 - // moneyBtn.OnClick = function(Button) { - // }.bindenv(this); - AddUIChild(moneyBtn); - - // 金币数量 - local storeNum = FontAssetManager.GenerateNormal("23434金币", true, { - color = txtColor - }); - storeNum.SetPosition(245 - storeNum.GetSize().w, 27); - Addchild(storeNum); + // 辅助装备 + local assist = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 19); + DrawSpriteFrame(assist, 179, 69); + // 耳环 + local earrings = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 122); + DrawSpriteFrame(earrings, 179, 102); + // 魔法石 + local MagicStone = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 20); + DrawSpriteFrame(MagicStone, 211, 101); } + } - - - - - - - - // if (!getroottable().rawin("chongzaiflag")) { // getroottable()["chongzaiflag"] <- true; // } else { diff --git a/sqr/User/UI/Window/5_Inventory/ItemCollect.nut b/sqr/User/UI/Window/5_Inventory/ItemCollect.nut index 1b86785..aab35ac 100644 --- a/sqr/User/UI/Window/5_Inventory/ItemCollect.nut +++ b/sqr/User/UI/Window/5_Inventory/ItemCollect.nut @@ -262,14 +262,14 @@ class _ItemCollection extends Yosin_CommonUi { } -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(); -} \ No newline at end of file +// 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(); +// } \ No newline at end of file