ro-table/Asstes/Resources/Script/FrameWork/GUI/view/Pvp/DesertWolfJoinView.txt
2025-06-04 05:02:57 +08:00

44 lines
1.3 KiB
Plaintext

DesertWolfJoinView = class("DesertWolfJoinView",ContainerView)
DesertWolfJoinView.ViewType = UIViewType.PopUpLayer
function DesertWolfJoinView:Init()
self:FindObjs()
self:AddEvts()
self:AddViewEvts()
self:InitShow()
end
function DesertWolfJoinView:FindObjs()
self.nameInput = self:FindGO("NameInput"):GetComponent(UIInput)
UIUtil.LimitInputCharacter(self.nameInput, 12)
end
function DesertWolfJoinView:AddEvts()
local joinButton = self:FindGO("JoinButton", self.desertWolfView)
self:AddClickEvent(joinButton,function ()
self:ClickJoin()
end)
end
function DesertWolfJoinView:AddViewEvts()
-- body
end
function DesertWolfJoinView:InitShow()
self.defaultName = string.format(ZhString.Pvp_DesertWolfJoinName, Game.Myself.data.name)
self.nameInput.value = self.defaultName
end
function DesertWolfJoinView:ClickJoin()
local resultStr = string.gsub(self.nameInput.value, " ", "")
if StringUtil.ChLength(resultStr) >= 2 then
if not FunctionMaskWord.Me():CheckMaskWord(resultStr, FunctionMaskWord.MaskWordType.SpecialSymbol | FunctionMaskWord.MaskWordType.Chat) then
ServiceMatchCCmdProxy.Instance:CallJoinRoomCCmd(PvpProxy.Type.DesertWolf, 0, resultStr)
self:CloseSelf()
else
MsgManager.ShowMsgByIDTable(958)
end
else
MsgManager.ShowMsgByIDTable(883)
end
end