去掉对应协议
parent
ecc545625a
commit
1d27d4aaf7
|
|
@ -36,30 +36,9 @@ function M:init(name)
|
||||||
|
|
||||||
self._eventmap[TX_Protocol.GAME_EVT_GANGZI] = self.OnEventGangCards
|
self._eventmap[TX_Protocol.GAME_EVT_GANGZI] = self.OnEventGangCards
|
||||||
self._eventmap[TX_Protocol.GAME_EVT_BUGANG] = self.OnEventBuGang
|
self._eventmap[TX_Protocol.GAME_EVT_BUGANG] = self.OnEventBuGang
|
||||||
|
|
||||||
self._eventmap[TX_Protocol.GAME_EVT_RESIDUE_CARD] = self.OnEventResidueCard
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local __pre_delete_card = false
|
local __pre_delete_card = false
|
||||||
-- 发送出牌指令到服务器
|
|
||||||
|
|
||||||
|
|
||||||
-------------------------展示牌---------------------------
|
|
||||||
function M:SendNextCard(card)
|
|
||||||
local _data = {}
|
|
||||||
_data["card"] = tonumber(card)
|
|
||||||
local _client = ControllerManager.GameNetClinet
|
|
||||||
_client:send(TX_Protocol.GAME_NEXT_CARD, _data)
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:ReqResidueCard()
|
|
||||||
local _data = {}
|
|
||||||
_data["card"] = 0
|
|
||||||
local _client = ControllerManager.GameNetClinet
|
|
||||||
_client:send(TX_Protocol.GAME_RESIDUE_CARD, _data)
|
|
||||||
end
|
|
||||||
|
|
||||||
------------------------------------------------------------
|
|
||||||
|
|
||||||
function M:SendOutCard(data, callback)
|
function M:SendOutCard(data, callback)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
|
|
@ -104,15 +83,6 @@ function M:OnEventBuGang(evt_data)
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.EventBuGang, evt_data["info"], true)
|
DispatchEvent(self._dispatcher, TX_GameEvent.EventBuGang, evt_data["info"], true)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnEventResidueCard(evt_data)
|
|
||||||
printlog("OnEventResidueCard")
|
|
||||||
pt(evt_data)
|
|
||||||
if evt_data.seat ~= DataManager.CurrenRoom.self_player.seat then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.EventResidueCard, evt_data["residueCard"])
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 发送放子选择到服务器
|
-- 发送放子选择到服务器
|
||||||
function M:SendAction(id)
|
function M:SendAction(id)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
|
|
|
||||||
|
|
@ -66,35 +66,6 @@ function M:InitView(url)
|
||||||
self:UpdatePlayerInfoView()
|
self:UpdatePlayerInfoView()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.showNextCtr = self._view:GetController('showNext')
|
|
||||||
self.showNextList = self._view:GetChild('list_showNext')
|
|
||||||
self._view:GetChild('btn_showNext').onClick:Set(function()
|
|
||||||
if self._flag_getRemindCard then
|
|
||||||
self.showNextCtr.selectedIndex = 1
|
|
||||||
self.showNextList:SetVirtual()
|
|
||||||
self.showNextList.itemRenderer = function(index, obj)
|
|
||||||
local card = self.cardSet[index + 1]
|
|
||||||
self:FillShowCards(obj, card, self.cardMap[card])
|
|
||||||
obj.data = { card = card }
|
|
||||||
end
|
|
||||||
self.showNextList.numItems = #self.cardSet
|
|
||||||
else
|
|
||||||
self:reqResidueCard()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
self._view:GetChild('btn_closeShow').onClick:Set(function()
|
|
||||||
self.showNextCtr.selectedIndex = 0
|
|
||||||
self.showNextList.selectedIndex = -1
|
|
||||||
self._showNextName = nil
|
|
||||||
end)
|
|
||||||
self.showNextList.onClickItem:Set(function(context)
|
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
|
||||||
_gamectr:SendNextCard(context.data.data.card)
|
|
||||||
self.showNextCtr.selectedIndex = 0
|
|
||||||
self.showNextList.selectedIndex = -1
|
|
||||||
self._showNextName = nil
|
|
||||||
end)
|
|
||||||
|
|
||||||
--------
|
--------
|
||||||
self:PlayerChangeLineState()
|
self:PlayerChangeLineState()
|
||||||
|
|
||||||
|
|
@ -227,7 +198,6 @@ function M:EventInit()
|
||||||
--self._viewText_testName.text = 0
|
--self._viewText_testName.text = 0
|
||||||
self:UpdateRound()
|
self:UpdateRound()
|
||||||
self:RemoveCursor()
|
self:RemoveCursor()
|
||||||
self:reqResidueCard()
|
|
||||||
self._state.selectedIndex = 1
|
self._state.selectedIndex = 1
|
||||||
self:ShowJing()
|
self:ShowJing()
|
||||||
if self._niao_View then
|
if self._niao_View then
|
||||||
|
|
@ -292,7 +262,6 @@ function M:EventInit()
|
||||||
end)
|
end)
|
||||||
_gamectr:AddEventListener(TX_GameEvent.GetCard, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.GetCard, function(...)
|
||||||
self:__CloseTip()
|
self:__CloseTip()
|
||||||
self:reqResidueCard()
|
|
||||||
local arg = { ... }
|
local arg = { ... }
|
||||||
local seat = arg[1]
|
local seat = arg[1]
|
||||||
local card = arg[2]
|
local card = arg[2]
|
||||||
|
|
@ -579,24 +548,6 @@ function M:EventInit()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.EventResidueCard, function(...)
|
|
||||||
local arg = { ... }
|
|
||||||
local residueCard = arg[1]
|
|
||||||
self.cardMap = {}
|
|
||||||
self.cardSet = {}
|
|
||||||
for i = 1, #residueCard do
|
|
||||||
local cardNum = residueCard[i]
|
|
||||||
if not self.cardMap[cardNum] then
|
|
||||||
self.cardMap[cardNum] = 1
|
|
||||||
table.insert(self.cardSet, cardNum)
|
|
||||||
else
|
|
||||||
self.cardMap[cardNum] = self.cardMap[cardNum] + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
table.sort(self.cardSet)
|
|
||||||
self._flag_getRemindCard = true
|
|
||||||
end)
|
|
||||||
|
|
||||||
--替换mianview的事件
|
--替换mianview的事件
|
||||||
_gamectr:AddEventListener(
|
_gamectr:AddEventListener(
|
||||||
GameEvent.PlayerState,
|
GameEvent.PlayerState,
|
||||||
|
|
@ -917,7 +868,6 @@ function M:ReloadRoom(bskip)
|
||||||
self._room._reload_flag = true
|
self._room._reload_flag = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self:reqResidueCard()
|
|
||||||
self:ShowJing()
|
self:ShowJing()
|
||||||
for i = 1, #room.player_list do
|
for i = 1, #room.player_list do
|
||||||
local p = room.player_list[i]
|
local p = room.player_list[i]
|
||||||
|
|
@ -1001,14 +951,6 @@ function M:UpdateCardBox(seat)
|
||||||
self._ctr_cardbox.selectedIndex = index
|
self._ctr_cardbox.selectedIndex = index
|
||||||
end
|
end
|
||||||
|
|
||||||
-----------------------展示牌----------------------------
|
|
||||||
|
|
||||||
function M:reqResidueCard()
|
|
||||||
self._flag_getRemindCard = false
|
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
|
||||||
_gamectr:ReqResidueCard()
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:SendShowNext(ShowNextConfrimCtr)
|
function M:SendShowNext(ShowNextConfrimCtr)
|
||||||
if not self._showNextName then
|
if not self._showNextName then
|
||||||
ViewUtil.ErrorTip(nil, "请先选择一个麻将牌")
|
ViewUtil.ErrorTip(nil, "请先选择一个麻将牌")
|
||||||
|
|
|
||||||
|
|
@ -388,10 +388,6 @@ function M:EventInit()
|
||||||
print("lingmeng witness EvnetPiao")
|
print("lingmeng witness EvnetPiao")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.EventResidueCard, function(...)
|
|
||||||
print("lingmeng witness EventResidueCard")
|
|
||||||
end)
|
|
||||||
|
|
||||||
--替换mianview的事件
|
--替换mianview的事件
|
||||||
_gamectr:AddEventListener(
|
_gamectr:AddEventListener(
|
||||||
GameEvent.PlayerState,
|
GameEvent.PlayerState,
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,5 @@ local TX_GameEvent = {
|
||||||
SendGangZi = "SendGangZi",
|
SendGangZi = "SendGangZi",
|
||||||
EventBuGang = "EventBuGang",
|
EventBuGang = "EventBuGang",
|
||||||
|
|
||||||
---
|
|
||||||
EventResidueCard = "EventResidueCard"
|
|
||||||
}
|
}
|
||||||
return TX_GameEvent
|
return TX_GameEvent
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,6 @@ local Protocol = {
|
||||||
GAME_EVT_GANGZI = "837",
|
GAME_EVT_GANGZI = "837",
|
||||||
GAME_EVT_BUGANG = "838",
|
GAME_EVT_BUGANG = "838",
|
||||||
GAME_EVT_DOGANG = "839",
|
GAME_EVT_DOGANG = "839",
|
||||||
|
|
||||||
--送牌
|
|
||||||
GAME_NEXT_CARD = "888",
|
|
||||||
GAME_RESIDUE_CARD = "613",
|
|
||||||
GAME_EVT_RESIDUE_CARD = "889"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Protocol
|
return Protocol
|
||||||
|
|
|
||||||
|
|
@ -36,30 +36,9 @@ function M:init(name)
|
||||||
|
|
||||||
self._eventmap[TX_Protocol.GAME_EVT_GANGZI] = self.OnEventGangCards
|
self._eventmap[TX_Protocol.GAME_EVT_GANGZI] = self.OnEventGangCards
|
||||||
self._eventmap[TX_Protocol.GAME_EVT_BUGANG] = self.OnEventBuGang
|
self._eventmap[TX_Protocol.GAME_EVT_BUGANG] = self.OnEventBuGang
|
||||||
|
|
||||||
self._eventmap[TX_Protocol.GAME_EVT_RESIDUE_CARD] = self.OnEventResidueCard
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local __pre_delete_card = false
|
local __pre_delete_card = false
|
||||||
-- 发送出牌指令到服务器
|
|
||||||
|
|
||||||
|
|
||||||
-------------------------展示牌---------------------------
|
|
||||||
function M:SendNextCard(card)
|
|
||||||
local _data = {}
|
|
||||||
_data["card"] = tonumber(card)
|
|
||||||
local _client = ControllerManager.GameNetClinet
|
|
||||||
_client:send(TX_Protocol.GAME_NEXT_CARD, _data)
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:ReqResidueCard()
|
|
||||||
local _data = {}
|
|
||||||
_data["card"] = 0
|
|
||||||
local _client = ControllerManager.GameNetClinet
|
|
||||||
_client:send(TX_Protocol.GAME_RESIDUE_CARD, _data)
|
|
||||||
end
|
|
||||||
|
|
||||||
------------------------------------------------------------
|
|
||||||
|
|
||||||
function M:SendOutCard(data, callback)
|
function M:SendOutCard(data, callback)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
|
|
@ -105,15 +84,6 @@ function M:OnEventBuGang(evt_data)
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.EventBuGang, evt_data["info"], true)
|
DispatchEvent(self._dispatcher, TX_GameEvent.EventBuGang, evt_data["info"], true)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnEventResidueCard(evt_data)
|
|
||||||
printlog("OnEventResidueCard")
|
|
||||||
pt(evt_data)
|
|
||||||
if evt_data.seat ~= DataManager.CurrenRoom.self_player.seat then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.EventResidueCard, evt_data["residueCard"])
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 发送放子选择到服务器
|
-- 发送放子选择到服务器
|
||||||
function M:SendAction(id)
|
function M:SendAction(id)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
|
|
|
||||||
|
|
@ -63,35 +63,6 @@ function M:InitView(url)
|
||||||
self:UpdatePlayerInfoView()
|
self:UpdatePlayerInfoView()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.showNextCtr = self._view:GetController('showNext')
|
|
||||||
self.showNextList = self._view:GetChild('list_showNext')
|
|
||||||
self._view:GetChild('btn_showNext').onClick:Set(function()
|
|
||||||
if self._flag_getRemindCard then
|
|
||||||
self.showNextCtr.selectedIndex = 1
|
|
||||||
self.showNextList:SetVirtual()
|
|
||||||
self.showNextList.itemRenderer = function(index, obj)
|
|
||||||
local card = self.cardSet[index + 1]
|
|
||||||
self:FillShowCards(obj, card, self.cardMap[card])
|
|
||||||
obj.data = { card = card }
|
|
||||||
end
|
|
||||||
self.showNextList.numItems = #self.cardSet
|
|
||||||
else
|
|
||||||
self:reqResidueCard()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
self._view:GetChild('btn_closeShow').onClick:Set(function()
|
|
||||||
self.showNextCtr.selectedIndex = 0
|
|
||||||
self.showNextList.selectedIndex = -1
|
|
||||||
self._showNextName = nil
|
|
||||||
end)
|
|
||||||
self.showNextList.onClickItem:Set(function(context)
|
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
|
||||||
_gamectr:SendNextCard(context.data.data.card)
|
|
||||||
self.showNextCtr.selectedIndex = 0
|
|
||||||
self.showNextList.selectedIndex = -1
|
|
||||||
self._showNextName = nil
|
|
||||||
end)
|
|
||||||
|
|
||||||
|
|
||||||
--------
|
--------
|
||||||
self:PlayerChangeLineState()
|
self:PlayerChangeLineState()
|
||||||
|
|
@ -225,7 +196,6 @@ function M:EventInit()
|
||||||
--self._viewText_testName.text = 0
|
--self._viewText_testName.text = 0
|
||||||
self:UpdateRound()
|
self:UpdateRound()
|
||||||
self:RemoveCursor()
|
self:RemoveCursor()
|
||||||
self:reqResidueCard()
|
|
||||||
self._state.selectedIndex = 1
|
self._state.selectedIndex = 1
|
||||||
self:ShowJing()
|
self:ShowJing()
|
||||||
if self._niao_View then
|
if self._niao_View then
|
||||||
|
|
@ -290,7 +260,6 @@ function M:EventInit()
|
||||||
end)
|
end)
|
||||||
_gamectr:AddEventListener(TX_GameEvent.GetCard, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.GetCard, function(...)
|
||||||
self:__CloseTip()
|
self:__CloseTip()
|
||||||
self:reqResidueCard()
|
|
||||||
local arg = { ... }
|
local arg = { ... }
|
||||||
local seat = arg[1]
|
local seat = arg[1]
|
||||||
local card = arg[2]
|
local card = arg[2]
|
||||||
|
|
@ -579,24 +548,6 @@ function M:EventInit()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.EventResidueCard, function(...)
|
|
||||||
local arg = { ... }
|
|
||||||
local residueCard = arg[1]
|
|
||||||
self.cardMap = {}
|
|
||||||
self.cardSet = {}
|
|
||||||
for i = 1, #residueCard do
|
|
||||||
local cardNum = residueCard[i]
|
|
||||||
if not self.cardMap[cardNum] then
|
|
||||||
self.cardMap[cardNum] = 1
|
|
||||||
table.insert(self.cardSet, cardNum)
|
|
||||||
else
|
|
||||||
self.cardMap[cardNum] = self.cardMap[cardNum] + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
table.sort(self.cardSet)
|
|
||||||
self._flag_getRemindCard = true
|
|
||||||
end)
|
|
||||||
|
|
||||||
--替换mianview的事件
|
--替换mianview的事件
|
||||||
_gamectr:AddEventListener(
|
_gamectr:AddEventListener(
|
||||||
GameEvent.PlayerState,
|
GameEvent.PlayerState,
|
||||||
|
|
@ -918,7 +869,6 @@ function M:ReloadRoom(bskip)
|
||||||
self._room._reload_flag = true
|
self._room._reload_flag = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self:reqResidueCard()
|
|
||||||
self:ShowJing()
|
self:ShowJing()
|
||||||
for i = 1, #room.player_list do
|
for i = 1, #room.player_list do
|
||||||
local p = room.player_list[i]
|
local p = room.player_list[i]
|
||||||
|
|
@ -1002,14 +952,6 @@ function M:UpdateCardBox(seat)
|
||||||
self._ctr_cardbox.selectedIndex = index
|
self._ctr_cardbox.selectedIndex = index
|
||||||
end
|
end
|
||||||
|
|
||||||
-----------------------展示牌----------------------------
|
|
||||||
|
|
||||||
function M:reqResidueCard()
|
|
||||||
self._flag_getRemindCard = false
|
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
|
||||||
_gamectr:ReqResidueCard()
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:SendShowNext(ShowNextConfrimCtr)
|
function M:SendShowNext(ShowNextConfrimCtr)
|
||||||
if not self._showNextName then
|
if not self._showNextName then
|
||||||
ViewUtil.ErrorTip(nil, "请先选择一个麻将牌")
|
ViewUtil.ErrorTip(nil, "请先选择一个麻将牌")
|
||||||
|
|
|
||||||
|
|
@ -388,10 +388,6 @@ function M:EventInit()
|
||||||
print("lingmeng witness EvnetPiao")
|
print("lingmeng witness EvnetPiao")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.EventResidueCard, function(...)
|
|
||||||
print("lingmeng witness EventResidueCard")
|
|
||||||
end)
|
|
||||||
|
|
||||||
--替换mianview的事件
|
--替换mianview的事件
|
||||||
_gamectr:AddEventListener(
|
_gamectr:AddEventListener(
|
||||||
GameEvent.PlayerState,
|
GameEvent.PlayerState,
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,5 @@ local TX_GameEvent = {
|
||||||
SendGangZi = "SendGangZi",
|
SendGangZi = "SendGangZi",
|
||||||
EventBuGang = "EventBuGang",
|
EventBuGang = "EventBuGang",
|
||||||
|
|
||||||
---
|
|
||||||
EventResidueCard = "EventResidueCard"
|
|
||||||
}
|
}
|
||||||
return TX_GameEvent
|
return TX_GameEvent
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,6 @@ local Protocol = {
|
||||||
GAME_EVT_GANGZI = "837",
|
GAME_EVT_GANGZI = "837",
|
||||||
GAME_EVT_BUGANG = "838",
|
GAME_EVT_BUGANG = "838",
|
||||||
GAME_EVT_DOGANG = "839",
|
GAME_EVT_DOGANG = "839",
|
||||||
|
|
||||||
--送牌
|
|
||||||
GAME_NEXT_CARD = "888",
|
|
||||||
GAME_RESIDUE_CARD = "613",
|
|
||||||
GAME_EVT_RESIDUE_CARD = "889"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Protocol
|
return Protocol
|
||||||
|
|
|
||||||
|
|
@ -36,32 +36,11 @@ function M:init(name)
|
||||||
|
|
||||||
self._eventmap[TX_Protocol.GAME_EVT_GANGZI] = self.OnEventGangCards
|
self._eventmap[TX_Protocol.GAME_EVT_GANGZI] = self.OnEventGangCards
|
||||||
self._eventmap[TX_Protocol.GAME_EVT_BUGANG] = self.OnEventBuGang
|
self._eventmap[TX_Protocol.GAME_EVT_BUGANG] = self.OnEventBuGang
|
||||||
|
|
||||||
self._eventmap[TX_Protocol.GAME_EVT_RESIDUE_CARD] = self.OnEventResidueCard
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local __pre_delete_card = false
|
local __pre_delete_card = false
|
||||||
-- 发送出牌指令到服务器
|
|
||||||
|
|
||||||
|
|
||||||
-------------------------展示牌---------------------------
|
|
||||||
function M:SendNextCard(card)
|
|
||||||
local _data = {}
|
|
||||||
_data["card"] = tonumber(card)
|
|
||||||
local _client = ControllerManager.GameNetClinet
|
|
||||||
|
|
||||||
_client:send(TX_Protocol.GAME_NEXT_CARD, _data)
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:ReqResidueCard()
|
|
||||||
local _data = {}
|
|
||||||
_data["card"] = 0
|
|
||||||
local _client = ControllerManager.GameNetClinet
|
|
||||||
_client:send(TX_Protocol.GAME_RESIDUE_CARD, _data)
|
|
||||||
end
|
|
||||||
|
|
||||||
------------------------------------------------------------
|
|
||||||
|
|
||||||
function M:SendOutCard(data, callback)
|
function M:SendOutCard(data, callback)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data["card"] = data.card
|
_data["card"] = data.card
|
||||||
|
|
@ -106,15 +85,6 @@ function M:OnEventBuGang(evt_data)
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.EventBuGang, evt_data["info"], true)
|
DispatchEvent(self._dispatcher, TX_GameEvent.EventBuGang, evt_data["info"], true)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnEventResidueCard(evt_data)
|
|
||||||
printlog("OnEventResidueCard")
|
|
||||||
pt(evt_data)
|
|
||||||
if evt_data.seat ~= DataManager.CurrenRoom.self_player.seat then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.EventResidueCard, evt_data["residueCard"])
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 发送放子选择到服务器
|
-- 发送放子选择到服务器
|
||||||
function M:SendAction(id)
|
function M:SendAction(id)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
|
|
|
||||||
|
|
@ -64,35 +64,6 @@ function M:InitView(url)
|
||||||
self:UpdatePlayerInfoView()
|
self:UpdatePlayerInfoView()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.showNextCtr = self._view:GetController('showNext')
|
|
||||||
self.showNextList = self._view:GetChild('list_showNext')
|
|
||||||
self._view:GetChild('btn_showNext').onClick:Set(function()
|
|
||||||
if self._flag_getRemindCard then
|
|
||||||
self.showNextCtr.selectedIndex = 1
|
|
||||||
self.showNextList:SetVirtual()
|
|
||||||
self.showNextList.itemRenderer = function(index, obj)
|
|
||||||
local card = self.cardSet[index + 1]
|
|
||||||
self:FillShowCards(obj, card, self.cardMap[card])
|
|
||||||
obj.data = { card = card }
|
|
||||||
end
|
|
||||||
self.showNextList.numItems = #self.cardSet
|
|
||||||
else
|
|
||||||
self:reqResidueCard()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
self._view:GetChild('btn_closeShow').onClick:Set(function()
|
|
||||||
self.showNextCtr.selectedIndex = 0
|
|
||||||
self.showNextList.selectedIndex = -1
|
|
||||||
self._showNextName = nil
|
|
||||||
end)
|
|
||||||
self.showNextList.onClickItem:Set(function(context)
|
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
|
||||||
_gamectr:SendNextCard(context.data.data.card)
|
|
||||||
self.showNextCtr.selectedIndex = 0
|
|
||||||
self.showNextList.selectedIndex = -1
|
|
||||||
self._showNextName = nil
|
|
||||||
end)
|
|
||||||
|
|
||||||
--------
|
--------
|
||||||
self:PlayerChangeLineState()
|
self:PlayerChangeLineState()
|
||||||
|
|
||||||
|
|
@ -224,7 +195,6 @@ function M:EventInit()
|
||||||
--self._viewText_testName.text = 0
|
--self._viewText_testName.text = 0
|
||||||
self:UpdateRound()
|
self:UpdateRound()
|
||||||
self:RemoveCursor()
|
self:RemoveCursor()
|
||||||
self:reqResidueCard()
|
|
||||||
self._state.selectedIndex = 1
|
self._state.selectedIndex = 1
|
||||||
self:ShowJing()
|
self:ShowJing()
|
||||||
if self._niao_View then
|
if self._niao_View then
|
||||||
|
|
@ -291,7 +261,6 @@ function M:EventInit()
|
||||||
end)
|
end)
|
||||||
_gamectr:AddEventListener(TX_GameEvent.GetCard, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.GetCard, function(...)
|
||||||
self:__CloseTip()
|
self:__CloseTip()
|
||||||
self:reqResidueCard()
|
|
||||||
local arg = { ... }
|
local arg = { ... }
|
||||||
local seat = arg[1]
|
local seat = arg[1]
|
||||||
local card = arg[2]
|
local card = arg[2]
|
||||||
|
|
@ -577,36 +546,6 @@ function M:EventInit()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.EventResidueCard, function(...)
|
|
||||||
local arg = { ... }
|
|
||||||
local residueCard = arg[1]
|
|
||||||
self.cardMap = {}
|
|
||||||
self.cardSet = {}
|
|
||||||
for i = 1, #residueCard do
|
|
||||||
local cardNum = residueCard[i]
|
|
||||||
if not self.cardMap[cardNum] then
|
|
||||||
self.cardMap[cardNum] = 1
|
|
||||||
table.insert(self.cardSet, cardNum)
|
|
||||||
else
|
|
||||||
self.cardMap[cardNum] = self.cardMap[cardNum] + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
table.sort(self.cardSet)
|
|
||||||
self._flag_getRemindCard = true
|
|
||||||
end)
|
|
||||||
|
|
||||||
--替换mianview的事件
|
|
||||||
_gamectr:AddEventListener(
|
|
||||||
GameEvent.PlayerState,
|
|
||||||
function(...)
|
|
||||||
printlog("lingmeng OnEventOnlineState")
|
|
||||||
local arg = { ... }
|
|
||||||
local p = arg[1]
|
|
||||||
local info = self._player_info[self:GetPos(p.seat)]
|
|
||||||
info._ctr_offline.selectedIndex = p.line_state == 0 and 1 or 0
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OutCard(card)
|
function M:OutCard(card)
|
||||||
|
|
@ -917,7 +856,6 @@ function M:ReloadRoom(bskip)
|
||||||
self._room._reload_flag = true
|
self._room._reload_flag = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self:reqResidueCard()
|
|
||||||
self:ShowJing()
|
self:ShowJing()
|
||||||
for i = 1, #room.player_list do
|
for i = 1, #room.player_list do
|
||||||
local p = room.player_list[i]
|
local p = room.player_list[i]
|
||||||
|
|
@ -1001,14 +939,6 @@ function M:UpdateCardBox(seat)
|
||||||
self._ctr_cardbox.selectedIndex = index
|
self._ctr_cardbox.selectedIndex = index
|
||||||
end
|
end
|
||||||
|
|
||||||
-----------------------展示牌----------------------------
|
|
||||||
|
|
||||||
function M:reqResidueCard()
|
|
||||||
self._flag_getRemindCard = false
|
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
|
||||||
_gamectr:ReqResidueCard()
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:SendShowNext(ShowNextConfrimCtr)
|
function M:SendShowNext(ShowNextConfrimCtr)
|
||||||
if not self._showNextName then
|
if not self._showNextName then
|
||||||
ViewUtil.ErrorTip(nil, "请先选择一个麻将牌")
|
ViewUtil.ErrorTip(nil, "请先选择一个麻将牌")
|
||||||
|
|
|
||||||
|
|
@ -392,9 +392,6 @@ function M:EventInit()
|
||||||
print("lingmeng witness EvnetPiao")
|
print("lingmeng witness EvnetPiao")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.EventResidueCard, function(...)
|
|
||||||
print("lingmeng witness EventResidueCard")
|
|
||||||
end)
|
|
||||||
|
|
||||||
--替换mianview的事件
|
--替换mianview的事件
|
||||||
_gamectr:AddEventListener(
|
_gamectr:AddEventListener(
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,5 @@ local TX_GameEvent = {
|
||||||
SendGangZi = "SendGangZi",
|
SendGangZi = "SendGangZi",
|
||||||
EventBuGang = "EventBuGang",
|
EventBuGang = "EventBuGang",
|
||||||
|
|
||||||
---
|
|
||||||
EventResidueCard = "EventResidueCard"
|
|
||||||
}
|
}
|
||||||
return TX_GameEvent
|
return TX_GameEvent
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,6 @@ local Protocol = {
|
||||||
GAME_EVT_GANGZI = "837",
|
GAME_EVT_GANGZI = "837",
|
||||||
GAME_EVT_BUGANG = "838",
|
GAME_EVT_BUGANG = "838",
|
||||||
GAME_EVT_DOGANG = "839",
|
GAME_EVT_DOGANG = "839",
|
||||||
|
|
||||||
--送牌
|
|
||||||
GAME_NEXT_CARD = "888",
|
|
||||||
GAME_RESIDUE_CARD = "613",
|
|
||||||
GAME_EVT_RESIDUE_CARD = "889"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Protocol
|
return Protocol
|
||||||
|
|
|
||||||
|
|
@ -36,30 +36,9 @@ function M:init(name)
|
||||||
|
|
||||||
self._eventmap[TX_Protocol.GAME_EVT_GANGZI] = self.OnEventGangCards
|
self._eventmap[TX_Protocol.GAME_EVT_GANGZI] = self.OnEventGangCards
|
||||||
self._eventmap[TX_Protocol.GAME_EVT_BUGANG] = self.OnEventBuGang
|
self._eventmap[TX_Protocol.GAME_EVT_BUGANG] = self.OnEventBuGang
|
||||||
|
|
||||||
self._eventmap[TX_Protocol.GAME_EVT_RESIDUE_CARD] = self.OnEventResidueCard
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local __pre_delete_card = false
|
local __pre_delete_card = false
|
||||||
-- 发送出牌指令到服务器
|
|
||||||
|
|
||||||
|
|
||||||
-------------------------展示牌---------------------------
|
|
||||||
function M:SendNextCard(card)
|
|
||||||
local _data = {}
|
|
||||||
_data["card"] = tonumber(card)
|
|
||||||
local _client = ControllerManager.GameNetClinet
|
|
||||||
_client:send(TX_Protocol.GAME_NEXT_CARD, _data)
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:ReqResidueCard()
|
|
||||||
local _data = {}
|
|
||||||
_data["card"] = 0
|
|
||||||
local _client = ControllerManager.GameNetClinet
|
|
||||||
_client:send(TX_Protocol.GAME_RESIDUE_CARD, _data)
|
|
||||||
end
|
|
||||||
|
|
||||||
------------------------------------------------------------
|
|
||||||
|
|
||||||
function M:SendOutCard(data, callback)
|
function M:SendOutCard(data, callback)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
|
|
@ -105,15 +84,6 @@ function M:OnEventBuGang(evt_data)
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.EventBuGang, evt_data["info"], true)
|
DispatchEvent(self._dispatcher, TX_GameEvent.EventBuGang, evt_data["info"], true)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnEventResidueCard(evt_data)
|
|
||||||
printlog("OnEventResidueCard")
|
|
||||||
pt(evt_data)
|
|
||||||
if evt_data.seat ~= DataManager.CurrenRoom.self_player.seat then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.EventResidueCard, evt_data["residueCard"])
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 发送放子选择到服务器
|
-- 发送放子选择到服务器
|
||||||
function M:SendAction(id)
|
function M:SendAction(id)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
|
|
|
||||||
|
|
@ -62,35 +62,6 @@ function M:InitView(url)
|
||||||
self:UpdatePlayerInfoView()
|
self:UpdatePlayerInfoView()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.showNextCtr = self._view:GetController('showNext')
|
|
||||||
self.showNextList = self._view:GetChild('list_showNext')
|
|
||||||
self._view:GetChild('btn_showNext').onClick:Set(function()
|
|
||||||
if self._flag_getRemindCard then
|
|
||||||
self.showNextCtr.selectedIndex = 1
|
|
||||||
self.showNextList:SetVirtual()
|
|
||||||
self.showNextList.itemRenderer = function(index, obj)
|
|
||||||
local card = self.cardSet[index + 1]
|
|
||||||
self:FillShowCards(obj, card, self.cardMap[card])
|
|
||||||
obj.data = { card = card }
|
|
||||||
end
|
|
||||||
self.showNextList.numItems = #self.cardSet
|
|
||||||
else
|
|
||||||
self:reqResidueCard()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
self._view:GetChild('btn_closeShow').onClick:Set(function()
|
|
||||||
self.showNextCtr.selectedIndex = 0
|
|
||||||
self.showNextList.selectedIndex = -1
|
|
||||||
self._showNextName = nil
|
|
||||||
end)
|
|
||||||
self.showNextList.onClickItem:Set(function(context)
|
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
|
||||||
_gamectr:SendNextCard(context.data.data.card)
|
|
||||||
self.showNextCtr.selectedIndex = 0
|
|
||||||
self.showNextList.selectedIndex = -1
|
|
||||||
self._showNextName = nil
|
|
||||||
end)
|
|
||||||
|
|
||||||
--------
|
--------
|
||||||
self:PlayerChangeLineState()
|
self:PlayerChangeLineState()
|
||||||
|
|
||||||
|
|
@ -223,7 +194,6 @@ function M:EventInit()
|
||||||
--self._viewText_testName.text = 0
|
--self._viewText_testName.text = 0
|
||||||
self:UpdateRound()
|
self:UpdateRound()
|
||||||
self:RemoveCursor()
|
self:RemoveCursor()
|
||||||
self:reqResidueCard()
|
|
||||||
self._state.selectedIndex = 1
|
self._state.selectedIndex = 1
|
||||||
self:ShowJing()
|
self:ShowJing()
|
||||||
if self._niao_View then
|
if self._niao_View then
|
||||||
|
|
@ -288,7 +258,6 @@ function M:EventInit()
|
||||||
end)
|
end)
|
||||||
_gamectr:AddEventListener(TX_GameEvent.GetCard, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.GetCard, function(...)
|
||||||
self:__CloseTip()
|
self:__CloseTip()
|
||||||
self:reqResidueCard()
|
|
||||||
local arg = { ... }
|
local arg = { ... }
|
||||||
local seat = arg[1]
|
local seat = arg[1]
|
||||||
local card = arg[2]
|
local card = arg[2]
|
||||||
|
|
@ -579,24 +548,6 @@ function M:EventInit()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.EventResidueCard, function(...)
|
|
||||||
local arg = { ... }
|
|
||||||
local residueCard = arg[1]
|
|
||||||
self.cardMap = {}
|
|
||||||
self.cardSet = {}
|
|
||||||
for i = 1, #residueCard do
|
|
||||||
local cardNum = residueCard[i]
|
|
||||||
if not self.cardMap[cardNum] then
|
|
||||||
self.cardMap[cardNum] = 1
|
|
||||||
table.insert(self.cardSet, cardNum)
|
|
||||||
else
|
|
||||||
self.cardMap[cardNum] = self.cardMap[cardNum] + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
table.sort(self.cardSet)
|
|
||||||
self._flag_getRemindCard = true
|
|
||||||
end)
|
|
||||||
|
|
||||||
--替换mianview的事件
|
--替换mianview的事件
|
||||||
_gamectr:AddEventListener(
|
_gamectr:AddEventListener(
|
||||||
GameEvent.PlayerState,
|
GameEvent.PlayerState,
|
||||||
|
|
@ -918,7 +869,6 @@ function M:ReloadRoom(bskip)
|
||||||
self._room._reload_flag = true
|
self._room._reload_flag = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self:reqResidueCard()
|
|
||||||
self:ShowJing()
|
self:ShowJing()
|
||||||
for i = 1, #room.player_list do
|
for i = 1, #room.player_list do
|
||||||
local p = room.player_list[i]
|
local p = room.player_list[i]
|
||||||
|
|
@ -1002,14 +952,6 @@ function M:UpdateCardBox(seat)
|
||||||
self._ctr_cardbox.selectedIndex = index
|
self._ctr_cardbox.selectedIndex = index
|
||||||
end
|
end
|
||||||
|
|
||||||
-----------------------展示牌----------------------------
|
|
||||||
|
|
||||||
function M:reqResidueCard()
|
|
||||||
self._flag_getRemindCard = false
|
|
||||||
local _gamectr = ControllerManager.GetController(GameController)
|
|
||||||
_gamectr:ReqResidueCard()
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:SendShowNext(ShowNextConfrimCtr)
|
function M:SendShowNext(ShowNextConfrimCtr)
|
||||||
if not self._showNextName then
|
if not self._showNextName then
|
||||||
ViewUtil.ErrorTip(nil, "请先选择一个麻将牌")
|
ViewUtil.ErrorTip(nil, "请先选择一个麻将牌")
|
||||||
|
|
|
||||||
|
|
@ -388,10 +388,6 @@ function M:EventInit()
|
||||||
print("lingmeng witness EvnetPiao")
|
print("lingmeng witness EvnetPiao")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.EventResidueCard, function(...)
|
|
||||||
print("lingmeng witness EventResidueCard")
|
|
||||||
end)
|
|
||||||
|
|
||||||
--替换mianview的事件
|
--替换mianview的事件
|
||||||
_gamectr:AddEventListener(
|
_gamectr:AddEventListener(
|
||||||
GameEvent.PlayerState,
|
GameEvent.PlayerState,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
|
|
||||||
local TX_GameEvent = {
|
local TX_GameEvent = {
|
||||||
-- 发牌
|
-- 发牌
|
||||||
SendCards = "SendCards",
|
SendCards = "SendCards",
|
||||||
|
|
||||||
EventTurn = "EventTurn",
|
EventTurn = "EventTurn",
|
||||||
|
|
@ -22,18 +21,16 @@ local TX_GameEvent = {
|
||||||
ZPResult2 = "ZPResult2",
|
ZPResult2 = "ZPResult2",
|
||||||
|
|
||||||
EventNiao = "EventNiao",
|
EventNiao = "EventNiao",
|
||||||
|
|
||||||
EvnetPiaoTip = "EvnetPiaoTip",
|
EvnetPiaoTip = "EvnetPiaoTip",
|
||||||
|
|
||||||
EvnetPiao = "EvnetPiao",
|
EvnetPiao = "EvnetPiao",
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
SendLaiZi="SendLaiZi",
|
SendLaiZi = "SendLaiZi",
|
||||||
SendGangZi = "SendGangZi",
|
SendGangZi = "SendGangZi",
|
||||||
EventBuGang = "EventBuGang",
|
EventBuGang = "EventBuGang",
|
||||||
|
|
||||||
---
|
|
||||||
EventResidueCard = "EventResidueCard"
|
|
||||||
}
|
}
|
||||||
return TX_GameEvent
|
return TX_GameEvent
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
local Protocol = {
|
local Protocol = {
|
||||||
-- 发牌协议
|
-- 发牌协议
|
||||||
GAME_EVT_PLAYER_DEAL = "811",
|
GAME_EVT_PLAYER_DEAL = "811",
|
||||||
|
|
||||||
-- 出牌
|
-- 出牌
|
||||||
GAME_DIS_CARD = "611",
|
GAME_DIS_CARD = "611",
|
||||||
|
|
||||||
|
|
@ -28,16 +28,16 @@ local Protocol = {
|
||||||
|
|
||||||
-- 大结算
|
-- 大结算
|
||||||
GAME_EVT_RESULT2 = "818",
|
GAME_EVT_RESULT2 = "818",
|
||||||
|
|
||||||
-- 抓牌
|
-- 抓牌
|
||||||
GAME_EVT_DRAW = "819",
|
GAME_EVT_DRAW = "819",
|
||||||
|
|
||||||
-- 转盘指向事件
|
-- 转盘指向事件
|
||||||
GAME_EVT_CHANGE_ACTIVE_PLAYER = "820",
|
GAME_EVT_CHANGE_ACTIVE_PLAYER = "820",
|
||||||
|
|
||||||
-- 抓鸟事件
|
-- 抓鸟事件
|
||||||
GAME_EVT_NIAO = "821",
|
GAME_EVT_NIAO = "821",
|
||||||
|
|
||||||
-- 飘鸟提示
|
-- 飘鸟提示
|
||||||
GAME_EVT_PIAOTIP = "833",
|
GAME_EVT_PIAOTIP = "833",
|
||||||
|
|
||||||
|
|
@ -47,11 +47,6 @@ local Protocol = {
|
||||||
GAME_EVT_GANGZI = "837",
|
GAME_EVT_GANGZI = "837",
|
||||||
GAME_EVT_BUGANG = "838",
|
GAME_EVT_BUGANG = "838",
|
||||||
GAME_EVT_DOGANG = "839",
|
GAME_EVT_DOGANG = "839",
|
||||||
|
|
||||||
--送牌
|
|
||||||
GAME_NEXT_CARD = "888",
|
|
||||||
GAME_RESIDUE_CARD = "613",
|
|
||||||
GAME_EVT_RESIDUE_CARD = "889"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Protocol
|
return Protocol
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,6 @@ function M:RegisterEvt()
|
||||||
|
|
||||||
self._eventmap[RunFast_Protocol.GAME_EVT_CARDINHAND] = self.OnPlaySuccCheckHandCard
|
self._eventmap[RunFast_Protocol.GAME_EVT_CARDINHAND] = self.OnPlaySuccCheckHandCard
|
||||||
self._eventmap[RunFast_Protocol.RunFast_Bomb_Score_New] = self.OnBompScoreNew
|
self._eventmap[RunFast_Protocol.RunFast_Bomb_Score_New] = self.OnBompScoreNew
|
||||||
self._eventmap[RunFast_Protocol.RunFast_CheckCard_Succ] = self.OnCheckCard
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- function M:Oener(evt_data)
|
-- function M:Oener(evt_data)
|
||||||
|
|
@ -134,19 +133,6 @@ function M:SendCard(cards, currentCard)
|
||||||
_client:send(RunFast_Protocol.RunFast_Send_Card, _data)
|
_client:send(RunFast_Protocol.RunFast_Send_Card, _data)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:SendCheckCard()
|
|
||||||
local _data = {}
|
|
||||||
local _client = ControllerManager.GameNetClinet
|
|
||||||
_client:send(RunFast_Protocol.RunFast_CheckCard, _data)
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:SendCheckCardSend(data)
|
|
||||||
local _data = {}
|
|
||||||
_data = data
|
|
||||||
local _client = ControllerManager.GameNetClinet
|
|
||||||
_client:send(RunFast_Protocol.RunFast_CheckCard_Send, _data)
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:SendPiao(piao)
|
function M:SendPiao(piao)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data["id"] = piao
|
_data["id"] = piao
|
||||||
|
|
@ -739,12 +725,4 @@ function M:OnBompScoreNew(evt_data)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:OnCheckCard(evt_data)
|
|
||||||
self._cacheEvent:Enqueue(
|
|
||||||
function()
|
|
||||||
DispatchEvent(self._dispatcher, RunFast_GameEvent.OnCheckCard, evt_data)
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,5 @@ local RunFast_GameEvent = {
|
||||||
EventXiPai = "EventXiPai",
|
EventXiPai = "EventXiPai",
|
||||||
OnPassSuccCheckCard = "OnPassSuccCheckCard",
|
OnPassSuccCheckCard = "OnPassSuccCheckCard",
|
||||||
OnBompScoreNew = "OnBompScoreNew",
|
OnBompScoreNew = "OnBompScoreNew",
|
||||||
OnCheckCard = "OnCheckCard"
|
|
||||||
}
|
}
|
||||||
return RunFast_GameEvent
|
return RunFast_GameEvent
|
||||||
|
|
|
||||||
|
|
@ -113,13 +113,6 @@ function M:InitView(url)
|
||||||
self._view:GetChild("roominfo_panel1"):GetChild("tex_beishu").text = ""
|
self._view:GetChild("roominfo_panel1"):GetChild("tex_beishu").text = ""
|
||||||
end
|
end
|
||||||
|
|
||||||
self._view_click = self._view:GetChild('click')
|
|
||||||
if self._view_click then
|
|
||||||
self._view_click.onClick:Set(function()
|
|
||||||
self._gamectr:SendCheckCard()
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
self.ctr_state = self._view:GetController("state")
|
self.ctr_state = self._view:GetController("state")
|
||||||
self._ctr_action = self._view:GetController("action")
|
self._ctr_action = self._view:GetController("action")
|
||||||
-- self._tex_leftTime = self._view:GetChild("time"):GetChild("title")
|
-- self._tex_leftTime = self._view:GetChild("time"):GetChild("title")
|
||||||
|
|
@ -714,45 +707,6 @@ function M:EventInit()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
_gamectr:AddEventListener(RunFast_GameEvent.OnCheckCard, function(...)
|
|
||||||
local arg = { ... }
|
|
||||||
local evt_data = arg[1]
|
|
||||||
local list = self._view:GetChild('comp_checkCard'):GetChild('list')
|
|
||||||
list:RemoveChildrenToPool()
|
|
||||||
for k, v in pairs(evt_data) do
|
|
||||||
local obj = list:AddItemFromPool()
|
|
||||||
table.sort(v, function(a, b)
|
|
||||||
if a % 100 == b % 100 then
|
|
||||||
return math.floor(a / 100) > math.floor(b / 100)
|
|
||||||
else
|
|
||||||
return a % 100 > b % 100
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
local titleText = ""
|
|
||||||
if k == "first" then
|
|
||||||
titleText = "手牌1:"
|
|
||||||
elseif k == "second" then
|
|
||||||
titleText = "手牌2:"
|
|
||||||
elseif k == "three" then
|
|
||||||
titleText = "手牌3:"
|
|
||||||
end
|
|
||||||
obj.text = titleText
|
|
||||||
obj:GetChild('click').onClick:Set(function()
|
|
||||||
evt_data.choic = k
|
|
||||||
self._gamectr:SendCheckCardSend(evt_data)
|
|
||||||
self._view:GetController('check').selectedIndex = 0
|
|
||||||
end)
|
|
||||||
obj:GetChild('List_Out').itemRenderer = function(index, obj)
|
|
||||||
local code = v[index + 1]
|
|
||||||
if code % 100 == 15 then
|
|
||||||
code = math.floor(code / 100) * 100 + 2
|
|
||||||
end
|
|
||||||
obj:GetChild('icon').url = string.format("ui://Main_Poker/%s", code)
|
|
||||||
end
|
|
||||||
obj:GetChild('List_Out').numItems = #v
|
|
||||||
end
|
|
||||||
self._view:GetController('check').selectedIndex = 1
|
|
||||||
end)
|
|
||||||
|
|
||||||
_gamectr:AddEventListener(RunFast_GameEvent.OnPassSuccCheckCard, function(...)
|
_gamectr:AddEventListener(RunFast_GameEvent.OnPassSuccCheckCard, function(...)
|
||||||
self._popEvent = false
|
self._popEvent = false
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,6 @@ local RunFast_Protocol = {
|
||||||
GAME_EVENT_XIPAI = "20837",
|
GAME_EVENT_XIPAI = "20837",
|
||||||
GAME_EVENT_NOTIFY_XIPAI = "20838",
|
GAME_EVENT_NOTIFY_XIPAI = "20838",
|
||||||
GAME_EVT_CARDINHAND = "202022",
|
GAME_EVT_CARDINHAND = "202022",
|
||||||
|
|
||||||
RunFast_CheckCard = "8881",
|
|
||||||
RunFast_CheckCard_Succ = "8882",
|
|
||||||
RunFast_CheckCard_Send = "888"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return RunFast_Protocol
|
return RunFast_Protocol
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,5 @@ local TX_GameEvent = {
|
||||||
SendGangZi = "SendGangZi",
|
SendGangZi = "SendGangZi",
|
||||||
EventBuGang = "EventBuGang",
|
EventBuGang = "EventBuGang",
|
||||||
|
|
||||||
---
|
|
||||||
EventResidueCard = "EventResidueCard"
|
|
||||||
}
|
}
|
||||||
return TX_GameEvent
|
return TX_GameEvent
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue