jx_client_neibu/lua_probject/main_project/main/majiang/MJMainView.lua

622 lines
20 KiB
Lua
Raw Normal View History

2025-04-01 10:48:36 +08:00
local MJPlayerCardInfoView = import(".MJPlayerCardInfoView")
local MJPlayerSelfCardInfoView = import(".MJPlayerSelfCardInfoView")
local TableBG = require("Game.Data.TableBG")
local MJSettingView = import(".MJSettingViewNew")
local MJMainRightPanelView = import(".MJMainRightPanelView")
2025-06-16 15:24:27 +08:00
local MJCheckG = import('.MJCheckG')
2025-04-01 10:48:36 +08:00
2025-04-02 19:03:26 +08:00
local bg_config = {
{ id = 1, url = "base/main_majiang/bg/bg1", thumb = "ui://Main_Majiang/b01" },
{ id = 2, url = "base/main_majiang/bg/bg2", thumb = "ui://Main_Majiang/b02" },
{ id = 3, url = "base/main_majiang/bg/bg3", thumb = "ui://Main_Majiang/b03" }
2025-04-01 10:48:36 +08:00
}
local M = {}
2025-04-02 19:03:26 +08:00
setmetatable(M, { __index = MainView })
2025-04-01 10:48:36 +08:00
local default_bg = 1
2025-06-10 19:28:53 +08:00
function M:InitView(url, use_custom_bg, custom_bg_config)
2025-04-01 10:48:36 +08:00
-- 加载牌型数据
if not DataManager.CardTypeList then
local json_data = Utils.LoadLocalFile("CardTypeData")
if json_data then
DataManager.CardTypeList = json.decode(json_data)
else
DataManager.CardTypeList = {}
end
end
self._room.card_type = DataManager.CardTypeList[tostring(self._room.game_id)] or 1
UIPackage.AddPackage("base/main_majiang/ui/Main_Majiang")
2025-04-02 19:03:26 +08:00
MainView.InitView(self, url)
2025-04-01 10:48:36 +08:00
local _view = self._view
self._cursor = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Ani_play_bj")
2025-06-10 19:28:53 +08:00
bg_config = custom_bg_config == nil and bg_config or custom_bg_config
2025-06-10 20:36:42 +08:00
if use_custom_bg then
2025-04-01 10:48:36 +08:00
TableBG.LoadTableBG(default_bg, self._room.game_id, self._root_view, bg_config)
end
local _room = self._room
local _cardbox = _view:GetChild("cardbox")
2025-04-02 19:03:26 +08:00
self._zhuanpanCtr = _cardbox:GetController("zuozi")
2025-05-08 12:41:42 +08:00
-- self._ctr_cardbox = _cardbox:GetController("c1")
-- self._tex_leftTime = _cardbox:GetChild("tex_leftnum")
2025-04-02 19:03:26 +08:00
2025-05-08 12:41:42 +08:00
local centerBox = _view:GetChild("Comp_ConterBox")
self._ctr_cardbox = centerBox:GetController("seat")
self._tex_leftTime = centerBox:GetChild("Text_Time")
2025-04-01 10:48:36 +08:00
if self._room.card_type == 2 then
self:Change3d(true)
else
self:Change3d(false)
end
local rightpanel = self._view:GetChild("com_roominfo")
2025-04-02 19:03:26 +08:00
if self._rightPanelView ~= nil then
2025-04-01 10:48:36 +08:00
self._rightPanelView:Destroy()
end
2025-04-02 19:03:26 +08:00
self._rightPanelView = MJMainRightPanelView.new(self, rightpanel)
--local tempdsaf=self._view:GetChild("btn_back_jiesan")
--tempdsaf:GetChild("n3").displayObject.gameObject:SetActive(false)
2025-04-11 12:49:08 +08:00
---- print("2222222222222222222222")
---- print(self._view:GetChild("btn_back_jiesan").displayObject.gameObject.name)
2025-04-02 19:03:26 +08:00
--self._view:GetChild("btn_back_jiesan").displayObject.gameObject:SetActive(false)
--local temp111=self._view:GetChild("btn_back_jiesan").displayObject.gameObject
--temp111:SetActive(false)
self._view:GetChild("btn_back_jiesan").onClick:Set(function()
2025-04-01 10:48:36 +08:00
if self.dismiss_room_cd_time > 0 then
ViewUtil.ErrorTip(nil, "您还处于解散冷却时间当中,请稍后重试!")
else
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:AskDismissRoom()
end
end)
self._tex_LeftCard = _view:GetChild("remaining_card")
2025-04-02 19:03:26 +08:00
2025-04-01 10:48:36 +08:00
self._player_card_info = {}
local _player_card_info = self._player_card_info
for i = 1, _room.room_config.people_num do
local tem = _view:GetChild("player_card_info" .. i)
2025-04-18 16:45:07 +08:00
print("====================================", "player_card_info" .. i, tem)
pt(_view)
2025-04-02 19:03:26 +08:00
_player_card_info[i] = self:NewMJPlayerCardInfoView(tem, i)
2025-04-01 10:48:36 +08:00
end
local list = _room.player_list
2025-04-02 19:03:26 +08:00
for i = 1, #list do
2025-04-01 10:48:36 +08:00
local p = list[i]
local info = _player_card_info[self:GetPos(p.seat)]
info:SetPlayer(p)
info:FillData()
end
local list = _room.player_list
local readyNum = 0
2025-04-02 19:03:26 +08:00
for i = 1, #list do
2025-04-01 10:48:36 +08:00
local p = list[i]
if p.ready then readyNum = readyNum + 1 end
end
2025-04-02 19:03:26 +08:00
for i = 1, #_room.player_list do
2025-04-01 10:48:36 +08:00
local p = _room.player_list[i]
2025-04-02 19:03:26 +08:00
local zi, icon = self:GetPosString(p.seat)
2025-04-01 10:48:36 +08:00
if self._room.card_type == 2 then
2025-04-02 19:03:26 +08:00
_cardbox:GetChild("3d_direction" .. self:GetIndex(self:GetPos(p.seat))).icon = "ui://MajiangCard3d/" .. icon
2025-04-01 10:48:36 +08:00
end
2025-04-02 19:03:26 +08:00
_cardbox:GetChild("direction" .. self:GetIndex(self:GetPos(p.seat))).text = zi
2025-04-01 10:48:36 +08:00
end
2025-04-02 19:03:26 +08:00
self._ctr_action = _view:GetController("action")
2025-04-01 10:48:36 +08:00
if _room.banker_seat == _room.self_player.seat and readyNum == _room.room_config.people_num then
--self._ctr_action.selectedIndex = 2
elseif not _room.self_player.ready then
2025-04-02 19:03:26 +08:00
local round = DataManager.CurrenRoom.room_config.config.times or 1
local xpconfig = DataManager.CurrenRoom.room_config.config.xi_pai
if xpconfig then
if round > 1 then
self._ctr_action.selectedIndex = 1
else
self._ctr_action.selectedIndex = 2
end
else
self._ctr_action.selectedIndex = 1
end
2025-04-01 10:48:36 +08:00
else
self._ctr_action.selectedIndex = 0
end
2025-06-09 16:30:22 +08:00
local changeTable = self._view:GetChild('btn_change')
if changeTable then
changeTable.onClick:Set(function()
default_bg = default_bg + 1 > #bg_config and 1 or default_bg + 1
TableBG.LoadTableBG(default_bg, self._room.game_id, self._root_view, bg_config)
end)
end
2025-06-16 15:24:27 +08:00
local checkG = self._view:GetChild('btn_check')
if checkG then
checkG.onClick:Set(function()
local checkG = MJCheckG.new()
checkG:Show()
end)
end
2025-06-25 22:49:44 +08:00
local viewList_witness = self._view:GetChild('comp_witness'):GetChild('list_players')
viewList_witness:SetVirtual()
viewList_witness.itemRenderer = function(index, obj)
obj:GetChild('title').text = _room.witness_player_list[index + 1].nick
ImageLoad.Load(_room.witness_player_list[index + 1].portrait, obj:GetChild('btn_head')._iconObject)
end
local btn_witness = self._view:GetChild('btn_pangGuang')
if btn_witness then
btn_witness.onClick:Set(function()
if _room._flag_updateWitness then
print("linemng", _room._flag_updateWitness, #_room.witness_player_list, viewList_witness.numItems)
_room._flag_updateWitness = false
if viewList_witness.numItems == #_room.witness_player_list then
viewList_witness:RefreshVirtualList()
else
viewList_witness.numItems = #_room.witness_player_list
end
end
self._view:GetController('witness').selectedIndex = 1
end)
end
2025-07-18 17:59:24 +08:00
self._view:GetChild('btn_closeRoom').onClick:Set(function()
local tip_owner = '您是否退出房间?\n(退出房间后房间将解散)'
local tip = '您是否退出房间?' -- \n (请注意,申请洗牌后退出,不会返还洗牌分)
local tipStr = ''
if self._room.agent then
tipStr = '您是否退出房间?'
else
tipStr = self._room.owner_id == self._room.self_player.self_user.account_id and tip_owner or tip
end
local _curren_msg = MsgWindow.new(self._root_view, tipStr, MsgWindow.MsgMode.OkAndCancel)
_curren_msg.onOk:Add(
function()
if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then
ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。')
else
ViewUtil.ShowModalWait(self._root_view)
self._gamectr:LevelRoom(
function(res)
ViewUtil.CloseModalWait()
if res.ReturnCode == 0 then
ViewManager.ChangeView(ViewManager.View_Family)
else
ViewUtil.ErrorTip(res.ReturnCode)
end
end
)
end
end
)
_curren_msg:Show()
end)
2025-04-02 19:03:26 +08:00
self:InitXiPai()
self:InitXiPai1()
end
2025-04-01 10:48:36 +08:00
function M:InitXiPai()
2025-04-02 19:03:26 +08:00
self._xipaiPanel = UIPackage.CreateObjectFromURL("ui://Common/panel_handanim")
self._xipaiPanel.visible = false
self._root_view:AddChild(self._xipaiPanel)
local offset = get_offset(self._full_offset)
2025-04-01 10:48:36 +08:00
self._xipaiPanel.width = GRoot.inst.width - (offset * 2)
self._xipaiPanel.height = GRoot.inst.height
self._xipaiPanel.x = offset
2025-04-02 19:03:26 +08:00
self._handAnimCtr = self._xipaiPanel:GetController("anim")
self._handAnimCtr.selectedIndex = 0
--self:PlayXiPai()
end
2025-04-01 10:48:36 +08:00
function M:InitXiPai1()
2025-04-02 19:03:26 +08:00
self._xipaiPanel1 = UIPackage.CreateObjectFromURL("ui://Common/panel_handanim02")
self._xipaiPanel1.visible = false
self._root_view:AddChild(self._xipaiPanel1)
local offset = get_offset(self._full_offset)
2025-04-01 10:48:36 +08:00
self._xipaiPanel1.width = GRoot.inst.width - (offset * 2)
self._xipaiPanel1.height = GRoot.inst.height
self._xipaiPanel1.x = offset
2025-04-02 19:03:26 +08:00
self._handAnimCtr1 = self._xipaiPanel1:GetController("anim1")
self._handAnimCtr1.selectedIndex = 0
end
2025-04-01 10:48:36 +08:00
function M:PlayXiPai(xipaiCallBack)
2025-04-02 19:03:26 +08:00
if self._xipaiPanel then
coroutine.start(function()
self._xipaiPanel.visible = true
self._xipaiPanel:GetTransition("XiPai"):Play()
self._handAnimCtr.selectedIndex = 1
coroutine.wait(3)
self._handAnimCtr.selectedIndex = 0
self._xipaiPanel.visible = false
if xipaiCallBack then
xipaiCallBack()
end
end)
end
2025-04-01 10:48:36 +08:00
end
function M:PlayXiPai1(xipaiCallBack)
2025-04-02 19:03:26 +08:00
if self._xipaiPanel1 then
coroutine.start(function()
self._xipaiPanel1.visible = true
self._xipaiPanel1:GetTransition("XiPai"):Play()
self._handAnimCtr1.selectedIndex = 1
coroutine.wait(3)
self._handAnimCtr1.selectedIndex = 0
self._xipaiPanel1.visible = false
if xipaiCallBack then
xipaiCallBack()
end
end)
end
2025-04-01 10:48:36 +08:00
end
function M:EventInit()
2025-04-02 19:03:26 +08:00
MainView.EventInit(self)
2025-04-01 10:48:36 +08:00
end
function M:Change3d(flag)
local _room = self._room
local _view = self._view
local _cardbox = _view:GetChild("cardbox")
2025-04-02 19:03:26 +08:00
for i = 1, #_room.player_list do
local p = _room.player_list[i]
local zi, icon = self:GetPosString(p.seat)
if self._room.card_type == 2 then
_cardbox:GetChild("3d_direction" .. self:GetIndex(self:GetPos(p.seat))).icon = "ui://MajiangCard3d/" .. icon
end
_cardbox:GetChild("direction" .. self:GetIndex(self:GetPos(p.seat))).text = zi
end
2025-04-01 10:48:36 +08:00
-- 如果要切换3d牌桌的cardbox位置及上方文字(剩余牌,回合数)显示不错乱,需要做以下改动
-- 取消文字组合的3d控制器的位置 并设置对cardbox的关联左左顶顶
if flag == true then
if _view:GetController("3d") ~= nil then
_view:GetController("3d").selectedIndex = 1
_cardbox.x = (_view.width - _cardbox.width) * 0.5
end
_cardbox:GetController("3d").selectedIndex = 1
_cardbox.x = (_view.width - _cardbox.width) * 0.5
else
if _view:GetController("3d") ~= nil then
_view:GetController("3d").selectedIndex = 0
_cardbox.x = (_view.width - _cardbox.width) * 0.5
end
2025-04-02 19:03:26 +08:00
2025-04-01 10:48:36 +08:00
_cardbox:GetController("3d").selectedIndex = 0
_cardbox.x = (_view.width - _cardbox.width) * 0.5
end
end
-- function M:NewSettingView()
-- local settingView = MJSettingView.new(self._root_view)
-- settingView:FillBgSection(function(url)
-- LoadGameBg(url, self._root_view)
-- end, self._room.game_id, default_bg)
-- settingView.onChangeCardCallback:Add(function()
-- self:Change3d(DataManager.CurrenRoom.card_type == 2)
-- self:ReloadRoom()
2025-04-02 19:03:26 +08:00
2025-04-01 10:48:36 +08:00
-- for i = 1, #self._room.player_list do
-- local p = self._room.player_list[i]
-- local card_info = self._player_card_info[self:GetPos(p.seat)]
-- card_info:ResetCardType()
-- end
-- end)
-- settingView.onEXVoiceCallback:Add(function()
-- end)
-- settingView.onEXChuPaiCallback:Add(function()
-- end)
-- return settingView
-- end
function M:NewSettingView()
local settingView = MJSettingView.new(self._root_view)
-- settingView._view:GetChild("btn_card_1").icon = pack_full_name .. "com_card_preview"
-- local gear = settingView._view:GetChild("panel_bg"):GetGear(0)
-- gear.pages = {"0", "1", "2"}
-- gear:Apply()
-- settingView.Change3d = function() end
2025-04-02 19:03:26 +08:00
settingView:FillBgSection(function(url, index)
2025-04-01 10:48:36 +08:00
LoadGameBg(url, self._root_view)
2025-04-02 19:03:26 +08:00
self._zhuanpanCtr.selectedIndex = index - 1
2025-04-01 10:48:36 +08:00
end, self._room.game_id, 1, bg_config)
settingView.onChangeCardCallback:Add(function()
self:RemoveCursor()
for i = 1, #self._room.player_list do
local p = self._room.player_list[i]
local card_info = self._player_card_info[self:GetPos(p.seat)]
card_info:Clear(true)
card_info:ResetCardType()
end
self:Change3d(DataManager.CurrenRoom.card_type == 2)
self:ReloadRoom(true)
end)
return settingView
end
function M:GetIndex(seat)
local index = seat
local people_num = self._room.room_config.people_num
if people_num == 2 and seat == 2 then
index = 3
elseif people_num == 3 and seat == 3 then
index = 4
end
return index
end
function M:GetPosString(seat)
if DataManager.CurrenRoom.room_config.people_num == 4 then
if seat == 1 then
2025-04-02 19:03:26 +08:00
return "", "dir_1"
2025-04-01 10:48:36 +08:00
elseif seat == 2 then
2025-04-02 19:03:26 +08:00
return "", "dir_2"
elseif seat == 3 then
return "西", "dir_3"
2025-04-01 10:48:36 +08:00
elseif seat == 4 then
2025-04-02 19:03:26 +08:00
return "", "dir_4"
2025-04-01 10:48:36 +08:00
end
elseif DataManager.CurrenRoom.room_config.people_num == 3 then
if seat == 1 then
2025-04-02 19:03:26 +08:00
return "", "dir_1"
2025-04-01 10:48:36 +08:00
elseif seat == 2 then
2025-04-02 19:03:26 +08:00
return "", "dir_2"
2025-04-01 10:48:36 +08:00
elseif seat == 3 then
2025-04-02 19:03:26 +08:00
return "西", "dir_3"
2025-04-01 10:48:36 +08:00
end
elseif DataManager.CurrenRoom.room_config.people_num == 2 then
if seat == 1 then
2025-04-02 19:03:26 +08:00
return "", "dir_1"
2025-04-01 10:48:36 +08:00
elseif seat == 2 then
2025-04-02 19:03:26 +08:00
return "西", "dir_3"
2025-04-01 10:48:36 +08:00
end
end
end
function M:SetCardBoxPosition()
local _room = self._room
for i = 1, _room.room_config.people_num do
2025-04-02 19:03:26 +08:00
local tex = self._view:GetChild("cardbox"):GetChild("direction" .. i)
2025-04-01 10:48:36 +08:00
local index = _room.self_player.seat + i - 1
index = index > 4 and index - 4 or index
tex.text = self._gamectr:GetPosString(index)
end
end
function M:markOutCards(showTip, data)
for i = 1, #self._room.player_list do
local p = self._room.player_list[i]
local info = self._player_card_info[self:GetPos(p.seat)]
for j = 1, #p.outcard_list do
local card = p.outcard_list[j]
if card == data then
2025-04-02 19:03:26 +08:00
for k = 1, #p.outcard_list do
2025-04-01 10:48:36 +08:00
local obj = info:GetOutCardByIndex(k)
if obj.data == card then
obj:GetController("gray").selectedIndex = showTip and 1 or 0
2025-04-02 19:03:26 +08:00
end
2025-04-01 10:48:36 +08:00
end
end
end
end
end
function M:OnPlayerEnter(...)
2025-04-02 19:03:26 +08:00
MainView.OnPlayerEnter(self, ...)
local arg = { ... }
2025-04-01 10:48:36 +08:00
local p = arg[1]
local info = self._player_card_info[self:GetPos(p.seat)]
info:SetPlayer(p)
info:FillData()
end
2025-04-02 19:03:26 +08:00
function M:OnPlayerReady(...)
local arg = { ... }
2025-04-01 10:48:36 +08:00
local p = arg[1]
local _room = self._room
local _view = self._view
2025-04-02 19:03:26 +08:00
2025-04-01 10:48:36 +08:00
local _player_info = self._player_info
if p.seat == _room.self_player.seat then
self._ctr_action.selectedIndex = 0
if p.entrust and self._clearingView and self._clearingView.DestroyWithCallback then
self._clearingView:DestroyWithCallback()
end
end
local info = _player_info[self:GetPos(p.seat)]
info:Ready(true)
local readyNum = self:GetReadyNum()
if readyNum == _room.room_config.people_num then
local _cardbox = _view:GetChild("cardbox")
2025-04-02 19:03:26 +08:00
for i = 1, #_room.player_list do
2025-04-01 10:48:36 +08:00
local p = _room.player_list[i]
2025-04-02 19:03:26 +08:00
local zi, icon = self:GetPosString(p.seat)
_cardbox:GetChild("3d_direction" .. self:GetIndex(self:GetPos(p.seat))).icon = "ui://MajiangCard3d/" .. icon
_cardbox:GetChild("direction" .. self:GetIndex(self:GetPos(p.seat))).text = zi
2025-04-01 10:48:36 +08:00
end
end
2025-04-02 19:03:26 +08:00
2025-04-01 10:48:36 +08:00
if _room.banker_seat == _room.self_player.seat and readyNum == _room.room_config.people_num then
if self._state.selectedIndex == 2 then
2025-04-02 19:03:26 +08:00
local _gamectr = ControllerManager.GetController(GameController)
2025-04-01 10:48:36 +08:00
_gamectr:StartGame()
end
2025-04-02 19:03:26 +08:00
--self._ctr_action.selectedIndex = 2
2025-04-01 10:48:36 +08:00
elseif not _room.self_player.ready then
2025-04-02 19:03:26 +08:00
--self._ctr_action.selectedIndex = 1
local round = DataManager.CurrenRoom.room_config.config.times or 1
local xpconfig = DataManager.CurrenRoom.room_config.config.xi_pai
if xpconfig then
if round > 1 then
self._ctr_action.selectedIndex = 1
else
self._ctr_action.selectedIndex = 2
end
else
self._ctr_action.selectedIndex = 1
end
2025-04-01 10:48:36 +08:00
else
2025-04-02 19:03:26 +08:00
self._ctr_action.selectedIndex = 0
2025-04-01 10:48:36 +08:00
end
end
function M:CountCardLeftNum(card)
local player_list = DataManager.CurrenRoom.player_list
local count = 4
for i = 1, #player_list do
local p = player_list[i]
if p.card_list then
for j = 1, #p.card_list do
if p.card_list[j] == card then
count = count - 1
end
end
end
for j = 1, #p.outcard_list do
if p.outcard_list[j] == card then
count = count - 1
end
end
for j = 1, #p.fz_list do
local fz = p.fz_list[j]
if fz.type == FZType.Chi then
for k = 1, #fz.opcard do
if card == fz.opcard[k] then
count = count - 1
break
end
end
else
local num = fz.type == FZType.Peng and 3 or 4
if card == fz.card then
count = count - num
end
end
end
end
return count
end
2025-04-02 19:03:26 +08:00
function M:OnPlayerLeave(...)
2025-04-01 10:48:36 +08:00
MainView.OnPlayerLeave(self, ...)
local _room = self._room
if _room.banker_seat == _room.self_player.seat then
2025-04-02 19:03:26 +08:00
self._ctr_action.selectedIndex = 0
2025-04-01 10:48:36 +08:00
end
end
function M:PlayerChangeLineState()
2025-04-02 19:03:26 +08:00
local isOutCard = true
local str = "玩家 "
for _, player in ipairs(self._room.player_list) do
if player.line_state == 0 then
isOutCard = false
-- str = str .. self._gamectr:GetPosString(player.seat) .. "、"
end
2025-04-01 10:48:36 +08:00
end
2025-04-02 19:03:26 +08:00
-- if not isOutCard then
-- str = str.sub(str, 1, string.len(str) - string.len("、"))
-- str = str .. " 正在赶来,请稍等"
-- if self._room.curren_round > 0 then
-- self._waitingView = ModalWaitingView.new(self._view, str)
-- end
-- else
-- if self._waitingView then
-- self._waitingView:CloseWaitingView()
-- end
-- end
2025-04-01 10:48:36 +08:00
self._player_card_info[1]._area_handcard_list.touchable = isOutCard
end
2025-04-02 19:03:26 +08:00
function M:NewMJPlayerCardInfoView(view, index)
if index == 1 then
return MJPlayerSelfCardInfoView.new(view, self)
end
return MJPlayerCardInfoView.new(view, self)
2025-04-01 10:48:36 +08:00
end
function M:RemoveCursor()
2025-06-10 19:49:18 +08:00
-- if self._cursor.parent then
-- self._cursor.parent:GetController("color").selectedIndex = 0
-- end
2025-04-01 10:48:36 +08:00
self._cursor:RemoveFromParent()
end
function M:Destroy()
UIPackage.RemovePackage("base/main_majiang/ui/Main_Majiang")
MainView.Destroy(self)
self._cursor:Dispose()
2025-04-02 19:03:26 +08:00
self._xipaiPanel:Dispose()
2025-04-01 10:48:36 +08:00
end
local majiang_asset_path = "base/main_majiang/sound/"
function M:PlayMJSound(path)
ViewUtil.PlaySound(self.asset_group, majiang_asset_path .. path)
end
function M:PlayMJMusic(path)
ViewUtil.PlayMuisc(self.asset_group, majiang_asset_path .. path)
end
2025-04-02 19:03:26 +08:00
function M:PlaySound(group, sex, path)
2025-04-01 10:48:36 +08:00
local sex_path = ViewUtil.Sex_Chat[sex]
2025-04-02 19:03:26 +08:00
local path1 = majiang_asset_path .. string.format("%s/%s.mp3", sex_path, path)
ViewUtil.PlaySound(group, path1)
2025-04-01 10:48:36 +08:00
end
function M:GetPrefix()
return get_majiang_prefix(DataManager.CurrenRoom.game_id)
end
2025-07-18 16:28:57 +08:00
-- 所有对家显示手牌
function M:ShowHand(msg)
2025-07-18 16:46:03 +08:00
local data = msg[1]
2025-07-18 17:59:24 +08:00
for _, player in pairs(data.info_list) do
local infoView = self._player_card_info[self:GetPos(player.seat)]
2025-07-18 16:46:03 +08:00
if infoView.class ~= "PlayerSelfCardInfoView" then
2025-07-18 17:59:24 +08:00
infoView:ShowHand(player.hand_card)
2025-07-18 16:46:03 +08:00
end
2025-07-18 16:28:57 +08:00
end
end
2025-04-02 19:03:26 +08:00
return M