Initial version - 1.2.0.60
EN: 1.2.0.60 CN: 1.2.0.61 JP: 1.2.0.63 KR: 1.2.0.67
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
local GachaPreviewCtrl = class("GachaPreviewCtrl", BaseCtrl)
|
||||
local Actor2DManager = require("Game.Actor2D.Actor2DManager")
|
||||
GachaPreviewCtrl._mapNodeConfig = {
|
||||
rtCharinfo = {
|
||||
sCtrlName = "Game.UI.TemplateEx.TemplateCharInfoCtrl"
|
||||
},
|
||||
TopBarPanel = {
|
||||
sNodeName = "TopBarPanel",
|
||||
sCtrlName = "Game.UI.TopBarEx.TopBarCtrl"
|
||||
},
|
||||
RimgL2d = {sComponentName = "RawImage"},
|
||||
btnSkill = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Skill"
|
||||
},
|
||||
btnPerk = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_Perk"
|
||||
},
|
||||
btnHeartStone = {
|
||||
sComponentName = "UIButton",
|
||||
callback = "OnBtnClick_HeartStone"
|
||||
},
|
||||
TMPSkill = {
|
||||
sComponentName = "TMP_Text",
|
||||
nCount = 2,
|
||||
sLanguageId = "SelectMember_Skill"
|
||||
},
|
||||
TMPPerk = {
|
||||
sComponentName = "TMP_Text",
|
||||
nCount = 2,
|
||||
sLanguageId = "Perk_Exclusive"
|
||||
},
|
||||
TMPHeartStone = {
|
||||
sComponentName = "TMP_Text",
|
||||
nCount = 2,
|
||||
sLanguageId = "HeartStone"
|
||||
},
|
||||
imgTab = {nCount = 3},
|
||||
rtSkillList = {
|
||||
sCtrlName = "Game.UI.GachaEx.GachaPreview.SkillListCtrl"
|
||||
},
|
||||
rtExPerkList = {
|
||||
sCtrlName = "Game.UI.GachaEx.GachaPreview.PerkListCtrl"
|
||||
},
|
||||
rtHeartStoneList = {
|
||||
sCtrlName = "Game.UI.GachaEx.GachaPreview.HeartStoneListCtrl"
|
||||
}
|
||||
}
|
||||
GachaPreviewCtrl._mapEventConfig = {}
|
||||
function GachaPreviewCtrl:Awake()
|
||||
end
|
||||
function GachaPreviewCtrl:FadeIn()
|
||||
end
|
||||
function GachaPreviewCtrl:FadeOut()
|
||||
end
|
||||
function GachaPreviewCtrl:OnEnable()
|
||||
self.curTab = 1
|
||||
local tbParam = self:GetPanelParam()
|
||||
self.nCharId = tbParam[1]
|
||||
if self.nCharId == nil then
|
||||
return
|
||||
end
|
||||
self._mapNode.rtSkillList:Refresh(self.nCharId)
|
||||
self._mapNode.rtCharinfo:Refresh({
|
||||
nLevel = self:CalCharMaxLevel(self.nCharId)
|
||||
}, ConfigTable.GetData_Character(self.nCharId))
|
||||
self._mapNode.rtSkillList.gameObject:SetActive(true)
|
||||
self._mapNode.rtExPerkList:SetShow(false)
|
||||
self._mapNode.rtHeartStoneList.gameObject:SetActive(false)
|
||||
for i = 1, 3 do
|
||||
self._mapNode.imgTab[i]:SetActive(i == self.curTab)
|
||||
end
|
||||
local mapCharCfgData = ConfigTable.GetData_Character(self.nCharId)
|
||||
Actor2DManager.SetActor2D(self:GetPanelId(), self._mapNode.RimgL2d, self.nCharId, mapCharCfgData.AdvanceSkinId)
|
||||
end
|
||||
function GachaPreviewCtrl:CalCharMaxLevel(nCharId)
|
||||
local nMaxLevel = 0
|
||||
local mapCharCfgData = ConfigTable.GetData_Character(nCharId)
|
||||
local forEach = function(mapData)
|
||||
if mapData.Grade == mapCharCfgData.Grade and tonumber(mapData.LvLimit) > nMaxLevel then
|
||||
nMaxLevel = tonumber(mapData.LvLimit)
|
||||
end
|
||||
end
|
||||
ForEachTableLine(DataTable.CharRaritySequence, forEach)
|
||||
return nMaxLevel
|
||||
end
|
||||
function GachaPreviewCtrl:OnDisable()
|
||||
Actor2DManager.UnsetActor2D()
|
||||
end
|
||||
function GachaPreviewCtrl:OnDestroy()
|
||||
end
|
||||
function GachaPreviewCtrl:OnRelease()
|
||||
end
|
||||
function GachaPreviewCtrl:OnBtnClick_Skill()
|
||||
if self.curTab == 1 then
|
||||
return
|
||||
end
|
||||
self.curTab = 1
|
||||
for i = 1, 3 do
|
||||
self._mapNode.imgTab[i]:SetActive(i == self.curTab)
|
||||
end
|
||||
self._mapNode.rtSkillList.gameObject:SetActive(true)
|
||||
self._mapNode.rtExPerkList:SetShow(false)
|
||||
self._mapNode.rtHeartStoneList.gameObject:SetActive(false)
|
||||
end
|
||||
function GachaPreviewCtrl:OnBtnClick_Perk()
|
||||
end
|
||||
function GachaPreviewCtrl:OnBtnClick_HeartStone()
|
||||
end
|
||||
return GachaPreviewCtrl
|
||||
@@ -0,0 +1,19 @@
|
||||
local GachaPreviewPanel = class("GachaPreviewPanel", BasePanel)
|
||||
GachaPreviewPanel._bIsMainPanel = false
|
||||
GachaPreviewPanel._tbDefine = {
|
||||
{
|
||||
sPrefabPath = "GachaEx/GachaCharInfoPanel.prefab",
|
||||
sCtrlName = "Game.UI.GachaEx.GachaPreview.GachaPreviewCtrl"
|
||||
}
|
||||
}
|
||||
function GachaPreviewPanel:Awake()
|
||||
end
|
||||
function GachaPreviewPanel:OnEnable()
|
||||
end
|
||||
function GachaPreviewPanel:OnDisable()
|
||||
end
|
||||
function GachaPreviewPanel:OnDestroy()
|
||||
end
|
||||
function GachaPreviewPanel:OnRelease()
|
||||
end
|
||||
return GachaPreviewPanel
|
||||
@@ -0,0 +1,127 @@
|
||||
local HeartStoneListCtrl = class("HeartStoneListCtrl", BaseCtrl)
|
||||
local HeartStoneTypeEnum = {
|
||||
[1] = {
|
||||
HeartStoneIndex = 1,
|
||||
icon = "zs_heartstone_lv_a",
|
||||
selecticon = "zs_heartstone_1"
|
||||
},
|
||||
[2] = {
|
||||
HeartStoneIndex = 2,
|
||||
icon = "zs_heartstone_lv_b",
|
||||
selecticon = "zs_heartstone_2"
|
||||
},
|
||||
[3] = {
|
||||
HeartStoneIndex = 3,
|
||||
icon = "zs_heartstone_lv_c",
|
||||
selecticon = "zs_heartstone_3"
|
||||
},
|
||||
[4] = {
|
||||
HeartStoneIndex = 4,
|
||||
icon = "zs_heartstone_lv_d",
|
||||
selecticon = "zs_heartstone_4"
|
||||
},
|
||||
[5] = {
|
||||
HeartStoneIndex = 5,
|
||||
icon = "zs_heartstone_lv_e",
|
||||
selecticon = "zs_heartstone_5"
|
||||
},
|
||||
[6] = {
|
||||
HeartStoneIndex = 6,
|
||||
icon = "zs_heartstone_lv_f",
|
||||
selecticon = "zs_heartstone_6"
|
||||
},
|
||||
[7] = {
|
||||
HeartStoneIndex = 7,
|
||||
icon = "zs_heartstone_lv_g",
|
||||
selecticon = "zs_heartstone_7"
|
||||
},
|
||||
[8] = {
|
||||
HeartStoneIndex = 8,
|
||||
icon = "zs_heartstone_lv_h",
|
||||
selecticon = "zs_heartstone_8"
|
||||
},
|
||||
[9] = {
|
||||
HeartStoneIndex = 9,
|
||||
icon = "zs_heartstone_lv_i",
|
||||
selecticon = "zs_heartstone_9"
|
||||
},
|
||||
[10] = {
|
||||
HeartStoneIndex = 10,
|
||||
icon = "zs_heartstone_lv_j",
|
||||
selecticon = "zs_heartstone_10"
|
||||
},
|
||||
[11] = {
|
||||
HeartStoneIndex = 11,
|
||||
icon = "zs_heartstone_lv_k",
|
||||
selecticon = "zs_heartstone_11"
|
||||
},
|
||||
[12] = {
|
||||
HeartStoneIndex = 12,
|
||||
icon = "zs_heartstone_lv_l",
|
||||
selecticon = "zs_heartstone_12"
|
||||
},
|
||||
[13] = {
|
||||
HeartStoneIndex = 13,
|
||||
icon = "zs_heartstone_lv_m",
|
||||
selecticon = "zs_heartstone_13"
|
||||
},
|
||||
[14] = {
|
||||
HeartStoneIndex = 14,
|
||||
icon = "zs_heartstone_lv_n",
|
||||
selecticon = "zs_heartstone_14"
|
||||
},
|
||||
[15] = {
|
||||
HeartStoneIndex = 15,
|
||||
icon = "zs_heartstone_lv_o",
|
||||
selecticon = "zs_heartstone_15"
|
||||
},
|
||||
[16] = {
|
||||
HeartStoneIndex = 16,
|
||||
icon = "zs_heartstone_lv_p",
|
||||
selecticon = "zs_heartstone_16"
|
||||
}
|
||||
}
|
||||
HeartStoneListCtrl._mapNodeConfig = {
|
||||
rtHeartStoneGrid = {nCount = 6, sComponentName = "Transform"}
|
||||
}
|
||||
HeartStoneListCtrl._mapEventConfig = {}
|
||||
function HeartStoneListCtrl:Awake()
|
||||
end
|
||||
function HeartStoneListCtrl:FadeIn()
|
||||
end
|
||||
function HeartStoneListCtrl:FadeOut()
|
||||
end
|
||||
function HeartStoneListCtrl:OnEnable()
|
||||
end
|
||||
function HeartStoneListCtrl:OnDisable()
|
||||
end
|
||||
function HeartStoneListCtrl:OnDestroy()
|
||||
end
|
||||
function HeartStoneListCtrl:OnRelease()
|
||||
end
|
||||
function HeartStoneListCtrl:Refresh(nCharId)
|
||||
self.nCharId = nCharId
|
||||
local HeartStoneType = ConfigTable.GetData_Character(self.nCharId).HeartStone
|
||||
self.mapHeartStoneType = HeartStoneTypeEnum[HeartStoneType]
|
||||
local rootPath = "Icon/ZZZOther/"
|
||||
local sybolType = 3
|
||||
for i = 1, 6 do
|
||||
local SymbolPath = rootPath .. self.mapHeartStoneType.icon .. tostring(i) .. tostring(sybolType)
|
||||
self:SetGrid(self._mapNode.rtHeartStoneGrid[i], self.nCharId * 100 + i, SymbolPath)
|
||||
end
|
||||
end
|
||||
function HeartStoneListCtrl:SetGrid(rtGrid, nHeartStoneId, sPath)
|
||||
local mapHeartStone = ConfigTable.GetData("CharacterHeartStone", nHeartStoneId)
|
||||
if mapHeartStone == nil then
|
||||
rtGrid.gameObject:SetActive(false)
|
||||
return
|
||||
end
|
||||
rtGrid.gameObject:SetActive(true)
|
||||
local imgIcon = rtGrid:Find("imgTitleBg/imgHeartStoneIcon"):GetComponent("Image")
|
||||
local TMPTitle = rtGrid:Find("imgTitleBg/TMPTitle"):GetComponent("TMP_Text")
|
||||
local TMPDesc = rtGrid:Find("srHeartStoneDesc/TMPDesc"):GetComponent("TMP_Text")
|
||||
self:SetPngSprite(imgIcon, sPath)
|
||||
NovaAPI.SetTMPText(TMPTitle, orderedFormat(ConfigTable.GetUIText("HeartStone_Level"), mapHeartStone.Level))
|
||||
NovaAPI.SetTMPText(TMPDesc, mapHeartStone.Desc)
|
||||
end
|
||||
return HeartStoneListCtrl
|
||||
@@ -0,0 +1,72 @@
|
||||
local SkillListGridCtrl = class("SkillListGridCtrl", BaseCtrl)
|
||||
local ConfigData = require("GameCore.Data.ConfigData")
|
||||
local minHeight = 178.84
|
||||
local defaultWidth = 673
|
||||
SkillListGridCtrl._mapNodeConfig = {
|
||||
imgPerkIcon = {sComponentName = "Image"},
|
||||
TMPPerkTitle = {sComponentName = "TMP_Text"},
|
||||
TMPDesc = {sComponentName = "TMP_Text"},
|
||||
rtTMPDesc = {
|
||||
sNodeName = "TMPDesc",
|
||||
sComponentName = "RectTransform"
|
||||
},
|
||||
imgDescBg = {
|
||||
sComponentName = "RectTransform"
|
||||
},
|
||||
TMP_Link = {
|
||||
sNodeName = "TMPDesc",
|
||||
sComponentName = "TMPHyperLink",
|
||||
callback = "OnBtnClick_Word"
|
||||
}
|
||||
}
|
||||
SkillListGridCtrl._mapEventConfig = {}
|
||||
function SkillListGridCtrl:Awake()
|
||||
end
|
||||
function SkillListGridCtrl:FadeIn()
|
||||
end
|
||||
function SkillListGridCtrl:FadeOut()
|
||||
end
|
||||
function SkillListGridCtrl:OnEnable()
|
||||
end
|
||||
function SkillListGridCtrl:OnDisable()
|
||||
end
|
||||
function SkillListGridCtrl:OnDestroy()
|
||||
end
|
||||
function SkillListGridCtrl:OnRelease()
|
||||
end
|
||||
function SkillListGridCtrl:SetPerk(nPerkId)
|
||||
if nPerkId == 0 or nPerkId == nil then
|
||||
self.gameObject:SetActive(false)
|
||||
return
|
||||
end
|
||||
local perkCfgData = ConfigTable.GetData_Perk(nPerkId)
|
||||
local perkItemCfgData = ConfigTable.GetData_Item(nPerkId)
|
||||
if perkCfgData == nil or perkItemCfgData == nil then
|
||||
self.gameObject:SetActive(false)
|
||||
return
|
||||
end
|
||||
local skillId = perkCfgData.EffectGroupId * 100 + 1
|
||||
local mapSkill = ConfigTable.GetData("PerkPassiveSkill", skillId)
|
||||
if mapSkill == nil then
|
||||
self.gameObject:SetActive(false)
|
||||
return
|
||||
end
|
||||
self.gameObject:SetActive(true)
|
||||
local sDesc = UTILS.SubDesc(mapSkill.Desc)
|
||||
NovaAPI.SetTMPSourceText(self._mapNode.TMPDesc, sDesc)
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPPerkTitle, perkItemCfgData.Title)
|
||||
self:SetPngSprite(self._mapNode.imgPerkIcon, perkItemCfgData.Icon)
|
||||
local wait = function()
|
||||
coroutine.yield(CS.UnityEngine.WaitForEndOfFrame())
|
||||
local height = self._mapNode.rtTMPDesc.sizeDelta.y
|
||||
if height < minHeight then
|
||||
height = minHeight
|
||||
end
|
||||
self._mapNode.imgDescBg.sizeDelta = Vector2(defaultWidth, height)
|
||||
end
|
||||
cs_coroutine.start(wait)
|
||||
end
|
||||
function SkillListGridCtrl:OnBtnClick_Word(link, sWordId)
|
||||
UTILS.ClickWordLink(link, sWordId)
|
||||
end
|
||||
return SkillListGridCtrl
|
||||
@@ -0,0 +1,81 @@
|
||||
local PerkListCtrl = class("PerkListCtrl", BaseCtrl)
|
||||
PerkListCtrl._mapNodeConfig = {
|
||||
tog = {
|
||||
sComponentName = "UIButton",
|
||||
nCount = 2,
|
||||
callback = "OnBtnClick_Tog"
|
||||
},
|
||||
togCtrl = {
|
||||
sNodeName = "tog",
|
||||
sCtrlName = "Game.UI.TemplateEx.TemplateToggleCtrl",
|
||||
nCount = 2
|
||||
},
|
||||
rtExPerkGrid = {
|
||||
nCount = 4,
|
||||
sCtrlName = "Game.UI.GachaEx.GachaPreview.PerkGridCtrl"
|
||||
}
|
||||
}
|
||||
PerkListCtrl._mapEventConfig = {}
|
||||
function PerkListCtrl:Awake()
|
||||
self.curTog = 1
|
||||
self.canvasGroup = self.gameObject:GetComponent("CanvasGroup")
|
||||
end
|
||||
function PerkListCtrl:FadeIn()
|
||||
end
|
||||
function PerkListCtrl:FadeOut()
|
||||
end
|
||||
function PerkListCtrl:OnEnable()
|
||||
for i = 1, 2 do
|
||||
self._mapNode.togCtrl[i]:SetDefault(i == self.curTog)
|
||||
end
|
||||
self._mapNode.togCtrl[1]:SetText(ConfigTable.GetUIText("Build_Leader"))
|
||||
self._mapNode.togCtrl[2]:SetText(ConfigTable.GetUIText("Build_Sub"))
|
||||
end
|
||||
function PerkListCtrl:OnDisable()
|
||||
end
|
||||
function PerkListCtrl:OnDestroy()
|
||||
end
|
||||
function PerkListCtrl:OnRelease()
|
||||
end
|
||||
function PerkListCtrl:SetShow(bShow)
|
||||
if bShow then
|
||||
NovaAPI.SetCanvasGroupAlpha(self.canvasGroup, 1)
|
||||
NovaAPI.SetCanvasGroupBlocksRaycasts(self.canvasGroup, true)
|
||||
else
|
||||
NovaAPI.SetCanvasGroupAlpha(self.canvasGroup, 0)
|
||||
NovaAPI.SetCanvasGroupBlocksRaycasts(self.canvasGroup, false)
|
||||
end
|
||||
end
|
||||
function PerkListCtrl:Refresh(nCharId)
|
||||
self.nCharId = nCharId
|
||||
local mapCharCfgData = ConfigTable.GetData_Character(nCharId)
|
||||
if mapCharCfgData == nil then
|
||||
self.gameObject:SetActive(false)
|
||||
return
|
||||
end
|
||||
if #mapCharCfgData.Weapons < 1 then
|
||||
self.gameObject:SetActive(false)
|
||||
return
|
||||
end
|
||||
local nWeaponId = mapCharCfgData.Weapons[#mapCharCfgData.Weapons]
|
||||
local mapWeaponCfgData = ConfigTable.GetData("Weapon", nWeaponId)
|
||||
local tbPerks
|
||||
if self.curTog == 1 then
|
||||
tbPerks = mapWeaponCfgData.MasterSpecificPerkIds
|
||||
else
|
||||
tbPerks = mapWeaponCfgData.AssistSpecificPerkIds
|
||||
end
|
||||
for index = 1, 4 do
|
||||
self._mapNode.rtExPerkGrid[index]:SetPerk(tbPerks[index])
|
||||
end
|
||||
end
|
||||
function PerkListCtrl:OnBtnClick_Tog(tog)
|
||||
local togIdx = table.indexof(self._mapNode.tog, tog)
|
||||
if togIdx ~= self.curTog then
|
||||
self._mapNode.togCtrl[togIdx]:SetTrigger(true)
|
||||
self._mapNode.togCtrl[self.curTog]:SetTrigger(false)
|
||||
self.curTog = togIdx
|
||||
self:Refresh(self.nCharId)
|
||||
end
|
||||
end
|
||||
return PerkListCtrl
|
||||
@@ -0,0 +1,64 @@
|
||||
local SkillListCtrl = class("SkillListCtrl", BaseCtrl)
|
||||
SkillListCtrl._mapNodeConfig = {
|
||||
rtSkillGrid = {
|
||||
nCount = 4,
|
||||
sCtrlName = "Game.UI.GachaEx.GachaPreview.SkillListGridCtrl"
|
||||
},
|
||||
txtTalentTitle = {sComponentName = "TMP_Text"},
|
||||
imgTalentBg = {sComponentName = "Image"},
|
||||
imgTalent = {sComponentName = "Image"},
|
||||
txtTalentName = {sComponentName = "TMP_Text"},
|
||||
TMPDescTalent = {sComponentName = "TMP_Text"},
|
||||
TMP_Link = {
|
||||
sNodeName = "TMPDescTalent",
|
||||
sComponentName = "TMPHyperLink",
|
||||
callback = "OnBtnClick_Word"
|
||||
}
|
||||
}
|
||||
SkillListCtrl._mapEventConfig = {}
|
||||
function SkillListCtrl:Awake()
|
||||
end
|
||||
function SkillListCtrl:FadeIn()
|
||||
end
|
||||
function SkillListCtrl:FadeOut()
|
||||
end
|
||||
function SkillListCtrl:OnEnable()
|
||||
end
|
||||
function SkillListCtrl:OnDisable()
|
||||
end
|
||||
function SkillListCtrl:OnDestroy()
|
||||
end
|
||||
function SkillListCtrl:OnRelease()
|
||||
end
|
||||
function SkillListCtrl:Refresh(nCharId)
|
||||
local mapCharCfgData = ConfigTable.GetData_Character(nCharId)
|
||||
if mapCharCfgData == nil then
|
||||
self.gameObject:SetActive(false)
|
||||
return
|
||||
end
|
||||
local mapSkillNormal = ConfigTable.GetData_Skill(mapCharCfgData.NormalAtkId)
|
||||
local mapSkillMain = ConfigTable.GetData_Skill(mapCharCfgData.SkillId)
|
||||
local mapSkillAssist = ConfigTable.GetData_Skill(mapCharCfgData.AssistSkillId)
|
||||
local mapSkillUltra = ConfigTable.GetData_Skill(mapCharCfgData.UltimateId)
|
||||
local mapSkillTalent = ConfigTable.GetData_Skill(mapCharCfgData.TalentSkillId)
|
||||
local nNormalMaxLevel = PlayerData.Char:GetCharSkillMaxLevel(nCharId, 1)
|
||||
local nMainMaxLevel = PlayerData.Char:GetCharSkillMaxLevel(nCharId, 2)
|
||||
local nAssistMaxLevel = PlayerData.Char:GetCharSkillMaxLevel(nCharId, 3)
|
||||
local nUltraMaxLevel = PlayerData.Char:GetCharSkillMaxLevel(nCharId, 4)
|
||||
self._mapNode.rtSkillGrid[1]:SetSkill(mapSkillNormal.Id, nNormalMaxLevel, nCharId, 1)
|
||||
self._mapNode.rtSkillGrid[2]:SetSkill(mapSkillMain.Id, nMainMaxLevel, nCharId, 2)
|
||||
self._mapNode.rtSkillGrid[3]:SetSkill(mapSkillAssist.Id, nAssistMaxLevel, nCharId, 3)
|
||||
self._mapNode.rtSkillGrid[4]:SetSkill(mapSkillUltra.Id, nUltraMaxLevel, nCharId, 4)
|
||||
if nil ~= mapSkillTalent then
|
||||
NovaAPI.SetTMPText(self._mapNode.txtTalentName, mapSkillTalent.Title)
|
||||
local _, color = ColorUtility.TryParseHtmlString(AllEnum.SkillElementColor[mapCharCfgData.EET])
|
||||
NovaAPI.SetImageColor(self._mapNode.imgTalentBg, color)
|
||||
local sDesc = UTILS.ParseDesc(mapSkillTalent)
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPDescTalent, sDesc)
|
||||
self:SetPngSprite(self._mapNode.imgTalent, mapSkillTalent.Icon)
|
||||
end
|
||||
end
|
||||
function SkillListCtrl:OnBtnClick_Word(link, sWordId)
|
||||
UTILS.ClickWordLink(link, sWordId)
|
||||
end
|
||||
return SkillListCtrl
|
||||
@@ -0,0 +1,94 @@
|
||||
local SkillListGridCtrl = class("SkillListGridCtrl", BaseCtrl)
|
||||
local ConfigData = require("GameCore.Data.ConfigData")
|
||||
SkillListGridCtrl._mapNodeConfig = {
|
||||
imgSkillIconBg = {sComponentName = "Image"},
|
||||
imgzsIcon = {sComponentName = "Image"},
|
||||
imgIconSkill = {sComponentName = "Image"},
|
||||
imgSkillTypeBg = {sComponentName = "Image"},
|
||||
txtSkillType = {sComponentName = "TMP_Text"},
|
||||
imgSkillType = {sComponentName = "Image"},
|
||||
TMPTitle = {sComponentName = "TMP_Text"},
|
||||
txtSkillLevel = {sComponentName = "TMP_Text"},
|
||||
imgEnergyInfoBg = {},
|
||||
imgCDInfoBg = {},
|
||||
srSkillDesc = {
|
||||
sComponentName = "RectTransform"
|
||||
},
|
||||
TMPCDTitle = {sComponentName = "TMP_Text", sLanguageId = "Talent_CD"},
|
||||
TMPCD = {sComponentName = "TMP_Text"},
|
||||
TMPEnergyTitle = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Talent_Cost"
|
||||
},
|
||||
TMPEnergy = {sComponentName = "TMP_Text"},
|
||||
TMPDesc = {sComponentName = "TMP_Text"},
|
||||
rtTMPDesc = {
|
||||
sComponentName = "RectTransform",
|
||||
sNodeName = "TMPDesc"
|
||||
},
|
||||
TMP_Link = {
|
||||
sNodeName = "TMPDesc",
|
||||
sComponentName = "TMPHyperLink",
|
||||
callback = "OnBtnClick_Word"
|
||||
}
|
||||
}
|
||||
SkillListGridCtrl._mapEventConfig = {}
|
||||
function SkillListGridCtrl:Awake()
|
||||
end
|
||||
function SkillListGridCtrl:FadeIn()
|
||||
end
|
||||
function SkillListGridCtrl:FadeOut()
|
||||
end
|
||||
function SkillListGridCtrl:OnEnable()
|
||||
end
|
||||
function SkillListGridCtrl:OnDisable()
|
||||
end
|
||||
function SkillListGridCtrl:OnDestroy()
|
||||
end
|
||||
function SkillListGridCtrl:OnRelease()
|
||||
end
|
||||
function SkillListGridCtrl:SetSkill(nSkillId, nLevel, nCharId, nType)
|
||||
local mapCharCfgData = ConfigTable.GetData_Character(nCharId)
|
||||
local mapCfgDataSkill = ConfigTable.GetData_Skill(nSkillId)
|
||||
local nCD = FormatNum(mapCfgDataSkill.SkillCD * ConfigData.IntFloatPrecision)
|
||||
local nCost = FormatNum(mapCfgDataSkill.UltraEnergy * ConfigData.IntFloatPrecision)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtSkillLevel, ConfigTable.GetUIText("Skill_Level") .. nLevel)
|
||||
self:SetAtlasSprite(self._mapNode.imgSkillIconBg, "12_rare", AllEnum.ElementIconType.SkillEx .. mapCharCfgData.EET)
|
||||
self:SetPngSprite(self._mapNode.imgIconSkill, mapCfgDataSkill.Icon)
|
||||
local skillShowCfg = AllEnum.SkillTypeShow[nType]
|
||||
NovaAPI.SetTMPText(self._mapNode.txtSkillType, ConfigTable.GetUIText(skillShowCfg.sLanguageId))
|
||||
self:SetAtlasSprite(self._mapNode.imgzsIcon, "10_ico", "zs_character_skill_" .. skillShowCfg.bgIconIndex)
|
||||
local _, color = ColorUtility.TryParseHtmlString(AllEnum.SkillElementBgColor[mapCharCfgData.EET])
|
||||
NovaAPI.SetImageColor(self._mapNode.imgzsIcon, Color(color.r, color.g, color.b, 0.19607843137254902))
|
||||
local skillTypeIconIdx = skillShowCfg.iconIndex
|
||||
self:SetAtlasSprite(self._mapNode.imgSkillType, "05_language", "zs_character_skill_text_" .. skillTypeIconIdx)
|
||||
NovaAPI.SetImageNativeSize(self._mapNode.imgSkillType)
|
||||
local _, _color = ColorUtility.TryParseHtmlString(skillShowCfg.bgColor)
|
||||
NovaAPI.SetImageColor(self._mapNode.imgSkillTypeBg, _color)
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPTitle, mapCfgDataSkill.Title)
|
||||
local sCD = tostring(nCD) .. ConfigTable.GetUIText("Talent_Sec")
|
||||
local sCost = tostring(nCost)
|
||||
if nCD <= 0 then
|
||||
sCD = ConfigTable.GetUIText("Skill_NoCD")
|
||||
end
|
||||
if nCost <= 0 then
|
||||
sCost = ConfigTable.GetUIText("Skill_NoCost")
|
||||
end
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPCD, sCD)
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPEnergy, sCost)
|
||||
local bVisibleCD, bVisibleCost = false, false
|
||||
if mapCfgDataSkill.Type == GameEnum.skillType.NORMAL then
|
||||
bVisibleCD, bVisibleCost = false, false
|
||||
elseif mapCfgDataSkill.Type == GameEnum.skillType.SKILL or mapCfgDataSkill.Type == GameEnum.skillType.SUPPORT then
|
||||
bVisibleCD, bVisibleCost = true, false
|
||||
elseif mapCfgDataSkill.Type == GameEnum.skillType.ULTIMATE then
|
||||
bVisibleCD, bVisibleCost = true, true
|
||||
end
|
||||
self._mapNode.imgEnergyInfoBg:SetActive(bVisibleCost)
|
||||
self._mapNode.imgCDInfoBg:SetActive(bVisibleCD)
|
||||
NovaAPI.SetTMPText(self._mapNode.TMPDesc, UTILS.ParseDesc(mapCfgDataSkill))
|
||||
end
|
||||
function SkillListGridCtrl:OnBtnClick_Word(link, sWordId)
|
||||
UTILS.ClickWordLink(link, sWordId)
|
||||
end
|
||||
return SkillListGridCtrl
|
||||
Reference in New Issue
Block a user