80 lines
2.3 KiB
Lua
80 lines
2.3 KiB
Lua
|
|
local WitnessView = require("Game.View.WitnessView")
|
||
|
|
local PKSettingView = import('.PKSettingView')
|
||
|
|
local TableBG = require("Game.Data.TableBG")
|
||
|
|
|
||
|
|
local M = {}
|
||
|
|
setmetatable(M, { __index = WitnessView })
|
||
|
|
|
||
|
|
local pk_default_bg = 1
|
||
|
|
local pk_bg_config = {
|
||
|
|
{ id = 1, url = 'extend/poker/runfast/bg/bg1', thumb = 'ui://Extend_Poker_RunFastNew/table_bg1' },
|
||
|
|
{ id = 2, url = 'extend/poker/runfast/bg/bg2', thumb = 'ui://Extend_Poker_RunFastNew/table_bg2' },
|
||
|
|
{ id = 3, url = 'extend/poker/runfast/bg/bg3', thumb = 'ui://Extend_Poker_RunFastNew/table_bg3' }
|
||
|
|
}
|
||
|
|
|
||
|
|
function M.new()
|
||
|
|
local self = setmetatable({}, { __index = M })
|
||
|
|
self.class = "PKMJWitness"
|
||
|
|
self:init()
|
||
|
|
|
||
|
|
return self
|
||
|
|
end
|
||
|
|
|
||
|
|
function M:init()
|
||
|
|
getmetatable(M).__index.init(self)
|
||
|
|
end
|
||
|
|
|
||
|
|
function M:InitView(url)
|
||
|
|
UIPackage.AddPackage('base/main_poker/ui/Main_Poker')
|
||
|
|
getmetatable(M).__index.InitView(self, url, isHideIpAdds)
|
||
|
|
|
||
|
|
local default_bg = ex_defaultbg or pk_default_bg
|
||
|
|
local bg_config = ex_bgconfig or pk_bg_config
|
||
|
|
-- 设置界面初始化方法
|
||
|
|
self.NewSettingView = function(self)
|
||
|
|
local settingView = PKSettingView.new(self, 0, isHideJiesan, settingUrl,
|
||
|
|
handler(self, self.UpdateCardSize), true)
|
||
|
|
return settingView
|
||
|
|
end
|
||
|
|
|
||
|
|
local _view = self._view
|
||
|
|
TableBG.LoadTableBG(default_bg, self._room.game_id, self._root_view, bg_config)
|
||
|
|
-- self:InitXiPai()
|
||
|
|
-- self:InitXiPai1()
|
||
|
|
|
||
|
|
self.com_notice = self._view:GetChild("com_notice")
|
||
|
|
end
|
||
|
|
|
||
|
|
function M:DoNoticeAnimation()
|
||
|
|
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
|
||
|
|
end
|
||
|
|
|
||
|
|
function M:Show()
|
||
|
|
getmetatable(M).__index.Show(self)
|
||
|
|
ViewUtil.PlaySound("RunFastNew_PK", "base/main_majiang/sound/game_backmusic.mp3")
|
||
|
|
self:DoNoticeAnimation()
|
||
|
|
end
|
||
|
|
|
||
|
|
return M
|