跟新最新
parent
13a5868e84
commit
a23c13d366
|
|
@ -84,10 +84,11 @@ function M:InitView(url)
|
|||
for i = 1, #room.player_list do
|
||||
local p = room.player_list[i]
|
||||
local index = self:GetPos(p.seat)
|
||||
print("lingmeng index", index)
|
||||
local info = self._player_info[index]
|
||||
local tem = self._view:GetChild("player_card_info" .. index)
|
||||
_player_card_info[index] = self:NewMJPlayerCardInfoView(tem, index)
|
||||
local cardInfo = _player_card_info[index]
|
||||
cardInfo = self:NewMJPlayerCardInfoView(tem, index)
|
||||
cardInfo:SetPlayer(p)
|
||||
cardInfo:UpdateHandCardWitness(false)
|
||||
cardInfo:UpdateOutCardList(nil, nil, self._cursor)
|
||||
|
|
@ -166,14 +167,21 @@ function M:EventInit()
|
|||
|
||||
local _gcm_outcard_url = "ui://Main_Majiang/Gcm_OutCard"
|
||||
_gamectr:AddEventListener(TX_GameEvent.OutCard, function(...)
|
||||
print("lingmeng witness OutCard")
|
||||
self._left_time = 0
|
||||
local arg = { ... }
|
||||
local p = arg[1]
|
||||
local card = arg[2]
|
||||
local seat = p.seat
|
||||
local info = self._player_card_info[self:GetPos(seat)]
|
||||
print("lingmeng witness OutCard1", self:GetPos(seat), info)
|
||||
|
||||
self:RemoveCursor()
|
||||
print("lingmeng witness OutCard1-2")
|
||||
|
||||
info:UpdateHandCardWitness(false)
|
||||
print("lingmeng witness OutCard2")
|
||||
|
||||
info:UpdateOutCardList(nil, nil, self._cursor)
|
||||
print("ling 2zhihouq")
|
||||
self:PlaySound("LiChuan_MJ", p.self_user.sex, tostring(card))
|
||||
|
|
|
|||
|
|
@ -509,9 +509,9 @@ function M:NewMJPlayerCardInfoView(view, index)
|
|||
end
|
||||
|
||||
function M:RemoveCursor()
|
||||
if self._cursor.parent then
|
||||
self._cursor.parent:GetController("color").selectedIndex = 0
|
||||
end
|
||||
-- if self._cursor.parent then
|
||||
-- self._cursor.parent:GetController("color").selectedIndex = 0
|
||||
-- end
|
||||
self._cursor:RemoveFromParent()
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -135,11 +135,13 @@ function M:UpdateHandCard(getcard, mp)
|
|||
end
|
||||
|
||||
function M:UpdateHandCardWitness(getcard, isSelf)
|
||||
print("lingmeng UpdateHandCardWitness")
|
||||
getcard = getcard or false
|
||||
isSelf = isSelf or false
|
||||
|
||||
self._view_handCardList:RemoveChildren()
|
||||
self._view_getCard:RemoveChildren()
|
||||
print("lingmeng UpdateHandCardWitness1")
|
||||
|
||||
for i = 0, self._player.hand_left_count - 1 do
|
||||
local btn_card
|
||||
|
|
@ -152,8 +154,12 @@ function M:UpdateHandCardWitness(getcard, isSelf)
|
|||
self:FillWitnessCard(btn_card)
|
||||
end
|
||||
end
|
||||
print("lingmeng UpdateHandCardWitness2")
|
||||
|
||||
self._view_handCardList.touchable = false
|
||||
self._view_getCard.touchable = false
|
||||
print("lingmeng UpdateHandCardWitness3")
|
||||
|
||||
self._ctr_getCard.selectedIndex = getcard and 1 or 0
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue