主界面
This commit is contained in:
parent
f47437d866
commit
6107c663e5
@ -1,20 +1,19 @@
|
||||
local MainCompBaseCell = require "app/ui/main_city/component/main_comp_base_cell"
|
||||
local DungeonComp = class("DungeonComp", MainCompBaseCell)
|
||||
local DungeonComp = class("DungeonComp", LuaComponent)
|
||||
|
||||
function DungeonComp:getIsOpen()
|
||||
return DataManager.DungeonData:isOpenAnyone()
|
||||
end
|
||||
-- function DungeonComp:getIsOpen()
|
||||
-- return DataManager.DungeonData:isOpenAnyone()
|
||||
-- end
|
||||
|
||||
function DungeonComp:getEntranceName()
|
||||
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_BTN)
|
||||
end
|
||||
-- function DungeonComp:getEntranceName()
|
||||
-- return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_BTN)
|
||||
-- end
|
||||
|
||||
function DungeonComp:getShowEntranceRedPoint()
|
||||
return DataManager.DungeonData:isCanChallengeAnyone()
|
||||
end
|
||||
-- function DungeonComp:getShowEntranceRedPoint()
|
||||
-- return DataManager.DungeonData:isCanChallengeAnyone()
|
||||
-- end
|
||||
|
||||
function DungeonComp:ctor()
|
||||
end
|
||||
-- function DungeonComp:ctor()
|
||||
-- end
|
||||
|
||||
function DungeonComp:init()
|
||||
self.uiMap = self:getBaseObject():genAllChildren()
|
||||
@ -28,13 +27,12 @@ function DungeonComp:init()
|
||||
cell:refresh(self.openDungeons[index].module)
|
||||
end)
|
||||
self.scrollRectComp:setTotalCount(0)
|
||||
self:refreshShow()
|
||||
end
|
||||
|
||||
function DungeonComp:refreshShow(targetMuduleKey)
|
||||
function DungeonComp:refresh(targetMuduleKey)
|
||||
if EDITOR_MODE then
|
||||
Logger.logHighlight("更新副本显示."..tostring(Time:getTodaySurplusTime()))
|
||||
end
|
||||
Logger.logHighlight("更新副本显示."..tostring(Time:getTodaySurplusTime()))
|
||||
end
|
||||
self.openDungeons = DataManager.DungeonData:getOpenDungeons()
|
||||
local targetIndex
|
||||
if targetMuduleKey then
|
||||
@ -45,17 +43,17 @@ function DungeonComp:refreshShow(targetMuduleKey)
|
||||
end
|
||||
end
|
||||
end
|
||||
self.scrollRectComp:clearCells()
|
||||
self.scrollRectComp:clearCells()
|
||||
self.scrollRectComp:refillCells(#self.openDungeons, nil, targetIndex)
|
||||
|
||||
-- 跨天定时器
|
||||
if self.countdownSid then
|
||||
self:getBaseObject():unscheduleGlobal(self.countdownSid)
|
||||
self.countdownSid = nil
|
||||
end
|
||||
self:getBaseObject():unscheduleGlobal(self.countdownSid)
|
||||
self.countdownSid = nil
|
||||
end
|
||||
self.countdownSid = self:getBaseObject():scheduleGlobal(function()
|
||||
ModuleManager.DungeonManager:checkDayChange()
|
||||
end, Time:getTodaySurplusTime() + 1)
|
||||
ModuleManager.DungeonManager:checkDayChange()
|
||||
end, Time:getTodaySurplusTime() + 1)
|
||||
|
||||
end
|
||||
|
||||
@ -10,6 +10,7 @@ local BF_UI_HELPER = GConst.TYPEOF_UNITY_CLASS.BF_UI_HELPER
|
||||
local HERO_COMP = "app/ui/hero/hero_comp"
|
||||
local MAIN_COMP = "app/ui/main_city/component/main_comp"
|
||||
local SHOP_COMP = "app/ui/shop/shop_comp"
|
||||
local DUNGEON_COMP = "app/ui/dungeon/dungeon_comp"
|
||||
|
||||
local BOTTOM_BTN_CELL = "app/ui/main_city/cell/bottom_btn_cell"
|
||||
|
||||
@ -17,6 +18,8 @@ MainCityUI.CLICK_BTN_TYPE = {
|
||||
[1] = "HOME",
|
||||
[2] = "HERO",
|
||||
[3] = "SHOP",
|
||||
[4] = "DUNGEON",
|
||||
[5] = "DUNGEON",
|
||||
}
|
||||
|
||||
function MainCityUI:getUIType()
|
||||
@ -49,6 +52,10 @@ function MainCityUI:getCurrencyParams()
|
||||
self.currencyParams.itemIds[1] = GConst.ItemConst.ITEM_ID_GOLD
|
||||
self.currencyParams.itemIds[2] = GConst.ItemConst.ITEM_ID_GEM
|
||||
self.currencyParams.itemIds[3] = GConst.ItemConst.ITEM_ID_VIT
|
||||
elseif self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.DUNGEON then
|
||||
self.currencyParams.itemIds[1] = GConst.ItemConst.ITEM_ID_GOLD
|
||||
self.currencyParams.itemIds[2] = GConst.ItemConst.ITEM_ID_GEM
|
||||
self.currencyParams.itemIds[3] = GConst.ItemConst.ITEM_ID_VIT
|
||||
end
|
||||
return self.currencyParams
|
||||
end
|
||||
@ -73,8 +80,6 @@ end
|
||||
function MainCityUI:ctor(params)
|
||||
self.isFirstEnter = params and params.isFirstEnter
|
||||
self.targetIndex = params and params.targetIndex
|
||||
|
||||
print("当前 Lua 版本: ", _VERSION) -- 输出:Lua 5.1
|
||||
end
|
||||
|
||||
function MainCityUI:onLoadRootComplete()
|
||||
@ -300,6 +305,12 @@ function MainCityUI:initComp()
|
||||
shopComp:initPrefabHelper()
|
||||
shopComp:genAllChildren()
|
||||
self.subComps[GConst.MainCityConst.BOTTOM_PAGE.SHOP] = shopComp:addLuaComponent(SHOP_COMP)
|
||||
|
||||
-- 地牢
|
||||
local dungeonComp = uiMap["main_ui.sub_ui_node.dungeon_comp"]
|
||||
dungeonComp:initPrefabHelper()
|
||||
dungeonComp:genAllChildren()
|
||||
self.subComps[GConst.MainCityConst.BOTTOM_PAGE.DUNGEON] = dungeonComp:addLuaComponent(DUNGEON_COMP)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user