天赋信息界面
This commit is contained in:
parent
3c7c289c79
commit
5818f99580
@ -4,6 +4,10 @@ function TalentManager:showMainUI()
|
|||||||
UIManager:showUI("app/ui/talent/talent_main_ui")
|
UIManager:showUI("app/ui/talent/talent_main_ui")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function TalentManager:showInfoUI(parmas)
|
||||||
|
UIManager:showUI("app/ui/talent/talent_info_ui", parmas)
|
||||||
|
end
|
||||||
|
|
||||||
function TalentManager:talentUpgrade()
|
function TalentManager:talentUpgrade()
|
||||||
local args = {}
|
local args = {}
|
||||||
self:sendMessage(ProtoMsgType.FromMsgEnum.TalentUpgradeReq, args, {}, self.onTalentUpgradeRsp, BIReport.ITEM_GET_TYPE.BOUNTY_REWARD)
|
self:sendMessage(ProtoMsgType.FromMsgEnum.TalentUpgradeReq, args, {}, self.onTalentUpgradeRsp, BIReport.ITEM_GET_TYPE.BOUNTY_REWARD)
|
||||||
|
|||||||
@ -8,9 +8,16 @@ function TalentCell:init()
|
|||||||
self.descTx1 = uiMap["talent_cell.desc_tx_1"]
|
self.descTx1 = uiMap["talent_cell.desc_tx_1"]
|
||||||
self.descTx2 = uiMap["talent_cell.desc_tx_2"]
|
self.descTx2 = uiMap["talent_cell.desc_tx_2"]
|
||||||
self.animator.enabled = false
|
self.animator.enabled = false
|
||||||
|
|
||||||
|
self.baseObject:addClickListener(function()
|
||||||
|
local parmas = {}
|
||||||
|
parmas.id = self.idx
|
||||||
|
ModuleManager.TalentManager:showInfoUI(parmas)
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function TalentCell:refresh(idx, cfg, showAni)
|
function TalentCell:refresh(idx, cfg, showAni)
|
||||||
|
self.idx = idx
|
||||||
self.bg:setSprite(GConst.ATLAS_PATH.UI_TALENT, "talent_" .. idx)
|
self.bg:setSprite(GConst.ATLAS_PATH.UI_TALENT, "talent_" .. idx)
|
||||||
self.descTx1:setText(I18N:getText("talent", idx, "name"))
|
self.descTx1:setText(I18N:getText("talent", idx, "name"))
|
||||||
local lv = DataManager.TalentData:getLevels(idx)
|
local lv = DataManager.TalentData:getLevels(idx)
|
||||||
|
|||||||
54
lua/app/ui/talent/talent_info_ui.lua
Normal file
54
lua/app/ui/talent/talent_info_ui.lua
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
local TalentInfoUI = class("TalentInfoUI", BaseUI)
|
||||||
|
|
||||||
|
local TALENT_CELL = "app/ui/talent/cell/talent_cell"
|
||||||
|
|
||||||
|
function TalentInfoUI:ctor(parmas)
|
||||||
|
parmas = parmas or {}
|
||||||
|
self.id = parmas.id or 1
|
||||||
|
end
|
||||||
|
|
||||||
|
function TalentInfoUI:isFullScreen()
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
function TalentInfoUI:getPrefabPath()
|
||||||
|
return "assets/prefabs/ui/talent/talent_info_ui.prefab"
|
||||||
|
end
|
||||||
|
|
||||||
|
function TalentInfoUI:onLoadRootComplete()
|
||||||
|
local uiMap = self.root:genAllChildren()
|
||||||
|
-- self.root:addClickListener(function()
|
||||||
|
-- self:closeUI()
|
||||||
|
-- end)
|
||||||
|
|
||||||
|
self.talentCell = uiMap["talent_info_ui.talent_cell"]:addLuaComponent(TALENT_CELL)
|
||||||
|
-- self.animator = uiMap["talent_info_ui.talent_cell"]:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR)
|
||||||
|
-- self.animator.enabled = false
|
||||||
|
self.descTx = uiMap["talent_info_ui.desc_tx"]
|
||||||
|
self.leftArrowBtn = uiMap["talent_info_ui.left_arrow_btn"]
|
||||||
|
self.rightArrowBtn = uiMap["talent_info_ui.right_arrow_btn"]
|
||||||
|
local continue = uiMap["talent_info_ui.continue"]
|
||||||
|
continue:setText(I18N:getGlobalText(I18N.GlobalConst.CLICK_TO_CONTINUE))
|
||||||
|
continue:addClickListener(function()
|
||||||
|
self:closeUI()
|
||||||
|
end)
|
||||||
|
|
||||||
|
self.leftArrowBtn:addClickListener(function()
|
||||||
|
self.id = self.id - 1
|
||||||
|
self:onRefresh()
|
||||||
|
end)
|
||||||
|
self.rightArrowBtn:addClickListener(function()
|
||||||
|
self.id = self.id + 1
|
||||||
|
self:onRefresh()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TalentInfoUI:onRefresh()
|
||||||
|
self.list = DataManager.TalentData:getCfgList()
|
||||||
|
self.talentCell:refresh(self.id, self.list[self.id])
|
||||||
|
self.leftArrowBtn:setActive(self.id > 1)
|
||||||
|
self.rightArrowBtn:setActive(self.id < #self.list)
|
||||||
|
self.descTx:setText(I18N:getText("talent", self.id, "desc"))
|
||||||
|
end
|
||||||
|
|
||||||
|
return TalentInfoUI
|
||||||
10
lua/app/ui/talent/talent_info_ui.lua.meta
Normal file
10
lua/app/ui/talent/talent_info_ui.lua.meta
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: afc8338e45770409da1c872f18b36dfa
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||||
Loading…
x
Reference in New Issue
Block a user