hengyang_client/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua

591 lines
16 KiB
Lua
Raw Normal View History

2025-04-01 10:48:36 +08:00
require("Game.View.ResultView")
local Hu_Type_Name = import(".CS_Win_Type")
local EXClearingView = {}
local M = EXClearingView
function EXClearingView.new(blur_view)
2025-04-11 11:23:14 +08:00
setmetatable(M, { __index = ResultView })
local self = setmetatable({}, { __index = M })
2025-04-01 10:48:36 +08:00
self._full = true
ResultView.init(self, "ui://Main_Majiang/clearing")
self._currenIndex = 0
self._blur_view = blur_view
self._close_zone = false
self:InitMaPai()
2025-04-11 11:23:14 +08:00
2025-04-01 10:48:36 +08:00
return self
end
function M:InitMaPai()
2025-04-11 11:23:14 +08:00
self.maPaiCtr = self._view:GetController("mapai")
self.maPaiCtr.selectedIndex = 0
2025-04-01 10:48:36 +08:00
2025-04-11 11:23:14 +08:00
self.maPaiList = {}
2025-04-01 10:48:36 +08:00
2025-04-11 11:23:14 +08:00
for i = 1, 8 do
local tempMP = self._view:GetChild("niao" .. i)
table.insert(self.maPaiList, tempMP)
2025-04-01 10:48:36 +08:00
end
end
2025-04-11 11:23:14 +08:00
function M:IsMapaiShow(niao, isShow)
if niao then
niao.visible = isShow
end
end
2025-04-01 10:48:36 +08:00
2025-04-11 11:23:14 +08:00
function M:SetMaPaiValue(niao, value)
2025-04-01 10:48:36 +08:00
if niao then
2025-04-11 11:23:14 +08:00
niao.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. value
2025-04-01 10:48:36 +08:00
end
end
2025-04-11 11:23:14 +08:00
function M:SetMaPaiColor(niao, num)
niao:GetController("color").selectedIndex = num
2025-04-01 10:48:36 +08:00
end
function M:HideAllMapai()
2025-04-11 11:23:14 +08:00
for i = 1, #self.maPaiList do
self:IsMapaiShow(self.maPaiList[i], false)
self:SetMaPaiColor(self.maPaiList[i], 0)
2025-04-01 10:48:36 +08:00
end
end
function M:ShowSelectMaPai(niaoList)
2025-04-11 11:23:14 +08:00
if niaoList and #niaoList > 0 then
self.maPaiCtr.selectedIndex = 1
2025-04-01 10:48:36 +08:00
self:HideAllMapai()
2025-04-11 11:23:14 +08:00
for i = 1, #niaoList do
self:IsMapaiShow(self.maPaiList[i], true)
self:SetMaPaiValue(self.maPaiList[i], niaoList[i].card)
if niaoList[i].score > 0 then
self:SetMaPaiColor(self.maPaiList[i], 2)
2025-04-01 10:48:36 +08:00
end
end
else
2025-04-11 11:23:14 +08:00
self.maPaiCtr.selectedIndex = 0
2025-04-01 10:48:36 +08:00
end
end
function M:CalculatePaixingInfo(result)
2025-04-11 11:23:14 +08:00
self.WinList = {}
if result.info_list and #result.info_list > 0 then
for i = 1, #result.info_list do
if result.info_list[i].win_list and #result.info_list[i].win_list > 0 then
table.insert(self.WinList, result.info_list[i].win_list)
2025-04-01 10:48:36 +08:00
end
end
end
2025-04-11 11:23:14 +08:00
2025-04-01 10:48:36 +08:00
printlog("牌型列表====>>>")
pt(self.WinList)
end
function M:SetPaixingxiangqing(num)
2025-04-11 11:23:14 +08:00
for i = 1, #self.PaiXingXiangQingCtrList do
2025-04-01 10:48:36 +08:00
if self.PaiXingXiangQingCtrList[i] then
2025-04-11 11:23:14 +08:00
self.PaiXingXiangQingCtrList[i].selectedIndex = num
2025-04-01 10:48:36 +08:00
end
end
end
function M:InitData(over, room, result, total_result, callback)
self._callback = callback
local _overCtr = self._view:GetController("over")
local btn_confirm = self._view:GetChild("btn_confirm")
local btn_result = self._view:GetChild("btn_showResult")
local btn_close = self._view:GetChild("big_result"):GetChild("btn_close")
local _btnCtr = self._view:GetController("button")
local _sdkCtr = self._view:GetController("sdk")
local ctr_type = self._view:GetController("type")
2025-04-11 11:23:14 +08:00
self._view:GetChild("tex_roominfo").text = string.format("房号%s 局%s/%s %s", room.room_id, room.curren_round,
room.room_config.round, os.date("%Y-%m-%d %H:%M:%S", os.time()))
2025-04-01 10:48:36 +08:00
self._view:GetChild("tex_gameinfo").text = string.gsub(room.room_config:GetDes2(), "\r", "")
2025-04-11 11:23:14 +08:00
2025-04-01 10:48:36 +08:00
if result then
self:ShowSelectMaPai(result.niao)
self:CalculatePaixingInfo(result)
end
2025-04-11 11:23:14 +08:00
self.PaiXingXiangQingCtrList = {}
local paixingxiangqing = self._view:GetChild("btn_detal")
local fanhuipaixing = self._view:GetChild("btn_fanhuipaixing")
fanhuipaixing.visible = false
paixingxiangqing.visible = true
2025-04-01 10:48:36 +08:00
paixingxiangqing.onClick:Add(function()
2025-04-11 11:23:14 +08:00
paixingxiangqing.visible = false
fanhuipaixing.visible = true
self:SetPaixingxiangqing(1)
end)
2025-04-01 10:48:36 +08:00
fanhuipaixing.onClick:Add(function()
2025-04-11 11:23:14 +08:00
paixingxiangqing.visible = true
fanhuipaixing.visible = false
self:SetPaixingxiangqing(0)
end)
2025-04-01 10:48:36 +08:00
if over ~= 2 then
if result.liuju then
ctr_type.selectedIndex = 3
else
local info_list = result.info_list
for i = 1, #info_list do
local is_win = info_list[i].is_win
if is_win then
if info_list[i].seat == room.self_player.seat then
ctr_type.selectedIndex = 1
else
ctr_type.selectedIndex = 2
end
end
end
end
if over == 0 then
_btnCtr.selectedIndex = 0
_sdkCtr.selectedIndex = 1
btn_confirm.onClick:Add(function()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:PlayerReady()
self:DestroyWithCallback()
end)
self:AddClearItem(room, result.info_list, nil, over, result.niao, result.active_player)
elseif over == 1 then
_btnCtr.selectedIndex = 1
_sdkCtr.selectedIndex = 1
btn_result.onClick:Add(function()
2025-04-11 11:23:14 +08:00
self.maPaiCtr.selectedIndex = 0
2025-04-01 10:48:36 +08:00
_overCtr.selectedIndex = 1
_btnCtr.selectedIndex = 0
_sdkCtr.selectedIndex = 0
if self._qsinfo_view then
self._qsinfo_view:Dispose()
end
end)
btn_close.onClick:Add(function()
ViewManager.ChangeView(ViewManager.View_Lobby)
end)
2025-04-11 11:23:14 +08:00
2025-04-01 10:48:36 +08:00
self:AddClearItem(room, result.info_list, total_result.info_list, over, result.niao, result.active_player)
end
else
_overCtr.selectedIndex = 1
2025-04-11 11:23:14 +08:00
self.maPaiCtr.selectedIndex = 0
2025-04-01 10:48:36 +08:00
btn_close.onClick:Add(function()
ViewManager.ChangeView(ViewManager.View_Lobby)
end)
2025-04-11 11:23:14 +08:00
2025-04-01 10:48:36 +08:00
self:AddClearItem(room, nil, total_result.info_list, over)
end
end
2025-04-11 11:23:14 +08:00
function M:AddClearItem(room, data, total_data, over, niao, active_player)
2025-04-01 10:48:36 +08:00
local n = over + 1
local list_view1 = self._view:GetChild("player_list_1")
local list_view2 = self._view:GetChild("player_list_2")
if 0 == over or 1 == over then
2025-04-11 11:23:14 +08:00
table.sort(data, function(a, b) return a.seat < b.seat end)
2025-04-01 10:48:36 +08:00
list_view1:RemoveChildrenToPool()
2025-04-11 11:23:14 +08:00
for i = 1, #data do
2025-04-01 10:48:36 +08:00
local item = list_view1:AddItemFromPool()
self:FillItemData(room, data[i], item, active_player, niao)
end
2025-04-11 11:23:14 +08:00
if #data == 3 then
2025-04-01 10:48:36 +08:00
list_view1.lineGap = 54
elseif #data == 2 then
list_view1.lineGap = 108
end
2025-04-11 11:23:14 +08:00
if 1 == over then
2025-04-01 10:48:36 +08:00
self:FillItemData2(room, total_data, list_view2)
end
elseif 2 == over then
self:FillItemData2(room, total_data, list_view2)
end
end
function M:FillItemData(room, data, item, active_player, niao)
local _gamectr = ControllerManager.GetController(GameController)
local p = room:GetPlayerBySeat(data["seat"])
item:GetChild("playerName").text = p.self_user.nick_name
2025-04-11 11:23:14 +08:00
item:GetChild("lab_hp").text = "" --抓马
2025-04-01 10:48:36 +08:00
local user = room:GetPlayerBySeat(data["seat"]).self_user
local head = item:GetChild('head'):GetChild('n4')
2025-04-11 11:23:14 +08:00
ImageLoad.Load(user.head_url, head)
2025-04-01 10:48:36 +08:00
-- 手牌
local hand_cards = data["hand_card"]
2025-04-11 11:23:14 +08:00
table.sort(hand_cards, ViewUtil.HandCardSort)
2025-04-01 10:48:36 +08:00
local hand_list_view = item:GetChild("hand_card_list")
hand_list_view:RemoveChildrenToPool()
2025-04-11 11:23:14 +08:00
for i = 1, #hand_cards do
2025-04-01 10:48:36 +08:00
local card = hand_list_view:AddItemFromPool()
2025-04-11 11:23:14 +08:00
card.icon = "ui://Main_Majiang/202_" .. hand_cards[i]
2025-04-01 10:48:36 +08:00
end
hand_list_view.width = 52 * #hand_cards
local fz_card = p.fz_list
local fz_card_list = item:GetChild("fz_card_list")
fz_card_list.width = 157 * #fz_card * 0.8
fz_card_list:RemoveChildrenToPool()
2025-04-11 11:23:14 +08:00
for i = 1, #fz_card do
2025-04-01 10:48:36 +08:00
if fz_card[i].type == FZType.Peng then
local item = fz_card_list:AddItemFromPool("ui://Main_Majiang/clearing_fz_3")
2025-04-11 11:23:14 +08:00
for j = 1, 3 do
2025-04-01 10:48:36 +08:00
local card = item:GetChild("card_" .. j)
2025-04-11 11:23:14 +08:00
card.icon = "ui://Main_Majiang/202_" .. fz_card[i].card
2025-04-01 10:48:36 +08:00
end
elseif fz_card[i].type == FZType.Chi then
local item = fz_card_list:AddItemFromPool("ui://Main_Majiang/clearing_fz_3")
2025-04-11 11:23:14 +08:00
for j = 1, 3 do
2025-04-01 10:48:36 +08:00
local card = item:GetChild("card_" .. j)
2025-04-11 11:23:14 +08:00
card.icon = "ui://Main_Majiang/" .. self:GetPrefix() .. "202_" .. fz_card[i].opcard[j]
2025-04-01 10:48:36 +08:00
end
elseif fz_card[i].type == FZType.Gang or fz_card[i].type == FZType.Gang_An or fz_card[i].type == FZType.Gang_Peng then
local item = fz_card_list:AddItemFromPool("ui://Main_Majiang/clearing_fz_4")
2025-04-11 11:23:14 +08:00
for j = 1, 4 do
2025-04-01 10:48:36 +08:00
local card = item:GetChild("card_" .. j)
if fz_card[i].type == FZType.Gang_An and j == 4 then
card.icon = "ui://Main_Majiang/202_00"
else
2025-04-11 11:23:14 +08:00
card.icon = "ui://Main_Majiang/202_" .. fz_card[i].card
2025-04-01 10:48:36 +08:00
end
end
end
end
local huadd = data["hu_score"]
local gangadd = data["gang_score"]
2025-04-11 11:23:14 +08:00
local jingadd = data["jing_score"]
2025-04-01 10:48:36 +08:00
local total = data["round_score"]
2025-04-11 11:23:14 +08:00
local geng_zhuan = data["geng_zhuan"]
2025-04-01 10:48:36 +08:00
local sp = " "
2025-04-11 11:23:14 +08:00
local str = "胡:" .. huadd .. ""
if gangadd then
str = str .. sp .. "杠:" .. gangadd .. ""
end
if jingadd then
str = str .. sp .. "博精:" .. jingadd .. ""
end
2025-04-01 10:48:36 +08:00
item:GetChild("score1").text = str
-- local total_score = data["total_score"]
if total >= 0 then
2025-04-11 11:23:14 +08:00
item:GetChild("score2").text = "+" .. total
2025-04-01 10:48:36 +08:00
item:GetChild("score2").grayed = false
else
item:GetChild("score2").text = total
item:GetChild("score2").grayed = true
end
2025-04-11 11:23:14 +08:00
2025-04-01 10:48:36 +08:00
--计算牌型
2025-04-11 11:23:14 +08:00
local totalPeson = DataManager.CurrenRoom.room_config.people_num - 1
2025-04-01 10:48:36 +08:00
local win_list = data["win_list"]
local is_win = data["is_win"] or false
2025-04-11 11:23:14 +08:00
local str1 = ""
sp = ""
2025-04-01 10:48:36 +08:00
if is_win then
if win_list then
if DataManager.CurrenRoom.isZiMoHu then
2025-04-11 11:23:14 +08:00
str1 = "自摸"
2025-04-01 10:48:36 +08:00
else
2025-04-11 11:23:14 +08:00
str1 = "接炮"
2025-04-01 10:48:36 +08:00
end
2025-04-11 11:23:14 +08:00
for i = 1, #win_list do
local huName = Hu_Type_Name[win_list[i].type]
2025-04-01 10:48:36 +08:00
if huName then
2025-04-11 11:23:14 +08:00
str1 = str1 .. sp .. huName .. "x" .. win_list[i].score
2025-04-01 10:48:36 +08:00
end
end
2025-04-11 11:23:14 +08:00
str1 = str1 .. " +" .. huadd .. ""
2025-04-01 10:48:36 +08:00
end
else
printlog("输家============")
if DataManager.CurrenRoom.isZiMoHu then
printlog("自摸处理============")
--str1=""
2025-04-11 11:23:14 +08:00
if #self.WinList == 1 then
for i = 1, #self.WinList do
for j = 1, #self.WinList[i] do
local huName = Hu_Type_Name[self.WinList[i][j].type]
2025-04-01 10:48:36 +08:00
if huName then
2025-04-11 11:23:14 +08:00
if j == 1 then
str1 = str1 .. huName .. "x" .. self.WinList[i][j].score
2025-04-01 10:48:36 +08:00
else
2025-04-11 11:23:14 +08:00
str1 = str1 .. sp .. huName .. "x" .. self.WinList[i][j].score
2025-04-01 10:48:36 +08:00
end
end
end
end
2025-04-11 11:23:14 +08:00
str1 = str1 .. " " .. huadd .. ""
2025-04-01 10:48:36 +08:00
else
printlog("服务端自摸计算异常===>>>")
end
else
printlog("非自摸处理====>>>")
--点炮 一炮多响
2025-04-11 11:23:14 +08:00
local yipaoduoxiang = false
if #self.WinList > 1 then
yipaoduoxiang = true
2025-04-01 10:48:36 +08:00
end
2025-04-11 11:23:14 +08:00
2025-04-01 10:48:36 +08:00
if yipaoduoxiang then
printlog("一炮多响====>>>")
2025-04-11 11:23:14 +08:00
str = "点炮"
local allTypeList = {}
local isHas = false
for i = 1, #self.WinList do
for j = 1, #self.WinList[i] do
isHas = IsHasDictionary(self.WinList[i][j].type, allTypeList)
if isHas == false then
table.insert(allTypeList, self.WinList[i][j].type)
2025-04-01 10:48:36 +08:00
end
end
end
2025-04-11 11:23:14 +08:00
if #allTypeList > 0 then
for i = 1, #allTypeList do
local huName = Hu_Type_Name[allTypeList[i]]
2025-04-01 10:48:36 +08:00
if huName then
2025-04-11 11:23:14 +08:00
str1 = str1 .. huName .. ""
2025-04-01 10:48:36 +08:00
end
end
2025-04-11 11:23:14 +08:00
str1 = str1 .. " " .. huadd .. ""
2025-04-01 10:48:36 +08:00
end
else
2025-04-11 11:23:14 +08:00
if p.self_user.account_id == active_player and is_win == false and not data["liuju"] then
str1 = "点炮"
if #self.WinList == 1 then
for i = 1, # self.WinList do
for j = 1, #self.WinList[i] do
local huName = Hu_Type_Name[self.WinList[i][j].type]
2025-04-01 10:48:36 +08:00
if huName then
2025-04-11 11:23:14 +08:00
str1 = str1 .. sp .. huName .. "x" .. self.WinList[i][j].score
2025-04-01 10:48:36 +08:00
end
end
end
2025-04-11 11:23:14 +08:00
str1 = str1 .. " " .. huadd .. ""
2025-04-01 10:48:36 +08:00
else
printlog("服务端自摸计算异常===>>>")
end
end
end
end
end
2025-04-11 11:23:14 +08:00
2025-04-01 10:48:36 +08:00
--
2025-04-11 11:23:14 +08:00
printlog("牌型计算==>>>", str1)
if data["ming_gang_num"] > 0 then
str1 = str1 .. " 明杠x" .. data["ming_gang_num"]
end
if data["an_gang_num"] > 0 then
str1 = str1 .. " 暗杠x" .. data["an_gang_num"]
end
if data["dian_gang_num"] > 0 then
str1 = str1 .. " 点杠x" .. data["dian_gang_num"]
end
if gangadd ~= 0 then
if gangadd > 0 then
str1 = str1 .. " +" .. gangadd .. ""
2025-04-01 10:48:36 +08:00
else
2025-04-11 11:23:14 +08:00
str1 = str1 .. " " .. gangadd .. ""
2025-04-01 10:48:36 +08:00
end
end
2025-04-11 11:23:14 +08:00
if data["ma_geng_gong"] and data["ma_geng_gong"] ~= 0 then
if data["ma_geng_gong"] > 0 then
str1 = str1 .. " 马跟杠:+" .. data["ma_geng_gong"] .. ""
2025-04-01 10:48:36 +08:00
else
2025-04-11 11:23:14 +08:00
str1 = str1 .. " 马跟杠:" .. data["ma_geng_gong"] .. ""
2025-04-01 10:48:36 +08:00
end
end
2025-04-11 11:23:14 +08:00
if geng_zhuan and geng_zhuan ~= 0 then
if geng_zhuan > 0 then
str1 = str1 .. " 跟庄:+" .. geng_zhuan .. ""
2025-04-01 10:48:36 +08:00
else
2025-04-11 11:23:14 +08:00
str1 = str1 .. " 跟庄:" .. geng_zhuan .. ""
2025-04-01 10:48:36 +08:00
end
2025-04-11 11:23:14 +08:00
end
item:GetChild("score3").text = str1
item:GetChild("score4").text = str1
local paixingCtr = item:GetController("detail")
table.insert(self.PaiXingXiangQingCtrList, paixingCtr)
2025-04-01 10:48:36 +08:00
-------------------------
local hp_nonnegative = room:checkHpNonnegative()
item:GetController("nonnegative").selectedIndex = hp_nonnegative and 1 or 0
if hp_nonnegative then
local hp_info = data.hp_info
local ctr_hp_limit = item:GetController("hp_limit")
local hp = d2ad(hp_info.round_actual_hp)
if hp >= 0 then hp = "+" .. tostring(hp) end
item:GetChild("tex_hp").text = hp
ctr_hp_limit.selectedIndex = hp_info.upper_limit and 1 or 0
end
2025-04-11 11:23:14 +08:00
2025-04-01 10:48:36 +08:00
item:GetController("win").selectedIndex = is_win and 0 or 1
2025-04-11 11:23:14 +08:00
if p.self_user.account_id == active_player and is_win == false and total < 0 then
item:GetController("win").selectedIndex = 2
2025-04-01 10:48:36 +08:00
end
2025-04-11 11:23:14 +08:00
2025-04-01 10:48:36 +08:00
if is_win then
2025-04-11 11:23:14 +08:00
item:GetController("bg").selectedIndex = 1
2025-04-01 10:48:36 +08:00
else
2025-04-11 11:23:14 +08:00
item:GetController("bg").selectedIndex = 0
2025-04-01 10:48:36 +08:00
end
local win_card = item:GetChild("win_card")
2025-04-11 11:23:14 +08:00
win_card.icon = "ui://Main_Majiang/202_" .. data["win_card"]
if niao and #niao > 0 then
local currentNiaoList = self:CalculateNiao(niao, data["seat"])
if currentNiaoList and #currentNiaoList > 0 then
2025-04-01 10:48:36 +08:00
local lst_niao = item:GetChild("list_niao")
lst_niao:RemoveChildrenToPool()
for i = 1, #currentNiaoList do
if currentNiaoList[i].score > 0 then
local card_niao = lst_niao:AddItemFromPool()
2025-04-11 11:23:14 +08:00
card_niao.icon = "ui://Main_Majiang/202_" .. currentNiaoList[i].card
end
2025-04-01 10:48:36 +08:00
end
end
end
2025-04-11 11:23:14 +08:00
2025-04-01 10:48:36 +08:00
if p.seat == room.banker_seat then
item:GetController("bank").selectedIndex = 1
end
end
2025-04-11 11:23:14 +08:00
function M:CalculateNiao(niaoList, seat)
local tempNiao = {}
for i = 1, #niaoList do
if niaoList[i].seat == seat then
table.insert(tempNiao, niaoList[i])
2025-04-01 10:48:36 +08:00
end
end
return tempNiao
end
function M:FillItemData2(room, data, list)
2025-04-11 11:23:14 +08:00
-- 赋值result_info聊天室分享需要
local player_list = {}
for i = 1, #data do
player_list[i] = {}
local user = room:GetPlayerBySeat(data[i].seat).self_user
player_list[i].id = user.account_id
player_list[i].hp_info = data[i].hp_info
player_list[i].score = data[i].total_score
player_list[i].house = room.owner_id == player_list[i].id and 1 or 0
player_list[i].nick = user.nick_name
player_list[i].head_url = user.head_url
local settle_log = data[i].settle_log
player_list[i].param = {}
player_list[i].param[1] = {}
player_list[i].param[1].key = "自摸次数:"
player_list[i].param[1].value = tostring(data[i].settle_log.zimo)
player_list[i].param[2] = {}
player_list[i].param[2].key = "接炮次数:"
player_list[i].param[2].value = tostring(data[i].settle_log.jie_pao)
player_list[i].param[3] = {}
player_list[i].param[3].key = "点炮次数:"
player_list[i].param[3].value = tostring(data[i].settle_log.dian_pao)
player_list[i].param[4] = {}
player_list[i].param[4].key = "暗杠次数:"
player_list[i].param[4].value = tostring(data[i].settle_log.an_kong)
player_list[i].param[5] = {}
player_list[i].param[5].key = "明杠次数:"
player_list[i].param[5].value = tostring(data[i].settle_log.ming_kong)
end
local round = room.room_config.round
self:GenerateRoomResultInfo(round, room.room_config:GetGameName(), room.room_id, room.create_time, player_list)
2025-04-01 10:48:36 +08:00
local big_result = self._view:GetChild("big_result")
2025-04-11 11:23:14 +08:00
big_result:GetChild("txt_room_info").text = string.format("%s 房号%s 局%s/%s", os.date("%Y/%m/%d", os.time()),
room.room_id, room.curren_round, room.room_config.round)
local lst_p = big_result:GetChild("player_list")
if #player_list == 3 then
2025-04-01 10:48:36 +08:00
lst_p.columnGap = 108
elseif #player_list == 2 then
lst_p.columnGap = 208
end
2025-04-11 11:23:14 +08:00
self:InitBigResult(room, 30)
2025-04-01 10:48:36 +08:00
local show_detail = room.hpOnOff == 1
2025-04-11 11:23:14 +08:00
for i = 1, lst_p.numChildren do
local com_p = lst_p:GetChildAt(i - 1)
com_p:GetController("jsicon").selectedIndex = i - 1
local list_param = com_p:GetChild("list_param")
for j = 1, list_param.numChildren do
local tem = list_param:GetChildAt(j - 1)
tem:GetChild("txt_value").textFormat.size = 30
end
if show_detail then
local score = 0
if com_p:GetController("pn").selectedIndex == 0 then
score = com_p:GetChild("txt_navigate").text
else
score = com_p:GetChild("txt_positive").text
end
score = score / room.score_times
com_p:GetChild("tex_detail_score").text = string.format("%s × %s倍", score, room.score_times)
end
end
if room.group_id ~= 0 then
big_result:GetController("group").selectedIndex = 1
end
DataManager.CurrenRoom = nil
2025-04-01 10:48:36 +08:00
end
function M:LoadHead(p, room)
local btn_head = self._view:GetChild("btn_head")
for i = 1, #room.player_list do
local player = room.player_list[i]
if p.seat == player.seat and player.self_user.head_url ~= "" then
ImageLoad.Load(player.self_user.head_url, btn_head.icon)
end
end
end
local prefix
function M:GetPrefix()
-- if not prefix then
2025-04-11 11:23:14 +08:00
prefix = get_majiang_prefix(10)
-- end
2025-04-01 10:48:36 +08:00
return prefix
end
2025-04-11 11:23:14 +08:00
function M:DestroyWithCallback()
2025-04-01 10:48:36 +08:00
if self._callback then
self._callback()
end
self:Destroy()
end
2025-04-11 11:23:14 +08:00
return M