礼包资源上传、bug_fix

This commit is contained in:
Fang 2023-07-24 15:13:21 +08:00
parent fddf41fca5
commit 8ad4b580e0
3 changed files with 43 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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)