PGRData/Script/matrix/xoverseas/xui/xuispecialregulation/XUiSpecialRegulationShow.lua

32 lines
No EOL
1 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.

local CSXTextManagerGetText = CS.XTextManager.GetText
local XUiSpecialRegulationShow = XLuaUiManager.Register(XLuaUi, "UiSpecialRegulationShow")
function XUiSpecialRegulationShow:OnStart(data)
self.data = data
self:AutoAddListener()
self:Refresh()
end
function XUiSpecialRegulationShow:AutoAddListener()
self.BtnConfirmB.CallBack = function()
if XLuaUiManager.IsUiLoad("UiDialog") then
XLuaUiManager.Remove("UiDialog")
end
self:Close()
end
end
function XUiSpecialRegulationShow:Refresh()
local info = ""
if self.data.type == 1 then
local consumeName = XDataCenter.ItemManager.GetItemName(self.data.consumeId)
if consumeName then
info = CSXTextManagerGetText("JPBusinessLawsDetails1",consumeName)
else
XLog.Error("consumeId is not Exist"..self.data.consumeId)
end
else
info = CSXTextManagerGetText("JPBusinessLawsDetails"..self.data.type,self.data.content)
end
self.TxtInfoNormal.text = string.gsub(info, "\\n", "\n")
end