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

124 lines
5.6 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)
--初始化组件(用于子类重写)
function GongMingResultTips:InitComponent()
2021-04-21 13:12:04 +08:00
this.spLoader = SpriteLoader.New()
2021-01-06 19:35:41 +08:00
self.BackMask = Util.GetGameObject(self.transform, "BackMask")
self.breakOpenSkillGrid =Util.GetGameObject(self.transform, "bg/breakOpenSkill/Mask")
self.upStarSkillTextPreDegree = Util.GetGameObject(self.transform, "bg/upStarSkillTextPre1/content")
self.upStarSkillTextPreEquip = Util.GetGameObject(self.transform, "bg/upStarSkillTextPre2/content")
2022-12-23 14:45:37 +08:00
self.preEquip = Util.GetGameObject(self.transform, "bg/upStarSkillTextPre2")
self.preEquip:SetActive(false)
self.upStarSkillTextPreHun = Util.GetGameObject(self.transform,"bg/upStarSkillTextPre3/content")
2022-12-23 14:45:37 +08:00
self.preHun = Util.GetGameObject(self.transform, "bg/upStarSkillTextPre3")
self.preHun:SetActive(false)
self.upStarSkillTextPreSoul = Util.GetGameObject(self.transform,"bg/upStarSkillTextPre4/content")
2022-12-23 14:45:37 +08:00
self.preSoul = Util.GetGameObject(self.transform, "bg/upStarSkillTextPre4")
self.preSoul:SetActive(false)
self.upStarSkillTextPreFa = Util.GetGameObject(self.transform,"bg/upStarSkillTextPre5/content")
2022-08-31 11:18:55 +08:00
self.upStarSkillTextPreFa1 = Util.GetGameObject(self.transform,"bg/upStarSkillTextPre5")
self.upStarSkillTextPreFa1:SetActive(false)
2021-01-06 19:35:41 +08:00
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
local data = HarmonyManager:GetAdditions()
2021-03-04 11:05:19 +08:00
for i = 1, #data do
if data[i].additionType == 1 then
if data[i].heroTid == 0 then
local num = HarmonyManager:HongMengTowerUpLimit()
2021-03-04 15:16:23 +08:00
self.upStarSkillTextPreDegree:GetComponent("Text").text = string.format(Language[12196],data[i].value,num)
2021-03-04 11:05:19 +08:00
elseif data[i].heroTid == -1 then
else
self.upStarSkillTextPreDegree:GetComponent("Text").text = string.format(Language[12197],data[i].value,GetLanguageStrById(ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName))
2021-03-04 11:05:19 +08:00
end
elseif data[i].additionType == 2 then
if data[i].value == -1 then
2021-03-04 15:16:23 +08:00
self.upStarSkillTextPreEquip:GetComponent("Text").text = string.format(Language[12198])
2021-03-04 11:05:19 +08:00
else
local equip = ConfigManager.GetConfigData(ConfigName.EquipStarsConfig,data[i].value)
self.upStarSkillTextPreEquip:GetComponent("Text").text = GetStringByEquipQua(equip.Quality,string.format(Language[12199],GetQuantityStrByquality(equip.Quality),equip.Stars,GetLanguageStrById(ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName)))
2021-03-04 11:05:19 +08:00
end
elseif data[i].additionType == 3 then
if data[i].heroTid~= 0 and data[i].value > 0 then
self.upStarSkillTextPreHun:SetActive(true)
self.upStarSkillTextPreHun:GetComponent("Text").text = string.format("<color=green>%d</color>(%s)",data[i].value,GetLanguageStrById(ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName))
2021-03-04 11:05:19 +08:00
else
if PlayerManager.level<75 then
self.upStarSkillTextPreHun:SetActive(false)
self.upStarSkillTextPreHun:GetComponent("Text").text = ""
2020-12-17 10:41:00 +08:00
else
2021-01-06 19:35:41 +08:00
self.upStarSkillTextPreHun:SetActive(true)
2021-03-04 15:16:23 +08:00
self.upStarSkillTextPreHun:GetComponent("Text").text = string.format(Language[12198])
2020-12-17 10:41:00 +08:00
end
2021-03-04 11:05:19 +08:00
end
elseif data[i].additionType == 4 then
if data[i].heroTid ~= 0 and data[i].value > 0 then
self.upStarSkillTextPreSoul:SetActive(true)
self.upStarSkillTextPreSoul:GetComponent("Text").text =string.format("<color=green>%d</color>(%s)",data[i].value,GetLanguageStrById(ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName))
2020-12-17 10:41:00 +08:00
else
2021-03-04 11:05:19 +08:00
if PlayerManager.level<75 then
self.upStarSkillTextPreSoul:SetActive(false)
self.upStarSkillTextPreSoul:GetComponent("Text").text =""
2020-12-29 20:36:37 +08:00
else
2021-03-04 11:05:19 +08:00
self.upStarSkillTextPreSoul:SetActive(true)
2021-03-04 15:16:23 +08:00
self.upStarSkillTextPreSoul:GetComponent("Text").text = string.format(Language[12198])
2020-12-29 20:36:37 +08:00
end
2021-03-04 11:05:19 +08:00
end
else
if data[i].value ~= -1 then
print(data[i].heroTid )
self.upStarSkillTextPreFa:GetComponent("Text").text =string.format("<color=green>%d</color>(%s)",data[i].value,GetLanguageStrById(ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName))
2021-03-04 11:05:19 +08:00
else
2021-03-04 15:16:23 +08:00
self.upStarSkillTextPreFa:GetComponent("Text").text =string.format(Language[12198])
2020-12-17 10:41:00 +08:00
end
end
2021-03-04 11:05:19 +08:00
end
2020-12-17 10:41:00 +08:00
end
--界面关闭时调用(用于子类重写)
function GongMingResultTips:OnClose()
end
--界面销毁时调用(用于子类重写)
function GongMingResultTips:OnDestroy()
2021-04-21 13:12:04 +08:00
this.spLoader:Destroy()
2020-12-17 10:41:00 +08:00
end
return GongMingResultTips