From 52e48d221713f64ec33ab575e64b8bdfe2c2ff87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=AE=B6=E7=82=9C?= <2029049582@qq.com> Date: Fri, 12 Sep 2025 17:10:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B6=E4=BB=96=E9=BA=BB=E5=B0=86=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extend/majiang/jinxi/EXMainView.lua | 4 +- .../extend/majiang/jinxi/EXPlayerInfoView.lua | 8 +- .../extend/majiang/jinxi/EXWitnessView.lua | 160 +++++------------ .../extend/majiang/jinxi/ExtendConfig.lua | 27 ++- .../majiang/nancheng/EXClearingView.lua | 12 ++ .../extend/majiang/nancheng/EXMainView.lua | 4 +- .../majiang/nancheng/EXPlayerInfoView.lua | 8 +- .../extend/majiang/nancheng/EXWitnessView.lua | 161 +++++------------- .../extend/majiang/nancheng/ExtendConfig.lua | 27 ++- 9 files changed, 136 insertions(+), 275 deletions(-) diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua index 61d13f44..27359c23 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua @@ -237,7 +237,9 @@ function M:EventInit() end) _gamectr:AddEventListener(TX_GameEvent.EventTurn, function(...) local arg = { ... } - -- self._left_time = 15 + if not self._left_time or self._left_time <= 15 then + self._left_time = 15 + end local seat = arg[1] self:UpdateCardBox(self:GetPos(seat)) -- if seat == self._room.self_player.seat then diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXPlayerInfoView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXPlayerInfoView.lua index ac74d71b..3a8b3a84 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXPlayerInfoView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXPlayerInfoView.lua @@ -3,17 +3,17 @@ local PlayerInfoView2 = require("Game.View.PlayerInfoView2") local M = {} -function M.new(view, mainView) +function M.new(view, mainView,flag_witness) setmetatable(M, { __index = PlayerInfoView2 }) local self = setmetatable({}, { __index = M }) self._view = view self._main_view = mainView - self:init() + self:init(flag_witness) return self end -function M:init() - PlayerInfoView2.init(self) +function M:init(flag_witness) + PlayerInfoView2.init(self,flag_witness) end function M:ShowInteraction(type, str) diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua index 6b82c763..ee2950c8 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua @@ -156,71 +156,13 @@ end function M:EventInit() -- UIPackage.AddPackage("extend/majiang/hongzhong/ui/Extend_MJ_HongZhong") - MainView.EventInit(self) + getmetatable(M).__index.EventInit(self) local _room = self._room local _view = self._view local _gcm_outcard_url = UIPackage.GetItemURL("Main_Majiang", "Gcm_OutCard") local _player_info = self._player_info local _gamectr = self._gamectr - _gamectr:AddEventListener(GameEvent.PlayerEnter, function(...) - self:PlayMJSound("user_enter.mp3") - local arg = { ... } - local p = arg[1] - local info1 = self._player_info[self:GetPos(p.seat)] - info1:FillData(p) - info1._view.visible = true - - local info2 = self._player_card_info[self:GetPos(p.seat)] - info2:SetPlayer(p) - info2:FillData() - end) - - _gamectr:AddEventListener(GameEvent.PlayerLeave, function(...) - local arg = { ... } - local p = arg[1] - local info1 = self._player_info[self:GetPos(p.seat)] - info1._view.visible = false - self:PlayMJSound("user_leave.mp3") - end) - - _gamectr:AddEventListener(GameEvent.WitnessPlayerEnter, function(...) - self:PlayMJSound("user_enter.mp3") - local arg = { ... } - local witnessPlayerList = arg[1] - self._room.witness_player_list = witnessPlayerList - - local _room = DataManager.CurrenRoom - local viewList_witness = self._view:GetChild('comp_witness'):GetChild('list_players') - if viewList_witness.numItems == #_room.witness_player_list then - viewList_witness:RefreshVirtualList() - else - viewList_witness.numItems = #_room.witness_player_list - end - end) - - _gamectr:AddEventListener(GameEvent.WitnessPlayerLeave, function(...) - ---- print("刷新托管数据=====") - local arg = { ... } - local player = arg[1] - local witnessPlayerList = self._room.witness_player_list - for i, _player in ipairs(witnessPlayerList) do - if _player.aid == player then - table.remove(witnessPlayerList, i) - break - end - end - - local _room = DataManager.CurrenRoom - local viewList_witness = self._view:GetChild('comp_witness'):GetChild('list_players') - print("linemng", _room._flag_updateWitness, #_room.witness_player_list, viewList_witness.numItems) - if viewList_witness.numItems == #_room.witness_player_list then - viewList_witness:RefreshVirtualList() - else - viewList_witness.numItems = #_room.witness_player_list - end - end) - _gamectr:AddEventListener(TX_GameEvent.SendLaiZi, function(...) local arg = { ... } print("lingmeng witness SendLaiZi") @@ -236,67 +178,10 @@ function M:EventInit() print("lingmeng witness EventBuGang") end) - _gamectr:AddEventListener(TX_GameEvent.SendCards, function(...) - print("lingmeng witness SendCards") - self:ShowJing() - if self._clearingView then - self._clearingView:Destroy() - self._clearingView = nil - end - self:UpdateRound() - self:RemoveCursor() - self._state.selectedIndex = 4 - local list = _room.player_list - for i = 1, #list do - local p = list[i] - local info = self._player_info[self:GetPos(p.seat)] - info:FillData(p) - info:MarkBank(p.seat == _room.banker_seat) - info:Ready(false) - local card_info = self._player_card_info[self:GetPos(p.seat)] - card_info:Clear() - card_info:UpdateHandCardWitness() - end - end) - _gamectr:AddEventListener(TX_GameEvent.EventTurn, function(...) - print("lingmeng witness EventTurn") - local arg = { ... } - -- self._left_time = 15 - local seat = arg[1] - self:UpdateCardBox(self:GetPos(seat)) - local playerInfo = self._player_info[self:GetPos(seat)] - local info = self._player_card_info[self:GetPos(seat)] - print("lingmeng hand_left_count", info._player.hand_left_count) - info._player.hand_left_count = info._player.hand_left_count + 1 - info:UpdateHandCardWitness(true) - end) - _gamectr:AddEventListener(TX_GameEvent.OutHint, function(...) print("lingmeng witness OutHint") end) - local _gcm_outcard_url = "ui://Main_Majiang/Gcm_OutCard" - _gamectr:AddEventListener(TX_GameEvent.OutCard, function(...) - print("lingmeng witness OutCard") - self._left_time = 0 - local arg = { ... } - local p = arg[1] - local card = arg[2] - local seat = p.seat - local info = self._player_card_info[self:GetPos(seat)] - - self:RemoveCursor() - - info:UpdateHandCardWitness(false) - - info:UpdateOutCardList(nil, nil, self._cursor) - self:PlayMJSound("chupai.mp3") - self:PlaySound("JinXi_MJ", p.self_user.sex, tostring(card)) - if seat == _room.self_player.seat then - _room.curren_outcard_seat = -1 - end - print("ling 2zhihou2") - end) _gamectr:AddEventListener(TX_GameEvent.GetCard, function(...) print("lingmeng witness GetCard") end) @@ -415,6 +300,7 @@ function M:EventInit() end) _gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...) + self:PlayMJSound("end_music.mp3") local _room = self._room self._left_time = 0 self:UpdateCardBox(0) @@ -438,6 +324,7 @@ function M:EventInit() -- self:RemoveCursor() if self._clearingView == nil then self._clearingView = EXClearingView.new(self._root_view) + self._clearingView._view:GetChild('btn_setting').onClick:Set(handler(self,self.ClickSetting)) coroutine.start(function() coroutine.wait(0.5) self._clearingView:Show() @@ -448,6 +335,31 @@ function M:EventInit() if _room.curren_round ~= _room.room_config.round then -- if #niao == 0 then self._view:GetChild("n13").visible = false end self._clearingView:InitData(0, _room, result, nil, function(...) + for i = 1, #data do + local p = _room:GetPlayerBySeat(data[i].seat) + p.total_score = data[i].total_score + local card_info = self._player_card_info[self:GetPos(p.seat)] + local info = self._player_info[self:GetPos(p.seat)] + --card_info:Clear() + card_info:ResetCardType() + if _room:checkHpNonnegative() then + p.cur_hp = data[i].total_score + end + info:UpdateScore() + info._view:GetChild("zhanji").visible = true + local num = data[i].total_score + if num >= 0 then + info._view:GetController("text_color").selectedIndex = 0 + info._view:GetChild("text_jifen").text = "+" .. num + else + info._view:GetController("text_color").selectedIndex = 1 + info._view:GetChild("text_jifen").text = num + end + + info._view:GetChild("mask_piao").title = "" + info._view:GetController("piao_niao").selectedIndex = 0 + p.fz_list = {} + end DataManager.CurrenRoom.self_player.card_list = {} self._clearingView = nil end) @@ -456,7 +368,7 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...) print("lingmeng witness ZPResult2") - -- self:UnmarkSelfTuoguan() + self:UnmarkSelfTuoguan() self._left_time = 0 self:UpdateCardBox(0) self._ctr_cardbox.selectedIndex = 0 @@ -486,6 +398,18 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.EventResidueCard, function(...) print("lingmeng witness EventResidueCard") end) + + --替换mianview的事件 + _gamectr:AddEventListener( + GameEvent.PlayerState, + function(...) + printlog("lingmeng OnEventOnlineState") + local arg = { ... } + local p = arg[1] + local info = self._player_info[self:GetPos(p.seat)] + info._ctr_offline.selectedIndex = p.line_state == 0 and 1 or 0 + end + ) end function M:InitPlayerInfoView() @@ -493,7 +417,7 @@ function M:InitPlayerInfoView() local _player_info = self._player_info for i = 1, self._room.room_config.people_num do local tem = self._view:GetChild(string.format("player_info%d_2", i)) - _player_info[i] = PlayerInfoView.new(tem, self) + _player_info[i] = PlayerInfoView.new(tem, self,true) tem.visible = false end end diff --git a/lua_probject/extend_project/extend/majiang/jinxi/ExtendConfig.lua b/lua_probject/extend_project/extend/majiang/jinxi/ExtendConfig.lua index 025c2aa9..e897b39e 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/ExtendConfig.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/ExtendConfig.lua @@ -105,22 +105,21 @@ function M:FillRoomData(s2croom) local tem = _info_list[i] local playerid = tem["playerid"] local p = room:GetPlayerById(playerid) - local outcard_list = tem["outcard_list"] - p.outcard_list = outcard_list p.total_score = tem["score"] - p.hand_left_count = tem["card_count"] p.piao_niao = tem["piao_niao"] or 0 - local opcard = tem["opcard"] - for k = 1, #opcard do - local op = opcard[k] - local fz = {} - fz.type = op["type"] - fz.card = op["card"] - fz.from_seat = op["from_seat"] - p.fz_list[#p.fz_list + 1] = fz - end - if not playing and room.curren_round > 0 then - -- self.GetGameController():PlayerReady() + if playing then + local outcard_list = tem["outcard_list"] + p.hand_left_count = tem["card_count"] + p.outcard_list = outcard_list + local opcard = tem["opcard"] + for k = 1, #opcard do + local op = opcard[k] + local fz = {} + fz.type = op["type"] + fz.card = op["card"] + fz.from_seat = op["from_seat"] + p.fz_list[#p.fz_list + 1] = fz + end end end end diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua index c227cc59..4d54df13 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua @@ -188,6 +188,8 @@ function M:fillResult0(room, peopleNum, result) print("===============================FZType.Peng", room.jing, fzCardInfo[j].card) if room.jing == fzCardInfo[j].card then card:GetController('jing').selectedIndex = 1 + else + card:GetController('jing').selectedIndex = 0 end end elseif fzCardInfo[j].type == FZType.Chi then @@ -200,6 +202,8 @@ function M:fillResult0(room, peopleNum, result) if room.jing == fzCardInfo[j].opcard[l] then card:GetController('jing').selectedIndex = 1 + else + card:GetController('jing').selectedIndex = 0 end end elseif fzCardInfo[j].type == FZType.Gang or fzCardInfo[j].type == FZType.Gang_An or fzCardInfo[j].type == FZType.Gang_Peng then @@ -214,6 +218,8 @@ function M:fillResult0(room, peopleNum, result) if room.jing == fzCardInfo[j].card then card:GetController('jing').selectedIndex = 1 + else + card:GetController('jing').selectedIndex = 0 end end end @@ -230,6 +236,8 @@ function M:fillResult0(room, peopleNum, result) obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), infoList.hand_card[index + 1]) if room.jing == infoList.hand_card[index + 1] then obj:GetController('jing').selectedIndex = 1 + else + obj:GetController('jing').selectedIndex = 0 end end handCardList.numItems = handInfoNum @@ -258,6 +266,8 @@ function M:fillResult0(room, peopleNum, result) huCardBtn.icon = string.format("ui://Main_Majiang/b202_%d", infoList.win_card) if room.jing == infoList.win_card then huCardBtn:GetController('jing').selectedIndex = 1 + else + huCardBtn:GetController('jing').selectedIndex = 0 end huCardBtn.visible = true @@ -358,6 +368,8 @@ function M:RemindCardRender(data, obj) obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), data) if room.jing == data then obj:GetController('jing').selectedIndex = 1 + else + obj:GetController('jing').selectedIndex = 0 end end diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua index 6f49f338..3af85240 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua @@ -235,7 +235,9 @@ function M:EventInit() end) _gamectr:AddEventListener(TX_GameEvent.EventTurn, function(...) local arg = { ... } - -- self._left_time = 15 + if not self._left_time or self._left_time <= 15 then + self._left_time = 15 + end local seat = arg[1] self:UpdateCardBox(self:GetPos(seat)) -- if seat == self._room.self_player.seat then diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXPlayerInfoView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXPlayerInfoView.lua index ac74d71b..3a8b3a84 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXPlayerInfoView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXPlayerInfoView.lua @@ -3,17 +3,17 @@ local PlayerInfoView2 = require("Game.View.PlayerInfoView2") local M = {} -function M.new(view, mainView) +function M.new(view, mainView,flag_witness) setmetatable(M, { __index = PlayerInfoView2 }) local self = setmetatable({}, { __index = M }) self._view = view self._main_view = mainView - self:init() + self:init(flag_witness) return self end -function M:init() - PlayerInfoView2.init(self) +function M:init(flag_witness) + PlayerInfoView2.init(self,flag_witness) end function M:ShowInteraction(type, str) diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua index ad6e9539..3a4e6b40 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua @@ -156,72 +156,13 @@ end function M:EventInit() -- UIPackage.AddPackage("extend/majiang/hongzhong/ui/Extend_MJ_HongZhong") - MainView.EventInit(self) + getmetatable(M).__index.EventInit(self) local _room = self._room local _view = self._view local _gcm_outcard_url = UIPackage.GetItemURL("Main_Majiang", "Gcm_OutCard") local _player_info = self._player_info local _gamectr = self._gamectr - _gamectr:AddEventListener(GameEvent.PlayerEnter, function(...) - self:PlayMJSound("user_enter.mp3") - local arg = { ... } - local p = arg[1] - local info1 = self._player_info[self:GetPos(p.seat)] - info1:FillData(p) - info1._view.visible = true - - local info2 = self._player_card_info[self:GetPos(p.seat)] - info2:SetPlayer(p) - info2:FillData() - end) - - _gamectr:AddEventListener(GameEvent.PlayerLeave, function(...) - local arg = { ... } - local p = arg[1] - local info1 = self._player_info[self:GetPos(p.seat)] - info1._view.visible = false - self:PlayMJSound("user_leave.mp3") - end) - - _gamectr:AddEventListener(GameEvent.WitnessPlayerEnter, function(...) - self:PlayMJSound("user_enter.mp3") - local arg = { ... } - local witnessPlayerList = arg[1] - self._room.witness_player_list = witnessPlayerList - - local _room = DataManager.CurrenRoom - local viewList_witness = self._view:GetChild('comp_witness'):GetChild('list_players') - print("linemng tcp", _room._flag_updateWitness, #_room.witness_player_list, viewList_witness.numItems) - if viewList_witness.numItems == #_room.witness_player_list then - viewList_witness:RefreshVirtualList() - else - viewList_witness.numItems = #_room.witness_player_list - end - end) - - _gamectr:AddEventListener(GameEvent.WitnessPlayerLeave, function(...) - ---- print("刷新托管数据=====") - local arg = { ... } - local player = arg[1] - local witnessPlayerList = self._room.witness_player_list - for i, _player in ipairs(witnessPlayerList) do - if _player.aid == player then - table.remove(witnessPlayerList, i) - break - end - end - - local _room = DataManager.CurrenRoom - local viewList_witness = self._view:GetChild('comp_witness'):GetChild('list_players') - print("linemng", _room._flag_updateWitness, #_room.witness_player_list, viewList_witness.numItems) - if viewList_witness.numItems == #_room.witness_player_list then - viewList_witness:RefreshVirtualList() - else - viewList_witness.numItems = #_room.witness_player_list - end - end) - _gamectr:AddEventListener(TX_GameEvent.SendLaiZi, function(...) local arg = { ... } print("lingmeng witness SendLaiZi") @@ -237,67 +178,10 @@ function M:EventInit() print("lingmeng witness EventBuGang") end) - _gamectr:AddEventListener(TX_GameEvent.SendCards, function(...) - print("lingmeng witness SendCards") - -- self:ShowJing() - if self._clearingView then - self._clearingView:Destroy() - self._clearingView = nil - end - self:UpdateRound() - self:RemoveCursor() - self._state.selectedIndex = 4 - local list = _room.player_list - for i = 1, #list do - local p = list[i] - local info = self._player_info[self:GetPos(p.seat)] - info:FillData(p) - info:MarkBank(p.seat == _room.banker_seat) - info:Ready(false) - local card_info = self._player_card_info[self:GetPos(p.seat)] - card_info:Clear() - card_info:UpdateHandCardWitness() - end - end) - _gamectr:AddEventListener(TX_GameEvent.EventTurn, function(...) - print("lingmeng witness EventTurn") - local arg = { ... } - -- self._left_time = 15 - local seat = arg[1] - self:UpdateCardBox(self:GetPos(seat)) - local playerInfo = self._player_info[self:GetPos(seat)] - local info = self._player_card_info[self:GetPos(seat)] - print("lingmeng hand_left_count", info._player.hand_left_count) - info._player.hand_left_count = info._player.hand_left_count + 1 - info:UpdateHandCardWitness(true) - end) - _gamectr:AddEventListener(TX_GameEvent.OutHint, function(...) print("lingmeng witness OutHint") end) - local _gcm_outcard_url = "ui://Main_Majiang/Gcm_OutCard" - _gamectr:AddEventListener(TX_GameEvent.OutCard, function(...) - print("lingmeng witness OutCard") - self._left_time = 0 - local arg = { ... } - local p = arg[1] - local card = arg[2] - local seat = p.seat - local info = self._player_card_info[self:GetPos(seat)] - - self:RemoveCursor() - - info:UpdateHandCardWitness(false) - - info:UpdateOutCardList(nil, nil, self._cursor) - self:PlayMJSound("chupai.mp3") - self:PlaySound("NanCheng_MJ", p.self_user.sex, tostring(card)) - if seat == _room.self_player.seat then - _room.curren_outcard_seat = -1 - end - print("ling 2zhihou2") - end) _gamectr:AddEventListener(TX_GameEvent.GetCard, function(...) print("lingmeng witness GetCard") end) @@ -416,6 +300,7 @@ function M:EventInit() end) _gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...) + self:PlayMJSound("end_music.mp3") local _room = self._room self._left_time = 0 self:UpdateCardBox(0) @@ -439,6 +324,7 @@ function M:EventInit() -- self:RemoveCursor() if self._clearingView == nil then self._clearingView = EXClearingView.new(self._root_view) + self._clearingView._view:GetChild('btn_setting').onClick:Set(handler(self,self.ClickSetting)) coroutine.start(function() coroutine.wait(0.5) self._clearingView:Show() @@ -449,6 +335,31 @@ function M:EventInit() if _room.curren_round ~= _room.room_config.round then -- if #niao == 0 then self._view:GetChild("n13").visible = false end self._clearingView:InitData(0, _room, result, nil, function(...) + for i = 1, #data do + local p = _room:GetPlayerBySeat(data[i].seat) + p.total_score = data[i].total_score + local card_info = self._player_card_info[self:GetPos(p.seat)] + local info = self._player_info[self:GetPos(p.seat)] + --card_info:Clear() + card_info:ResetCardType() + if _room:checkHpNonnegative() then + p.cur_hp = data[i].total_score + end + info:UpdateScore() + info._view:GetChild("zhanji").visible = true + local num = data[i].total_score + if num >= 0 then + info._view:GetController("text_color").selectedIndex = 0 + info._view:GetChild("text_jifen").text = "+" .. num + else + info._view:GetController("text_color").selectedIndex = 1 + info._view:GetChild("text_jifen").text = num + end + + info._view:GetChild("mask_piao").title = "" + info._view:GetController("piao_niao").selectedIndex = 0 + p.fz_list = {} + end DataManager.CurrenRoom.self_player.card_list = {} self._clearingView = nil end) @@ -457,7 +368,7 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...) print("lingmeng witness ZPResult2") - -- self:UnmarkSelfTuoguan() + self:UnmarkSelfTuoguan() self._left_time = 0 self:UpdateCardBox(0) self._ctr_cardbox.selectedIndex = 0 @@ -487,6 +398,18 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.EventResidueCard, function(...) print("lingmeng witness EventResidueCard") end) + + --替换mianview的事件 + _gamectr:AddEventListener( + GameEvent.PlayerState, + function(...) + printlog("lingmeng OnEventOnlineState") + local arg = { ... } + local p = arg[1] + local info = self._player_info[self:GetPos(p.seat)] + info._ctr_offline.selectedIndex = p.line_state == 0 and 1 or 0 + end + ) end function M:InitPlayerInfoView() @@ -494,7 +417,7 @@ function M:InitPlayerInfoView() local _player_info = self._player_info for i = 1, self._room.room_config.people_num do local tem = self._view:GetChild(string.format("player_info%d_2", i)) - _player_info[i] = PlayerInfoView.new(tem, self) + _player_info[i] = PlayerInfoView.new(tem, self,true) tem.visible = false end end diff --git a/lua_probject/extend_project/extend/majiang/nancheng/ExtendConfig.lua b/lua_probject/extend_project/extend/majiang/nancheng/ExtendConfig.lua index 6a928492..f24ef048 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/ExtendConfig.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/ExtendConfig.lua @@ -101,22 +101,21 @@ function M:FillRoomData(s2croom) local tem = _info_list[i] local playerid = tem["playerid"] local p = room:GetPlayerById(playerid) - local outcard_list = tem["outcard_list"] - p.outcard_list = outcard_list p.total_score = tem["score"] - p.hand_left_count = tem["card_count"] p.piao_niao = tem["piao_niao"] or 0 - local opcard = tem["opcard"] - for k = 1, #opcard do - local op = opcard[k] - local fz = {} - fz.type = op["type"] - fz.card = op["card"] - fz.from_seat = op["from_seat"] - p.fz_list[#p.fz_list + 1] = fz - end - if not playing and room.curren_round > 0 then - -- self.GetGameController():PlayerReady() + if playing then + local outcard_list = tem["outcard_list"] + p.hand_left_count = tem["card_count"] + p.outcard_list = outcard_list + local opcard = tem["opcard"] + for k = 1, #opcard do + local op = opcard[k] + local fz = {} + fz.type = op["type"] + fz.card = op["card"] + fz.from_seat = op["from_seat"] + p.fz_list[#p.fz_list + 1] = fz + end end end end