小结算周期修复

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
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

View File

@ -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()
@ -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(...)

View File

@ -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()

View File

@ -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(...)

View File

@ -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(...)

View File

@ -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(...)

View File

@ -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