PGRData/Script/matrix/xui/xuiguildboss/component/XUiGuildBossLog.lua
2024-09-01 22:49:41 +02:00

37 lines
No EOL
1.6 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--工会boss日志组件
local XUiGuildBossLog = XClass(nil, "XUiGuildBossLog")
function XUiGuildBossLog:Ctor(ui)
self.GameObject = ui.gameObject
self.Transform = ui.transform
XTool.InitUiObject(self)
self.GetText = CS.XTextManager.GetText
end
function XUiGuildBossLog:Init(data)
self.NameText.text = data.PlayerName
self.DescText.text = string.format(self.GetText("GuildBossLogLine1"),
XTime.TimestampToGameDateTimeString(data.Time, "MM-dd HH:mm"),
XGuildBossConfig.GetBossStageInfo(data.StageId).Name) .. "\n"
self.DescText.text = self.DescText.text .. string.format(self.GetText("GuildBossLogLine2"), data.SubHp)
-- 区别nzwjV3更新前后两种日志安稳度日志和触发次数日志
if data.TotalEffectCount and data.TotalEffectCount > 0 then -- 是触发次数日志
if data.CurEffectCount > 0 and data.CurEffectCount <= data.TotalEffectCount then
self.DescText.text = self.DescText.text .. "\n" .. string.format(self.GetText("GuildBossLogLine3"), data.CurEffectCount) --nzwjV3 安稳度改为触发次数
end
else -- 是安稳度日志
if data.EffectValue > 0 then
self.DescText.text = self.DescText.text .. "\n" .. string.format(self.GetText("GuildBossLogLine6"), data.EffectValue)
end
if data.EffectValue >= 100 then
self.DescText.text = self.DescText.text .. string.format(self.GetText("GuildBossLogLine4"))
self.DescText.text = self.DescText.text .. "\n" .. string.format(self.GetText("GuildBossLogLine5"), data.EffectHp)
end
end
self.LayoutNode:SetDirty()
end
return XUiGuildBossLog