界面调整

This commit is contained in:
xiekaidong 2023-07-21 16:15:25 +08:00
parent dbbfbf4842
commit ff21cd5b2b
4 changed files with 36 additions and 19 deletions

View File

@ -228,9 +228,9 @@ function BattleArmorResultUI:refreshUnitInfo()
local desc, over = armorData:getTaskDescByIndex(chapterId, index, nil, taskProgrees) local desc, over = armorData:getTaskDescByIndex(chapterId, index, nil, taskProgrees)
starDesc:setText(desc) starDesc:setText(desc)
if over then if over then
star:setSprite(GConst.ATLAS_PATH.COMMON, "common_star_1") star:setSprite(GConst.ATLAS_PATH.BATTLE, "battle_star_1")
else else
star:setSprite(GConst.ATLAS_PATH.COMMON, "common_star_2") star:setSprite(GConst.ATLAS_PATH.BATTLE, "battle_star_2")
end end
local h = starDesc:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredHeight local h = starDesc:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredHeight

View File

@ -451,11 +451,13 @@ function BattleUI:refreshTaskBtn()
local uiMap = self.root:genAllChildren() local uiMap = self.root:genAllChildren()
local taskBtn = uiMap["battle_ui.top_node.task_btn"] local taskBtn = uiMap["battle_ui.top_node.task_btn"]
if self.battleController.battleType == GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE then if self.battleController.battleType == GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE then
taskBtn:setSprite(GConst.ATLAS_PATH.BATTLE, "battle_btn_task")
taskBtn:setActive(true) taskBtn:setActive(true)
taskBtn:addClickListener(function() taskBtn:addClickListener(function()
ModuleManager.DailyChallengeManager:showBattleTaskUI() ModuleManager.DailyChallengeManager:showBattleTaskUI()
end) end)
elseif self.battleController.battleType == GConst.BattleConst.BATTLE_TYPE.DUNGEON_ARMOR then elseif self.battleController.battleType == GConst.BattleConst.BATTLE_TYPE.DUNGEON_ARMOR then
taskBtn:setSprite(GConst.ATLAS_PATH.BATTLE, "battle_btn_task_2")
taskBtn:setActive(true) taskBtn:setActive(true)
taskBtn:addClickListener(function() taskBtn:addClickListener(function()
ModuleManager.DungeonArmorManager:showBattleTaskUI() ModuleManager.DungeonArmorManager:showBattleTaskUI()

View File

@ -6,18 +6,15 @@ function ChapterCell:refresh(id)
local bg1 = uiMap["chapter_cell.bg_1"] local bg1 = uiMap["chapter_cell.bg_1"]
local bg2 = uiMap["chapter_cell.bg_2"] local bg2 = uiMap["chapter_cell.bg_2"]
local touchNode = uiMap["chapter_cell.touch_node"] local touchNode = uiMap["chapter_cell.touch_node"]
local lockInfo = uiMap["chapter_cell.cloud.lock_info"]
if index % 2 ~= 0 then -- 奇数 if index % 2 ~= 0 then -- 奇数
bg1:setVisible(true) bg1:setVisible(true)
bg2:setVisible(false) bg2:setVisible(false)
touchNode:setAnchoredPositionX(-125) touchNode:setAnchoredPositionX(-125)
lockInfo:setAnchoredPositionX(-125)
else else
bg1:setVisible(false) bg1:setVisible(false)
bg2:setVisible(true) bg2:setVisible(true)
touchNode:setAnchoredPositionX(125) touchNode:setAnchoredPositionX(125)
lockInfo:setAnchoredPositionX(125)
end end
local config = ConfigManager:getConfig("chapter_dungeon_armor")[id] local config = ConfigManager:getConfig("chapter_dungeon_armor")[id]
@ -100,19 +97,6 @@ function ChapterCell:refresh(id)
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.PASS_REQUIRE)) GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.PASS_REQUIRE))
end) end)
end end
local cloud = uiMap["chapter_cell.cloud"]
local unlock, p, needP = armorData:getStagePassEnough(id)
if unlock then
cloud:setVisible(false)
else
cloud:setVisible(true)
p = p or 0
needP = needP or 1
uiMap["chapter_cell.cloud.lock_info.p_slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = p / needP
uiMap["chapter_cell.cloud.lock_info.desc_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_10, needP))
uiMap["chapter_cell.cloud.lock_info.desc_2"]:setText(p .. "/" .. needP)
end
end end
return ChapterCell return ChapterCell

View File

@ -23,6 +23,7 @@ function DungeonArmorMainUI:ctor()
self.armorData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_ARMOR) self.armorData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_ARMOR)
self.chapterList = {} self.chapterList = {}
self.targetId = self.armorData:getPassedMaxId() self.targetId = self.armorData:getPassedMaxId()
self.unlockId = nil
for id, info in pairs(ConfigManager:getConfig("chapter_dungeon_armor")) do for id, info in pairs(ConfigManager:getConfig("chapter_dungeon_armor")) do
table.insert(self.chapterList, id) table.insert(self.chapterList, id)
if not self.targetId then if not self.targetId then
@ -33,7 +34,8 @@ function DungeonArmorMainUI:ctor()
self.targetId = id self.targetId = id
end end
if not self.armorData:getStagePassEnough(id) then if (id - 1) > 0 and not self.armorData:getStagePassEnough(id - 1) then -- 显示两个未解锁的
self.unlockId = id - 1
break break
end end
end end
@ -127,6 +129,7 @@ function DungeonArmorMainUI:refreshScrollrect()
end) end)
end end
self.scrollRect:refillCells(#self.chapterList, nil, self.targetId) self.scrollRect:refillCells(#self.chapterList, nil, self.targetId)
self:refreshCloud(self.unlockId)
end end
function DungeonArmorMainUI:refreshFormation() function DungeonArmorMainUI:refreshFormation()
@ -218,4 +221,32 @@ function DungeonArmorMainUI:refreshBG(chapterId, index)
end end
end end
function DungeonArmorMainUI:refreshCloud(id)
local uiMap = self.root:genAllChildren()
local cloud = uiMap["dungeon_armor_main_ui.scrollrect.viewport.content.cloud"]
if not id then
cloud:setVisible(false)
return
end
cloud:setVisible(true)
local unlock, p, needP = self.armorData:getStagePassEnough(id)
if unlock then
cloud:setVisible(false)
else
cloud:setVisible(true)
uiMap["dungeon_armor_main_ui.scrollrect.viewport.content.cloud.mask"]:addClickListener(function()
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_10, needP))
end)
p = p or 0
needP = needP or 1
uiMap["dungeon_armor_main_ui.scrollrect.viewport.content.cloud.lock_info.p_slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = p / needP
uiMap["dungeon_armor_main_ui.scrollrect.viewport.content.cloud.lock_info.desc_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_10, needP))
uiMap["dungeon_armor_main_ui.scrollrect.viewport.content.cloud.lock_info.desc_2"]:setText(p .. "/" .. needP)
-- 位置
local zheng = id // 6
cloud:setAnchoredPositionY(1200 * zheng + 100)
end
end
return DungeonArmorMainUI return DungeonArmorMainUI