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

308 lines
14 KiB
Lua
Raw Normal View History

2021-04-21 13:12:04 +08:00
require("Base/BasePanel")
2020-12-17 10:41:00 +08:00
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)
2021-01-11 21:04:12 +08:00
local jewelConfig = ConfigManager.GetConfig(ConfigName.JewelConfig)
2020-12-17 10:41:00 +08:00
--初始化组件(用于子类重写)
function GongMingResultTips:InitComponent()
2021-04-21 13:12:04 +08:00
this.spLoader = SpriteLoader.New()
2020-12-17 10:41:00 +08:00
this.BtnBack = Util.GetGameObject(self.transform, "btnBack")
2021-01-14 21:11:53 +08:00
this.textTitle = Util.GetGameObject(self.transform,"grid/ver/textTitle"):GetComponent("Text")
2020-12-17 10:41:00 +08:00
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")
2022-08-31 11:47:15 +08:00
Util.GetGameObject(self.transform,"grid/ver/recordPer (1)/name/text (5)"):SetActive(false)
Util.GetGameObject(self.transform,"grid/ver/recordPer (1)/Image (19)"):SetActive(false)
2021-01-14 21:11:53 +08:00
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
2020-12-28 10:44:31 +08:00
local LingDegree = -1
local HunDegree = -1
2020-12-17 10:41:00 +08:00
function GongMingResultTips:OnOpen(flag)
--共鸣前
local SelectId = HarmonyManager:GetUnLoadData()
local herodata = HeroManager.GetSingleHeroData(SelectId)
2021-01-20 12:02:04 +08:00
print("herodata.equipIdList ",#herodata.equipIdList)
2021-01-07 21:45:22 +08:00
local _Star = EquipManager.GetMinEquipStar(herodata.equipIdList)
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)
2020-12-25 15:33:12 +08:00
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)
2020-12-21 10:08:30 +08:00
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
2021-01-14 21:11:53 +08:00
else
2024-01-03 15:24:49 +08:00
if HarmonyManager:HongMengTowerUpLimit()>=300 then
2020-12-18 13:39:35 +08:00
-- body
2021-03-02 16:53:12 +08:00
this.textTitle.text = Language[12193]
2021-03-04 15:16:23 +08:00
else
this.textTitle.text = Language[12194]
2020-12-18 13:39:35 +08:00
end
2021-01-07 21:45:22 +08:00
local data = HarmonyManager:GetAdditions()
2020-12-18 13:39:35 +08:00
Util.GetGameObject(this.TextOneAll,"textDegree"):GetComponent("Text").text = string.format("%d",herodata.oriLv)
2022-12-23 14:45:37 +08:00
if data[2] and data[2].value > 0 then
2021-01-07 21:45:22 +08:00
-- 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
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextOneAll,"textEqiue"):GetComponent("Text").text = Language[10086]
2021-01-07 21:45:22 +08:00
else
if _Star == 0 then
-- body
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextOneAll,"textEqiue"):GetComponent("Text").text = Language[10086]
2021-01-07 21:45:22 +08:00
else
local equip = ConfigManager.GetConfigData(ConfigName.EquipStarsConfig,_Star)
2021-03-04 15:16:23 +08:00
Util.GetGameObject(this.TextOneAll,"textEqiue"):GetComponent("Text").text = string.format(Language[12195],GetQuantityStrByquality(equip.Quality),equip.Stars)
2021-01-07 21:45:22 +08:00
end
end
2021-01-11 21:04:12 +08:00
local dataRockOne = EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2])
if dataRockOne then
2020-12-17 10:41:00 +08:00
-- body
2021-03-02 16:53:12 +08:00
if dataRockOne.type == Language[10552] then
2021-01-18 17:43:11 +08:00
-- 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
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = Language[10086]
2021-01-11 21:04:12 +08:00
else
2021-01-18 17:43:11 +08:00
-- body
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = Language[10086]
2021-01-11 21:04:12 +08:00
end
2021-01-08 17:29:54 +08:00
else
2021-01-18 17:43:11 +08:00
--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
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = Language[10086]
2021-01-18 17:43:11 +08:00
else
-- body
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = Language[10086]
2021-01-18 17:43:11 +08:00
end
2020-12-17 10:41:00 +08:00
end
2021-01-18 17:43:11 +08:00
-- if dataRockOne.oriLv >= 0 then
-- else
-- Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = "无"
-- end
2020-12-28 10:44:31 +08:00
else
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = Language[10086]
2020-12-17 10:41:00 +08:00
end
2021-01-11 21:04:12 +08:00
local dataRockTwo = EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1])
if dataRockTwo then
2020-12-17 10:41:00 +08:00
-- body
2021-03-02 16:53:12 +08:00
if dataRockTwo.type == Language[10553] then
2021-01-18 17:43:11 +08:00
-- body
LingDegree = dataRockTwo.oriLv
if LingDegree > 0 then
2021-01-11 21:04:12 +08:00
-- body
2021-01-18 17:43:11 +08:00
Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = string.format("%d",LingDegree)
elseif LingDegree == 0 then
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = Language[10086]
2021-01-11 21:04:12 +08:00
else
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = Language[10086]
2021-01-18 17:43:11 +08:00
-- body
end
2021-01-08 17:29:54 +08:00
else
2021-01-18 17:43:11 +08:00
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
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = Language[10086]
2021-01-18 17:43:11 +08:00
else
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = Language[10086]
2021-01-18 17:43:11 +08:00
end
2020-12-17 10:41:00 +08:00
end
2021-01-18 17:43:11 +08:00
2020-12-28 10:44:31 +08:00
else
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = Language[10086]
2020-12-17 10:41:00 +08:00
end
2020-12-28 10:44:31 +08:00
if herodata.star >= 6 then
2020-12-26 15:58:03 +08:00
-- body
2024-01-03 15:24:49 +08:00
-- if herodata.talismanList > 0 then
-- -- body
-- Util.GetGameObject(this.TextOneAll,"textFa"):GetComponent("Text").text = string.format("%d",herodata.oritalismanList)
-- else
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextOneAll,"textFa"):GetComponent("Text").text = string.format(Language[10086])
2024-01-03 15:24:49 +08:00
--end
2020-12-26 15:58:03 +08:00
else
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextOneAll,"textFa"):GetComponent("Text").text = string.format(Language[10086])
2020-12-26 15:58:03 +08:00
end
2022-08-31 11:47:15 +08:00
Util.GetGameObject(this.TextOneAll,"textFa"):SetActive(false)
2020-12-28 10:44:31 +08:00
2020-12-17 10:41:00 +08:00
2021-01-07 21:45:22 +08:00
2020-12-17 10:41:00 +08:00
for i = 1, #data do
2020-12-18 13:39:35 +08:00
if data[i].additionType == 1 then
2020-12-23 17:41:31 +08:00
if HarmonyManager.hongmengTablet >= HarmonyManager.TowerStartLimit then
2020-12-18 13:39:35 +08:00
-- body
2021-01-07 21:45:22 +08:00
Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = string.format("%d",herodata.lv)
2020-12-18 13:39:35 +08:00
else
2021-01-07 21:45:22 +08:00
Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = string.format("%d",herodata.lv)
2020-12-18 13:39:35 +08:00
end
2020-12-17 10:41:00 +08:00
elseif data[i].additionType == 2 then
if data[i].value == -1 then
2021-01-07 21:45:22 +08:00
if _Star == 0 then
-- body
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format(Language[10086])
2021-01-07 21:45:22 +08:00
else
local equip = ConfigManager.GetConfigData(ConfigName.EquipStarsConfig,_Star)
2021-03-04 15:16:23 +08:00
Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format(Language[12195],GetQuantityStrByquality(equip.Quality),equip.Stars)
2021-01-07 21:45:22 +08:00
end
2020-12-17 10:41:00 +08:00
else
2021-01-07 21:45:22 +08:00
local equip = ConfigManager.GetConfigData(ConfigName.EquipStarsConfig,data[i].value)
2021-03-04 15:16:23 +08:00
Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format(Language[12195],GetQuantityStrByquality(equip.Quality),equip.Stars)
2020-12-17 10:41:00 +08:00
end
-- body
elseif data[i].additionType == 3 then
2021-01-18 17:43:11 +08:00
print(HunDegree.." !!!!!!!!! "..data[i].value)
2021-01-07 21:45:22 +08:00
if HunDegree ~= -1 and data[i].value > 0 then
2020-12-17 10:41:00 +08:00
-- body
2020-12-28 10:44:31 +08:00
if HunDegree >data[i].value then
-- body
2021-01-07 21:45:22 +08:00
Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("%d",HunDegree)
2020-12-28 10:44:31 +08:00
else
2021-01-07 21:45:22 +08:00
Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("%d",data[i].value)
2020-12-28 10:44:31 +08:00
end
2020-12-17 10:41:00 +08:00
else
2021-01-07 21:45:22 +08:00
if HunDegree > 0 then
-- body
Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("%d",HunDegree)
else
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = Language[10086]
2021-01-07 21:45:22 +08:00
end
2020-12-28 10:44:31 +08:00
end
2020-12-17 10:41:00 +08:00
-- body
elseif data[i].additionType == 4 then
2021-01-18 17:43:11 +08:00
print(HunDegree.." @@@@@@@@@@@@ "..data[i].value)
2021-01-07 21:45:22 +08:00
if LingDegree ~= -1 and data[i].value > 0 then
2020-12-28 10:44:31 +08:00
-- body
if LingDegree>data[i].value then
2021-01-07 21:45:22 +08:00
Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("%d",LingDegree)
2020-12-28 10:44:31 +08:00
else
2021-01-07 21:45:22 +08:00
Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("%d",data[i].value)
2020-12-28 10:44:31 +08:00
end
2020-12-17 10:41:00 +08:00
else
2021-01-07 21:45:22 +08:00
if LingDegree > 0 then
-- body
Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("%d",LingDegree)
else
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text = Language[10086]
2021-01-07 21:45:22 +08:00
end
2020-12-17 10:41:00 +08:00
end
2020-12-28 10:44:31 +08:00
2020-12-17 10:41:00 +08:00
-- body
else
2020-12-28 10:44:31 +08:00
if herodata.star >= 6 then
2020-12-26 15:58:03 +08:00
-- body
2021-01-07 21:45:22 +08:00
if data[i].value > 0 and data[i].value > herodata.talismanList then
2020-12-28 10:44:31 +08:00
-- body data[i].value > herodata.talismanList or data[i].value and herodata.talismanList
2021-01-07 21:45:22 +08:00
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)
2020-12-28 10:44:31 +08:00
else
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text =string.format(Language[10086])
2020-12-28 10:44:31 +08:00
end
2020-12-26 15:58:03 +08:00
else
2021-03-02 16:53:12 +08:00
Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text =string.format(Language[10086])
2020-12-26 15:58:03 +08:00
end
2022-08-31 11:47:15 +08:00
Util.GetGameObject(this.TextTwoAll,"textFa"):SetActive(false)
2020-12-26 15:58:03 +08:00
2020-12-17 10:41:00 +08:00
end
2022-08-31 11:47:15 +08:00
Util.GetGameObject(this.TextTwoAll,"textFa"):SetActive(false)
2020-12-17 10:41:00 +08:00
end
end
end
--界面关闭时调用(用于子类重写)
function GongMingResultTips:OnClose()
2020-12-25 15:33:12 +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
--界面销毁时调用(用于子类重写)
function GongMingResultTips:OnDestroy()
2021-04-21 13:12:04 +08:00
this.spLoader:Destroy()
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