UI
This commit is contained in:
parent
9d97844bea
commit
897bd97fe4
@ -24,26 +24,26 @@ function BagMainUI:onLoadRootComplete()
|
||||
|
||||
self.titleTx = uiMap["bag_main_ui.bg.title_tx"]
|
||||
self.btnTxs = {I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4), I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_16)}
|
||||
self.pageBtns = {}
|
||||
self.pageBtnTxs = {}
|
||||
self.pageBtnLocks = {}
|
||||
self.pageRedImgs = {}
|
||||
for i = 1, 2 do
|
||||
self.pageBtns[i] = uiMap["bag_main_ui.bg.btns.page_btn_" .. i]
|
||||
self.pageBtnTxs[i] = uiMap["bag_main_ui.bg.btns.page_btn_" .. i .. ".text"]
|
||||
self.pageBtnLocks[i] = uiMap["bag_main_ui.bg.btns.page_btn_" .. i .. ".lock_img"]
|
||||
self.pageRedImgs[i] = uiMap["bag_main_ui.red_node.red_img_" .. i]
|
||||
-- if self.pageBtnLocks[i] then
|
||||
-- self.pageBtnLocks[i]:setActive(not self:getIsOpen(i))
|
||||
-- self.pageBtns = {}
|
||||
-- self.pageBtnTxs = {}
|
||||
-- self.pageBtnLocks = {}
|
||||
-- self.pageRedImgs = {}
|
||||
-- for i = 1, 2 do
|
||||
-- self.pageBtns[i] = uiMap["bag_main_ui.bg.btns.page_btn_" .. i]
|
||||
-- self.pageBtnTxs[i] = uiMap["bag_main_ui.bg.btns.page_btn_" .. i .. ".text"]
|
||||
-- self.pageBtnLocks[i] = uiMap["bag_main_ui.bg.btns.page_btn_" .. i .. ".lock_img"]
|
||||
-- self.pageRedImgs[i] = uiMap["bag_main_ui.red_node.red_img_" .. i]
|
||||
-- -- if self.pageBtnLocks[i] then
|
||||
-- -- self.pageBtnLocks[i]:setActive(not self:getIsOpen(i))
|
||||
-- -- end
|
||||
-- self.pageBtns[i] :addClickListener(function()
|
||||
-- if not self:getIsOpen(i) or self.page == i then
|
||||
-- return
|
||||
-- end
|
||||
-- self.page = i
|
||||
-- self:onRefresh()
|
||||
-- end)
|
||||
-- end
|
||||
self.pageBtns[i] :addClickListener(function()
|
||||
if not self:getIsOpen(i) or self.page == i then
|
||||
return
|
||||
end
|
||||
self.page = i
|
||||
self:onRefresh()
|
||||
end)
|
||||
end
|
||||
|
||||
self.scrollrect = uiMap["bag_main_ui.bg.scrollrect"]
|
||||
self.scrollRectComp = uiMap["bag_main_ui.bg.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
|
||||
@ -65,7 +65,7 @@ end
|
||||
|
||||
function BagMainUI:onRefresh()
|
||||
self:initList()
|
||||
self:refreshPageBtn()
|
||||
-- self:refreshPageBtn()
|
||||
self:refreshScrollrect()
|
||||
|
||||
self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.BAG_DESC_1))
|
||||
@ -76,20 +76,20 @@ function BagMainUI:initList()
|
||||
end
|
||||
|
||||
-- 刷新标签红点
|
||||
function BagMainUI:refreshPageBtn()
|
||||
for i = 1, 2 do
|
||||
self.pageBtns[i]:setActive(false)
|
||||
if self.page == i then
|
||||
self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.COMMON, "common_tab_1")
|
||||
self.pageBtnTxs[i]:setText(self.btnTxs[i])
|
||||
else
|
||||
self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.COMMON, "common_tab_2")
|
||||
self.pageBtnTxs[i]:setText("<color=#72778C>" .. self.btnTxs[i] .. "</color>")
|
||||
end
|
||||
-- self.pageRedImgs[i]:setActive(self.heroEntity:showRedPoint(i))
|
||||
self.pageRedImgs[i]:setActive(false)
|
||||
end
|
||||
end
|
||||
-- function BagMainUI:refreshPageBtn()
|
||||
-- for i = 1, 2 do
|
||||
-- self.pageBtns[i]:setActive(false)
|
||||
-- if self.page == i then
|
||||
-- self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.COMMON, "common_tab_1")
|
||||
-- self.pageBtnTxs[i]:setText(self.btnTxs[i])
|
||||
-- else
|
||||
-- self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.COMMON, "common_tab_2")
|
||||
-- self.pageBtnTxs[i]:setText("<color=#72778C>" .. self.btnTxs[i] .. "</color>")
|
||||
-- end
|
||||
-- -- self.pageRedImgs[i]:setActive(self.heroEntity:showRedPoint(i))
|
||||
-- self.pageRedImgs[i]:setActive(false)
|
||||
-- end
|
||||
-- end
|
||||
|
||||
function BagMainUI:refreshScrollrect()
|
||||
self.scrollRectComp:refillCells(#self.list)
|
||||
|
||||
@ -141,7 +141,7 @@ function HeroCell:_refresh(id, isGray)
|
||||
self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position])
|
||||
self.check:setVisible(false)
|
||||
self:refreshHeroIcon(heroInfo.icon)
|
||||
self:setGray(isGray)
|
||||
-- self:setGray(isGray)
|
||||
self.nameTx:setText(ModuleManager.HeroManager:getHeroName(id))
|
||||
end
|
||||
|
||||
@ -162,12 +162,12 @@ function HeroCell:setSpineVisible(visible, scale)
|
||||
end
|
||||
|
||||
function HeroCell:setGray(isGray)
|
||||
if self.isGray == isGray then
|
||||
return
|
||||
end
|
||||
self.isGray = isGray
|
||||
self.icon:setImageGray(isGray)
|
||||
self.matchImg:setImageGray(isGray)
|
||||
-- if self.isGray == isGray then
|
||||
-- return
|
||||
-- end
|
||||
-- self.isGray = isGray
|
||||
-- self.icon:setImageGray(isGray)
|
||||
-- self.matchImg:setImageGray(isGray)
|
||||
end
|
||||
|
||||
return HeroCell
|
||||
|
||||
@ -52,9 +52,7 @@ function CommonBoxUI:onLoadRootComplete()
|
||||
self.btnClose = uiMap["common_box_ui.content.btn_close"]
|
||||
self.rewardCell = uiMap["common_box_ui.content.info_node.reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
|
||||
self.txName = uiMap["common_box_ui.content.info_node.tx_name"]
|
||||
self.txType = uiMap["common_box_ui.content.info_node.tx_type"]
|
||||
self.txCount = uiMap["common_box_ui.content.info_node.tx_count"]
|
||||
self.txDesc = uiMap["common_box_ui.content.desc.tx_desc"]
|
||||
self.txDesc = uiMap["common_box_ui.content.info_node.tx_desc"]
|
||||
self.scrollrect = uiMap["common_box_ui.content.scrollrect"]
|
||||
self.selectNode = uiMap["common_box_ui.content.select"]
|
||||
self.txSelect = uiMap["common_box_ui.content.select.tx_select"]
|
||||
@ -113,8 +111,8 @@ end
|
||||
function CommonBoxUI:onRefresh()
|
||||
self.rewardCell:refreshById(self.id)
|
||||
self.txName:setText(ModuleManager.ItemManager:getItemName(self.id))
|
||||
self.txType:setText(I18N:getGlobalText(I18N.GlobalConst["ITEM_TYPE_" .. ModuleManager.ItemManager:getItemType(self.id)]))
|
||||
self.txCount:setText(I18N:getGlobalText(I18N.GlobalConst.ITEM_DESC_1, self.maxCount))
|
||||
-- self.txType:setText(I18N:getGlobalText(I18N.GlobalConst["ITEM_TYPE_" .. ModuleManager.ItemManager:getItemType(self.id)]))
|
||||
-- self.txCount:setText(I18N:getGlobalText(I18N.GlobalConst.ITEM_DESC_1, self.maxCount))
|
||||
self.txDesc:setText(ModuleManager.ItemManager:getItemDesc(self.id))
|
||||
|
||||
self.txSelect:setText(self.curCount)
|
||||
@ -152,12 +150,12 @@ function CommonBoxUI:onRefresh()
|
||||
-- 展示宝箱tips
|
||||
self.selectNode:setActive(false)
|
||||
self.btnUse:setActive(false)
|
||||
self.contentNode:setSizeDeltaY(580)
|
||||
self.contentNode:setSizeDeltaY(620)
|
||||
else
|
||||
-- 展示宝箱开奖励
|
||||
self.selectNode:setActive(true)
|
||||
self.btnUse:setActive(true)
|
||||
self.contentNode:setSizeDeltaY(728)
|
||||
self.contentNode:setSizeDeltaY(768)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -42,15 +42,15 @@ function MainComp:init()
|
||||
self.heroNodeList = {}
|
||||
for i = 1, 5 do
|
||||
self.heroNodeList[i] = uiMap["main_comp.formation.hero_" .. i]
|
||||
self.heroNodeList[i]:addClickListener(function()
|
||||
local heroId = self.curFormation[i]
|
||||
if heroId then
|
||||
local hero = DataManager.HeroData:getHeroById(heroId)
|
||||
if hero then
|
||||
ModuleManager.HeroManager:showHeroDetailUI(heroId, nil, nil, GConst.BattleConst.FORMATION_TYPE.STAGE)
|
||||
end
|
||||
end
|
||||
end)
|
||||
-- self.heroNodeList[i]:addClickListener(function()
|
||||
-- local heroId = self.curFormation[i]
|
||||
-- if heroId then
|
||||
-- local hero = DataManager.HeroData:getHeroById(heroId)
|
||||
-- if hero then
|
||||
-- ModuleManager.HeroManager:showHeroDetailUI(heroId, nil, nil, GConst.BattleConst.FORMATION_TYPE.STAGE)
|
||||
-- end
|
||||
-- end
|
||||
-- end)
|
||||
end
|
||||
|
||||
self.chapterMiddleBg = uiMap["main_comp.middle_bg"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user