talent
This commit is contained in:
parent
7d4a361039
commit
afbe226434
@ -40,6 +40,7 @@ function DataManager:init()
|
||||
self:initManager("ActBossRushData", "app/userdata/activity/act_boss_rush/act_boss_rush_data")
|
||||
self:initManager("FourteenDayData", "app/userdata/activity/fourteen_day/fourteen_day_data")
|
||||
self:initManager("ActPvpData", "app/userdata/activity/act_pvp/act_pvp_data")
|
||||
self:initManager("TalentData", "app/userdata/talent/talent_data")
|
||||
end
|
||||
|
||||
function DataManager:initManager(name, path)
|
||||
|
||||
@ -87,6 +87,8 @@ local MODULE_PATHS = {
|
||||
DungeonRuneManager = "app/module/dungeon_rune/dungeon_rune_manager",
|
||||
-- 梦魇酒馆
|
||||
ActPvpManager = "app/module/activity/act_pvp/act_pvp_manager",
|
||||
-- 天赋
|
||||
TalentManager = "app/module/talent/talent_manager",
|
||||
}
|
||||
|
||||
-- 这里的key对应func_open里的id
|
||||
|
||||
@ -239,6 +239,7 @@ GConst.ATLAS_PATH = {
|
||||
ACT_COMMON = "assets/arts/atlas/ui/act_common.asset",
|
||||
UI_DUNGEON_RUNE = "assets/arts/atlas/ui/dungeon_rune.asset",
|
||||
UI_ACT_PVP = "assets/arts/atlas/ui/act_pvp.asset",
|
||||
UI_TALENT = "assets/arts/atlas/ui/talent.asset",
|
||||
}
|
||||
|
||||
GConst.TOUCH_EVENT = {
|
||||
|
||||
8
lua/app/module/talent.meta
Normal file
8
lua/app/module/talent.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8eea523f2a2fd4531b4e8b11a4f7ac7f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
68
lua/app/module/talent/talent_manager.lua
Normal file
68
lua/app/module/talent/talent_manager.lua
Normal file
@ -0,0 +1,68 @@
|
||||
local TalentManager = class("TalentManager", BaseModule)
|
||||
|
||||
function TalentManager:showMainUI()
|
||||
UIManager:showUI("app/ui/talent/talent_main_ui")
|
||||
end
|
||||
|
||||
-- function TalentManager:claimReward(index, isPro)
|
||||
-- local args = {
|
||||
-- level = index,
|
||||
-- is_pro = isPro,
|
||||
-- }
|
||||
-- self:sendMessage(ProtoMsgType.FromMsgEnum.BountyRewardReq, args, {}, self.onClaimReward, BIReport.ITEM_GET_TYPE.BOUNTY_REWARD)
|
||||
-- end
|
||||
|
||||
-- function TalentManager:onClaimReward(result)
|
||||
-- if result.err_code == GConst.ERROR_STR.SUCCESS then
|
||||
-- if result.rewards then
|
||||
-- -- 读表获取该层奖励 如果是箱子走单独奖励展示接口
|
||||
-- local isOneKeyGet = false
|
||||
-- local isSpecialBox = false
|
||||
-- local index = result.reqData.level
|
||||
-- local rewardId
|
||||
-- if index == 0 then -- 一键领取
|
||||
-- isOneKeyGet = true
|
||||
-- else
|
||||
-- local isPro = result.reqData.is_pro
|
||||
-- local info = DataManager.BountyData:getSeasonInfoByLevel(index)
|
||||
-- local rewardType
|
||||
-- if info then
|
||||
-- local reward = isPro and info.reward_pro or info.reward
|
||||
-- rewardType = reward and reward.type
|
||||
-- rewardId = reward and reward.id
|
||||
-- if rewardType == GConst.REWARD_TYPE.ITEM then
|
||||
-- local itemCfgInfo = ConfigManager:getConfig("item")[rewardId]
|
||||
-- if itemCfgInfo and itemCfgInfo.type == GConst.ItemConst.ITEM_TYPE.BOX then
|
||||
-- isSpecialBox = true
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
|
||||
-- if isSpecialBox and not isOneKeyGet then
|
||||
-- ModuleManager.ShopManager:showBoxOpenUI({type = GConst.ShopConst.BOX_REWARD_TYPE.BOUNTY, params = rewardId, rewards = result.rewards})
|
||||
-- local openType = BIReport.BOX_OPEN_OPEN_TYPE.BOUNTY
|
||||
-- BIReport:postBoxOpen(rewardId, BIReport.BOX_OPEN_BOX_TYPE.ACTIVITY, openType, 0, result.rewards)
|
||||
-- else
|
||||
-- GFunc.showRewardBox(result.rewards)
|
||||
-- end
|
||||
-- end
|
||||
-- if result.reqData.is_pro ~= nil then
|
||||
-- local BountyData = DataManager.BountyData
|
||||
-- local index = result.reqData.level
|
||||
-- if index ~= 0 then
|
||||
-- if result.reqData.is_pro then
|
||||
-- BountyData:onClaimProReward(result.reqData.level)
|
||||
-- else
|
||||
-- BountyData:onClaimReward(result.reqData.level)
|
||||
-- end
|
||||
-- else
|
||||
-- BountyData:onOneKeyClaimReward()
|
||||
-- end
|
||||
|
||||
-- BIReport:postBountyReward(BountyData:getBountyReportType(), BountyData:getLevel(), BountyData:getExp(), BountyData:getSeason(), result.reqData.level, result.reqData.is_pro)
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
|
||||
return TalentManager
|
||||
10
lua/app/module/talent/talent_manager.lua.meta
Normal file
10
lua/app/module/talent/talent_manager.lua.meta
Normal file
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f5deae3eb5ccc40f68cdba06a867eeb1
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||
@ -20,4 +20,8 @@ function PlayerInfoCell:refresh()
|
||||
self.playerHeadCell:refresh(nil, nil, true)
|
||||
end
|
||||
|
||||
function PlayerInfoCell:setActive(active)
|
||||
self.baseObject:setActive(active)
|
||||
end
|
||||
|
||||
return PlayerInfoCell
|
||||
8
lua/app/ui/company.meta
Normal file
8
lua/app/ui/company.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f0d0aa4aa2804a4fb3ecf06bdbba3dd
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -3,43 +3,13 @@ local CompanyComp = class("CompanyComp", LuaComponent)
|
||||
function CompanyComp:init()
|
||||
self.uiMap = self:getBaseObject():genAllChildren()
|
||||
|
||||
self.scrollRect = self.uiMap["dungeon_comp.scrollrect"]
|
||||
self.scrollRectComp = self.scrollRect:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
|
||||
self.scrollRectComp:addInitCallback(function()
|
||||
return "app/ui/dungeon/dungeon_board_cell"
|
||||
self.talentBtn = self.uiMap["company_comp.talent_btn"]
|
||||
self.talentBtn:addClickListener(function()
|
||||
ModuleManager.TalentManager:showMainUI()
|
||||
end)
|
||||
self.scrollRectComp:addRefreshCallback(function(index, cell)
|
||||
cell:refresh(self.openDungeons[index].module)
|
||||
end)
|
||||
self.scrollRectComp:setTotalCount(0)
|
||||
end
|
||||
|
||||
function CompanyComp:refresh(targetMuduleKey)
|
||||
if EDITOR_MODE then
|
||||
Logger.logHighlight("更新副本显示."..tostring(Time:getTodaySurplusTime()))
|
||||
end
|
||||
self.openDungeons = DataManager.DungeonData:getOpenDungeons()
|
||||
local targetIndex
|
||||
if targetMuduleKey then
|
||||
for index, dungeon in ipairs(self.openDungeons) do
|
||||
if dungeon.module == targetMuduleKey then
|
||||
targetIndex = index
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
self.scrollRectComp:clearCells()
|
||||
self.scrollRectComp:refillCells(#self.openDungeons, nil, targetIndex)
|
||||
|
||||
-- 跨天定时器
|
||||
if self.countdownSid then
|
||||
self:getBaseObject():unscheduleGlobal(self.countdownSid)
|
||||
self.countdownSid = nil
|
||||
end
|
||||
self.countdownSid = self:getBaseObject():scheduleGlobal(function()
|
||||
ModuleManager.DungeonManager:checkDayChange()
|
||||
end, Time:getTodaySurplusTime() + 1)
|
||||
|
||||
function CompanyComp:refresh()
|
||||
end
|
||||
|
||||
return CompanyComp
|
||||
10
lua/app/ui/company/company_comp.lua.meta
Normal file
10
lua/app/ui/company/company_comp.lua.meta
Normal file
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51843cc6523a14b839debe68ec1af29c
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||
@ -686,6 +686,11 @@ function MainCityUI:refreshPlayerInfo()
|
||||
if not self.playerInfoCell then
|
||||
self.playerInfoCell = CellManager:addCellComp(self.uiMap["main_ui.player_info_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_INFO_CELL)
|
||||
end
|
||||
if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.COMPANY then
|
||||
self.playerInfoCell:setActive(false)
|
||||
return
|
||||
end
|
||||
self.playerInfoCell:setActive(true)
|
||||
self.playerInfoCell:refresh()
|
||||
end
|
||||
|
||||
@ -827,6 +832,7 @@ function MainCityUI:switchMainCompModule(moduleKey)
|
||||
self:setTopNodeVisible(true)
|
||||
self:setSideBarVisible(true)
|
||||
self:refreshBounty()
|
||||
self:refreshPlayerInfo()
|
||||
UIManager:updateBarsState(self)
|
||||
end
|
||||
|
||||
|
||||
8
lua/app/ui/talent.meta
Normal file
8
lua/app/ui/talent.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6fa537387a2fc48e5be949d9bd6b9827
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
lua/app/ui/talent/cell.meta
Normal file
8
lua/app/ui/talent/cell.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d2c8192c12d44899995c67bf903f55f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
23
lua/app/ui/talent/cell/talent_cell.lua
Normal file
23
lua/app/ui/talent/cell/talent_cell.lua
Normal file
@ -0,0 +1,23 @@
|
||||
local TalentCell = class("TalentCell", BaseCell)
|
||||
|
||||
function TalentCell:init()
|
||||
local uiMap = self:getUIMap()
|
||||
|
||||
self.bg = uiMap["talent_cell.bg"]
|
||||
self.descTx1 = uiMap["talent_cell.desc_tx_1"]
|
||||
self.descTx2 = uiMap["talent_cell.desc_tx_2"]
|
||||
uiMap["talent_cell.desc_tx_1"]:setText("11111")
|
||||
uiMap["talent_cell.desc_tx_2"]:setText("2222")
|
||||
end
|
||||
|
||||
function TalentCell:refresh(idx, cfg)
|
||||
self.bg:setSprite(GConst.ATLAS_PATH.UI_TALENT, "talent_" .. idx)
|
||||
self.descTx1:setText("攻击提升")
|
||||
self.descTx2:setText("Lv." .. idx)
|
||||
end
|
||||
|
||||
function TalentCell:setActive(active)
|
||||
self.baseObject:setActive(active)
|
||||
end
|
||||
|
||||
return TalentCell
|
||||
10
lua/app/ui/talent/cell/talent_cell.lua.meta
Normal file
10
lua/app/ui/talent/cell/talent_cell.lua.meta
Normal file
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 057052df930374051a59e8397333ec52
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||
56
lua/app/ui/talent/talent_main_ui.lua
Normal file
56
lua/app/ui/talent/talent_main_ui.lua
Normal file
@ -0,0 +1,56 @@
|
||||
local TalentMainUI = class("TalentMainUI", BaseUI)
|
||||
|
||||
local TALENT_CELL = "app/ui/talent/cell/talent_cell"
|
||||
|
||||
function TalentMainUI:ctor()
|
||||
end
|
||||
|
||||
function TalentMainUI:isFullScreen()
|
||||
return false
|
||||
end
|
||||
|
||||
function TalentMainUI:getCurrencyParams()
|
||||
if self.currencyParams == nil then
|
||||
self.currencyParams = {
|
||||
itemIds = {
|
||||
GConst.ItemConst.ITEM_ID_GOLD,
|
||||
}
|
||||
}
|
||||
end
|
||||
return self.currencyParams
|
||||
end
|
||||
|
||||
function TalentMainUI:getPrefabPath()
|
||||
return "assets/prefabs/ui/talent/talent_ui.prefab"
|
||||
end
|
||||
|
||||
function TalentMainUI:onLoadRootComplete()
|
||||
local uiMap = self.root:genAllChildren()
|
||||
uiMap["talent_ui.close_btn"]:addClickListener(function()
|
||||
self:closeUI()
|
||||
end)
|
||||
|
||||
self.getBtn = uiMap["talent_ui.get_btn"]
|
||||
local text = uiMap["talent_ui.get_btn.text"]
|
||||
local costTx = uiMap["talent_ui.get_btn.cost.cost_tx"]
|
||||
|
||||
|
||||
-- uiMap["talent_ui.title_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.TALENT))
|
||||
uiMap["talent_ui.title_tx"]:setText("研发中心")
|
||||
uiMap["talent_ui.get_btn.text"]:setText("研发")
|
||||
self.scrollRect = uiMap["talent_ui.bottom_bg.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
|
||||
self.scrollRect:addInitCallback(function()
|
||||
return TALENT_CELL
|
||||
end)
|
||||
self.scrollRect:addRefreshCallback(function(index, cell)
|
||||
cell:refresh(index, self.list[index])
|
||||
end)
|
||||
self.scrollRect:clearCells()
|
||||
end
|
||||
|
||||
function TalentMainUI:onRefresh()
|
||||
self.list = DataManager.TalentData:getCfgList()
|
||||
self.scrollRect:setTotalCount(#self.list)
|
||||
end
|
||||
|
||||
return TalentMainUI
|
||||
10
lua/app/ui/talent/talent_main_ui.lua.meta
Normal file
10
lua/app/ui/talent/talent_main_ui.lua.meta
Normal file
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c489976f9910642e3bfb4a57d776dfcf
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||
@ -1,6 +1,8 @@
|
||||
local PlayerData = class("PlayerData", BaseData)
|
||||
local RECHARGE_CFG = ConfigManager:getConfig("recharge")
|
||||
|
||||
local PlayerExpCfg = ConfigManager:getConfig("player_exp")
|
||||
|
||||
function PlayerData:ctor()
|
||||
self.data.dirty = false
|
||||
end
|
||||
@ -603,4 +605,9 @@ function PlayerData:getGameVersion()
|
||||
return self.game_version
|
||||
end
|
||||
|
||||
--@region 玩家经验
|
||||
function PlayerData:getPlayerExpCfg()
|
||||
return PlayerExpCfg
|
||||
end
|
||||
--@endregion
|
||||
return PlayerData
|
||||
8
lua/app/userdata/talent.meta
Normal file
8
lua/app/userdata/talent.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 03c8eba69a85c4859a584ce0ea0b9b40
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
18
lua/app/userdata/talent/talent_data.lua
Normal file
18
lua/app/userdata/talent/talent_data.lua
Normal file
@ -0,0 +1,18 @@
|
||||
local TalentData = class("TalentData", BaseData)
|
||||
|
||||
local TalentCfg = ConfigManager:getConfig("talent")
|
||||
|
||||
function TalentData:ctor()
|
||||
end
|
||||
|
||||
function TalentData:init(data)
|
||||
end
|
||||
|
||||
function TalentData:clear()
|
||||
end
|
||||
|
||||
function TalentData:getCfgList()
|
||||
return TalentCfg
|
||||
end
|
||||
|
||||
return TalentData
|
||||
10
lua/app/userdata/talent/talent_data.lua.meta
Normal file
10
lua/app/userdata/talent/talent_data.lua.meta
Normal file
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 974f43202a7b7463fa0b3cacea3e4266
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||
Loading…
x
Reference in New Issue
Block a user