2023-07-14 19:35:33 +00:00
|
|
|
--选择难度的难度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)
|
2024-09-01 20:49:41 +00:00
|
|
|
self.Lock.gameObject:SetActiveEx(false)
|
2023-07-14 19:35:33 +00:00
|
|
|
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
|
2024-09-01 20:49:41 +00:00
|
|
|
--未解锁 nzwjV3 显示未解锁标签 fixme
|
2023-07-14 19:35:33 +00:00
|
|
|
else
|
2024-09-01 20:49:41 +00:00
|
|
|
self.TxtGroup.alpha = 0.5
|
2023-07-14 19:35:33 +00:00
|
|
|
self.FunctionGroup.gameObject:SetActiveEx(false)
|
2024-09-01 20:49:41 +00:00
|
|
|
self.Lock.gameObject:SetActiveEx(true)
|
2023-07-14 19:35:33 +00:00
|
|
|
end
|
|
|
|
else
|
|
|
|
self.FunctionGroup.gameObject:SetActiveEx(false)
|
2024-09-01 20:49:41 +00:00
|
|
|
self.Lock.gameObject:SetActiveEx(false)
|
2023-07-14 19:35:33 +00:00
|
|
|
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
|
2024-09-01 20:49:41 +00:00
|
|
|
else -- nzwjV3 显示未解锁标签 fixme
|
|
|
|
self.TxtGroup.alpha = 0.5
|
|
|
|
self.Lock.gameObject:SetActiveEx(true)
|
2023-07-14 19:35:33 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
--更换下期level
|
|
|
|
function XUiGuildBossLevelGrid:OnBtnSelectClick()
|
|
|
|
XDataCenter.GuildBossManager.GuildBossLevelRequest(self.Data.Level)
|
|
|
|
end
|
|
|
|
|
|
|
|
return XUiGuildBossLevelGrid
|