PGRData/Script/matrix/xui/xuidlchunt/settle/XUiDlcHuntPowerSettleLose.lua
2024-09-01 22:49:41 +02:00

54 lines
1.9 KiB
Lua
Raw Permalink 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.

local GridLoseTip = require("XUi/XUiSettleLose/XUiGridLoseTip")
---@class XUiDlcHuntPowerSettleLose:XLuaUi
local XUiDlcHuntPowerSettleLose = XLuaUiManager.Register(XLuaUi, "UiDlcHuntPowerSettleLose")
function XUiDlcHuntPowerSettleLose:Ctor()
self.SpecialSoundMap = {}
end
function XUiDlcHuntPowerSettleLose:OnAwake()
self:RegisterClickEvent(self.BtnDlcBlue, self.OnClickQuitTeam)
self:RegisterClickEvent(self.BtnDlcYellow, self.Close)
self:RegisterClickEvent(self.BtnLose, self.Close)
end
---@param data XDlcHuntSettle
function XUiDlcHuntPowerSettleLose:OnStart(data)
self.TxtPeople.text = CS.XTextManager.GetText("BattleLoseActorNum", #data.Members)
self.TxtStageName.text = data.Name
self:SetTips(data.SettleLoseTipId)
end
function XUiDlcHuntPowerSettleLose:OnClickQuitTeam()
XDataCenter.DlcRoomManager.Quit()
self:Close()
end
---
--- 根据"settleLoseTipId"来生成提示
function XUiDlcHuntPowerSettleLose:SetTips(settleLoseTipId)
if not self.HadSetTip then
local tipDescList = XFubenConfigs.GetTipDescList(settleLoseTipId)
if tipDescList == nil then
XLog.Error("XUiDlcHuntPowerSettleLose:SetTips函数错误tipDescList为空")
return
end
local skipIdList = XFubenConfigs.GetSkipIdList(settleLoseTipId)
if tipDescList == nil then
XLog.Error("XUiDlcHuntPowerSettleLose:SetTips函数错误skipIdList为空")
return
end
for i, desc in ipairs(tipDescList) do
local obj = CS.UnityEngine.Object.Instantiate(self.GridLoseTip)
obj.transform:SetParent(self.PanelTips.transform, false)
obj.gameObject:SetActiveEx(true)
GridLoseTip.New(obj, self, { ["TipDesc"] = desc, ["SkipId"] = skipIdList[i] })
end
self.GridLoseTip.gameObject:SetActiveEx(false)
self.HadSetTip = true
end
end
return XUiDlcHuntPowerSettleLose