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

303 lines
13 KiB
Lua

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)
local jewelConfig = ConfigManager.GetConfig(ConfigName.JewelConfig)
--初始化组件(用于子类重写)
function GongMingResultTips:InitComponent()
this.BtnBack = Util.GetGameObject(self.transform, "btnBack")
this.textTitle = Util.GetGameObject(self.transform,"grid/ver/textTitle"):GetComponent("Text")
this.TextOneAll = Util.GetGameObject(self.transform,"grid/TextOne")
this.TextTwoAll = Util.GetGameObject(self.transform,"grid/TextTwo")
this.HeroSkin = Util.GetGameObject(self.transform,"grid/ver/HeroSkin")
end
--绑定事件(用于子类重写)
function GongMingResultTips:BindEvent()
Util.AddClick(this.BtnBack, function()
self:ClosePanel()
end)
end
--添加事件监听(用于子类重写)
function GongMingResultTips:AddListener()
end
--移除事件监听(用于子类重写)
function GongMingResultTips:RemoveListener()
end
local LingDegree = -1
local HunDegree = -1
function GongMingResultTips:OnOpen(flag)
--共鸣前
local SelectId = HarmonyManager:GetUnLoadData()
local herodata = HeroManager.GetSingleHeroData(SelectId)
print("herodata.equipIdList ",#herodata.equipIdList)
local _Star = EquipManager.GetMinEquipStar(herodata.equipIdList)
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
this.liveName = GetResourcePath(heroTData.Live)
this.liveNode = poolManager:LoadLive(this.liveName, this.HeroSkin.transform, Vector3.one * heroTData.Scale, Vector3.New(heroTData.Position[1], heroTData.Position[2]))
-- this.liveNode.transform.sizeDelta = Vector2.New(1000, 1000)
this.HeroSkin:GetComponent("RectTransform").localScale = Vector2.New(0.7,0.7)
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)
--共鸣后
if flag then
else
if HarmonyManager:HongMengTowerUpLimit()>=330 then
-- body
this.textTitle.text = Language[12193]
else
this.textTitle.text = Language[12194]
end
local data = HarmonyManager:GetAdditions()
Util.GetGameObject(this.TextOneAll,"textDegree"):GetComponent("Text").text = string.format("%d",herodata.oriLv)
if data[2].value > 0 then
-- body
-- if _Star >= data[2].value then
-- -- body
-- -- local equip = ConfigManager.GetConfigData(ConfigName.EquipStarsConfig,_Star)
-- -- Util.GetGameObject(this.TextOneAll,"textEqiue"):GetComponent("Text").text = string.format("%s%d星",GetQuantityStrByquality(equip.Quality),equip.Stars)
-- else
-- end
Util.GetGameObject(this.TextOneAll,"textEqiue"):GetComponent("Text").text = Language[10086]
else
if _Star == 0 then
-- body
Util.GetGameObject(this.TextOneAll,"textEqiue"):GetComponent("Text").text = Language[10086]
else
local equip = ConfigManager.GetConfigData(ConfigName.EquipStarsConfig,_Star)
Util.GetGameObject(this.TextOneAll,"textEqiue"):GetComponent("Text").text = string.format(Language[12195],GetQuantityStrByquality(equip.Quality),equip.Stars)
end
end
local dataRockOne = EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2])
if dataRockOne then
-- body
if dataRockOne.type == Language[10552] then
-- body
-- Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = string.format("%d",dataRockOne.oriLv)
HunDegree = dataRockOne.oriLv
if HunDegree > 0 then
Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = string.format("%d",HunDegree)
elseif HunDegree == 0 then
Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = Language[10086]
else
-- body
Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = Language[10086]
end
else
--Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = string.format("%d",dataRockOne.oriLv)
LingDegree = dataRockOne.oriLv
if LingDegree > 0 then
Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = string.format("%d",LingDegree)
elseif LingDegree == 0 then
Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = Language[10086]
else
-- body
Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = Language[10086]
end
end
-- if dataRockOne.oriLv >= 0 then
-- else
-- Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = "无"
-- end
else
Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = Language[10086]
end
local dataRockTwo = EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1])
if dataRockTwo then
-- body
if dataRockTwo.type == Language[10553] then
-- body
LingDegree = dataRockTwo.oriLv
if LingDegree > 0 then
-- body
Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = string.format("%d",LingDegree)
elseif LingDegree == 0 then
Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = Language[10086]
else
Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = Language[10086]
-- body
end
else
HunDegree = dataRockTwo.oriLv
if HunDegree > 0 then
-- body
Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = string.format("%d",HunDegree)
elseif HunDegree == 0 then
-- body
Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = Language[10086]
else
Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = Language[10086]
end
end
else
Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = Language[10086]
end
if herodata.star >= 6 then
-- body
if herodata.talismanList > 0 then
-- body
Util.GetGameObject(this.TextOneAll,"textFa"):GetComponent("Text").text = string.format("%d",herodata.oritalismanList)
else
Util.GetGameObject(this.TextOneAll,"textFa"):GetComponent("Text").text = string.format(Language[10086])
end
else
Util.GetGameObject(this.TextOneAll,"textFa"):GetComponent("Text").text = string.format(Language[10086])
end
for i = 1, #data do
if data[i].additionType == 1 then
if HarmonyManager.hongmengTablet >= HarmonyManager.TowerStartLimit then
-- body
Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = string.format("%d",herodata.lv)
else
Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = string.format("%d",herodata.lv)
end
elseif data[i].additionType == 2 then
if data[i].value == -1 then
if _Star == 0 then
-- body
Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format(Language[10086])
else
local equip = ConfigManager.GetConfigData(ConfigName.EquipStarsConfig,_Star)
Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format(Language[12195],GetQuantityStrByquality(equip.Quality),equip.Stars)
end
else
local equip = ConfigManager.GetConfigData(ConfigName.EquipStarsConfig,data[i].value)
Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format(Language[12195],GetQuantityStrByquality(equip.Quality),equip.Stars)
end
-- body
elseif data[i].additionType == 3 then
print(HunDegree.." !!!!!!!!! "..data[i].value)
if HunDegree ~= -1 and data[i].value > 0 then
-- body
if HunDegree >data[i].value then
-- body
Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("%d",HunDegree)
else
Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("%d",data[i].value)
end
else
if HunDegree > 0 then
-- body
Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("%d",HunDegree)
else
Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = Language[10086]
end
end
-- body
elseif data[i].additionType == 4 then
print(HunDegree.." @@@@@@@@@@@@ "..data[i].value)
if LingDegree ~= -1 and data[i].value > 0 then
-- body
if LingDegree>data[i].value then
Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("%d",LingDegree)
else
Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("%d",data[i].value)
end
else
if LingDegree > 0 then
-- body
Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("%d",LingDegree)
else
Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text = Language[10086]
end
end
-- body
else
if herodata.star >= 6 then
-- body
if data[i].value > 0 and data[i].value > herodata.talismanList then
-- body data[i].value > herodata.talismanList or data[i].value and herodata.talismanList
Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text =string.format("%d",data[i].value)
elseif data[i].value <= herodata.talismanList then
-- body
Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text =string.format("%d",herodata.talismanList)
else
Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text =string.format(Language[10086])
end
else
Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text =string.format(Language[10086])
end
end
end
end
end
--界面关闭时调用(用于子类重写)
function GongMingResultTips:OnClose()
if this.liveNode then
poolManager:UnLoadLive(this.liveName, this.liveNode)
this.liveNode = nil
end
end
--界面销毁时调用(用于子类重写)
function GongMingResultTips:OnDestroy()
if this.liveNode then
poolManager:UnLoadLive(this.liveName, this.liveNode)
this.liveNode = nil
end
end
return GongMingResultTips