2025-07-30 21:56:29 +08:00
|
|
|
|
local MJSettingView = require("main.majiang.MJSettingViewNew")
|
2025-08-28 15:02:07 +08:00
|
|
|
|
local MJMainView = require("main.majiang.MJMainView")
|
2025-07-30 21:56:29 +08:00
|
|
|
|
|
|
|
|
|
|
local WitnessView = {}
|
2025-07-30 22:31:32 +08:00
|
|
|
|
|
2025-09-08 14:39:21 +08:00
|
|
|
|
local M = WitnessView
|
|
|
|
|
|
setmetatable(M, { __index = BaseView })
|
|
|
|
|
|
function M:init()
|
|
|
|
|
|
self._gamectr = ControllerManager.GetController(GameController)
|
|
|
|
|
|
self._room = DataManager.CurrenRoom
|
|
|
|
|
|
self._room.Witness = true
|
|
|
|
|
|
|
|
|
|
|
|
UIPackage.AddPackage('base/chat/ui/Chat')
|
|
|
|
|
|
|
|
|
|
|
|
self._eventmap = {}
|
|
|
|
|
|
self._put_map = false
|
|
|
|
|
|
self._new_hide = false
|
|
|
|
|
|
self._queue = false
|
|
|
|
|
|
self._style = 1
|
|
|
|
|
|
self._popEvent = true
|
|
|
|
|
|
self:InitView()
|
2025-07-30 22:31:32 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
2025-09-08 14:39:21 +08:00
|
|
|
|
function M:InitView(url)
|
|
|
|
|
|
local room = self._room
|
|
|
|
|
|
BaseView.InitView(self, url)
|
|
|
|
|
|
|
2025-07-30 21:56:29 +08:00
|
|
|
|
self.btn_setting = self._view:GetChild("btn_setting")
|
|
|
|
|
|
|
2025-07-30 22:31:32 +08:00
|
|
|
|
self.com_logocType = self._view:GetChild("com_logo"):GetController("cType")
|
|
|
|
|
|
|
2025-07-30 21:56:29 +08:00
|
|
|
|
self.btn_setting.onClick:Set(function()
|
2025-07-30 22:31:32 +08:00
|
|
|
|
local view = MJSettingView.new(self, true)
|
2025-07-30 21:56:29 +08:00
|
|
|
|
view:Show()
|
|
|
|
|
|
end)
|
2025-08-28 15:02:07 +08:00
|
|
|
|
self.com_notice = self._view:GetChild("com_notice")
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2025-09-08 14:39:21 +08:00
|
|
|
|
function M:Show()
|
2025-08-28 15:02:07 +08:00
|
|
|
|
getmetatable(WitnessView).__index.Show(self)
|
|
|
|
|
|
self:DoNoticeAnimation()
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2025-09-08 14:39:21 +08:00
|
|
|
|
function M:DoNoticeAnimation()
|
2025-08-28 15:02:07 +08:00
|
|
|
|
self.noticeIndex = self.noticeIndex or 1
|
|
|
|
|
|
if not DataManager.GameNotice or #DataManager.GameNotice == 0 then
|
|
|
|
|
|
return
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
local text_notice = self.com_notice:GetChild("text_notice")
|
|
|
|
|
|
text_notice.text = DataManager.GameNotice[self.noticeIndex]
|
|
|
|
|
|
local speed = 44
|
|
|
|
|
|
local time = text_notice.width / speed
|
|
|
|
|
|
|
|
|
|
|
|
text_notice.x = self.com_notice.width
|
|
|
|
|
|
|
|
|
|
|
|
local tween = text_notice:TweenMove(Vector2(-text_notice.width, text_notice.y), time):OnComplete(function()
|
|
|
|
|
|
self:DoNoticeAnimation()
|
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
tween:SetEase(EaseType.Linear)
|
|
|
|
|
|
|
|
|
|
|
|
self.noticeIndex = self.noticeIndex + 1
|
|
|
|
|
|
if self.noticeIndex > #DataManager.GameNotice then
|
|
|
|
|
|
self.noticeIndex = 1
|
|
|
|
|
|
end
|
2025-09-03 21:58:19 +08:00
|
|
|
|
|
|
|
|
|
|
--强制让牌类型为1,只有一种牌
|
|
|
|
|
|
self._room.card_type = 1
|
2025-07-30 21:56:29 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
2025-09-08 14:39:21 +08:00
|
|
|
|
return M
|