装备副本界面添加礼包入口

This commit is contained in:
Fang 2023-08-11 16:34:50 +08:00
parent eb566b7782
commit fde89edddb
2 changed files with 84 additions and 0 deletions

View File

@ -1,6 +1,7 @@
local DungeonArmorMainUI = class("DungeonArmorMainUI", BaseUI)
local CHAPTER_LAYER_CELL = "app/ui/dungeon_armor/cell/chapter_cell"
local GIFT_CELL = "app/ui/main_city/cell/side_bar_armor_gift_cell"
function DungeonArmorMainUI:getCurrencyParams()
if self.currencyParams == nil then
@ -48,6 +49,11 @@ function DungeonArmorMainUI:onLoadRootComplete()
self:_addListeners()
self:_bind()
DataManager.ShopData:checkPopGift(PayManager.PURCHARSE_ACT_TYPE.ARMOR_GIFT)
self:refreshTime()
self:scheduleGlobal(function()
self:refreshTime()
end, 1)
end
function DungeonArmorMainUI:_display()
@ -63,6 +69,7 @@ function DungeonArmorMainUI:_display()
self.btnFund:setActive(not GFunc.isShenhe())
self:refreshFund()
self:initRightBtns()
self:refreshScrollrect()
self:refreshFormation()
self:refreshStarNode()
@ -284,4 +291,39 @@ function DungeonArmorMainUI:refreshFund()
end
end
function DungeonArmorMainUI:refreshTime()
self:refreshRightBtns()
end
function DungeonArmorMainUI:initRightBtns()
if self.rightBtnCells then
return
end
local uiMap = self.root:genAllChildren()
self.rightNode = uiMap["dungeon_armor_main_ui.right_node"]
self.rightArrow = uiMap["dungeon_armor_main_ui.right_node.arrow_node"]
self.rightBtnCells = {}
self.rightBtnCells.giftCell = CellManager:addCellComp(uiMap["dungeon_armor_main_ui.right_node.side_bar.side_bar_cell"], GIFT_CELL)
self.rightArrow:setVisible(false)
self:refreshRightBtns()
end
function DungeonArmorMainUI:refreshRightBtns()
local y = 0
if self.rightBtnCells.giftCell:checkIsOpen() then
y = y - 60
self.rightBtnCells.giftCell:setActive(true)
self.rightBtnCells.giftCell:setVisible(true)
self.rightBtnCells.giftCell:getBaseObject():setAnchoredPositionY(y)
self.rightBtnCells.giftCell:refresh()
else
self.rightBtnCells.giftCell:setVisible(false)
end
-- 暂不处理箭头的问题
self.rightNode:setVisible(y < 0)
end
return DungeonArmorMainUI

View File

@ -1,6 +1,7 @@
local DungeonWeaponMainUI = class("DungeonWeaponMainUI", BaseUI)
local CHAPTER_LAYER_CELL = "app/ui/dungeon_weapon/cell/chapter_layer_cell"
local GIFT_CELL = "app/ui/main_city/cell/side_bar_weapon_gift_cell"
function DungeonWeaponMainUI:getCurrencyParams()
if self.currencyParams == nil then
@ -40,12 +41,18 @@ function DungeonWeaponMainUI:onLoadRootComplete()
self:_addListeners()
self:_bind()
DataManager.ShopData:checkPopGift(PayManager.PURCHARSE_ACT_TYPE.WEAPON_GIFT)
self:refreshTime()
self:scheduleGlobal(function()
self:refreshTime()
end, 1)
end
function DungeonWeaponMainUI:_display()
local uiMap = self.root:genAllChildren()
uiMap["dungeon_weapon_mian_ui.banner.btn_formation.tx_ok"]:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_4))
self:initRightBtns()
self:refreshScrollrect()
self:refreshFormation()
self:refreshRemianNode()
@ -115,4 +122,39 @@ function DungeonWeaponMainUI:refreshRemianNode()
GFunc.expandImgToFitTx(node, txt, 16.5)
end
function DungeonWeaponMainUI:refreshTime()
self:refreshRightBtns()
end
function DungeonWeaponMainUI:initRightBtns()
if self.rightBtnCells then
return
end
local uiMap = self.root:genAllChildren()
self.rightNode = uiMap["dungeon_weapon_mian_ui.right_node"]
self.rightArrow = uiMap["dungeon_weapon_mian_ui.right_node.arrow_node"]
self.rightBtnCells = {}
self.rightBtnCells.giftCell = CellManager:addCellComp(uiMap["dungeon_weapon_mian_ui.right_node.side_bar.side_bar_cell"], GIFT_CELL)
self.rightArrow:setVisible(false)
self:refreshRightBtns()
end
function DungeonWeaponMainUI:refreshRightBtns()
local y = 0
if self.rightBtnCells.giftCell:checkIsOpen() then
y = y - 60
self.rightBtnCells.giftCell:setActive(true)
self.rightBtnCells.giftCell:setVisible(true)
self.rightBtnCells.giftCell:getBaseObject():setAnchoredPositionY(y)
self.rightBtnCells.giftCell:refresh()
else
self.rightBtnCells.giftCell:setVisible(false)
end
-- 暂不处理箭头的问题
self.rightNode:setVisible(y < 0)
end
return DungeonWeaponMainUI