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

66 lines
No EOL
2.7 KiB
Lua

--选择难度的难度grid
local XUiGuildBossLevelGrid = XClass(nil, "XUiGuildBossLevelGrid")
function XUiGuildBossLevelGrid:Ctor(ui)
self.GameObject = ui.gameObject
self.Transform = ui.transform
XTool.InitUiObject(self)
self.BtnSelect.CallBack = function() self:OnBtnSelectClick() end
end
function XUiGuildBossLevelGrid:Init(data, curLevel, nextLevel, rankLevel, highScore)
self.Data = data
self.TxtLv.text = CS.XTextManager.GetText("GuildBossDiffLv", data.Level)
self.TxtBossHp.text = CS.XTextManager.GetText("GuildBossDiffHp", XUiHelper.GetLargeIntNumText(data.BossHp))
self.TxtUnlockScore.text = CS.XTextManager.GetText("GuildBossDiffUnlock", XUiHelper.GetLargeIntNumText(data.UnlockScore))
self.TxtAdditionPercent.text = CS.XTextManager.GetText("GuildBossDiffScoreAdd", data.AdditionPercent)
--当前这一期所使用的Level标记
if curLevel == data.Level then
self.CurMark.gameObject:SetActiveEx(true)
else
self.CurMark.gameObject:SetActiveEx(false)
end
--只有会长和副会长能操作
if rankLevel <= XGuildConfig.GuildRankLevel.CoLeader then
--如果已解锁
if highScore >= data.UnlockScore then
self.FunctionGroup.gameObject:SetActiveEx(true)
self.Lock.gameObject:SetActiveEx(false)
self.TxtGroup.alpha = 1
--如果是下次选择的level
if data.Level == nextLevel then
self.NextSelectMark.gameObject:SetActiveEx(true)
self.BtnSelect.gameObject:SetActiveEx(false)
else
self.NextSelectMark.gameObject:SetActiveEx(false)
self.BtnSelect.gameObject:SetActiveEx(true)
end
--未解锁 nzwjV3 显示未解锁标签 fixme
else
self.TxtGroup.alpha = 0.5
self.FunctionGroup.gameObject:SetActiveEx(false)
self.Lock.gameObject:SetActiveEx(true)
end
else
self.FunctionGroup.gameObject:SetActiveEx(false)
self.Lock.gameObject:SetActiveEx(false)
if highScore >= data.UnlockScore then
self.TxtGroup.alpha = 1
if data.Level == nextLevel then
self.FunctionGroup.gameObject:SetActiveEx(true)
self.NextSelectMark.gameObject:SetActiveEx(true)
self.BtnSelect.gameObject:SetActiveEx(false)
end
else -- nzwjV3 显示未解锁标签 fixme
self.TxtGroup.alpha = 0.5
self.Lock.gameObject:SetActiveEx(true)
end
end
end
--更换下期level
function XUiGuildBossLevelGrid:OnBtnSelectClick()
XDataCenter.GuildBossManager.GuildBossLevelRequest(self.Data.Level)
end
return XUiGuildBossLevelGrid