miduo_client/Assets/ManagedResources/~Lua/Modules/Harmony/Panel/GongMingResultPanel.lua

218 lines
10 KiB
Lua
Raw Normal View History

2020-12-17 10:41:00 +08:00
require("Base/BasePanel")
GongMingResultTips = Inherit(BasePanel)
local this = GongMingResultTips
local curSelectHeroList={}
local heroDataList={}
local curNeedRoleNum
local openThisPanel
local curHeroData = {}
local TempData = nil;
local SelectHero = nil
local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
--初始化组件(用于子类重写)
function GongMingResultTips:InitComponent()
this.BtnBack = Util.GetGameObject(self.transform, "btnBack")
this.TextOneAll = Util.GetGameObject(self.transform,"grid/TextOne")
this.TextTwoAll = Util.GetGameObject(self.transform,"grid/TextTwo")
2020-12-21 10:08:30 +08:00
this.HeroSkin = Util.GetGameObject(self.transform,"grid/ver/HeroSkin")
2020-12-17 10:41:00 +08:00
end
--绑定事件(用于子类重写)
function GongMingResultTips:BindEvent()
Util.AddClick(this.BtnBack, function()
self:ClosePanel()
end)
end
--添加事件监听(用于子类重写)
function GongMingResultTips:AddListener()
end
--移除事件监听(用于子类重写)
function GongMingResultTips:RemoveListener()
end
local LingDegree = 0
local HunDegree = 0
function GongMingResultTips:OnOpen(flag)
--共鸣前
local SelectId = HarmonyManager:GetUnLoadData()
local herodata = HeroManager.GetSingleHeroData(SelectId)
2020-12-21 10:08:30 +08:00
local heroTData=nil
if herodata.skinId and herodata.skinId>0 then
heroTData=ConfigManager.GetConfigDataByKey(ConfigName.HeroSkin,"Type",herodata.skinId)
else
heroTData= ConfigManager.GetConfigData(ConfigName.HeroConfig,herodata.id)
end
2020-12-17 10:41:00 +08:00
2020-12-21 10:08:30 +08:00
this.liveName = GetResourcePath(heroTData.Live)
this.liveNode = poolManager:LoadLive(this.liveName, this.HeroSkin.transform, Vector3.one * heroTData.Scale*0.7, Vector3.New(heroTData.Position[1], heroTData.Position[2]))
this.liveNode.transform.sizeDelta = Vector2.New(1000, 1000)
local SkeletonGraphic = this.liveNode:GetComponent("SkeletonGraphic")
local idle = function()
SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
end
SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete + idle
poolManager:SetLiveClearCall(this.liveName, this.liveNode, function()
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete - idle
end)
2020-12-17 10:41:00 +08:00
--共鸣后
if flag then
-- body
2020-12-18 13:39:35 +08:00
Util.GetGameObject(this.TextOneAll,"textDegree"):GetComponent("Text").text = string.format("%d",herodata.oriLv)
2020-12-17 10:41:00 +08:00
Util.GetGameObject(this.TextOneAll,"textEqiue"):GetComponent("Text").text = ""
Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = ""
Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = ""
Util.GetGameObject(this.TextOneAll,"textFa"):GetComponent("Text").text = ""
-- if EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2]) then
-- -- body
-- if EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2]).lv then
-- Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = string.format("%d",EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2]).lv)
-- LingDegree = EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2]).lv
-- end
-- else
-- end
-- if EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1]) then
-- -- body
-- if EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1]).lv then
-- -- body
-- Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = string.format("%d",EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1]).lv)
-- HunDegree = EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1]).lv
-- end
-- end
-- Util.GetGameObject(this.TextOneAll,"textFa"):GetComponent("Text").text = string.format("%d",herodata.talismanList)
2020-12-18 13:39:35 +08:00
if HeroManager.IsTenTalent(herodata.star) then
-- body
Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = HarmonyManager.hongmengTablet
else
Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = herodata.lv
end
2020-12-17 10:41:00 +08:00
Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = ""
Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = ""
Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text = ""
Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text = ""
-- local data = HarmonyManager:GetAdditions()
-- for i = 1, #data do
-- if data[i].additionType == 1 then
-- Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = string.format("<color=green>%d</color>",data[i].value)
-- elseif data[i].additionType == 2 then
-- if data[i].value == -1 then
-- Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format("<color=green>无</color>")
-- else
-- Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format("<color=red>%d</color>",data[i].value)
-- end
-- -- body
-- elseif data[i].additionType == 3 then
-- if HunDegree >data[i].value then
-- -- body
-- Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("<color=green>%d</color>",HunDegree)
-- else
-- Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("<color=green>%d</color>",data[i].value)
-- end
-- -- body
-- elseif data[i].additionType == 4 then
-- if LingDegree>data[i].value then
-- Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("<color=green>%d</color>",LingDegree)
-- else
-- Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("<color=green>%d</color>",data[i].value)
-- end
-- -- body
-- else
-- Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text =string.format("<color=green>%d</color>",data[i].value)
-- end
-- end
else
2020-12-18 13:39:35 +08:00
Util.GetGameObject(this.TextOneAll,"textDegree"):GetComponent("Text").text = string.format("%d",herodata.oriLv)
2020-12-17 10:41:00 +08:00
Util.GetGameObject(this.TextOneAll,"textEqiue"):GetComponent("Text").text = ""
if EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2]) then
-- body
if EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2]).lv then
Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = string.format("%d",EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2]).lv)
LingDegree = EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2]).lv
end
else
end
if EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1]) then
-- body
if EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1]).lv then
-- body
Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = string.format("%d",EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1]).lv)
HunDegree = EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1]).lv
end
end
Util.GetGameObject(this.TextOneAll,"textFa"):GetComponent("Text").text = string.format("%d",herodata.talismanList)
local data = HarmonyManager:GetAdditions()
for i = 1, #data do
2020-12-18 13:39:35 +08:00
if data[i].additionType == 1 then
if HarmonyManager.hongmengTablet >= 330 then
-- body
Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = string.format("<color=green>%d</color>",herodata.lv)
else
Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = string.format("<color=green>%d</color>",data[i].value)
end
2020-12-17 10:41:00 +08:00
elseif data[i].additionType == 2 then
if data[i].value == -1 then
Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format("<color=green>无</color>")
else
Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format("<color=red>%d</color>",data[i].value)
end
-- body
elseif data[i].additionType == 3 then
if HunDegree >data[i].value then
-- body
Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("<color=green>%d</color>",HunDegree)
else
Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("<color=green>%d</color>",data[i].value)
end
-- body
elseif data[i].additionType == 4 then
if LingDegree>data[i].value then
Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("<color=green>%d</color>",LingDegree)
else
Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("<color=green>%d</color>",data[i].value)
end
-- body
else
Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text =string.format("<color=green>%d</color>",data[i].value)
end
end
end
end
--界面关闭时调用(用于子类重写)
function GongMingResultTips:OnClose()
end
--界面销毁时调用(用于子类重写)
function GongMingResultTips:OnDestroy()
2020-12-21 10:08:30 +08:00
if this.liveNode then
poolManager:UnLoadLive(this.liveName, this.liveNode)
this.liveNode = nil
end
2020-12-17 10:41:00 +08:00
end
return GongMingResultTips