同步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)
---- print("进入房间++++++++++++++++++++++++++++++++++++++")
print("进入房间++++++++++++++++++++++++++++++++++++++")
self._cacheEvent:Enqueue(
function()
local p = self._room:NewPlayer()

View File

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

View File

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

View File

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

View File

@ -229,5 +229,9 @@
<group id="n168_qz7i" name="showNext" xy="-125,-102" size="2832,1436" advanced="true">
<gearDisplay controller="showNext" pages="1"/>
</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>
</component>