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