取消重写selfcard中旧内容
parent
197ab53986
commit
1e614133bb
|
|
@ -15,21 +15,21 @@ function M.new(view, mainView)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:ShowHuTip(card_list)
|
-- function M:ShowHuTip(card_list)
|
||||||
printlog("ShowHuTip")
|
-- printlog("ShowHuTip")
|
||||||
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
|
-- local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
|
||||||
DataManager.CurrenRoom.room_config.Laizi)
|
-- DataManager.CurrenRoom.room_config.Laizi)
|
||||||
if #tingList > 0 then
|
-- if #tingList > 0 then
|
||||||
if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then
|
-- if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then
|
||||||
for i = 1, #DataManager.CurrenRoom.laiziInfo do
|
-- for i = 1, #DataManager.CurrenRoom.laiziInfo do
|
||||||
if IsHasDictionary(DataManager.CurrenRoom.laiziInfo[i], tingList) == false then
|
-- if IsHasDictionary(DataManager.CurrenRoom.laiziInfo[i], tingList) == false then
|
||||||
table.insert(tingList, DataManager.CurrenRoom.laiziInfo[i])
|
-- table.insert(tingList, DataManager.CurrenRoom.laiziInfo[i])
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
self._mainView._hu_tip:FillData(tingList)
|
-- self._mainView._hu_tip:FillData(tingList)
|
||||||
end
|
-- end
|
||||||
|
|
||||||
function M:UpdateHandCard(getcard, mp)
|
function M:UpdateHandCard(getcard, mp)
|
||||||
MJPlayerSelfCardInfoView.UpdateHandCard(self, getcard, mp)
|
MJPlayerSelfCardInfoView.UpdateHandCard(self, getcard, mp)
|
||||||
|
|
@ -108,103 +108,104 @@ function M:UpdateHandCard(getcard, mp)
|
||||||
-- end
|
-- end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:__OnClickHandCard(context)
|
-- function M:__OnClickHandCard(context)
|
||||||
local button = context.sender
|
-- local button = context.sender
|
||||||
local _carViewList = self._carViewList
|
-- local _carViewList = self._carViewList
|
||||||
local refresh = true
|
-- local refresh = true
|
||||||
local card_list = {}
|
-- local card_list = {}
|
||||||
for i = 1, #_carViewList do
|
-- for i = 1, #_carViewList do
|
||||||
local btn = _carViewList[i].card
|
-- local btn = _carViewList[i].card
|
||||||
local card = self:GetCard(btn)
|
-- local card = self:GetCard(btn)
|
||||||
if btn ~= button and btn.selected == true then
|
-- if btn ~= button and btn.selected == true then
|
||||||
if button.data.card_item == card then
|
-- if button.data.card_item == card then
|
||||||
refresh = false
|
-- refresh = false
|
||||||
else
|
-- else
|
||||||
self._mainView:markOutCards(false, card)
|
-- self._mainView:markOutCards(false, card)
|
||||||
end
|
-- end
|
||||||
btn.selected = false
|
-- btn.selected = false
|
||||||
end
|
-- end
|
||||||
if not btn.selected then
|
-- if not btn.selected then
|
||||||
table.insert(card_list, card)
|
-- table.insert(card_list, card)
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
|
|
||||||
if self._out_card then
|
-- if self._out_card then
|
||||||
-- self:ShowHuTip(card_list)
|
-- -- self:ShowHuTip(card_list)
|
||||||
end
|
-- end
|
||||||
|
|
||||||
-- 标记出牌
|
-- -- 标记出牌
|
||||||
if refresh then
|
-- if refresh then
|
||||||
if button.selected then
|
-- if button.selected then
|
||||||
self._mainView:markOutCards(true, button.data.card_item)
|
-- self._mainView:markOutCards(true, button.data.card_item)
|
||||||
else
|
-- else
|
||||||
self._mainView:markOutCards(false, button.data.card_item)
|
-- self._mainView:markOutCards(false, button.data.card_item)
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
|
|
||||||
local _room = DataManager.CurrenRoom
|
-- local _room = DataManager.CurrenRoom
|
||||||
if not button.selected and _room.curren_outcard_seat == _room.self_player.seat then
|
-- if not button.selected and _room.curren_outcard_seat == _room.self_player.seat then
|
||||||
local card = button.data
|
-- local card = button.data
|
||||||
self._mainView:OutCard(card.card_item)
|
-- self._mainView:OutCard(card.card_item)
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
|
|
||||||
function M:__OnDragStart(card)
|
-- function M:__OnDragStart(card)
|
||||||
local card_list = membe_clone(DataManager.CurrenRoom.self_player.card_list)
|
-- local card_list = membe_clone(DataManager.CurrenRoom.self_player.card_list)
|
||||||
list_remove(card_list, card)
|
-- list_remove(card_list, card)
|
||||||
-- self:ShowHuTip(card_list)
|
-- -- self:ShowHuTip(card_list)
|
||||||
end
|
-- end
|
||||||
|
|
||||||
function M:__OnDragEnd(context)
|
-- function M:__OnDragEnd(context)
|
||||||
if self.outcard_button then
|
-- if self.outcard_button then
|
||||||
self.outcard_button:Dispose()
|
-- self.outcard_button:Dispose()
|
||||||
self.outcard_button = nil
|
-- self.outcard_button = nil
|
||||||
end
|
-- end
|
||||||
local button = context.sender
|
-- local button = context.sender
|
||||||
|
|
||||||
--button:RemoveFromParent()
|
-- --button:RemoveFromParent()
|
||||||
local card = button.data
|
-- local card = button.data
|
||||||
local _room = DataManager.CurrenRoom
|
-- local _room = DataManager.CurrenRoom
|
||||||
|
|
||||||
-- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
|
-- -- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
|
||||||
if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then
|
-- if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then
|
||||||
self._mainView:OutCard(card.card_item)
|
-- self._mainView:OutCard(card.card_item)
|
||||||
button.touchable = false
|
-- button.touchable = false
|
||||||
self.outcard_button = button
|
-- self.outcard_button = button
|
||||||
else
|
-- else
|
||||||
self._area_handcard_list:AddChildAt(button, card.index)
|
-- self._area_handcard_list:AddChildAt(button, card.index)
|
||||||
button:TweenMove(card.old_postion, 0.2)
|
-- button:TweenMove(card.old_postion, 0.2)
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
|
|
||||||
function M:CheckPlayerOnlineState()
|
-- function M:CheckPlayerOnlineState()
|
||||||
local room = DataManager.CurrenRoom
|
-- local room = DataManager.CurrenRoom
|
||||||
for i = 1, #room.player_list do
|
-- for i = 1, #room.player_list do
|
||||||
if room.player_list[i].line_state == 0 then
|
-- if room.player_list[i].line_state == 0 then
|
||||||
return false
|
-- return false
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
return true
|
-- return true
|
||||||
end
|
-- end
|
||||||
|
|
||||||
function M:Clear(bskip)
|
function M:Clear(bskip)
|
||||||
|
MJPlayerSelfCardInfoView.Clear(self)
|
||||||
--self._ctr_state.selectedIndex = 0
|
--self._ctr_state.selectedIndex = 0
|
||||||
self._area_fz_list.x = self._src_fz_list.x
|
-- self._area_fz_list.x = self._src_fz_list.x
|
||||||
self._area_fz_list.y = self._src_fz_list.y
|
-- self._area_fz_list.y = self._src_fz_list.y
|
||||||
self._area_fz_list.width = self._src_fz_list.z
|
-- self._area_fz_list.width = self._src_fz_list.z
|
||||||
self._area_fz_list.height = self._src_fz_list.w
|
-- self._area_fz_list.height = self._src_fz_list.w
|
||||||
|
|
||||||
self._area_fz_list:RemoveChildren(0, -1, true)
|
-- self._area_fz_list:RemoveChildren(0, -1, true)
|
||||||
self._area_handcard_list:RemoveChildren(0, -1, true)
|
-- self._area_handcard_list:RemoveChildren(0, -1, true)
|
||||||
self._area_outcard_list:RemoveChildren(0, -1, true)
|
-- self._area_outcard_list:RemoveChildren(0, -1, true)
|
||||||
if bskip == nil or bskip == false then
|
-- if bskip == nil or bskip == false then
|
||||||
self._mask_liangpai:RemoveChildren(0, -1, true)
|
-- self._mask_liangpai:RemoveChildren(0, -1, true)
|
||||||
end
|
-- end
|
||||||
|
|
||||||
for i = 1, #self._carViewList do
|
-- for i = 1, #self._carViewList do
|
||||||
self._carViewList[i].card:Dispose()
|
-- self._carViewList[i].card:Dispose()
|
||||||
end
|
-- end
|
||||||
self._carViewList = {}
|
-- self._carViewList = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue