2025-12-18 20:23:31 +08:00
|
|
|
|
---
|
|
|
|
|
|
--- Created by 谌建军.
|
|
|
|
|
|
--- DateTime: 2017/12/19 11:05
|
|
|
|
|
|
---
|
|
|
|
|
|
require("Game.View.ResultView")
|
|
|
|
|
|
|
|
|
|
|
|
local EXResultView = {}
|
|
|
|
|
|
|
|
|
|
|
|
local M = EXResultView
|
|
|
|
|
|
|
2026-01-04 21:54:26 +08:00
|
|
|
|
function EXResultView.new(root, data, over, win_seat)
|
2025-12-18 20:23:31 +08:00
|
|
|
|
setmetatable(M, { __index = ResultView })
|
|
|
|
|
|
local self = setmetatable({}, { __index = M })
|
|
|
|
|
|
|
|
|
|
|
|
self.class = "EXResultView"
|
|
|
|
|
|
self._currenIndex = 0
|
|
|
|
|
|
self._close_zone = false
|
|
|
|
|
|
self._root_runFast = root
|
|
|
|
|
|
self._gamectr = ControllerManager.GetController(GameController)
|
2026-01-04 21:54:26 +08:00
|
|
|
|
self:init("ui://Extend_Poker_DuoDuo/clearing_new", data, over, win_seat)
|
2025-12-18 20:23:31 +08:00
|
|
|
|
return self
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2026-01-04 21:54:26 +08:00
|
|
|
|
function M:init(url, data, over, win_seat)
|
2025-12-18 20:23:31 +08:00
|
|
|
|
ResultView.init(self, url, true)
|
|
|
|
|
|
|
|
|
|
|
|
local room = DataManager.CurrenRoom
|
|
|
|
|
|
self._view:GetController('over').selectedIndex = 0
|
|
|
|
|
|
|
|
|
|
|
|
if over == 2 and room.curren_round <= 0 then
|
|
|
|
|
|
if room._flag_lobby then
|
|
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Lobby)
|
|
|
|
|
|
else
|
|
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Family)
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
------------------
|
|
|
|
|
|
|
|
|
|
|
|
--只有一人直接退,有两人才进正常结算
|
|
|
|
|
|
if not over and #data == 1 then
|
|
|
|
|
|
if room._flag_lobby then
|
|
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Lobby)
|
|
|
|
|
|
else
|
|
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Family)
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2026-01-04 21:54:26 +08:00
|
|
|
|
--下一局
|
2025-12-18 20:23:31 +08:00
|
|
|
|
self._view:GetChild('btn_nextRound').onClick:Set(function()
|
|
|
|
|
|
if over == 0 then
|
|
|
|
|
|
local _gamectr = ControllerManager.GetController(GameController)
|
|
|
|
|
|
_gamectr:ConformToNextGame()
|
|
|
|
|
|
self:Destroy()
|
|
|
|
|
|
else
|
|
|
|
|
|
self._view:GetController('over').selectedIndex = 1
|
|
|
|
|
|
end
|
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
self._view:GetChild('btn_closeRound').onClick:Set(function()
|
|
|
|
|
|
if room._flag_lobby then
|
|
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Lobby)
|
|
|
|
|
|
else
|
|
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Family)
|
|
|
|
|
|
end
|
|
|
|
|
|
end)
|
|
|
|
|
|
|
2026-01-04 21:54:26 +08:00
|
|
|
|
--处理win_seat
|
|
|
|
|
|
local temp_win_seat = {}
|
2026-01-06 22:33:16 +08:00
|
|
|
|
for i, v in ipairs(win_seat) do
|
2026-01-04 21:54:26 +08:00
|
|
|
|
temp_win_seat[v] = 1
|
|
|
|
|
|
end
|
|
|
|
|
|
win_seat = temp_win_seat
|
|
|
|
|
|
self._view:GetController('win').selectedIndex = win_seat[room.self_player.seat] and 1 or 0
|
2025-12-18 20:23:31 +08:00
|
|
|
|
|
|
|
|
|
|
local over0List = self._view:GetChild('list_over0')
|
2026-01-06 22:33:16 +08:00
|
|
|
|
table.sort(data, function(a, b)
|
2026-01-04 21:54:26 +08:00
|
|
|
|
return a.ranking < b.ranking
|
|
|
|
|
|
end)
|
2025-12-18 20:23:31 +08:00
|
|
|
|
over0List.itemRenderer = function(index, obj)
|
|
|
|
|
|
local info = data[index + 1]
|
|
|
|
|
|
local playerInfo = room:GetPlayerBySeat(info.seat)
|
|
|
|
|
|
obj:GetChild('name').text = playerInfo.self_user.nick_name
|
2026-01-04 21:54:26 +08:00
|
|
|
|
obj:GetChild('cardScore').text = info.roundCardScore
|
|
|
|
|
|
obj:GetChild('bompScore').text = info.roundBonusScore
|
2025-12-18 20:23:31 +08:00
|
|
|
|
obj:GetChild('score').text = info.winscore > 0 and string.format("+%d", info.winscore) or info.winscore
|
|
|
|
|
|
end
|
|
|
|
|
|
over0List.numItems = #data
|
|
|
|
|
|
|
|
|
|
|
|
if over == 1 or (over == 2 and room.curren_round > 0) then
|
|
|
|
|
|
self._view:GetChild('text_roomID').text = room.room_id
|
|
|
|
|
|
self._view:GetChild('text_time').text = os.date('%m-%d %H:%M', os.time())
|
|
|
|
|
|
for i = 1, #data do
|
|
|
|
|
|
local info = data[i]
|
|
|
|
|
|
local playerInfo = room:GetPlayerBySeat(info.seat)
|
2026-01-06 22:33:16 +08:00
|
|
|
|
self:FillPlayerInfoEnd(self._view:GetChild(string.format("comp_playerInfo%d_over1", i)), info, playerInfo)
|
2025-12-18 20:23:31 +08:00
|
|
|
|
end
|
|
|
|
|
|
coroutine.start(function()
|
|
|
|
|
|
coroutine.wait(2)
|
|
|
|
|
|
self._view:GetController('over').selectedIndex = 1
|
|
|
|
|
|
end)
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-01-04 21:54:26 +08:00
|
|
|
|
-- local Btn_Share = self._view:GetChild('btn_shareRecord')
|
|
|
|
|
|
-- if Btn_Share then
|
|
|
|
|
|
-- Btn_Share.onClick:Set(function()
|
|
|
|
|
|
-- self:SaveRenderTextureToPNG()
|
|
|
|
|
|
-- end)
|
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
|
|
-- local Btn_Copy = self._view:GetChild('btn_copyRecord')
|
|
|
|
|
|
-- if Btn_Copy then
|
|
|
|
|
|
-- Btn_Copy.onClick:Set(function()
|
|
|
|
|
|
-- local resultStr = ""
|
|
|
|
|
|
-- if room.group_id ~= 0 then
|
|
|
|
|
|
-- local group = DataManager.groups:get(room.group_id)
|
|
|
|
|
|
-- resultStr = string.format("【%s】俱乐部,", group.name)
|
|
|
|
|
|
-- end
|
|
|
|
|
|
-- resultStr = string.format("%s%s\n", resultStr, room.game_info.name)
|
|
|
|
|
|
-- for i = 1, #data do
|
|
|
|
|
|
-- local info = data[i]
|
|
|
|
|
|
-- local playerInfo = room:GetPlayerBySeat(info.seat)
|
|
|
|
|
|
-- resultStr = string.format("%s%s\nID:%s【%s】\n", resultStr, playerInfo.self_user.nick_name,
|
|
|
|
|
|
-- playerInfo.self_user.account_id,
|
|
|
|
|
|
-- info.total_score)
|
|
|
|
|
|
-- end
|
|
|
|
|
|
-- resultStr = string.format("%s房号:%s 局数:%s/%s局\n结束时间:%s", resultStr, room.room_id, room.curren_round,
|
|
|
|
|
|
-- room.room_config.Times, os.date("%Y-%m-%d %H:%M:%S", os.time()))
|
|
|
|
|
|
-- ViewUtil.__openWx()
|
|
|
|
|
|
-- GameApplication.Instance:CopyToClipboard(resultStr)
|
|
|
|
|
|
-- end)
|
|
|
|
|
|
-- end
|
2025-12-18 20:23:31 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:FillPlayerInfoEnd(view, info, playerInfo, bigWin)
|
|
|
|
|
|
local room = DataManager.CurrenRoom
|
|
|
|
|
|
|
2026-01-06 22:33:16 +08:00
|
|
|
|
ImageLoad.Load(playerInfo.self_user.head_url, view:GetChild('btn_head')._iconObject)
|
|
|
|
|
|
view:GetChild('text_name').text = ViewUtil.stringEllipsis(playerInfo.self_user.nick_name)
|
|
|
|
|
|
view:GetChild('text_id').text = string.format("标识:%s", playerInfo.self_user.account_id)
|
2025-12-18 20:23:31 +08:00
|
|
|
|
local detailList = view:GetChild('list_detail')
|
2026-01-06 22:33:16 +08:00
|
|
|
|
self:FillDetailChild(detailList:AddItemFromPool(), "炸弹数", info.settle_log.boomnum)
|
|
|
|
|
|
self:FillDetailChild(detailList:AddItemFromPool(), "胜局",
|
2025-12-18 20:23:31 +08:00
|
|
|
|
string.format("%d赢%d输", info.settle_log.winnum, room.room_config.Times - info.settle_log.winnum))
|
2026-01-06 22:33:16 +08:00
|
|
|
|
if info.total_score > 0 then
|
|
|
|
|
|
view:GetController('win').selectedIndex = 1
|
|
|
|
|
|
view:GetChild('text_winScore').text = string.format("+%s", info.total_score)
|
|
|
|
|
|
else
|
|
|
|
|
|
view:GetController('win').selectedIndex = 0
|
|
|
|
|
|
view:GetChild('text_loseScore').text = info.total_score
|
|
|
|
|
|
end
|
2025-12-18 20:23:31 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:FillPlayerHead(view, playerInfo, bigWin)
|
|
|
|
|
|
ImageLoad.Load(playerInfo.self_user.head_url, view:GetChild('btn_head')._iconObject)
|
|
|
|
|
|
view:GetChild('text_name').text = ViewUtil.stringEllipsis(playerInfo.self_user.nick_name)
|
|
|
|
|
|
view:GetChild('text|_ID').text = playerInfo.self_user.account_id
|
|
|
|
|
|
view:GetController('bigWin').selectedIndex = bigWin and 1 or 0
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2026-01-06 22:33:16 +08:00
|
|
|
|
function M:FillDetailChild(view, title, value)
|
|
|
|
|
|
view:GetChild('text_title').text = title
|
2025-12-18 20:23:31 +08:00
|
|
|
|
view:GetChild('text_value').text = value
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:SetDestroryCallback(fct)
|
|
|
|
|
|
self._destoryCallback = fct
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:Destroy()
|
|
|
|
|
|
if self._destoryCallback then
|
|
|
|
|
|
self._destoryCallback()
|
|
|
|
|
|
end
|
|
|
|
|
|
getmetatable(M).__index.Destroy(self)
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
return M
|