小结算周期修复

master
1076390229 2025-08-04 19:20:35 +08:00
parent 82b6e0c8cd
commit 2fb81a6496
7 changed files with 100 additions and 17 deletions

View File

@ -97,12 +97,13 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne
if self._witnessCallbak then if self._witnessCallbak then
self._witnessCallbak() self._witnessCallbak()
end end
self:DestroyWithCallback() --self:DestroyWithCallback()
else else
local _gamectr = ControllerManager.GetController(GameController) local _gamectr = ControllerManager.GetController(GameController)
_gamectr:PlayerReady() _gamectr:PlayerReady()
self:DestroyWithCallback() --self:DestroyWithCallback()
end end
self:DestroyWithCallback()
end) end)
elseif over == 1 then elseif over == 1 then
showBtnTypeCtr.selectedIndex = 1 showBtnTypeCtr.selectedIndex = 1

View File

@ -13,6 +13,9 @@ local M = {}
function M.new() function M.new()
setmetatable(M, { __index = MJMainView }) setmetatable(M, { __index = MJMainView })
local self = setmetatable({}, { __index = M }) local self = setmetatable({}, { __index = M })
self.EXClearingViewClass = EXClearingView
self.class = "MainView" self.class = "MainView"
self.asset_group = "FuZhou_MJ" self.asset_group = "FuZhou_MJ"
self:init() self:init()
@ -403,6 +406,8 @@ function M:EventInit()
end) end)
_gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...) _gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...)
MJMainView.OnResult1(self, ...)
--[[
self._popEvent = false self._popEvent = false
self:__CloseTip() self:__CloseTip()
self._left_time = 0 self._left_time = 0
@ -433,10 +438,10 @@ function M:EventInit()
self._popEvent = true self._popEvent = true
end) end)
end end
if _room.curren_round ~= _room.room_config.round then if _room.curren_round ~= _room.room_config.round then
-- if #niao == 0 then self._view:GetChild("n13").visible = false end -- 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 for i = 1, #data do
local p = _room:GetPlayerBySeat(data[i].seat) local p = _room:GetPlayerBySeat(data[i].seat)
@ -467,10 +472,11 @@ function M:EventInit()
self._state.selectedIndex = 2 self._state.selectedIndex = 2
self._clearingView = nil self._clearingView = nil
]] ]]
--[[
end) end)
end end
-- self._player_card_info[1]:ShowHuTip() -- self._player_card_info[1]:ShowHuTip()]]
end) end)
_gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...) _gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...)

View File

@ -362,16 +362,12 @@ function M:UpdateCardBox(seat)
end end
function M:OnFangziAction(...) function M:OnFangziAction(...)
print("lingmeng OnFangziAction")
-- self:__CloseTip()
print("lingmeng OnFangziAction1")
local arg = { ... } local arg = { ... }
local _player_card_info = self._player_card_info local _player_card_info = self._player_card_info
local fz = arg[1] local fz = arg[1]
local player = arg[2] local player = arg[2]
local index = arg[3] local index = arg[3]
printlog("OnFangziAction")
local info = _player_card_info[self:GetPos(player.seat)] local info = _player_card_info[self:GetPos(player.seat)]
-- local pNode = info._mask_liangpai -- local pNode = info._mask_liangpai
@ -380,13 +376,11 @@ function M:OnFangziAction(...)
local fs_info = _player_card_info[self:GetPos(fz.from_seat)] local fs_info = _player_card_info[self:GetPos(fz.from_seat)]
fs_info:UpdateOutCardList() fs_info:UpdateOutCardList()
end end
print("lingmeng OnFangziAction5")
info:UpdateFzList(fz, index, true) info:UpdateFzList(fz, index, true)
local getcard = fz.type == FZType.Peng or fz.type == FZType.Chi 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._player.hand_left_count = info._player.hand_left_count - 1
info:UpdateHandCardWitness(true) info:UpdateHandCardWitness(true)
-- self:__CloseTip() -- self:__CloseTip()

View File

@ -13,6 +13,9 @@ local M = {}
function M.new() function M.new()
setmetatable(M, { __index = MJMainView }) setmetatable(M, { __index = MJMainView })
local self = setmetatable({}, { __index = M }) local self = setmetatable({}, { __index = M })
self.EXClearingViewClass = EXClearingView
self.class = "MainView" self.class = "MainView"
self.asset_group = "JinXi_MJ" self.asset_group = "JinXi_MJ"
self:init() self:init()
@ -397,6 +400,8 @@ function M:EventInit()
end) end)
_gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...) _gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...)
MJMainView.OnResult1(self, ...)
--[[
self._popEvent = false self._popEvent = false
self:__CloseTip() self:__CloseTip()
self._left_time = 0 self._left_time = 0
@ -462,6 +467,7 @@ function M:EventInit()
end) end)
end end
-- self._player_card_info[1]:ShowHuTip() -- self._player_card_info[1]:ShowHuTip()
]]
end) end)
_gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...) _gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...)

View File

@ -13,6 +13,9 @@ local M = {}
function M.new() function M.new()
setmetatable(M, { __index = MJMainView }) setmetatable(M, { __index = MJMainView })
local self = setmetatable({}, { __index = M }) local self = setmetatable({}, { __index = M })
self.EXClearingViewClass = EXClearingView
self.class = "MainView" self.class = "MainView"
self.asset_group = "LiChuan_MJ" self.asset_group = "LiChuan_MJ"
self:init() self:init()
@ -398,6 +401,8 @@ function M:EventInit()
end) end)
_gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...) _gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...)
MJMainView.OnResult1(self, ...)
--[[
self._popEvent = false self._popEvent = false
self:__CloseTip() self:__CloseTip()
self._left_time = 0 self._left_time = 0
@ -464,7 +469,7 @@ function M:EventInit()
self._clearingView = nil self._clearingView = nil
end) end)
end end
-- self._player_card_info[1]:ShowHuTip() -- self._player_card_info[1]:ShowHuTip()]]
end) end)
_gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...) _gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...)

View File

@ -13,6 +13,9 @@ local M = {}
function M.new() function M.new()
setmetatable(M, { __index = MJMainView }) setmetatable(M, { __index = MJMainView })
local self = setmetatable({}, { __index = M }) local self = setmetatable({}, { __index = M })
self.EXClearingViewClass = EXClearingView
self.class = "MainView" self.class = "MainView"
self.asset_group = "NanCheng_MJ" self.asset_group = "NanCheng_MJ"
self:init() self:init()
@ -398,6 +401,8 @@ function M:EventInit()
end) end)
_gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...) _gamectr:AddEventListener(TX_GameEvent.ZPResult1, function(...)
MJMainView.OnResult1(self, ...)
--[[
self._popEvent = false self._popEvent = false
self:__CloseTip() self:__CloseTip()
self._left_time = 0 self._left_time = 0
@ -462,7 +467,7 @@ function M:EventInit()
self._clearingView = nil self._clearingView = nil
end) end)
end end
-- self._player_card_info[1]:ShowHuTip() -- self._player_card_info[1]:ShowHuTip()]]
end) end)
_gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...) _gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...)

View File

@ -622,4 +622,70 @@ function M:ShowHand(msg)
end end
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 return M