From 5e18ddccd0eee9deec0970c653c8de3342f66f73 Mon Sep 17 00:00:00 2001 From: WONIU Date: Tue, 7 Jan 2025 20:31:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sqr/Core/UI_Class/UI_Widget.nut | 18 +++++++++++------- .../5_Inventory/Inventory_EquipmentPage.nut | 6 ++++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/sqr/Core/UI_Class/UI_Widget.nut b/sqr/Core/UI_Class/UI_Widget.nut index e84862d..b97ddf3 100644 --- a/sqr/Core/UI_Class/UI_Widget.nut +++ b/sqr/Core/UI_Class/UI_Widget.nut @@ -598,17 +598,21 @@ class Yosin_RowMoreTitleBtn extends Yosin_CommonUi { // 进度显示 class Yosin_Schedule extends Yosin_CommonUi { - constructor(X, Y, W, H, path, idx) { + // schedule 进度比例0-1 + constructor(X, Y, W, H, path, idx, schedulePercent) { base.constructor(X, Y, W, H); - local schedule = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 164); - schedule.SetPosition(0, 0); + local schedule = CL_SpriteObject(path, idx + 1); + Addchild(schedule); - AddUIChild(schedule); + local scheduleBar = CL_SpriteObject(path, idx); + Addchild(scheduleBar); - local scheduleBar = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 165); - scheduleBar.SetPosition(1, 1); - AddUIChild(scheduleBar); + local barSize = scheduleBar.GetSize(); + local barW = barSize.w * schedulePercent; + + scheduleBar.SetCropRect(X, Y, barW, 5); + scheduleBar.SetSize( barW , 5); } diff --git a/sqr/User/UI/Window/5_Inventory/Inventory_EquipmentPage.nut b/sqr/User/UI/Window/5_Inventory/Inventory_EquipmentPage.nut index 24b164e..aa3460b 100644 --- a/sqr/User/UI/Window/5_Inventory/Inventory_EquipmentPage.nut +++ b/sqr/User/UI/Window/5_Inventory/Inventory_EquipmentPage.nut @@ -124,6 +124,12 @@ class InventoryItem extends Yosin_CommonUi { }); weight.SetPosition(itemCollection.X + 8, itemCollection.bottom() - 25); Addchild(weight); + + // 重量进度条 + local weightSchedule = Yosin_Schedule(weight.right() + 2, weight.Y + 4 , 125, 10, "sprite/interface/newstyle/windows/inventory/inventory.img", 1, 0.7); + Addchild(weightSchedule); + + } }