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()
|
|
|
|
|
2021-01-06 19:35:41 +08:00
|
|
|
-- this.BtnBack = Util.GetGameObject(self.transform, "btnBack")
|
2020-12-17 10:41:00 +08:00
|
|
|
|
|
|
|
|
2021-01-06 19:35:41 +08:00
|
|
|
-- this.TextAll = Util.GetGameObject(self.transform,"grid/TextAll")
|
|
|
|
-- this.contentHunText = Util.GetGameObject(self.transform,"grid/ver/recordPer (1)/name/text (3)")
|
|
|
|
-- this.contentLingText = Util.GetGameObject(self.transform,"grid/ver/recordPer (1)/name/text (4)")
|
|
|
|
|
|
|
|
self.BackMask = Util.GetGameObject(self.transform, "BackMask")
|
|
|
|
|
|
|
|
|
|
|
|
self.breakOpenSkillGrid =Util.GetGameObject(self.transform, "bg/breakOpenSkill/Mask")
|
|
|
|
self.upStarSkillTextPreDegree = Util.GetGameObject(self.transform, "bg/upStarSkillTextPre")
|
|
|
|
self.upStarSkillTextPreEquip = Util.GetGameObject(self.transform, "bg/upStarSkillTextPre (1)")
|
|
|
|
self.upStarSkillTextPreHun = Util.GetGameObject(self.transform,"bg/upStarSkillTextPre (2)")
|
|
|
|
self.upStarSkillTextPreSoul = Util.GetGameObject(self.transform,"bg/upStarSkillTextPre (3)")
|
|
|
|
self.upStarSkillTextPreFa = Util.GetGameObject(self.transform,"bg/upStarSkillTextPre (4)")
|
|
|
|
self.upStarOpenSkill =Util.GetGameObject(self.transform, "bg/upStarOpenSkill/Mask")
|
2020-12-17 10:41:00 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--绑定事件(用于子类重写)
|
|
|
|
function GongMingResultTips:BindEvent()
|
|
|
|
|
2021-01-06 19:35:41 +08:00
|
|
|
Util.AddClick(this.BackMask, function()
|
2020-12-17 10:41:00 +08:00
|
|
|
self:ClosePanel()
|
|
|
|
end)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--添加事件监听(用于子类重写)
|
|
|
|
function GongMingResultTips:AddListener()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--移除事件监听(用于子类重写)
|
|
|
|
function GongMingResultTips:RemoveListener()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2020-12-21 10:08:30 +08:00
|
|
|
function GongMingResultTips:OnOpen(skinId)
|
2020-12-17 10:41:00 +08:00
|
|
|
LogGreen("打开面板")
|
|
|
|
local data = HarmonyManager:GetAdditions()
|
|
|
|
-- for key, value in pairs(heroConfig[]) do
|
|
|
|
-- -- body
|
|
|
|
-- print(key, " ",value)
|
|
|
|
-- end
|
2020-12-22 19:55:39 +08:00
|
|
|
|
2020-12-28 20:02:36 +08:00
|
|
|
--if HarmonyManager.hongmengTablet >= HarmonyManager.TowerStartLimit then
|
2020-12-17 10:41:00 +08:00
|
|
|
-- body
|
|
|
|
--LogGreen(HarmonyManager.hongmengTablet)
|
|
|
|
for i = 1, #data do
|
|
|
|
|
|
|
|
if data[i].additionType == 1 then
|
2020-12-28 20:02:36 +08:00
|
|
|
if data[i].heroTid == 0 then
|
|
|
|
-- body
|
|
|
|
local num = HarmonyManager:HongMengTowerUpLimit()
|
2021-01-06 19:35:41 +08:00
|
|
|
self.upStarSkillTextPreDegree:GetComponent("Text").text = string.format("\t\t\t\t\t\t<color=green>%d级</color>(当前上限%d级)",data[i].value,num)
|
2020-12-28 20:02:36 +08:00
|
|
|
elseif data[i].heroTid == -1 then
|
|
|
|
-- body
|
|
|
|
|
|
|
|
else
|
2021-01-06 19:35:41 +08:00
|
|
|
self.upStarSkillTextPreDegree:GetComponent("Text").text = string.format("\t\t\t\t\t\t<color=green>%d级</color>(%s)",data[i].value,ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName)
|
2020-12-28 20:02:36 +08:00
|
|
|
end
|
|
|
|
|
2020-12-17 10:41:00 +08:00
|
|
|
elseif data[i].additionType == 2 then
|
|
|
|
if data[i].value == -1 then
|
|
|
|
-- body
|
2021-01-08 17:29:54 +08:00
|
|
|
self.upStarSkillTextPreEquip:GetComponent("Text").text = string.format("\t\t\t\t\t\t<color=red>无</color>")
|
2020-12-17 10:41:00 +08:00
|
|
|
else
|
2020-12-18 13:39:35 +08:00
|
|
|
local equip = ConfigManager.GetConfigData(ConfigName.EquipStarsConfig,data[i].value)
|
|
|
|
|
2021-01-11 21:04:12 +08:00
|
|
|
self.upStarSkillTextPreEquip:GetComponent("Text").text = string.format("\t\t\t\t\t\t<color=green>%s%d星</color>(%s)",GetQuantityStrByquality(equip.Quality),equip.Stars,ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName)
|
2020-12-17 10:41:00 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
-- body ReadingName
|
|
|
|
elseif data[i].additionType == 3 then
|
2021-01-06 19:35:41 +08:00
|
|
|
if data[i].heroTid~= 0 and data[i].value > 0 then
|
2020-12-17 10:41:00 +08:00
|
|
|
-- body
|
2021-01-06 19:35:41 +08:00
|
|
|
self.upStarSkillTextPreHun:SetActive(true)
|
|
|
|
self.upStarSkillTextPreHun:GetComponent("Text").text = string.format("\t\t\t\t\t\t<color=green>%d</color>(%s)",data[i].value,ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName)
|
2020-12-17 10:41:00 +08:00
|
|
|
else
|
2020-12-22 19:27:49 +08:00
|
|
|
print(" textHun ",data[i].value)
|
2020-12-22 19:55:39 +08:00
|
|
|
if PlayerManager.level<75 then
|
|
|
|
-- body
|
2021-01-06 19:35:41 +08:00
|
|
|
self.upStarSkillTextPreHun:SetActive(false)
|
|
|
|
self.upStarSkillTextPreHun:GetComponent("Text").text = ""
|
2020-12-22 19:55:39 +08:00
|
|
|
else
|
2021-01-06 19:35:41 +08:00
|
|
|
self.upStarSkillTextPreHun:SetActive(true)
|
2021-01-08 17:29:54 +08:00
|
|
|
self.upStarSkillTextPreHun:GetComponent("Text").text = string.format("\t\t\t\t\t\t<color=red>无</color>")
|
2020-12-22 19:55:39 +08:00
|
|
|
end
|
|
|
|
|
2020-12-17 10:41:00 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
-- body
|
|
|
|
elseif data[i].additionType == 4 then
|
2021-01-06 19:35:41 +08:00
|
|
|
if data[i].heroTid ~= 0 and data[i].value > 0 then
|
2020-12-17 10:41:00 +08:00
|
|
|
-- body
|
|
|
|
-- print(tostring(data[i].value).." "..data[i].heroTid.." ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName ")
|
2021-01-06 19:35:41 +08:00
|
|
|
self.upStarSkillTextPreSoul:SetActive(true)
|
|
|
|
self.upStarSkillTextPreSoul:GetComponent("Text").text =string.format("\t\t\t\t\t\t<color=green>%d</color>(%s)",data[i].value,ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName)
|
2020-12-17 10:41:00 +08:00
|
|
|
|
|
|
|
|
|
|
|
else
|
2020-12-22 19:55:39 +08:00
|
|
|
if PlayerManager.level<75 then
|
|
|
|
-- body
|
2021-01-06 19:35:41 +08:00
|
|
|
self.upStarSkillTextPreSoul:SetActive(false)
|
|
|
|
self.upStarSkillTextPreSoul:GetComponent("Text").text =""
|
2020-12-22 19:55:39 +08:00
|
|
|
else
|
2021-01-06 19:35:41 +08:00
|
|
|
self.upStarSkillTextPreSoul:SetActive(true)
|
2021-01-08 17:29:54 +08:00
|
|
|
self.upStarSkillTextPreSoul:GetComponent("Text").text = string.format("\t\t\t\t\t\t<color=red>无</color>")
|
2020-12-22 19:55:39 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2020-12-17 10:41:00 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
-- body
|
|
|
|
else
|
2020-12-29 20:36:37 +08:00
|
|
|
if data[i].value ~= -1 then
|
|
|
|
-- body
|
|
|
|
print(data[i].heroTid )
|
2021-01-06 19:35:41 +08:00
|
|
|
self.upStarSkillTextPreFa:GetComponent("Text").text =string.format("\t\t\t\t\t\t<color=green>%d</color>(%s)",data[i].value,ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName)
|
2020-12-29 20:36:37 +08:00
|
|
|
else
|
2021-01-08 17:29:54 +08:00
|
|
|
self.upStarSkillTextPreFa:GetComponent("Text").text =string.format("\t\t\t\t\t\t<color=red>无</color>")
|
2020-12-29 20:36:37 +08:00
|
|
|
end
|
|
|
|
|
2020-12-17 10:41:00 +08:00
|
|
|
end
|
|
|
|
end
|
2020-12-28 20:02:36 +08:00
|
|
|
--else
|
|
|
|
-- for i = 1, #data do
|
2020-12-17 10:41:00 +08:00
|
|
|
|
2020-12-28 20:02:36 +08:00
|
|
|
-- if data[i].additionType == 1 then
|
|
|
|
-- print(data[i].value," ")
|
|
|
|
-- Util.GetGameObject(this.TextAll,"textDegree"):GetComponent("Text").text = string.format("<color=green>%d级</color>(%s)",data[i].value,ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName)
|
|
|
|
-- elseif data[i].additionType == 2 then
|
|
|
|
-- if data[i].value == -1 then
|
|
|
|
-- -- body
|
|
|
|
-- Util.GetGameObject(this.TextAll,"textEqiue"):GetComponent("Text").text = string.format("<color=red>无</color>")
|
|
|
|
-- else
|
|
|
|
-- Util.GetGameObject(this.TextAll,"textEqiue"):GetComponent("Text").text = string.format("<color=red>装备%d品</color>(%s)",data[i].value,ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName)
|
|
|
|
-- end
|
2020-12-17 10:41:00 +08:00
|
|
|
|
2020-12-28 20:02:36 +08:00
|
|
|
-- -- body ReadingName
|
|
|
|
-- elseif data[i].additionType == 3 then
|
|
|
|
-- if data[i].heroTid~=0 then
|
|
|
|
-- -- body
|
|
|
|
-- this.contentLingText:SetActive(true)
|
|
|
|
-- Util.GetGameObject(this.TextAll,"textHun"):GetComponent("Text").text = string.format("<color=green>%d</color>(%s)",data[i].value,ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName)
|
|
|
|
-- else
|
|
|
|
-- if PlayerManager.level<75 then
|
|
|
|
-- -- body
|
|
|
|
-- this.contentLingText:SetActive(false)
|
|
|
|
-- Util.GetGameObject(this.TextAll,"textHun"):GetComponent("Text").text = ""
|
|
|
|
-- else
|
|
|
|
-- this.contentLingText:SetActive(true)
|
|
|
|
-- Util.GetGameObject(this.TextAll,"textHun"):GetComponent("Text").text = string.format("<color=red>无</color>")
|
|
|
|
-- end
|
|
|
|
-- -- Util.GetGameObject(this.TextAll,"textHun"):GetComponent("Text").text = string.format("<color=green>%d</color>",data[i].value)
|
|
|
|
-- --Util.GetGameObject(this.TextAll,"textHun"):GetComponent("Text").text = string.format("<color=red>无</color>")
|
|
|
|
-- end
|
2020-12-17 10:41:00 +08:00
|
|
|
|
2020-12-28 20:02:36 +08:00
|
|
|
-- -- body
|
|
|
|
-- elseif data[i].additionType == 4 then
|
|
|
|
-- if data[i].heroTid ~= 0 then
|
|
|
|
-- -- body
|
|
|
|
-- -- print(tostring(data[i].value).." "..data[i].heroTid.." ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName ")
|
|
|
|
-- this.contentHunText:SetActive(true)
|
|
|
|
-- Util.GetGameObject(this.TextAll,"textLing"):GetComponent("Text").text =string.format("<color=green>%d</color>(%s)",data[i].value,ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName)
|
2020-12-17 10:41:00 +08:00
|
|
|
|
2020-12-28 20:02:36 +08:00
|
|
|
-- else
|
|
|
|
-- if PlayerManager.level<75 then
|
|
|
|
-- -- body
|
|
|
|
-- this.contentHunText:SetActive(false)
|
|
|
|
-- Util.GetGameObject(this.TextAll,"textLing"):GetComponent("Text").text = ""
|
|
|
|
-- else
|
|
|
|
-- this.contentHunText:SetActive(true)
|
|
|
|
-- Util.GetGameObject(this.TextAll,"textLing"):GetComponent("Text").text = string.format("<color=red>无</color>")
|
|
|
|
-- end
|
|
|
|
-- -- Util.GetGameObject(this.TextAll,"textLing"):GetComponent("Text").text = string.format("<color=green>%d</color>",data[i].value)
|
|
|
|
-- --Util.GetGameObject(this.TextAll,"textLing"):GetComponent("Text").text = string.format("<color=red>无</color>")
|
|
|
|
-- end
|
2020-12-17 10:41:00 +08:00
|
|
|
|
2020-12-28 20:02:36 +08:00
|
|
|
-- -- body
|
|
|
|
-- else
|
|
|
|
-- if data[i].value > 0 then
|
|
|
|
-- -- body
|
|
|
|
-- Util.GetGameObject(this.TextAll,"textFa"):GetComponent("Text").text =string.format("<color=green>%d</color>(%s)",data[i].value,ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName)
|
|
|
|
-- else
|
|
|
|
-- Util.GetGameObject(this.TextAll,"textFa"):GetComponent("Text").text =string.format("<color=red>无</color>")
|
|
|
|
-- end
|
2020-12-26 15:58:03 +08:00
|
|
|
|
2020-12-28 20:02:36 +08:00
|
|
|
-- end
|
|
|
|
-- end
|
2020-12-17 10:41:00 +08:00
|
|
|
|
2020-12-28 20:02:36 +08:00
|
|
|
--end
|
2020-12-17 10:41:00 +08:00
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--界面关闭时调用(用于子类重写)
|
|
|
|
function GongMingResultTips:OnClose()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--界面销毁时调用(用于子类重写)
|
|
|
|
function GongMingResultTips:OnDestroy()
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
return GongMingResultTips
|