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

228 lines
11 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)
--初始化组件(用于子类重写)
function GongMingResultTips:InitComponent()
-- this.BtnBack = Util.GetGameObject(self.transform, "btnBack")
-- 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")
end
--绑定事件(用于子类重写)
function GongMingResultTips:BindEvent()
Util.AddClick(this.BackMask, function()
self:ClosePanel()
end)
end
--添加事件监听(用于子类重写)
function GongMingResultTips:AddListener()
end
--移除事件监听(用于子类重写)
function GongMingResultTips:RemoveListener()
end
function GongMingResultTips:OnOpen(skinId)
LogGreen("打开面板")
local data = HarmonyManager:GetAdditions()
-- for key, value in pairs(heroConfig[]) do
-- -- body
-- print(key, " ",value)
-- end
--if HarmonyManager.hongmengTablet >= HarmonyManager.TowerStartLimit then
-- body
--LogGreen(HarmonyManager.hongmengTablet)
for i = 1, #data do
if data[i].additionType == 1 then
if data[i].heroTid == 0 then
-- body
local num = HarmonyManager:HongMengTowerUpLimit()
self.upStarSkillTextPreDegree:GetComponent("Text").text = string.format("\t\t\t\t\t\t<color=green>%d级</color>(当前上限%d级)",data[i].value,num)
elseif data[i].heroTid == -1 then
-- body
else
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)
end
elseif data[i].additionType == 2 then
if data[i].value == -1 then
-- body
self.upStarSkillTextPreEquip:GetComponent("Text").text = string.format("\t\t\t\t\t\t\t<color=red>无</color>")
else
local equip = ConfigManager.GetConfigData(ConfigName.EquipStarsConfig,data[i].value)
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)
end
-- body ReadingName
elseif data[i].additionType == 3 then
if data[i].heroTid~= 0 and data[i].value > 0 then
-- body
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)
else
print(" textHun ",data[i].value)
if PlayerManager.level<75 then
-- body
self.upStarSkillTextPreHun:SetActive(false)
self.upStarSkillTextPreHun:GetComponent("Text").text = ""
else
self.upStarSkillTextPreHun:SetActive(true)
self.upStarSkillTextPreHun:GetComponent("Text").text = string.format("\t\t\t\t\t\t\t<color=red>无</color>")
end
end
-- body
elseif data[i].additionType == 4 then
if data[i].heroTid ~= 0 and data[i].value > 0 then
-- body
-- print(tostring(data[i].value).." "..data[i].heroTid.." ConfigManager.TryGetConfigData(ConfigName.HeroConfig, data[i].heroTid).ReadingName ")
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)
else
if PlayerManager.level<75 then
-- body
self.upStarSkillTextPreSoul:SetActive(false)
self.upStarSkillTextPreSoul:GetComponent("Text").text =""
else
self.upStarSkillTextPreSoul:SetActive(true)
self.upStarSkillTextPreSoul:GetComponent("Text").text = string.format("\t\t\t\t\t\t\t<color=red>无</color>")
end
end
-- body
else
if data[i].value ~= -1 then
-- body
print(data[i].heroTid )
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)
else
self.upStarSkillTextPreFa:GetComponent("Text").text =string.format("\t\t\t\t\t\t\t<color=red>无</color>")
end
end
end
--else
-- for i = 1, #data do
-- 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
-- -- 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
-- -- 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)
-- 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
-- -- 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
-- end
-- end
--end
end
--界面关闭时调用(用于子类重写)
function GongMingResultTips:OnClose()
end
--界面销毁时调用(用于子类重写)
function GongMingResultTips:OnDestroy()
end
return GongMingResultTips