同步46.45

master
罗家炜 2025-06-11 16:45:21 +08:00
parent 6ad0b67cf6
commit 9cef826299
6 changed files with 75 additions and 52 deletions

View File

@ -282,7 +282,7 @@ end
-- 玩家进 -- 玩家进
function M:OnEventPlayerEnter(evt_data) function M:OnEventPlayerEnter(evt_data)
---- print("进入房间++++++++++++++++++++++++++++++++++++++") print("进入房间++++++++++++++++++++++++++++++++++++++")
self._cacheEvent:Enqueue( self._cacheEvent:Enqueue(
function() function()
local p = self._room:NewPlayer() local p = self._room:NewPlayer()

View File

@ -31,12 +31,13 @@ end
-- end -- end
-- end -- end
function M:InitData(over, room, result, total_result, callback) function M:InitData(over, room, result, total_result, callback, isWitness, witnessCallbak)
-- print("===============================InitData===========================", over, room, result, total_result) -- print("===============================InitData===========================", over, room, result, total_result)
-- pt(room) -- pt(room)
-- pt(result) -- pt(result)
-- Pt(total_result) -- Pt(total_result)
self._callback = callback self._callback = callback
self._witnessCallbak = witnessCallbak
local showClearMainBtn = self._view:GetChild("btn_showClearMain") local showClearMainBtn = self._view:GetChild("btn_showClearMain")
local nextRoundBtn = self._view:GetChild("btn_nextRound") local nextRoundBtn = self._view:GetChild("btn_nextRound")
local nextRoundBtn2 = self._view:GetChild("Btn_NextRound2") local nextRoundBtn2 = self._view:GetChild("Btn_NextRound2")
@ -55,9 +56,16 @@ function M:InitData(over, room, result, total_result, callback)
end) end)
nextRoundBtn.onClick:Set(function() nextRoundBtn.onClick:Set(function()
local _gamectr = ControllerManager.GetController(GameController) if isWitness and isWitness == 1 then
_gamectr:PlayerReady() if self._witnessCallbak then
self:DestroyWithCallback() self._witnessCallbak()
end
self:DestroyWithCallback()
else
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:PlayerReady()
self:DestroyWithCallback()
end
end) end)
@ -71,9 +79,16 @@ function M:InitData(over, room, result, total_result, callback)
_overCtr.selectedIndex = 0 _overCtr.selectedIndex = 0
self:fillResult0(room, peopleNum, result) self:fillResult0(room, peopleNum, result)
nextRoundBtn2.onClick:Set(function() nextRoundBtn2.onClick:Set(function()
local _gamectr = ControllerManager.GetController(GameController) if isWitness and isWitness == 1 then
_gamectr:PlayerReady() if self._witnessCallbak then
self:DestroyWithCallback() self._witnessCallbak()
end
self:DestroyWithCallback()
else
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:PlayerReady()
self:DestroyWithCallback()
end
end) end)
elseif over == 1 then elseif over == 1 then
showBtnTypeCtr.selectedIndex = 1 showBtnTypeCtr.selectedIndex = 1

View File

@ -476,28 +476,30 @@ function M:EventInit()
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)
p.total_score = data[i].total_score if p then
local card_info = self._player_card_info[self:GetPos(p.seat)] p.total_score = data[i].total_score
local info = self._player_info[self:GetPos(p.seat)] local card_info = self._player_card_info[self:GetPos(p.seat)]
card_info:Clear() local info = self._player_info[self:GetPos(p.seat)]
card_info:ResetCardType() card_info:Clear()
if _room:checkHpNonnegative() then card_info:ResetCardType()
p.cur_hp = data[i].hp_info.cur_hp if _room:checkHpNonnegative() then
end p.cur_hp = data[i].hp_info.cur_hp
-- info:UpdateScore() end
info._view:GetChild("zhanji").visible = true -- info:UpdateScore()
local num = data[i].hp_info.total_hp info._view:GetChild("zhanji").visible = true
if num >= 0 then local num = data[i].hp_info.total_hp
info._view:GetController("text_color").selectedIndex = 0 if num >= 0 then
info._view:GetChild("text_jifen").text = "+" .. d2ad(num) info._view:GetController("text_color").selectedIndex = 0
else info._view:GetChild("text_jifen").text = "+" .. d2ad(num)
info._view:GetController("text_color").selectedIndex = 1 else
info._view:GetChild("text_jifen").text = d2ad(num) info._view:GetController("text_color").selectedIndex = 1
end info._view:GetChild("text_jifen").text = d2ad(num)
end
info._view:GetChild("mask_piao").title = "" info._view:GetChild("mask_piao").title = ""
info._view:GetController("piao_niao").selectedIndex = 0 info._view:GetController("piao_niao").selectedIndex = 0
p.fz_list = {} p.fz_list = {}
end
end end
DataManager.CurrenRoom.self_player.card_list = {} DataManager.CurrenRoom.self_player.card_list = {}
self._state.selectedIndex = 2 self._state.selectedIndex = 2

View File

@ -256,33 +256,35 @@ function M:EventInit()
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)
p.total_score = data[i].total_score if p then
local card_info = self._player_card_info[self:GetPos(p.seat)] p.total_score = data[i].total_score
local info = self._player_info[self:GetPos(p.seat)] local card_info = self._player_card_info[self:GetPos(p.seat)]
card_info:Clear() local info = self._player_info[self:GetPos(p.seat)]
card_info:ResetCardType() card_info:Clear()
if _room:checkHpNonnegative() then card_info:ResetCardType()
p.cur_hp = data[i].hp_info.cur_hp if _room:checkHpNonnegative() then
end p.cur_hp = data[i].hp_info.cur_hp
-- info:UpdateScore() end
info._view:GetChild("zhanji").visible = true -- info:UpdateScore()
local num = data[i].hp_info.total_hp info._view:GetChild("zhanji").visible = true
if num >= 0 then local num = data[i].hp_info.total_hp
info._view:GetController("text_color").selectedIndex = 0 if num >= 0 then
info._view:GetChild("text_jifen").text = "+" .. d2ad(num) info._view:GetController("text_color").selectedIndex = 0
else info._view:GetChild("text_jifen").text = "+" .. d2ad(num)
info._view:GetController("text_color").selectedIndex = 1 else
info._view:GetChild("text_jifen").text = d2ad(num) info._view:GetController("text_color").selectedIndex = 1
end info._view:GetChild("text_jifen").text = d2ad(num)
end
info._view:GetChild("mask_piao").title = "" info._view:GetChild("mask_piao").title = ""
info._view:GetController("piao_niao").selectedIndex = 0 info._view:GetController("piao_niao").selectedIndex = 0
p.fz_list = {} p.fz_list = {}
end
end end
DataManager.CurrenRoom.self_player.card_list = {} DataManager.CurrenRoom.self_player.card_list = {}
self._state.selectedIndex = 2 self._ctr_state.selectedIndex = 2
self._clearingView = nil self._clearingView = nil
end) end, 1)
end end
print("lingmeng witness ZPResult3") print("lingmeng witness ZPResult3")

View File

@ -229,5 +229,9 @@
<group id="n168_qz7i" name="showNext" xy="-125,-102" size="2832,1436" advanced="true"> <group id="n168_qz7i" name="showNext" xy="-125,-102" size="2832,1436" advanced="true">
<gearDisplay controller="showNext" pages="1"/> <gearDisplay controller="showNext" pages="1"/>
</group> </group>
<graph id="n182_kw9h" name="n182" xy="874,1024" size="784,100" type="rect" lineSize="0" fillColor="#4c000000"/>
<text id="n181_kw9h" name="n181" xy="1114,1035" size="304,79" fontSize="60" color="#ffffff" text="正在旁观中">
<gearDisplay controller="state" pages="4"/>
</text>
</displayList> </displayList>
</component> </component>