rank筛选修复
parent
e58d307197
commit
1d938cdbac
|
|
@ -241,7 +241,7 @@ function M:InitBoxType()
|
||||||
table.insert(values, tostring(games[i].game_id))
|
table.insert(values, tostring(games[i].game_id))
|
||||||
end
|
end
|
||||||
|
|
||||||
self._data_seletedType = 0
|
self._data_seletedType = "0"
|
||||||
return items, values
|
return items, values
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -314,13 +314,13 @@ local function init(self,cardInhand,addCard,isZhong,qidui,eightLaizi)
|
||||||
return self:checkQidui() or self:tryWin()
|
return self:checkQidui() or self:tryWin()
|
||||||
end
|
end
|
||||||
|
|
||||||
local specialCardList={400,403,406,409,412,415,418}
|
local specialCardList = { 401, 402, 403, 404, 405, 406, 407 }
|
||||||
function M.tingPai(cardInhand,isZhong,qidui,eightLaizi)
|
function M.tingPai(cardInhand, isZhong, qidui, eightLaizi)
|
||||||
--printlog("isZhong",isZhong)
|
-- printlog("isZhong", isZhong)
|
||||||
--printlog("qidui",qidui)
|
-- printlog("qidui", qidui)
|
||||||
--printlog("eightLaizi",eightLaizi)
|
-- printlog("eightLaizi", eightLaizi)
|
||||||
--pt(cardInhand)
|
-- pt(cardInhand)
|
||||||
local self = setmetatable({}, {__index = M})
|
local self = setmetatable({}, { __index = M })
|
||||||
local tingList = {}
|
local tingList = {}
|
||||||
if not cardInhand or #cardInhand == 0 then
|
if not cardInhand or #cardInhand == 0 then
|
||||||
return tingList
|
return tingList
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,6 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne
|
||||||
|
|
||||||
if result then
|
if result then
|
||||||
result.cardList = json.decode(result.cardList)
|
result.cardList = json.decode(result.cardList)
|
||||||
--排序
|
|
||||||
--table.sort(result.cardList)
|
--table.sort(result.cardList)
|
||||||
end
|
end
|
||||||
self.list_lastCard = self._view:GetChild('list_lastCard')
|
self.list_lastCard = self._view:GetChild('list_lastCard')
|
||||||
|
|
@ -97,13 +96,12 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne
|
||||||
if self._witnessCallbak then
|
if self._witnessCallbak then
|
||||||
self._witnessCallbak()
|
self._witnessCallbak()
|
||||||
end
|
end
|
||||||
--self:DestroyWithCallback()
|
self:DestroyWithCallback()
|
||||||
else
|
else
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
local _gamectr = ControllerManager.GetController(GameController)
|
||||||
_gamectr:PlayerReady()
|
_gamectr:PlayerReady()
|
||||||
--self:DestroyWithCallback()
|
self:DestroyWithCallback()
|
||||||
end
|
end
|
||||||
self:DestroyWithCallback()
|
|
||||||
end)
|
end)
|
||||||
elseif over == 1 then
|
elseif over == 1 then
|
||||||
mainCtr.selectedIndex = 1
|
mainCtr.selectedIndex = 1
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@ function M:InitView(url)
|
||||||
--]]
|
--]]
|
||||||
local config = ExtendManager.GetExtendConfig(room.game_id)
|
local config = ExtendManager.GetExtendConfig(room.game_id)
|
||||||
local mode = config:GetGameInfo()
|
local mode = config:GetGameInfo()
|
||||||
pt("lingmeng", room)
|
|
||||||
local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config),
|
local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config),
|
||||||
json.encode(room.room_config.config.hpData))
|
json.encode(room.room_config.config.hpData))
|
||||||
self._view:GetChild('wanfa_text').text = gamePlay
|
self._view:GetChild('wanfa_text').text = gamePlay
|
||||||
|
|
@ -233,6 +232,7 @@ function M:EventInit()
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.SendCards, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.SendCards, function(...)
|
||||||
-- self:ShowHuTip()
|
-- self:ShowHuTip()
|
||||||
|
--测试用记录出牌权次数
|
||||||
--self._viewText_testName.text = 0
|
--self._viewText_testName.text = 0
|
||||||
self:UpdateRound()
|
self:UpdateRound()
|
||||||
self._state.selectedIndex = 1
|
self._state.selectedIndex = 1
|
||||||
|
|
@ -251,7 +251,7 @@ function M:EventInit()
|
||||||
end)
|
end)
|
||||||
_gamectr:AddEventListener(TX_GameEvent.EventTurn, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.EventTurn, function(...)
|
||||||
local arg = { ... }
|
local arg = { ... }
|
||||||
self._left_time = 15
|
-- self._left_time = 15
|
||||||
local seat = arg[1]
|
local seat = arg[1]
|
||||||
self:UpdateCardBox(self:GetPos(seat))
|
self:UpdateCardBox(self:GetPos(seat))
|
||||||
-- if seat == self._room.self_player.seat then
|
-- if seat == self._room.self_player.seat then
|
||||||
|
|
@ -268,7 +268,6 @@ function M:EventInit()
|
||||||
local _gcm_outcard_url = "ui://Main_Majiang/Gcm_OutCard"
|
local _gcm_outcard_url = "ui://Main_Majiang/Gcm_OutCard"
|
||||||
_gamectr:AddEventListener(TX_GameEvent.OutCard, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.OutCard, function(...)
|
||||||
self:__CloseTip()
|
self:__CloseTip()
|
||||||
self._left_time = 0
|
|
||||||
local arg = { ... }
|
local arg = { ... }
|
||||||
local p = arg[1]
|
local p = arg[1]
|
||||||
local card = arg[2]
|
local card = arg[2]
|
||||||
|
|
@ -354,41 +353,38 @@ function M:EventInit()
|
||||||
end
|
end
|
||||||
if _room.curren_round ~= _room.room_config.round then
|
if _room.curren_round ~= _room.room_config.round then
|
||||||
-- if #niao == 0 then self._view:GetChild("n13").visible = false end
|
-- if #niao == 0 then self._view:GetChild("n13").visible = false end
|
||||||
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].total_score
|
if _room:checkHpNonnegative() then
|
||||||
end
|
p.cur_hp = data[i].total_score
|
||||||
-- info:UpdateScore()
|
end
|
||||||
info._view:GetChild("zhanji").visible = true
|
-- info:UpdateScore()
|
||||||
local num = data[i].total_score
|
info._view:GetChild("zhanji").visible = true
|
||||||
if num >= 0 then
|
local num = data[i].total_score
|
||||||
info._view:GetController("text_color").selectedIndex = 0
|
if num >= 0 then
|
||||||
info._view:GetChild("text_jifen").text = "+" .. num
|
info._view:GetController("text_color").selectedIndex = 0
|
||||||
else
|
info._view:GetChild("text_jifen").text = "+" .. num
|
||||||
info._view:GetController("text_color").selectedIndex = 1
|
else
|
||||||
info._view:GetChild("text_jifen").text = num
|
info._view:GetController("text_color").selectedIndex = 1
|
||||||
end
|
info._view:GetChild("text_jifen").text = 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
|
||||||
self._clearingView = nil
|
self._clearingView = nil
|
||||||
]]
|
|
||||||
--[[
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end
|
end
|
||||||
-- self._player_card_info[1]:ShowHuTip()]]
|
-- self._player_card_info[1]:ShowHuTip()]]
|
||||||
end)
|
end)
|
||||||
|
|
@ -486,6 +482,7 @@ function M:OutCard(card)
|
||||||
info:UpdateHandCard()
|
info:UpdateHandCard()
|
||||||
|
|
||||||
info:UpdateOutCardList(nil, card, self._cursor)
|
info:UpdateOutCardList(nil, card, self._cursor)
|
||||||
|
info._ctr_tip.selectedIndex = 0
|
||||||
self:PlaySound("FuZhou_MJ", self._room.self_player.self_user.sex, tostring(card))
|
self:PlaySound("FuZhou_MJ", self._room.self_player.self_user.sex, tostring(card))
|
||||||
self:PlayMJSound("chupai.mp3")
|
self:PlayMJSound("chupai.mp3")
|
||||||
-- self:ShowHuTip()
|
-- self:ShowHuTip()
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ end
|
||||||
function M:InitView(url)
|
function M:InitView(url)
|
||||||
local room = self._room
|
local room = self._room
|
||||||
UIPackage.AddPackage("extend/majiang/fuzhou/ui/Extend_MJ_FuZhou")
|
UIPackage.AddPackage("extend/majiang/fuzhou/ui/Extend_MJ_FuZhou")
|
||||||
MJPlayBackView.InitView(self, "ui://Main_Majiang/Main_" .. room.room_config.people_num)
|
MJPlayBackView.InitView(self, string.format("ui://Main_Majiang/Main_new_%d_jiangxi", room.room_config.people_num))
|
||||||
local _cardbox = self._view:GetChild("cardbox")
|
local _cardbox = self._view:GetChild("cardbox")
|
||||||
--self._view:GetChild("panel_record"):GetChild("btn_LastStep").enabled = false
|
--self._view:GetChild("panel_record"):GetChild("btn_LastStep").enabled = false
|
||||||
self._ctr_cardbox = _cardbox:GetController("c1")
|
self._ctr_cardbox = _cardbox:GetController("c1")
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,8 @@ function M:FillRoomData(s2croom)
|
||||||
room.room_config = EXRoomConfig.new(_config)
|
room.room_config = EXRoomConfig.new(_config)
|
||||||
local playerList = _tableInfo["playerData"]
|
local playerList = _tableInfo["playerData"]
|
||||||
room.curren_round = _tableInfo["round"]
|
room.curren_round = _tableInfo["round"]
|
||||||
|
room.witness_player_list = _tableInfo["playerSpectatorData"]
|
||||||
|
room._flag_updateWitness = true
|
||||||
self:FillPlayerData(playerList)
|
self:FillPlayerData(playerList)
|
||||||
|
|
||||||
if (reload) then
|
if (reload) then
|
||||||
|
|
|
||||||
|
|
@ -73,9 +73,9 @@ function M:SendOutCard(card, callback)
|
||||||
_room.curren_outcard_seat = -1
|
_room.curren_outcard_seat = -1
|
||||||
list_remove(p.card_list, card)
|
list_remove(p.card_list, card)
|
||||||
|
|
||||||
pt(p.card_list)
|
|
||||||
table.sort(p.card_list, self.HandCardSortAndJing)
|
table.sort(p.card_list, self.HandCardSortAndJing)
|
||||||
|
|
||||||
|
|
||||||
p.hand_left_count = p.hand_left_count - 1
|
p.hand_left_count = p.hand_left_count - 1
|
||||||
if not p.outcard_list then p.outcard_list = {} end
|
if not p.outcard_list then p.outcard_list = {} end
|
||||||
p.outcard_list[#p.outcard_list + 1] = card
|
p.outcard_list[#p.outcard_list + 1] = card
|
||||||
|
|
|
||||||
|
|
@ -141,8 +141,8 @@ function M:SelectedConfigData()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:LoadConfigData(data)
|
function M:LoadConfigData(data)
|
||||||
printlog("加载房间配置=========>>>")
|
--printlog("加载房间配置=========>>>")
|
||||||
pt(data)
|
--pt(data)
|
||||||
local _config = self._config
|
local _config = self._config
|
||||||
_config:GetController("round").selectedIndex = data.opt - 1
|
_config:GetController("round").selectedIndex = data.opt - 1
|
||||||
_config:GetController("peopleNum").selectedIndex = data.maxPlayers - 2
|
_config:GetController("peopleNum").selectedIndex = data.maxPlayers - 2
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,6 @@ function M:InitPlayerInfoView()
|
||||||
local tem = self._view:GetChild(string.format("player_info%d_%d", i, (self._state.selectedIndex % 2) + 1))
|
local tem = self._view:GetChild(string.format("player_info%d_%d", i, (self._state.selectedIndex % 2) + 1))
|
||||||
_player_info[i] = PlayerInfoView.new(tem, self)
|
_player_info[i] = PlayerInfoView.new(tem, self)
|
||||||
tem.visible = false
|
tem.visible = false
|
||||||
printlog("lingmeng _player_info init", tem, i)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -267,8 +266,6 @@ function M:EventInit()
|
||||||
local _gcm_outcard_url = "ui://Main_Majiang/Gcm_OutCard"
|
local _gcm_outcard_url = "ui://Main_Majiang/Gcm_OutCard"
|
||||||
_gamectr:AddEventListener(TX_GameEvent.OutCard, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.OutCard, function(...)
|
||||||
self:__CloseTip()
|
self:__CloseTip()
|
||||||
|
|
||||||
|
|
||||||
local arg = { ... }
|
local arg = { ... }
|
||||||
local p = arg[1]
|
local p = arg[1]
|
||||||
local card = arg[2]
|
local card = arg[2]
|
||||||
|
|
@ -293,12 +290,10 @@ function M:EventInit()
|
||||||
self._tex_LeftCard.text = string.format("余%d张", arg[3])
|
self._tex_LeftCard.text = string.format("余%d张", arg[3])
|
||||||
-- self:UpdateRoomInfo()
|
-- self:UpdateRoomInfo()
|
||||||
local info = self._player_card_info[self:GetPos(seat)]
|
local info = self._player_card_info[self:GetPos(seat)]
|
||||||
print("lingmeng log GetCard", self:GetPos(seat))
|
|
||||||
info:UpdateHandCard(true)
|
info:UpdateHandCard(true)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.FZTips, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.FZTips, function(...)
|
||||||
print("========================OnEventFzTips1")
|
|
||||||
local arg = { ... }
|
local arg = { ... }
|
||||||
local _tip = arg[1]
|
local _tip = arg[1]
|
||||||
local weight = arg[2]
|
local weight = arg[2]
|
||||||
|
|
@ -450,7 +445,6 @@ function M:EventInit()
|
||||||
self._popEvent = true
|
self._popEvent = true
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
if _room.curren_round ~= _room.room_config.round then
|
if _room.curren_round ~= _room.room_config.round then
|
||||||
-- if #niao == 0 then self._view:GetChild("n13").visible = false end
|
-- if #niao == 0 then self._view:GetChild("n13").visible = false end
|
||||||
self._clearingView:InitData(0, _room, result, nil, function(...)
|
self._clearingView:InitData(0, _room, result, nil, function(...)
|
||||||
|
|
@ -493,7 +487,6 @@ function M:EventInit()
|
||||||
self:PlayMJSound("end_music.mp3")
|
self:PlayMJSound("end_music.mp3")
|
||||||
self:UnmarkSelfTuoguan()
|
self:UnmarkSelfTuoguan()
|
||||||
self._left_time = 0
|
self._left_time = 0
|
||||||
|
|
||||||
self:UpdateCardBox(0)
|
self:UpdateCardBox(0)
|
||||||
self._ctr_cardbox.selectedIndex = 0
|
self._ctr_cardbox.selectedIndex = 0
|
||||||
local arg = { ... }
|
local arg = { ... }
|
||||||
|
|
@ -577,7 +570,6 @@ function M:OutCard(card)
|
||||||
printlog("当前出牌为===>>>" .. card)
|
printlog("当前出牌为===>>>" .. card)
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
local _gamectr = ControllerManager.GetController(GameController)
|
||||||
self._room.curren_outcard_seat = -1
|
self._room.curren_outcard_seat = -1
|
||||||
-- _gamectr:SendAction(0)
|
|
||||||
_gamectr:SendOutCard(card, function()
|
_gamectr:SendOutCard(card, function()
|
||||||
local info = self._player_card_info[1]
|
local info = self._player_card_info[1]
|
||||||
self:RemoveCursor()
|
self:RemoveCursor()
|
||||||
|
|
@ -707,8 +699,6 @@ function M:__FangziTip(tip, weight)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
printlog("__FangziTip2")
|
|
||||||
|
|
||||||
_ctr_tips.selectedIndex = 1
|
_ctr_tips.selectedIndex = 1
|
||||||
_lit_fanzi.numItems = tip.tip_num + 1
|
_lit_fanzi.numItems = tip.tip_num + 1
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -120,10 +120,7 @@ function M:FillRoomData(s2croom)
|
||||||
fz.from_seat = op["from_seat"]
|
fz.from_seat = op["from_seat"]
|
||||||
p.fz_list[#p.fz_list + 1] = fz
|
p.fz_list[#p.fz_list + 1] = fz
|
||||||
end
|
end
|
||||||
print("=======================在此进入", playing)
|
|
||||||
|
|
||||||
if not playing and room.curren_round > 0 then
|
if not playing and room.curren_round > 0 then
|
||||||
print("=======================在此进入")
|
|
||||||
self.GetGameController():PlayerReady()
|
self.GetGameController():PlayerReady()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue