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/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/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/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/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.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..b583b7d --- /dev/null +++ b/sqr/User/UI/Window/4_Personalinfo/4_PersonalInfo.nut @@ -0,0 +1,45 @@ +/* +文件名: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); +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, 266, ["角色", "装扮/宠物", "护石"], "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..1a1b77f --- /dev/null +++ b/sqr/User/UI/Window/4_Personalinfo/Personalinfo_RoleInfoPage.nut @@ -0,0 +1,451 @@ + +/* +文件名: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 = 465; + base.constructor( gX, gY, w, h); + + + // 创建画布 + Canvas = CL_CanvasObject(); + // 重设大小并清空 + Canvas.ResizeAndClear(w, h); + // 开始绘制 + Canvas.BeginDraw(); + + // 绘制 + DrawWidget(); + + // 结束绘制 + 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() { + // 背景 + local backGround = CL_SpriteFrameObject("sprite/interface2/profile/profile.img", 60); + Canvas.DrawSpriteFrame(backGround, 0, 0); + + // 上半部分 装备展示 + local equipment = Personalinfo_CharactersEquipment(); + Canvas.DrawSprite(equipment); + + // 名称 等级 其他 + RegisterNameAndOther(); + // 属性 + RegisterPropertyItems(); + + } + + + // 名称 等级 其他 + function RegisterNameAndOther() { + + // 名称 + 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 + }); + local adventurerFameTextRight = adventurerFameRight + 5 + adventurerFameText.GetSize().w; + + Canvas.DrawActor(adventurerFameText, adventurerFameRight + 5, 185); + + // 冒险家名望数值 + local adventurerFameNum = FontAssetManager.GenerateNormal("7", true, { + color = green + }); + Canvas.DrawActor(adventurerFameNum, adventurerFameTextRight + 5, 185); + } + + + // 属性 + function RegisterPropertyItems() { + // 属性 + + local leftListX = 0; + local rightListX = 132; + local rowY = 213; + local rowH = 18; + + // 生命 + local life = roleInfoPropertyItem( 0, "生命", "100"); + Canvas.DrawSprite(life, leftListX, rowY); + // 魔法 + local magic = roleInfoPropertyItem( 1, "魔法", "100"); + Canvas.DrawSprite(magic, rightListX, rowY); + + rowY += rowH; + + // 物理防御力 + local physicalDefense = roleInfoPropertyItem(8, "物理防御力", "100", false); + Canvas.DrawSprite(physicalDefense, leftListX, rowY); + + // 魔法防御力 + local magicDefense = roleInfoPropertyItem( 9, "魔法防御力", "100"); + Canvas.DrawSprite(magicDefense, rightListX, rowY); + + rowY += rowH; + + // 力量 + local strength = roleInfoPropertyItem( 2, "力量", "100"); + Canvas.DrawSprite(strength, leftListX, rowY); + // 智力 + local intelligence = roleInfoPropertyItem( 3, "智力", "100"); + Canvas.DrawSprite(intelligence, rightListX, rowY); + + rowY += rowH; + + // 体力 + local vitality = roleInfoPropertyItem( 4, "体力", "100"); + Canvas.DrawSprite(vitality, leftListX, rowY); + // 精神 + local spirit = roleInfoPropertyItem( 5, "精神", "100"); + Canvas.DrawSprite(spirit, rightListX, rowY); + + rowY += rowH; + + // 物理攻击力 + local physicalATK = roleInfoPropertyItem( 6, "物理攻击力", "100"); + Canvas.DrawSprite(physicalATK, leftListX, rowY); + // 魔法攻击力 + local magicATK = roleInfoPropertyItem( 7, "魔法攻击力", "100"); + Canvas.DrawSprite(magicATK, rightListX, rowY); + + rowY += rowH; + + // 物理暴击 + local physicalCrit = roleInfoPropertyItem( 10, "物理暴击", "100"); + Canvas.DrawSprite(physicalCrit, leftListX, rowY); + // 魔法暴击 + local magicCrit = roleInfoPropertyItem( 11, "魔法暴击", "100"); + Canvas.DrawSprite(magicCrit, rightListX, rowY); + + + rowY += rowH; + + // 独立攻击 + local independentAttack = roleInfoPropertyItem( 12, "独立攻击", "100"); + Canvas.DrawSprite(independentAttack, leftListX, rowY); + + rowY += rowH; + + // 攻击速度 + local attackSpeed = roleInfoPropertyItem(13, "攻击速度", "100"); + Canvas.DrawSprite(attackSpeed, leftListX, rowY); + + // 释放速度 + local releaseSpeed = roleInfoPropertyItem( 14, "释放速度", "100"); + Canvas.DrawSprite(releaseSpeed, rightListX, rowY); + + rowY += rowH; + + // 移动速度 + local moveSpeed = roleInfoPropertyItem( 15, "移动速度", "100"); + Canvas.DrawSprite(moveSpeed, leftListX, rowY); + + rowY += rowH; + + // 攻击属性 + local attackProperty = roleInfoPropertyItem(16, "攻击属性", "火(0)/冰(0)/光(0)/暗(0)", true, 260); + Canvas.DrawSprite(attackProperty, leftListX, rowY); + } + + + // 底部四个按钮 + 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 CL_CanvasObject { + + // additionReaction 属性是否有加成 加成为绿色 不加成灰色 + constructor(idx, title, numText, additionReaction = true, width = 125) { + local w = width; + local h = 18; + base.constructor(); + + // 重设大小并清空 + ResizeAndClear(w, 18); + // 开始绘制 + 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); + local iconRight = iconX + icon.GetSize().w; + DrawSpriteFrame(icon, iconX, h/ 2 - icon.GetSize().h / 2); + + + // 属性名称 + local property = FontAssetManager.GenerateNormal(title, true, { + color = titlecolor + }); + DrawActor(property, iconRight + 5, 0); + + // 属性数值 + local propertyNum = FontAssetManager.GenerateNormal(numText, true, { + color = numColor + }); + local numX = w - propertyNum.GetSize().w; + DrawActor(propertyNum, numX, 0); + + // 结束绘制 + EndDraw(); + } + +} + + +// 其他面板按钮 +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); + + 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"; + 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){ + icon.SetPosition( iconX , iconY + 1 ); + }else{ + icon.SetPosition( iconX , iconY ); + } + } + + +} + + + + + +// 上半部分 人物装备穿戴 +class Personalinfo_CharactersEquipment extends CL_CanvasObject { + + // 展示其他装备 + showOtherEquipment = null; + // 允许更换装备 + allowChangeEquipment = null; + // // 画布 + // Canvas = null; + + constructor() { + local w = 248; + local h = 179; + base.constructor(); + + showOtherEquipment = true; + allowChangeEquipment = false; + + // 创建画布 + CL_CanvasObject(); + // 重设大小并清空 + ResizeAndClear(w, h); + // 设置填充画刷 用于绘制边框和线条 + // Canvas.SetFillBrush(sq_RGBA(59, 56, 57, 250)); + // 设置轮廓画刷 用于绘制边框和线条 + // Canvas.SetStrokeBrush(sq_RGBA(59, 56, 57, 250)); + // 开始绘制 + BeginDraw(); + + // 绘制背景 + DrawBackground(w); + + // 结束绘制 + EndDraw(); + } + + + // 背景 + function DrawBackground(Width) { + + // 装备栏背景 + 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); + + // todo 角色展示 + + // 结婚戒指槽位 + local ringSlotBg = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory_cn.img", 0); + DrawSpriteFrame(ringSlotBg, Width / 2 - ringSlotBg.GetSize().w / 2, 5); + + // todo 根据是否装备 显示装备 + if (showOtherEquipment) { + // 辅助装备 + 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 { +// //遍历窗口队列 如果可见则调用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/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 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