抚州添加庄家积分翻倍
parent
fadf1b10da
commit
3c23a3dfe2
|
|
@ -113,6 +113,7 @@ function M:SelectedConfigData()
|
||||||
local fengding = _config:GetController("FengDing").selectedIndex
|
local fengding = _config:GetController("FengDing").selectedIndex
|
||||||
local Tiandihu = _config:GetController("TianDiHu").selectedIndex
|
local Tiandihu = _config:GetController("TianDiHu").selectedIndex
|
||||||
local zikechengshun = _config:GetController("ZiKeChengShun").selectedIndex
|
local zikechengshun = _config:GetController("ZiKeChengShun").selectedIndex
|
||||||
|
local zuangfenfanbei = _config:GetController('ZhuangFenFanBei').selectedIndex
|
||||||
|
|
||||||
local jiangma = Mathf.Round(_config:GetChild("n92").value)
|
local jiangma = Mathf.Round(_config:GetChild("n92").value)
|
||||||
|
|
||||||
|
|
@ -134,6 +135,8 @@ function M:SelectedConfigData()
|
||||||
_data["fengding"] = fengding
|
_data["fengding"] = fengding
|
||||||
_data["Tiandihu"] = Tiandihu
|
_data["Tiandihu"] = Tiandihu
|
||||||
_data["zikechengshun"] = zikechengshun
|
_data["zikechengshun"] = zikechengshun
|
||||||
|
_data["zuangfenfanbei"] = zuangfenfanbei
|
||||||
|
|
||||||
|
|
||||||
_data["jiangma"] = jiangma
|
_data["jiangma"] = jiangma
|
||||||
_data['xi_pai'] = xi_pai
|
_data['xi_pai'] = xi_pai
|
||||||
|
|
@ -209,6 +212,9 @@ function M:LoadConfigToDetail(data)
|
||||||
if configData.zikechengshun then
|
if configData.zikechengshun then
|
||||||
returnString = string.format("%s%s", returnString, configData.zikechengshun == 0 and ",有字可成顺" or "")
|
returnString = string.format("%s%s", returnString, configData.zikechengshun == 0 and ",有字可成顺" or "")
|
||||||
end
|
end
|
||||||
|
if configData.zuangfenfanbei then
|
||||||
|
returnString = string.format("%s%s", returnString, configData.zikechengshun == 0 and ",庄家积分翻倍" or "")
|
||||||
|
end
|
||||||
return returnString
|
return returnString
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ local PKMainView = import("main.poker.PKMainView")
|
||||||
local RunFast_PlayerPokerInfoView = import(".RunFast_PlayerPokerInfoView")
|
local RunFast_PlayerPokerInfoView = import(".RunFast_PlayerPokerInfoView")
|
||||||
local RunFast_PlayerSelfPokerInfoView = import(".RunFast_PlayerSelfPokerInfoView")
|
local RunFast_PlayerSelfPokerInfoView = import(".RunFast_PlayerSelfPokerInfoView")
|
||||||
local RunFast_GameEvent = import(".RunFast_GameEvent")
|
local RunFast_GameEvent = import(".RunFast_GameEvent")
|
||||||
local RunFast_ResultView = import(".RunFast_ResultView_jiangxi")
|
local RunFast_ResultView = import(".RunFast_ResultView")
|
||||||
local RunFast_RightPanelView = import(".RunFast_RightPanelView")
|
local RunFast_RightPanelView = import(".RunFast_RightPanelView")
|
||||||
local PlayerInfoView = import(".EXPlayerInfoView")
|
local PlayerInfoView = import(".EXPlayerInfoView")
|
||||||
local TableBG = import('Game.Data.TableBG')
|
local TableBG = import('Game.Data.TableBG')
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ local RunFast_PlayerCardInfoView = import('.RunFast_PlayerPokerInfoView')
|
||||||
local RunFast_PlayerSelfCardInfoView = import('.RunFast_PlayerSelfPokerInfoView')
|
local RunFast_PlayerSelfCardInfoView = import('.RunFast_PlayerSelfPokerInfoView')
|
||||||
local PlayerInfoView = import('.EXPlayerInfoView')
|
local PlayerInfoView = import('.EXPlayerInfoView')
|
||||||
local RunFast_RightPanelView = import(".RunFast_RightPanelView")
|
local RunFast_RightPanelView = import(".RunFast_RightPanelView")
|
||||||
local RunFast_ResultView = import(".RunFast_ResultView_jiangxi")
|
local RunFast_ResultView = import(".RunFast_ResultView")
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
local RunFast_Record_Event = {
|
local RunFast_Record_Event = {
|
||||||
|
|
|
||||||
|
|
@ -17,306 +17,97 @@ function RunFast_ResultView.new(blur_view, data, roomid, over, win_seat, dissolv
|
||||||
self._close_zone = false
|
self._close_zone = false
|
||||||
--self._blur_view = blur_view
|
--self._blur_view = blur_view
|
||||||
self._gamectr = ControllerManager.GetController(GameController)
|
self._gamectr = ControllerManager.GetController(GameController)
|
||||||
self:init("ui://Extend_Poker_RunFastNew/clearing", data, roomid, over, win_seat, dissolve, remaincards)
|
self:init("ui://Extend_Poker_RunFastNew/clearing_new", data, roomid, over, win_seat, dissolve, remaincards)
|
||||||
|
print("=======================lingmengresult", data, roomid, over, win_seat, dissolve, remaincards)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:init(url, data, roomid, over, win_seat, dissolve, remaincards)
|
function M:init(url, data, roomid, over, win_seat, dissolve, remaincards)
|
||||||
ResultView.init(self, url, true)
|
ResultView.init(self, url, true)
|
||||||
self.xiPaiCtr = self._view:GetController("xipai")
|
|
||||||
|
|
||||||
|
|
||||||
local round = DataManager.CurrenRoom.room_config.config.times or 1
|
|
||||||
local xpconfig = DataManager.CurrenRoom.room_config.config.xi_pai
|
|
||||||
if xpconfig and round > 1 then
|
|
||||||
self.xiPaiCtr.selectedIndex = 1
|
|
||||||
else
|
|
||||||
self.xiPaiCtr.selectedIndex = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
--self:InitData(data,roomid)
|
|
||||||
--self:InitData(data,roomid)
|
|
||||||
printlog("aaaaaaaaaaaaaaaa1111111111111111111111111222222222222222 ", dissolve)
|
|
||||||
pt(data)
|
|
||||||
if dissolve == 1 then
|
|
||||||
-- body
|
|
||||||
self.xiPaiCtr.selectedIndex = 0
|
|
||||||
self:InitData(data, win_seat, roomid)
|
|
||||||
else
|
|
||||||
local xipai = self._view:GetChild("btn_xipai")
|
|
||||||
xipai.touchable = true
|
|
||||||
xipai.onClick:Add(function()
|
|
||||||
local xiPaiCallBack = function()
|
|
||||||
xipai.touchable = false
|
|
||||||
self.xiPaiCtr.selectedIndex = 0
|
|
||||||
ViewUtil.ErrorTip(1000000, "申请洗牌成功")
|
|
||||||
end
|
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
|
||||||
_gamectr:SendXiPaiAction(xiPaiCallBack)
|
|
||||||
end)
|
|
||||||
if DataManager.CurrenRoom.xipaiScore then
|
|
||||||
--xipai.text="洗牌 积分x"..DataManager.CurrenRoom.xipaiScore
|
|
||||||
else
|
|
||||||
--xipai.text="洗牌 积分x0"
|
|
||||||
end
|
|
||||||
|
|
||||||
self:InitData_One(data, win_seat, over, roomid, remaincards)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:ChangeCodeByTo(card)
|
|
||||||
local flower = card % 10
|
|
||||||
local number = math.floor(card / 10)
|
|
||||||
if number == 15 then
|
|
||||||
number = 2
|
|
||||||
end
|
|
||||||
return flower * 100 + number
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 小结算
|
|
||||||
function M:InitData_One(data, winseat, over, roomid, remaincards)
|
|
||||||
local room = DataManager.CurrenRoom
|
local room = DataManager.CurrenRoom
|
||||||
self._view:GetController("sdk").selectedIndex = 1
|
self._view:GetController('over').selectedIndex = 0
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
|
||||||
local list_view = self._view:GetChild("player_list_1")
|
|
||||||
list_view:RemoveChildrenToPool()
|
|
||||||
|
|
||||||
local leftCardAll = self._view:GetChild("leftCardHand")
|
--按钮功能全部未开放
|
||||||
leftCardAll:RemoveChildrenToPool()
|
self._view:GetChild('btn_shareRecord').onClick:Set(function()
|
||||||
|
ViewUtil.ErrorMsg(self._view, "", "该功能还未开放")
|
||||||
if remaincards and #remaincards > 0 then
|
|
||||||
table.sort(remaincards, function(a, b)
|
|
||||||
return a % 100 < b % 100
|
|
||||||
end)
|
end)
|
||||||
for i = 1, #remaincards do
|
self._view:GetChild('btn_copyRecord').onClick:Set(function()
|
||||||
local card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. remaincards[i])
|
ViewUtil.ErrorMsg(self._view, "", "该功能还未开放")
|
||||||
leftCardAll:AddChild(card_code_obj)
|
end)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
--只有一人直接退,有两人才进正常结算
|
||||||
|
if not over and #data == 1 then
|
||||||
|
ViewManager.ChangeView(ViewManager.View_Family)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
for i = 1, #data do
|
|
||||||
local player = data[i]
|
|
||||||
local item = list_view:AddItemFromPool("ui://Extend_Poker_RunFastNew/clearing_item_1")
|
|
||||||
|
|
||||||
|
|
||||||
local leftCard = item:GetChild("leftCard")
|
|
||||||
leftCard:RemoveChildrenToPool()
|
|
||||||
-- table.sort(data[i].handCards,function (a,b)
|
|
||||||
|
|
||||||
-- return a % 100 < b % 100
|
|
||||||
-- end)
|
|
||||||
|
|
||||||
for j = 1, #data[i].handCards do
|
|
||||||
local code = data[i].handCards[j]
|
|
||||||
local card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code)
|
|
||||||
leftCard:AddChild(card_code_obj)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- table.sort(data[i].outCards,function (a,b)
|
|
||||||
-- return a % 100 < b % 100
|
|
||||||
-- end)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for k = 1, #data[i].outCards do
|
|
||||||
local code = data[i].outCards[k]
|
|
||||||
local card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. code)
|
|
||||||
leftCard:AddChild(card_code_obj)
|
|
||||||
card_code_obj:GetChildAt(0):GetChildAt(0).color = Color(0.7, 0.7, 0.7)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local boom = item:GetChild("boom")
|
|
||||||
boom.text = player.thisboomnum
|
|
||||||
|
|
||||||
local piao = item:GetChild("piao")
|
|
||||||
if player.piao <= 0 then
|
|
||||||
piao.text = "0"
|
|
||||||
else
|
|
||||||
piao.text = "" .. player.piao
|
|
||||||
end
|
|
||||||
|
|
||||||
local nichen = item:GetChild("nichen")
|
|
||||||
|
|
||||||
if player.nick ~= nil then
|
|
||||||
-- body
|
|
||||||
nichen.text = tostring(player.nick)
|
|
||||||
else
|
|
||||||
nichen.text = tostring(player.self_user.nick_name)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local shengpai = item:GetChild("shengpai")
|
|
||||||
if player.cards ~= nil then
|
|
||||||
-- body
|
|
||||||
shengpai.text = tostring(#player.cards)
|
|
||||||
else
|
|
||||||
shengpai.text = tostring(#player.hand_list)
|
|
||||||
end
|
|
||||||
|
|
||||||
local rt = 1
|
|
||||||
if room.hpOnOff == 1 then
|
|
||||||
rt = room.score_times
|
|
||||||
end
|
|
||||||
|
|
||||||
local hp_nonnegative = room:checkHpNonnegative()
|
|
||||||
local roundScore = player.winscore
|
|
||||||
if hp_nonnegative then
|
|
||||||
local jifen = ""
|
|
||||||
if roundScore > 0 then
|
|
||||||
jifen = "+" .. roundScore
|
|
||||||
else
|
|
||||||
jifen = "" .. roundScore
|
|
||||||
end
|
|
||||||
|
|
||||||
local tili = ""
|
|
||||||
local limit = ""
|
|
||||||
if player.hp_info.round_actual_hp > 0 then
|
|
||||||
tili = "(+" .. d2ad(player.hp_info.round_actual_hp) .. ")"
|
|
||||||
if player.hp_info.upper_limit then
|
|
||||||
limit = "达到上限"
|
|
||||||
end
|
|
||||||
else
|
|
||||||
tili = "(" .. d2ad(player.hp_info.round_actual_hp) .. ")"
|
|
||||||
if player.hp_info.upper_limit then
|
|
||||||
limit = "达到下限"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
item:GetChild("score").text = jifen .. tili .. limit
|
|
||||||
else
|
|
||||||
local jifen = ""
|
|
||||||
if roundScore >= 0 then
|
|
||||||
jifen = "+" .. roundScore
|
|
||||||
else
|
|
||||||
jifen = "" .. roundScore
|
|
||||||
end
|
|
||||||
jifen = jifen .. " "
|
|
||||||
|
|
||||||
local tili = ""
|
|
||||||
if room.hpOnOff > 0 then
|
|
||||||
local need = roundScore * rt
|
|
||||||
tili = "("
|
|
||||||
if roundScore > 0 then
|
|
||||||
tili = tili .. "+" .. tostring(need)
|
|
||||||
else
|
|
||||||
tili = tili .. tostring(need)
|
|
||||||
end
|
|
||||||
|
|
||||||
tili = tili .. ")"
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
item:GetChild("score").text = jifen .. tili
|
|
||||||
end
|
|
||||||
|
|
||||||
if roundScore >= 0 then
|
|
||||||
if room.self_player.seat == player.seat then
|
|
||||||
-- body
|
|
||||||
self._view:GetController("result").selectedIndex = 1
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if room.self_player.seat == player.seat then
|
|
||||||
self._view:GetController("result").selectedIndex = 0
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
if over == 0 then
|
if over == 0 then
|
||||||
-- body
|
self._view:GetChild('btn_nextRound').onClick:Set(function()
|
||||||
local btn_confirm = self._view:GetChild("btn_confirm")
|
|
||||||
btn_confirm.onClick:Set(function()
|
|
||||||
self:Destroy()
|
self:Destroy()
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
local _gamectr = ControllerManager.GetController(GameController)
|
||||||
_gamectr:ConformToNextGame()
|
_gamectr:ConformToNextGame()
|
||||||
end)
|
end)
|
||||||
else
|
end
|
||||||
self.xiPaiCtr.selectedIndex = 0
|
|
||||||
local btn_confirm = self._view:GetChild("btn_confirm")
|
|
||||||
btn_confirm.onClick:Set(function()
|
self._view:GetChild('btn_closeRound').onClick:Set(function()
|
||||||
--self:Destroy()
|
ViewManager.ChangeView(ViewManager.View_Family)
|
||||||
self:InitData(data, winseat, roomid)
|
end)
|
||||||
-- ViewManager.ChangeView(ViewManager.View_Lobby)
|
|
||||||
|
self._view:GetController('win').selectedIndex = win_seat == room.self_player.seat and 1 or 0
|
||||||
|
|
||||||
|
local over0List = self._view:GetChild('list_over0')
|
||||||
|
over0List:SetVirtual()
|
||||||
|
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
|
||||||
|
obj:GetChild('residue').text = #info.handCards
|
||||||
|
obj:GetChild('bomb').text = info.thisboomnum
|
||||||
|
obj:GetChild('score').text = info.winscore > 0 and string.format("+%d", info.winscore) or info.winscore
|
||||||
|
end
|
||||||
|
over0List.numItems = #data
|
||||||
|
|
||||||
|
if over == 1 or (not over and #data == 2) then
|
||||||
|
self._view:GetChild('text_roomID').text = room.room_id
|
||||||
|
self._view:GetChild('text_time').text = os.date('%m-%d %H:%M', os.time())
|
||||||
|
self._view:GetChild('text_groupID').text = room.group_id or 0
|
||||||
|
for i = 1, #data do
|
||||||
|
local info = data[i]
|
||||||
|
local playerInfo = room:GetPlayerBySeat(info.seat)
|
||||||
|
self:FillPlayerInfoEnd(self._view:GetChild(string.format("comp_playerInfo%d_over1", i)), info, playerInfo)
|
||||||
|
end
|
||||||
|
coroutine.start(function()
|
||||||
|
coroutine.wait(2)
|
||||||
|
self._view:GetController('over').selectedIndex = 1
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 大结算
|
function M:FillPlayerInfoEnd(view, info, playerInfo)
|
||||||
function M:InitData(data, winseat, roomid)
|
|
||||||
self.xiPaiCtr.selectedIndex = 0
|
|
||||||
self._view:GetController("sdk").selectedIndex = 0
|
|
||||||
|
|
||||||
local room = DataManager.CurrenRoom
|
local room = DataManager.CurrenRoom
|
||||||
|
|
||||||
local rt = 1
|
self:FillPlayerHead(view:GetChild('comp_playerInfo'), playerInfo)
|
||||||
if room.hpOnOff == 1 and room.score_times ~= 1 then
|
|
||||||
rt = room.score_times
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 赋值result_info,聊天室分享需要
|
local detailList = view:GetChild('list_detail')
|
||||||
local player_list = {}
|
|
||||||
for i = 1, #data do
|
|
||||||
player_list[i] = {}
|
|
||||||
|
|
||||||
local user = room:GetPlayerBySeat(data[i].seat).self_user
|
self:FillDetailChild(detailList:AddItemFromPool(), "单局最高得分", info.settle_log.maxscore)
|
||||||
|
self:FillDetailChild(detailList:AddItemFromPool(), "打出炸弹数", info.settle_log.boomnum)
|
||||||
|
self:FillDetailChild(detailList:AddItemFromPool(), "胜负局数",
|
||||||
|
string.format("%d赢%d输", info.settle_log.winnum, room.room_config.Times - info.settle_log.winnum))
|
||||||
|
self:FillDetailChild(detailList:AddItemFromPool(), "总积分", info.total_score)
|
||||||
|
end
|
||||||
|
|
||||||
player_list[i].id = user.account_id
|
function M:FillPlayerHead(view, playerInfo)
|
||||||
|
ImageLoad.Load(playerInfo.self_user.head_url, view:GetChild('btn_head')._iconObject)
|
||||||
|
view:GetChild('text_name').text = playerInfo.self_user.nick_name
|
||||||
|
view:GetChild('text|_ID').text = playerInfo.self_user.account_id
|
||||||
|
end
|
||||||
|
|
||||||
player_list[i].score = data[i].score
|
function M:FillDetailChild(view, title, value)
|
||||||
player_list[i].hp_info = data[i].hp_info
|
view:GetChild('text_title').text = title
|
||||||
player_list[i].house = room.owner_id == player_list[i].id and 1 or 0
|
view:GetChild('text_value').text = value
|
||||||
player_list[i].nick = user.nick_name
|
|
||||||
player_list[i].seat = data[i].seat
|
|
||||||
player_list[i].head_url = data[i].self_user.head_url
|
|
||||||
|
|
||||||
if data[i].entrust ~= nil then
|
|
||||||
player_list[i].entrust = data[i].entrust > 0
|
|
||||||
else
|
|
||||||
player_list[i].entrust = false
|
|
||||||
end
|
|
||||||
|
|
||||||
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.winnum)
|
|
||||||
|
|
||||||
player_list[i].param[2] = {}
|
|
||||||
player_list[i].param[2].key = "打出炸弹数:"
|
|
||||||
player_list[i].param[2].value = tostring(data[i].settle_log.boomnum)
|
|
||||||
|
|
||||||
player_list[i].param[3] = {}
|
|
||||||
player_list[i].param[3].key = "春天次数:"
|
|
||||||
player_list[i].param[3].value = tostring(data[i].settle_log.springnum)
|
|
||||||
|
|
||||||
player_list[i].param[4] = {}
|
|
||||||
player_list[i].param[4].key = "当局最高分:"
|
|
||||||
player_list[i].param[4].value = tostring(data[i].settle_log.maxscore * rt)
|
|
||||||
|
|
||||||
if data[i].daniao > 0 then
|
|
||||||
player_list[i].flag = { "打鸟" }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
self:GenerateRoomResultInfo(room.room_config.Times, room.room_config:GetGameName(), room.room_id, room.create_time,
|
|
||||||
player_list)
|
|
||||||
self:InitBigResult(room)
|
|
||||||
local big_result = self._view:GetChild("big_result")
|
|
||||||
local lst_p = big_result:GetChild("player_list")
|
|
||||||
-- local list_param = com_p:GetChild("list_param")
|
|
||||||
for i = 1, lst_p.numChildren do
|
|
||||||
local com_p = lst_p:GetChildAt(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
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -1,113 +0,0 @@
|
||||||
---
|
|
||||||
--- Created by 谌建军.
|
|
||||||
--- DateTime: 2017/12/19 11:05
|
|
||||||
---
|
|
||||||
require("Game.View.ResultView")
|
|
||||||
|
|
||||||
local RunFast_ResultView = {}
|
|
||||||
|
|
||||||
local M = RunFast_ResultView
|
|
||||||
|
|
||||||
function RunFast_ResultView.new(blur_view, data, roomid, over, win_seat, dissolve, remaincards)
|
|
||||||
setmetatable(M, { __index = ResultView })
|
|
||||||
local self = setmetatable({}, { __index = M })
|
|
||||||
|
|
||||||
self.class = "RunFast_ResultView"
|
|
||||||
self._currenIndex = 0
|
|
||||||
self._close_zone = false
|
|
||||||
--self._blur_view = blur_view
|
|
||||||
self._gamectr = ControllerManager.GetController(GameController)
|
|
||||||
self:init("ui://Extend_Poker_RunFastNew/clearing_new", data, roomid, over, win_seat, dissolve, remaincards)
|
|
||||||
print("=======================lingmengresult", data, roomid, over, win_seat, dissolve, remaincards)
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:init(url, data, roomid, over, win_seat, dissolve, remaincards)
|
|
||||||
ResultView.init(self, url, true)
|
|
||||||
|
|
||||||
local room = DataManager.CurrenRoom
|
|
||||||
self._view:GetController('over').selectedIndex = 0
|
|
||||||
|
|
||||||
--按钮功能全部未开放
|
|
||||||
self._view:GetChild('btn_shareRecord').onClick:Set(function()
|
|
||||||
ViewUtil.ErrorMsg(self._view, "", "该功能还未开放")
|
|
||||||
end)
|
|
||||||
self._view:GetChild('btn_copyRecord').onClick:Set(function()
|
|
||||||
ViewUtil.ErrorMsg(self._view, "", "该功能还未开放")
|
|
||||||
end)
|
|
||||||
------------------
|
|
||||||
|
|
||||||
--只有一人直接退,有两人才进正常结算
|
|
||||||
if not over and #data == 1 then
|
|
||||||
ViewManager.ChangeView(ViewManager.View_Family)
|
|
||||||
end
|
|
||||||
|
|
||||||
if over == 0 then
|
|
||||||
self._view:GetChild('btn_nextRound').onClick:Set(function()
|
|
||||||
self:Destroy()
|
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
|
||||||
_gamectr:ConformToNextGame()
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
self._view:GetChild('btn_closeRound').onClick:Set(function()
|
|
||||||
ViewManager.ChangeView(ViewManager.View_Family)
|
|
||||||
end)
|
|
||||||
|
|
||||||
self._view:GetController('win').selectedIndex = win_seat == room.self_player.seat and 1 or 0
|
|
||||||
|
|
||||||
local over0List = self._view:GetChild('list_over0')
|
|
||||||
over0List:SetVirtual()
|
|
||||||
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
|
|
||||||
obj:GetChild('residue').text = #info.handCards
|
|
||||||
obj:GetChild('bomb').text = info.thisboomnum
|
|
||||||
obj:GetChild('score').text = info.winscore > 0 and string.format("+%d", info.winscore) or info.winscore
|
|
||||||
end
|
|
||||||
over0List.numItems = #data
|
|
||||||
|
|
||||||
if over == 1 or (not over and #data == 2) then
|
|
||||||
self._view:GetChild('text_roomID').text = room.room_id
|
|
||||||
self._view:GetChild('text_time').text = os.date('%m-%d %H:%M', os.time())
|
|
||||||
self._view:GetChild('text_groupID').text = room.group_id or 0
|
|
||||||
for i = 1, #data do
|
|
||||||
local info = data[i]
|
|
||||||
local playerInfo = room:GetPlayerBySeat(info.seat)
|
|
||||||
self:FillPlayerInfoEnd(self._view:GetChild(string.format("comp_playerInfo%d_over1", i)), info, playerInfo)
|
|
||||||
end
|
|
||||||
coroutine.start(function()
|
|
||||||
coroutine.wait(2)
|
|
||||||
self._view:GetController('over').selectedIndex = 1
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:FillPlayerInfoEnd(view, info, playerInfo)
|
|
||||||
local room = DataManager.CurrenRoom
|
|
||||||
|
|
||||||
self:FillPlayerHead(view:GetChild('comp_playerInfo'), playerInfo)
|
|
||||||
|
|
||||||
local detailList = view:GetChild('list_detail')
|
|
||||||
|
|
||||||
self:FillDetailChild(detailList:AddItemFromPool(), "单局最高得分", info.settle_log.maxscore)
|
|
||||||
self:FillDetailChild(detailList:AddItemFromPool(), "打出炸弹数", info.settle_log.boomnum)
|
|
||||||
self:FillDetailChild(detailList:AddItemFromPool(), "胜负局数",
|
|
||||||
string.format("%d赢%d输", info.settle_log.winnum, room.room_config.Times - info.settle_log.winnum))
|
|
||||||
self:FillDetailChild(detailList:AddItemFromPool(), "总积分", info.total_score)
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:FillPlayerHead(view, playerInfo)
|
|
||||||
ImageLoad.Load(playerInfo.self_user.head_url, view:GetChild('btn_head')._iconObject)
|
|
||||||
view:GetChild('text_name').text = playerInfo.self_user.nick_name
|
|
||||||
view:GetChild('text|_ID').text = playerInfo.self_user.account_id
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:FillDetailChild(view, title, value)
|
|
||||||
view:GetChild('text_title').text = title
|
|
||||||
view:GetChild('text_value').text = value
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue