From 8ad4b580e019728c3e16df2240c988ca7602f55c Mon Sep 17 00:00:00 2001 From: Fang Date: Mon, 24 Jul 2023 15:13:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=A4=BC=E5=8C=85=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E3=80=81bug=5Ffix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/hero/armor_info_comp.lua | 11 +++++++++++ lua/app/ui/hero/weapon_info_comp.lua | 11 +++++++++++ lua/app/ui/shop/gift_pop_ui.lua | 25 +++++++++++++++++++++---- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/lua/app/ui/hero/armor_info_comp.lua b/lua/app/ui/hero/armor_info_comp.lua index 8b81810d..5b80beba 100644 --- a/lua/app/ui/hero/armor_info_comp.lua +++ b/lua/app/ui/hero/armor_info_comp.lua @@ -138,6 +138,7 @@ function ArmorInfoComp:refreshSelectArmor() costNode:setActive(true) local icon = uiMap["armor_info.upgrade.cost.cost_" .. i .. ".img_icon"] local num = uiMap["armor_info.upgrade.cost.cost_" .. i .. ".tx_num"] + local add = uiMap["armor_info.upgrade.cost.cost_" .. i .. ".img_icon.img_add"] local costId = GFunc.getRewardId(cost[i]) local costNum = GFunc.getRewardNum(cost[i]) @@ -151,6 +152,16 @@ function ArmorInfoComp:refreshSelectArmor() icon:setSprite(atlas, name, function () icon:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):SetNativeSize() end) + if costNum - haveNum > 0 then + add:setActive(true) + icon:setTouchEnable(true) + else + add:setActive(false) + icon:setTouchEnable(false) + end + icon:addClickListener(function() + UIManager:showUI("app/ui/dungeon/item_get_ui", {id = costId, value = costNum - haveNum}) + end) else costNode:setActive(false) end diff --git a/lua/app/ui/hero/weapon_info_comp.lua b/lua/app/ui/hero/weapon_info_comp.lua index 94d5f665..2d200319 100644 --- a/lua/app/ui/hero/weapon_info_comp.lua +++ b/lua/app/ui/hero/weapon_info_comp.lua @@ -97,6 +97,7 @@ function WeaponInfoComp:refresh() costNode:setActive(true) local icon = uiMap["weapon_info.upgrade.cost.cost_" .. i .. ".img_icon"] local num = uiMap["weapon_info.upgrade.cost.cost_" .. i .. ".tx_num"] + local add = uiMap["weapon_info.upgrade.cost.cost_" .. i .. ".img_icon.img_add"] local costId = GFunc.getRewardId(cost[i]) local costNum = GFunc.getRewardNum(cost[i]) @@ -110,6 +111,16 @@ function WeaponInfoComp:refresh() icon:setSprite(atlas, name, function () icon:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):SetNativeSize() end) + if costNum - haveNum > 0 then + add:setActive(true) + icon:setTouchEnable(true) + else + add:setActive(false) + icon:setTouchEnable(false) + end + icon:addClickListener(function() + UIManager:showUI("app/ui/dungeon/item_get_ui", {id = costId, value = costNum - haveNum}) + end) else costNode:setActive(false) end diff --git a/lua/app/ui/shop/gift_pop_ui.lua b/lua/app/ui/shop/gift_pop_ui.lua index b0b2bce7..7157019f 100644 --- a/lua/app/ui/shop/gift_pop_ui.lua +++ b/lua/app/ui/shop/gift_pop_ui.lua @@ -1,17 +1,31 @@ local GiftPopUI = class("GiftPopUI", BaseUI) local GIFT_BG_NAME = { + [PayManager.PURCHARSE_TYPE.ACT_GIFT] = { + [PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = "assets/arts/textures/background/shop/shop_gift_bg_1.png", + [PayManager.PURCHARSE_ACT_TYPE.BEGINNER_GIFT] = "assets/arts/textures/background/shop/shop_gift_bg_1.png", + [PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT] = "assets/arts/textures/background/shop/shop_gift_bg_1.png", + [PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = "assets/arts/textures/background/shop/shop_gift_bg_1.png", + [PayManager.PURCHARSE_ACT_TYPE.WEAPON_GIFT] = "assets/arts/textures/background/shop/shop_gift_bg_2.png", + [PayManager.PURCHARSE_ACT_TYPE.ARMOR_GIFT] = "assets/arts/textures/background/shop/shop_gift_bg_2.png", + }, + [PayManager.PURCHARSE_TYPE.CHAPTER_GIFT] = "assets/arts/textures/background/shop/shop_gift_bg_1.png", + [PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW] = "assets/arts/textures/background/shop/shop_gift_bg_1.png", +} + +local GIFT_BG_BANNER_NAME = { [PayManager.PURCHARSE_TYPE.ACT_GIFT] = { [PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = "assets/arts/textures/background/shop/shop_gift_banner_1_1.png", [PayManager.PURCHARSE_ACT_TYPE.BEGINNER_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_3_1.png", [PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_4_1.png", [PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_6_1.png", - [PayManager.PURCHARSE_ACT_TYPE.WEAPON_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_6_1.png", - [PayManager.PURCHARSE_ACT_TYPE.ARMOR_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_6_1.png", + [PayManager.PURCHARSE_ACT_TYPE.WEAPON_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_7_2.png", + [PayManager.PURCHARSE_ACT_TYPE.ARMOR_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_8_2.png", }, [PayManager.PURCHARSE_TYPE.CHAPTER_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_2_1.png", [PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW] = "assets/arts/textures/background/shop/shop_gift_banner_5_1.png", } + local GIFT_TITLE_TEXT = { [PayManager.PURCHARSE_TYPE.ACT_GIFT] = { [PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = I18N.GlobalConst.SHOP_DESC_9, @@ -60,6 +74,7 @@ function GiftPopUI:onLoadRootComplete() self.titleTx = self.uiMap["gift_pop_ui.bg.title"] self.banner = self.uiMap["gift_pop_ui.bg.banner"] + self.bg = self.uiMap["gift_pop_ui.bg"] self.offNode = self.uiMap["gift_pop_ui.bg.off_img"] self.offText = self.uiMap["gift_pop_ui.bg.off_img.text"] @@ -106,10 +121,12 @@ function GiftPopUI:refresh(needCheck) if self.actType == PayManager.PURCHARSE_TYPE.ACT_GIFT then local type = PayManager:getGiftConfigInfo(self.actType, self.actId).type self.titleTx:setText(I18N:getGlobalText(GIFT_TITLE_TEXT[self.actType][type])) - self.banner:setTexture(GIFT_BG_NAME[self.actType][type]) + self.banner:setTexture(GIFT_BG_BANNER_NAME[self.actType][type]) + self.bg:setTexture(GIFT_BG_NAME[self.actType][type]) else self.titleTx:setText(I18N:getGlobalText(GIFT_TITLE_TEXT[self.actType])) - self.banner:setTexture(GIFT_BG_NAME[self.actType]) + self.banner:setTexture(GIFT_BG_BANNER_NAME[self.actType]) + self.bg:setTexture(GIFT_BG_NAME[self.actType]) end local cfgInfo = PayManager:getGiftConfigInfo(self.actType, self.actId) From fd863d414c6f851bf2bfba3887158ef4fec26d4c Mon Sep 17 00:00:00 2001 From: Fang Date: Mon, 24 Jul 2023 15:57:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=81=93=E5=85=B7=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=89=AB=E8=8D=A1=E6=96=87=E6=A1=88=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/common/mop_up_ui.lua | 4 +++- lua/app/ui/hero/armor_info_comp.lua | 10 ++-------- lua/app/ui/hero/weapon_info_comp.lua | 10 ++-------- lua/app/ui/shop/shop_comp.lua | 2 ++ 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/lua/app/ui/common/mop_up_ui.lua b/lua/app/ui/common/mop_up_ui.lua index 110e5bcb..eeb02ab9 100644 --- a/lua/app/ui/common/mop_up_ui.lua +++ b/lua/app/ui/common/mop_up_ui.lua @@ -88,14 +88,16 @@ function MopUpUI:refreshTarget() self.rewardCell:refreshItemById(self.target.id) self.rewardCell:hideCountTx() - uiMap["mop_up_ui.bg.item_node.desc_1"]:setText(GFunc.getRewardName(GConst.REWARD_TYPE.ITEM, self.target.id)) local curProgress = DataManager.BagData.ItemData:getItemNumById(self.target.id) or 0 + local itemNameTx = GFunc.getRewardName(GConst.REWARD_TYPE.ITEM, self.target.id) local progressTx if curProgress >= self.target.value then progressTx = string.format("%s/%s", curProgress, self.target.value) else + itemNameTx = itemName .. "(" .. I18N:getGlobalText(I18N.GlobalConst.MOP_UP_DESC_3) .. ")" progressTx = string.format("%s/%s", curProgress, self.target.value) end + uiMap["mop_up_ui.bg.item_node.desc_1"]:setText(itemNameTx) uiMap["mop_up_ui.bg.item_node.desc_2"]:setText(progressTx) uiMap["mop_up_ui.bg.item_node.progress_slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = curProgress / self.target.value end diff --git a/lua/app/ui/hero/armor_info_comp.lua b/lua/app/ui/hero/armor_info_comp.lua index 5b80beba..4c5f6bce 100644 --- a/lua/app/ui/hero/armor_info_comp.lua +++ b/lua/app/ui/hero/armor_info_comp.lua @@ -152,15 +152,9 @@ function ArmorInfoComp:refreshSelectArmor() icon:setSprite(atlas, name, function () icon:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):SetNativeSize() end) - if costNum - haveNum > 0 then - add:setActive(true) - icon:setTouchEnable(true) - else - add:setActive(false) - icon:setTouchEnable(false) - end + add:setActive(costNum - haveNum > 0) icon:addClickListener(function() - UIManager:showUI("app/ui/dungeon/item_get_ui", {id = costId, value = costNum - haveNum}) + UIManager:showUI("app/ui/dungeon/item_get_ui", {id = costId, value = costNum - haveNum < 0 and 0 or costNum - haveNum}) end) else costNode:setActive(false) diff --git a/lua/app/ui/hero/weapon_info_comp.lua b/lua/app/ui/hero/weapon_info_comp.lua index 2d200319..30f105c8 100644 --- a/lua/app/ui/hero/weapon_info_comp.lua +++ b/lua/app/ui/hero/weapon_info_comp.lua @@ -111,15 +111,9 @@ function WeaponInfoComp:refresh() icon:setSprite(atlas, name, function () icon:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):SetNativeSize() end) - if costNum - haveNum > 0 then - add:setActive(true) - icon:setTouchEnable(true) - else - add:setActive(false) - icon:setTouchEnable(false) - end + add:setActive(costNum - haveNum > 0) icon:addClickListener(function() - UIManager:showUI("app/ui/dungeon/item_get_ui", {id = costId, value = costNum - haveNum}) + UIManager:showUI("app/ui/dungeon/item_get_ui", {id = costId, value = costNum - haveNum < 0 and 0 or costNum - haveNum}) end) else costNode:setActive(false) diff --git a/lua/app/ui/shop/shop_comp.lua b/lua/app/ui/shop/shop_comp.lua index 1c2b787e..e7b66a13 100644 --- a/lua/app/ui/shop/shop_comp.lua +++ b/lua/app/ui/shop/shop_comp.lua @@ -17,6 +17,8 @@ local PAGE_DISCOUNT_LEVEL_SELL_CELL = "app/ui/shop/cell/level_sell_cell" -- 助 local PAGE_DISCOUNT_GROW_SELL_CELL = "app/ui/shop/cell/grow_sell_cell" -- 成长 local PAGE_DISCOUNT_COIN_SELL_CELL = "app/ui/shop/cell/coin_sell_cell" -- 金币 local PAGE_DISCOUNT_ARENA_SELL_CELL = "app/ui/shop/cell/arena_gift_sell_cell" -- 竞技场 +local PAGE_DISCOUNT_WEAPON_SELL_CELL = "app/ui/shop/cell/weapon_gift_sell_cell" -- 武器 +local PAGE_DISCOUNT_ARMOR_SELL_CELL = "app/ui/shop/cell/armor_gift_sell_cell" -- 防具 function ShopComp:init() self.uiMap = self.baseObject:genAllChildren()