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

159 lines
6.8 KiB
Lua
Raw Normal View History

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()
this.BtnBack = Util.GetGameObject(self.transform, "btnBack")
this.TextAll = Util.GetGameObject(self.transform,"grid/TextAll")
end
--绑定事件(用于子类重写)
function GongMingResultTips:BindEvent()
Util.AddClick(this.BtnBack, function()
self:ClosePanel()
end)
end
--添加事件监听(用于子类重写)
function GongMingResultTips:AddListener()
end
--移除事件监听(用于子类重写)
function GongMingResultTips:RemoveListener()
end
function GongMingResultTips:OnOpen(equipSId)
LogGreen("打开面板")
local data = HarmonyManager:GetAdditions()
-- for key, value in pairs(heroConfig[]) do
-- -- body
-- print(key, " ",value)
-- end
if HarmonyManager.hongmengTablet >= 330 then
-- body
--LogGreen(HarmonyManager.hongmengTablet)
for i = 1, #data do
if data[i].additionType == 1 then
local num = HarmonyManager:HongMengTowerUpLimit()
Util.GetGameObject(this.TextAll,"textDegree"):GetComponent("Text").text = string.format("<color=green>%d级</color>(当前上限%d级)",HarmonyManager.hongmengTablet,330+num*5)
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
2020-12-18 13:39:35 +08:00
local equip = ConfigManager.GetConfigData(ConfigName.EquipStarsConfig,data[i].value)
Util.GetGameObject(this.TextAll,"textEqiue"):GetComponent("Text").text = string.format("<color=red>%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
if data[i].heroTid~=0 then
-- body
2020-12-18 13:39:35 +08:00
2020-12-17 10:41:00 +08:00
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
Util.GetGameObject(this.TextAll,"textHun"):GetComponent("Text").text = string.format("<color=green>%d</color>",data[i].value)
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 ")
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
Util.GetGameObject(this.TextAll,"textHun"):GetComponent("Text").text = string.format("<color=green>%d</color>",data[i].value)
end
-- body
else
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)
end
end
else
for i = 1, #data do
if data[i].additionType == 1 then
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
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
Util.GetGameObject(this.TextAll,"textHun"):GetComponent("Text").text = string.format("<color=green>%d</color>",data[i].value)
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 ")
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
Util.GetGameObject(this.TextAll,"textHun"):GetComponent("Text").text = string.format("<color=green>%d</color>",data[i].value)
end
-- body
else
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)
end
end
end
end
--界面关闭时调用(用于子类重写)
function GongMingResultTips:OnClose()
end
--界面销毁时调用(用于子类重写)
function GongMingResultTips:OnDestroy()
end
return GongMingResultTips