diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua index 0536ae54..eac5ab89 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua @@ -97,12 +97,13 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne if self._witnessCallbak then self._witnessCallbak() end - self:DestroyWithCallback() + --self:DestroyWithCallback() else local _gamectr = ControllerManager.GetController(GameController) _gamectr:PlayerReady() - self:DestroyWithCallback() + --self:DestroyWithCallback() end + self:DestroyWithCallback() end) elseif over == 1 then showBtnTypeCtr.selectedIndex = 1 diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua index b0a7b9ae..30a8aaa2 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua @@ -13,6 +13,9 @@ local M = {} function M.new() setmetatable(M, { __index = MJMainView }) local self = setmetatable({}, { __index = M }) + + self.EXClearingViewClass = EXClearingView + self.class = "MainView" self.asset_group = "FuZhou_MJ" self:init() @@ -373,7 +376,7 @@ function M:EventInit() if tem.type > 0 and tem.type < 32 then local com_name = "he" .. tem.type printlog("声音====>>>", com_name) - local sound_name = string.format("extend/majiang/fuzhou/sound/%s/%s.mp3", + local sound_name = string.format("extend/majiang/fuzhou/sound/%s/%s.mp3", ViewUtil.Sex_Chat[player.self_user.sex], com_name) ViewUtil.PlaySound("FuZhou_MJ", sound_name) @@ -403,6 +406,8 @@ function M:EventInit() end) _gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...) + MJMainView.OnResult1(self, ...) + --[[ self._popEvent = false self:__CloseTip() self._left_time = 0 @@ -433,11 +438,11 @@ function M:EventInit() self._popEvent = true end) end - 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(...) - --[[ + 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 @@ -467,10 +472,11 @@ function M:EventInit() self._state.selectedIndex = 2 self._clearingView = nil ]] + --[[ end) - + end - -- self._player_card_info[1]:ShowHuTip() + -- self._player_card_info[1]:ShowHuTip()]] end) _gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...) diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua index 753809a5..5764f8e5 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua @@ -362,16 +362,12 @@ function M:UpdateCardBox(seat) end function M:OnFangziAction(...) - print("lingmeng OnFangziAction") - -- self:__CloseTip() - print("lingmeng OnFangziAction1") local arg = { ... } local _player_card_info = self._player_card_info local fz = arg[1] local player = arg[2] local index = arg[3] - printlog("OnFangziAction") local info = _player_card_info[self:GetPos(player.seat)] -- local pNode = info._mask_liangpai @@ -380,13 +376,11 @@ function M:OnFangziAction(...) local fs_info = _player_card_info[self:GetPos(fz.from_seat)] fs_info:UpdateOutCardList() end - print("lingmeng OnFangziAction5") info:UpdateFzList(fz, index, true) local getcard = fz.type == FZType.Peng or fz.type == FZType.Chi - printlog(getcard) + --printlog(getcard) - print("lingmeng hand_left_count", info._player.hand_left_count) info._player.hand_left_count = info._player.hand_left_count - 1 info:UpdateHandCardWitness(true) -- self:__CloseTip() diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua index dd0c66f8..f393b21d 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua @@ -13,6 +13,9 @@ local M = {} function M.new() setmetatable(M, { __index = MJMainView }) local self = setmetatable({}, { __index = M }) + + self.EXClearingViewClass = EXClearingView + self.class = "MainView" self.asset_group = "JinXi_MJ" self:init() @@ -397,6 +400,8 @@ function M:EventInit() end) _gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...) + MJMainView.OnResult1(self, ...) + --[[ self._popEvent = false self:__CloseTip() self._left_time = 0 @@ -462,6 +467,7 @@ function M:EventInit() end) end -- self._player_card_info[1]:ShowHuTip() + ]] end) _gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...) diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua index 92523e76..74830630 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua @@ -13,6 +13,9 @@ local M = {} function M.new() setmetatable(M, { __index = MJMainView }) local self = setmetatable({}, { __index = M }) + + self.EXClearingViewClass = EXClearingView + self.class = "MainView" self.asset_group = "LiChuan_MJ" self:init() @@ -398,6 +401,8 @@ function M:EventInit() end) _gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...) + MJMainView.OnResult1(self, ...) + --[[ self._popEvent = false self:__CloseTip() self._left_time = 0 @@ -464,7 +469,7 @@ function M:EventInit() self._clearingView = nil end) end - -- self._player_card_info[1]:ShowHuTip() + -- self._player_card_info[1]:ShowHuTip()]] end) _gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...) diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua index 1da475b3..1d6decd1 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua @@ -13,6 +13,9 @@ local M = {} function M.new() setmetatable(M, { __index = MJMainView }) local self = setmetatable({}, { __index = M }) + + self.EXClearingViewClass = EXClearingView + self.class = "MainView" self.asset_group = "NanCheng_MJ" self:init() @@ -398,6 +401,8 @@ function M:EventInit() end) _gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...) + MJMainView.OnResult1(self, ...) + --[[ self._popEvent = false self:__CloseTip() self._left_time = 0 @@ -462,7 +467,7 @@ function M:EventInit() self._clearingView = nil end) end - -- self._player_card_info[1]:ShowHuTip() + -- self._player_card_info[1]:ShowHuTip()]] end) _gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...) diff --git a/lua_probject/main_project/main/majiang/MJMainView.lua b/lua_probject/main_project/main/majiang/MJMainView.lua index 6f13c223..27688b4d 100644 --- a/lua_probject/main_project/main/majiang/MJMainView.lua +++ b/lua_probject/main_project/main/majiang/MJMainView.lua @@ -622,4 +622,70 @@ function M:ShowHand(msg) end end +function M:OnResult1(...) + local _room = self._room + self._popEvent = false + self:__CloseTip() + self._left_time = 0 + self:UpdateCardBox(0) + self._ctr_cardbox.selectedIndex = 0 + local arg = { ... } + self:ShowHand(arg) + local result = arg[1] + local liuju = result.liuju + local data = result.info_list + local niao = result.niao + -- if liuju then + -- local le = UIPackage.CreateObjectFromURL("ui://Main_Majiang/LiuJu") + -- self._view:AddChild(le) + -- le:Center() + -- le:GetTransition("t0"):Play() + -- coroutine.start(function() + -- coroutine.wait(1) + -- le:Dispose() + -- end) + -- end + self:RemoveCursor() + self._clearingView = self.EXClearingViewClass.new(self._root_view) + coroutine.start(function() + coroutine.wait(0.5) + self._clearingView:Show() + self._popEvent = true + end) + + 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._state.selectedIndex = 2 + self._clearingView = nil + end) + end +end + return M