jx_client_neibu/lua_probject/main_project/main/poker/MSMainView.lua

46 lines
1.6 KiB
Lua
Raw Permalink Normal View History

2025-04-01 10:48:36 +08:00
local TableBG = import('Game.Data.TableBG')
local MainRightPanelView = import('Game.View.MainRightPanelView')
---
local M = {}
setmetatable(M, {__index = MainView})
local pk_default_bg = 1
local pk_bg_config = {
{id = 1, url = 'base/main_poker/bg/bg3', thumb = 'ui://Main_Poker/bg3'},
{id = 2, url = 'base/main_poker/bg/bg2', thumb = 'ui://Main_Poker/bg2'},
{id = 3, url = 'base/main_poker/bg/bg1', thumb = 'ui://Main_Poker/bg1'}
}
-- settingViewType:1跑得快显示换牌隐藏返回和解散 2超级拼十隐藏解散和换牌 3其他隐藏换牌根据是否观战显示解散和返回
-- ex_defaultbg 自定义默认背景编号
-- ex_bgconfig 自定义的背景
function M:InitView(url, isHideIpAdds, settingViewType, ex_defaultbg, ex_bgconfig, isHideJiesan,settingUrl)
printlog("11111111111111111111")
UIPackage.AddPackage('base/main_poker/ui/Main_Poker')
MainView.InitView(self, url, isHideIpAdds)
local _view = self._view
local default_bg = ex_defaultbg or pk_default_bg
local bg_config = ex_bgconfig or pk_bg_config
TableBG.LoadTableBG(default_bg, self._room.game_id, self._root_view, bg_config)
local rightpanel = self._view:GetChild('right_panel')
if rightpanel then
self._rightPanelView = MainRightPanelView.new(self, rightpanel)
end
end
-- 设置界面的换牌回调,需要换牌的玩法settingViewType传1,重写这个方法
function M:UpdateCard(index)
end
function M:UpdateCardSize(index)
end
function M:Destroy()
UIPackage.RemovePackage('base/main_poker/ui/Main_Poker')
MainView.Destroy(self)
end
return M