diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index 12548820..39a128c1 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -341,8 +341,11 @@ function M:UpdateFamilyRoom(fgCtr, id) list_room:SetVirtual() local list_gamePlay = self._view:GetChild('list_gamePlay') list_gamePlay:SetVirtual() - local playList = DataManager.groups:get(id).playList - local roomList = DataManager.groups:get(id).rooms + local playList = self._group.playList + local roomList = self._group.rooms + print("=========================playList,rooms") + pt(playList) + pt(roomList) list_room.itemRenderer = function(index, obj) if index < #roomList then -- local config = ExtendManager.GetExtendConfig(roomList[index + 1].pid) @@ -351,13 +354,13 @@ function M:UpdateFamilyRoom(fgCtr, id) -- obj:GetChild('Label_gameRule').title = gamePlay obj:GetChild('game_type').text = string.format("房间-%s", roomList[index + 1].id) obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = 1 - obj:GetChild('btn_joinGame').onClick:Add(function() + obj:GetChild('btn_joinGame').onClick:Set(function() ViewUtil.ShowModalWait(self._root_view, "匹配房间中", 'join_room') local roomCtr = ControllerManager.GetController(RoomController) roomCtr:PublicJoinRoom( - Protocol.WEB_FG_MATCH_ROOM, + Protocol.WEB_FG_JOIN_ROOM, roomList[index + 1].id, - true, + false, function(response) ViewUtil.CloseModalWait('join_room') if (response.ReturnCode == -1) then @@ -374,7 +377,7 @@ function M:UpdateFamilyRoom(fgCtr, id) end end, id, - playList[index + 1].id + roomList[index + 1].pid ) end) else @@ -384,7 +387,7 @@ function M:UpdateFamilyRoom(fgCtr, id) -- obj:GetChild('Label_gameRule').title = gamePlay obj:GetChild('game_type').text = playList[index - #roomList + 1].name obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = 0 - obj:GetChild('btn_joinGame').onClick:Add(function() + obj:GetChild('btn_joinGame').onClick:Set(function() ViewUtil.ShowModalWait(self._root_view, "匹配房间中", 'join_room') local roomCtr = ControllerManager.GetController(RoomController) fgCtr:FG_ChangeFag(id, DataManager.SelfUser.acc, 777777, function() @@ -436,6 +439,7 @@ function M:UpdateFamilyRoom(fgCtr, id) end) end) end + print("=======================why", list_room.numItems, #playList, #roomList) list_room.numItems = #playList + #roomList list_gamePlay.numItems = #playList + 1 end @@ -535,7 +539,6 @@ function M:OnUpdate() ViewUtil.ErrorTip(res.ReturnCode, string.format('删除房间-%s失败!', self._group.rooms[i].id)) else self._roomNum = #self._group.rooms - self._group.update_room = false end end ) diff --git a/lua_probject/base_project/Game/View/LoginView.lua b/lua_probject/base_project/Game/View/LoginView.lua index bac293ff..5a870a62 100644 --- a/lua_probject/base_project/Game/View/LoginView.lua +++ b/lua_probject/base_project/Game/View/LoginView.lua @@ -106,7 +106,7 @@ end function M:Show() BaseView.Show(self) - -- self:QuickLogin() + self:QuickLogin() end local function __goto_lobby(response) diff --git a/lua_probject/extend_project/extend/majiang/nancheng/MJPlayerSelfCardInfoView.lua b/lua_probject/extend_project/extend/majiang/nancheng/MJPlayerSelfCardInfoView.lua index 72d1d092..74c9086d 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/MJPlayerSelfCardInfoView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/MJPlayerSelfCardInfoView.lua @@ -3,11 +3,11 @@ local MJPlayerCardInfoView = require("main.majiang.MJPlayerCardInfoView") local CardCheck = import(".CardCheck") local M = {} --- -function M.new(view,mainView) - setmetatable(MJPlayerSelfCardInfoView, {__index = MJPlayerCardInfoView}) - setmetatable(M, {__index = MJPlayerSelfCardInfoView}) - local self = setmetatable({},{__index = M}) +-- +function M.new(view, mainView) + setmetatable(MJPlayerSelfCardInfoView, { __index = MJPlayerCardInfoView }) + setmetatable(M, { __index = MJPlayerSelfCardInfoView }) + local self = setmetatable({}, { __index = M }) self.class = "PlayerSelfCardInfoView" self._view = view self._mainView = mainView @@ -17,16 +17,16 @@ end function M:ShowHuTip(card_list) printlog("ShowHuTip") - local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) + local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, + DataManager.CurrenRoom.room_config.Laizi) if #tingList > 0 then - if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo>0 then - for i=1,#DataManager.CurrenRoom.laiziInfo do - if IsHasDictionary(DataManager.CurrenRoom.laiziInfo[i],tingList)==false then - table.insert(tingList,DataManager.CurrenRoom.laiziInfo[i] ) - end - end - end - + if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then + for i = 1, #DataManager.CurrenRoom.laiziInfo do + if IsHasDictionary(DataManager.CurrenRoom.laiziInfo[i], tingList) == false then + table.insert(tingList, DataManager.CurrenRoom.laiziInfo[i]) + end + end + end end self._mainView._hu_tip:FillData(tingList) end @@ -35,32 +35,28 @@ function M:UpdateHandCard(getcard, mp) MJPlayerSelfCardInfoView.UpdateHandCard(self, getcard, mp) local _carViewList = self._carViewList - if DataManager.CurrenRoom.laiziInfo and #self._carViewList>0 then - for i=1,#self._carViewList do - local obj=self._carViewList[i] - if obj and obj.card then - if IsHasDictionary(obj.card_item,DataManager.CurrenRoom.laiziInfo) then - if obj.card.GetController then - if obj.card:GetController("laizi") then - obj.card:GetController("laizi").selectedIndex=1 - end - - end - else - if obj.card.GetController then - if obj.card:GetController("laizi") then - obj.card:GetController("laizi").selectedIndex=0 - end - end - end - - end - end - - - end - - + if DataManager.CurrenRoom.laiziInfo and #self._carViewList > 0 then + for i = 1, #self._carViewList do + local obj = self._carViewList[i] + if obj and obj.card then + if IsHasDictionary(obj.card_item, DataManager.CurrenRoom.laiziInfo) then + if obj.card.GetController then + if obj.card:GetController("laizi") then + obj.card:GetController("laizi").selectedIndex = 1 + end + end + else + if obj.card.GetController then + if obj.card:GetController("laizi") then + obj.card:GetController("laizi").selectedIndex = 0 + end + end + end + end + end + end + + local card_list = DataManager.CurrenRoom.self_player.card_list self:ShowHuTip(card_list) if getcard then @@ -73,7 +69,8 @@ function M:UpdateHandCard(getcard, mp) local btn = _carViewList[i].card local card = self:GetCard(btn) list_remove(card_list, card) - local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) + local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, + DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) if #tingList > 0 then local count = 0 for j = 1, #tingList do @@ -92,7 +89,7 @@ function M:UpdateHandCard(getcard, mp) end) -- 如果几张牌的可胡牌数一致,也只显示'三角',可胡牌数不一致才显示'多' local all_same = #lst_mark ~= 0 and lst_mark[1].count == total_num / #lst_mark or false - for i = 1, #lst_mark do + for i = 1, #lst_mark do local tem = lst_mark[i] if all_same or tem.count < lst_mark[1].count then tem.item:GetController("mark_ting").selectedIndex = 1 @@ -109,7 +106,6 @@ function M:UpdateHandCard(getcard, mp) end self._out_card = false end - end function M:__OnClickHandCard(context) @@ -117,17 +113,17 @@ function M:__OnClickHandCard(context) local _carViewList = self._carViewList local refresh = true local card_list = {} - for i=1,#_carViewList do + for i = 1, #_carViewList do local btn = _carViewList[i].card 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 refresh = false else self._mainView:markOutCards(false, card) end btn.selected = false - end + end if not btn.selected then table.insert(card_list, card) end @@ -160,16 +156,16 @@ function M:__OnDragStart(card) end function M:__OnDragEnd(context) - if self.outcard_button then - self.outcard_button:Dispose() - self.outcard_button = nil - end + if self.outcard_button then + self.outcard_button:Dispose() + self.outcard_button = nil + end local button = context.sender - + --button:RemoveFromParent() local card = button.data local _room = DataManager.CurrenRoom - + -- 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 self._mainView:OutCard(card.card_item) @@ -190,6 +186,7 @@ function M:CheckPlayerOnlineState() end return true end + function M:Clear(bskip) --self._ctr_state.selectedIndex = 0 self._area_fz_list.x = self._src_fz_list.x @@ -204,10 +201,10 @@ function M:Clear(bskip) self._mask_liangpai:RemoveChildren(0, -1, true) end - for i=1,#self._carViewList do + for i = 1, #self._carViewList do self._carViewList[i].card:Dispose() end self._carViewList = {} - end -return M \ No newline at end of file + +return M diff --git a/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua b/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua index 85d74c7e..81c0a6f7 100644 --- a/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua +++ b/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua @@ -20,7 +20,7 @@ local M = PlayerCardInfoView --- Create a new PlayerCardInfoView function M.new(view, mainView) local self = {} - setmetatable(self, {__index = M}) + setmetatable(self, { __index = M }) self._view = view self._mainView = mainView self:init() @@ -34,7 +34,7 @@ function M:init() self._mask_data = json.decode(mask) self._area_handcard_list = view:GetChild('area_handcard_list') - + self._area_fz_list = view:GetChild('area_fz_list') self._area_outcard_list = view:GetChild('area_outcard_list') self._src_fz_list = @@ -51,23 +51,21 @@ function M:init() end self._mask_liangpai = view:GetChild('mask_liangpai') - - local _gamectr = ControllerManager.GetController(GameController) - if _gamectr then - _gamectr:AddEventListener(GameEvent.MJModifySzie, handler(self, self.SetMJSize)) - end - + local _gamectr = ControllerManager.GetController(GameController) + if _gamectr then + _gamectr:AddEventListener(GameEvent.MJModifySzie, handler(self, self.SetMJSize)) + end end function M:SetMJSize(zS) - local tempSzieConfig={} - tempSzieConfig.size=zS - local filename = 'mjsize' .. DataManager.SelfUser.account_id + local tempSzieConfig = {} + tempSzieConfig.size = zS + local filename = 'mjsize' .. DataManager.SelfUser.account_id Utils.SaveLocalFile(filename, json.encode(tempSzieConfig)) - - --ControllerManager.OnConnect(SocketCode.TimeoutDisconnect) - ViewManager.refreshGameView() + + --ControllerManager.OnConnect(SocketCode.TimeoutDisconnect) + ViewManager.refreshGameView() end function M:SetPlayer(p) @@ -119,12 +117,12 @@ function M:GetPrefix() end function M:fillCard(obj, pos_str, card, use3d) - if self._current_card_type == 2 and (use3d == nil or use3d == true) then obj.icon = 'ui://MajiangCard3d/' .. 'b' .. pos_str .. card else obj.icon = 'ui://Main_Majiang/' .. self:GetPrefix() .. pos_str .. card end + print("================================fillCard", obj, pos_str, card, use3d, obj.icon) end function M:getBackCard(card) @@ -190,9 +188,9 @@ function M:UpdateHandCard(getcard, mp) self:fillCard(obj, card, _player.card_list[i + 1]) -- obj.icon = UIPackage.GetItemURL("Main_Majiang", card .. _player.card_list[i+1]) - + local offset = getcard and (i == _player.hand_left_count - 1 and 0 or 0) - + ViewUtil.CardPos(obj, self._area_handcard_list, oder, i, offset) --改变左右两边的手牌的x值 @@ -353,7 +351,7 @@ local function getPos(my_seat, other_seat, total) local pos = 0 pos = other_seat - my_seat + 1 if pos <= 0 then - pos = pos + total + pos = pos + total end if total ~= 4 and pos == total then pos = total + 1 @@ -496,7 +494,7 @@ function M:UpdateFzList(fz, index, show_card) -- if num == 0 then return end -- if index == -1 then -- -- local obj = self._area_fz_list:GetChildAt(num - 1) - -- local pic_arrow = UIPackage.CreateObjectFromURL("ui://Main_Majiang/com_arrow") + -- local pic_arrow = UIPackage.CreateObjectFromURL("ui://Main_Majiang/com_arrow") -- obj:AddChild(pic_arrow) -- pic_arrow:Center() -- local my_seat = self._player.seat diff --git a/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua b/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua index cd0402b4..12c51db0 100644 --- a/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua +++ b/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua @@ -1,84 +1,84 @@ local MJPlayerCardInfoView = import(".MJPlayerCardInfoView") local CardView = { - card = nil, - -- 牌序号 - card_item =0, - -- 索引 - index = 0, - -- 原始位置 - old_postion = Vector2.zero + card = nil, + -- 牌序号 + card_item = 0, + -- 索引 + index = 0, + -- 原始位置 + old_postion = Vector2.zero } -local function NewCardView(card,cardItem) +local function NewCardView(card, cardItem) local self = {} - setmetatable(self,{__index = CardView}) + setmetatable(self, { __index = CardView }) self.card = card self.card_item = cardItem return self end local PlayerSelfView = { - _dragCom=nil, + _dragCom = nil, _carViewList = {} } local M = PlayerSelfView -function PlayerSelfView.new(view,mainView) - setmetatable(M,{__index = MJPlayerCardInfoView}) - local self = setmetatable({}, {__index = M}) - self._view = view - self._mainView = mainView - self:init() - return self +function PlayerSelfView.new(view, mainView) + setmetatable(M, { __index = MJPlayerCardInfoView }) + local self = setmetatable({}, { __index = M }) + self._view = view + self._mainView = mainView + self:init() + return self end function M:init() MJPlayerCardInfoView.init(self) - + local filename = 'mjsize' .. DataManager.SelfUser.account_id local json_data = Utils.LoadLocalFile(filename) - if json_data then - local _data = json.decode(json_data) - if _data.size==0 then - self._area_handcard_list:SetScale(1,1.1) - self._area_fz_list:SetScale(0.6,0.6) - elseif _data.size==1 then - self._area_handcard_list:SetScale(1,1) - self._area_fz_list:SetScale(1,1) - - elseif _data.size==2 then - self._area_handcard_list:SetScale(0.8,0.8) - self._area_fz_list:SetScale(0.8,0.8) + if json_data then + local _data = json.decode(json_data) + if _data.size == 0 then + self._area_handcard_list:SetScale(1, 1.1) + self._area_fz_list:SetScale(0.6, 0.6) + elseif _data.size == 1 then + self._area_handcard_list:SetScale(1, 1) + self._area_fz_list:SetScale(1, 1) + elseif _data.size == 2 then + self._area_handcard_list:SetScale(0.8, 0.8) + self._area_fz_list:SetScale(0.8, 0.8) end - end + end end function M:setHandCardPos(btn_card, i, getcard) btn_card.x = i * btn_card.width * 1.05 + (getcard and 20 or 0) end -function M:UpdateHandCard(getcard,mp) +function M:UpdateHandCard(getcard, mp) + print("======================main", getcard, mp) if self.outcard_button then self.outcard_button:Dispose() self.outcard_button = nil end getcard = getcard or false - mp = mp or false + mp = mp or false local pv = self local _carViewList = self._carViewList local _lit = pv._area_handcard_list - for i=1,#_carViewList do + for i = 1, #_carViewList do _carViewList[i].card:Dispose() end _carViewList = {} local _dragCom = self._dragCom if (_dragCom == nil) then - _dragCom = UIPackage.CreateObject("Common","UIPanel") - _dragCom.size = Vector2(1,1) - pv._view:AddChild(_dragCom) + _dragCom = UIPackage.CreateObject("Common", "UIPanel") + _dragCom.size = Vector2(1, 1) + pv._view:AddChild(_dragCom) end _dragCom.xy = pv._area_handcard_list.xy self._dragCom = _dragCom @@ -91,71 +91,70 @@ function M:UpdateHandCard(getcard,mp) local cards = DataManager.CurrenRoom.self_player.card_list if (not mp) then - for i=0,(#cards)-1 do - local tem_card = cards[i+1] + for i = 0, (#cards) - 1 do + local tem_card = cards[i + 1] - local btn_card = UIPackage.CreateObject(self:GetCardObjPack(), "Btn_Card"..b3d) - btn_card:SetScale(1.05,1.05) - -- btn_card.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. tem_card) - self:fillCard(btn_card,"201_",tem_card) - self:setHandCardPos(btn_card, i, i == #cards - 1 and getcard) - local c_v = NewCardView(btn_card, tem_card) - c_v.index = i - c_v.old_postion = btn_card.xy - _carViewList[#_carViewList+1] = c_v - - _lit:AddChild(btn_card) + local btn_card = UIPackage.CreateObject(self:GetCardObjPack(), "Btn_Card" .. b3d) + btn_card:SetScale(1.05, 1.05) + -- btn_card.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. tem_card) + self:fillCard(btn_card, "201_", tem_card) + self:setHandCardPos(btn_card, i, i == #cards - 1 and getcard) + local c_v = NewCardView(btn_card, tem_card) + c_v.index = i + c_v.old_postion = btn_card.xy + _carViewList[#_carViewList + 1] = c_v - if (not self._player.auto_out_card) then - btn_card.data = c_v - -- btn_card.draggable = true; - -- btn_card.onDragStart:Set(function(evt) - -- local _agent = evt.sender - -- _agent:RemoveFromParent() - -- _dragCom:AddChild(_agent) - -- if self.__OnDragStart then - -- self:__OnDragStart(evt) - -- end - -- _agent.onDragEnd:Set(self.__OnDragEnd,self) - -- end) - btn_card.onTouchBegin:Set(handler(self, self.onTouchBegin)) - btn_card.onTouchMove:Set(handler(self, self.onTouchMove)) - btn_card.onTouchEnd:Set(handler(self, self.__OnDragEnd)) - btn_card.onClick:Set(self.__OnClickHandCard,self) - else - btn_card:GetChild("icon").color = Color(0.5,0.5,0.5) - btn_card.touchable = false - end - end + _lit:AddChild(btn_card) + + if (not self._player.auto_out_card) then + btn_card.data = c_v + -- btn_card.draggable = true; + -- btn_card.onDragStart:Set(function(evt) + -- local _agent = evt.sender + -- _agent:RemoveFromParent() + -- _dragCom:AddChild(_agent) + -- if self.__OnDragStart then + -- self:__OnDragStart(evt) + -- end + -- _agent.onDragEnd:Set(self.__OnDragEnd,self) + -- end) + btn_card.onTouchBegin:Set(handler(self, self.onTouchBegin)) + btn_card.onTouchMove:Set(handler(self, self.onTouchMove)) + btn_card.onTouchEnd:Set(handler(self, self.__OnDragEnd)) + btn_card.onClick:Set(self.__OnClickHandCard, self) + else + btn_card:GetChild("icon").color = Color(0.5, 0.5, 0.5) + btn_card.touchable = false + end + end else - for i=0,(#cards)-1 do - - local mp_card = UIPackage.CreateObject("Main_Majiang", "Mp_self_card"..b3d) - -- mp_card.icon = UIPackage.GetItemURL("Main_Majiang", "202_" .. cards[i+1]) - self:fillCard(mp_card,"202_",cards[i+1]) - mp_card:SetScale(1.05,1.05) - -- mp_card.x = i * mp_card.width + (i == #cards - 1 and getcard and 20 or 0) - self:setHandCardPos(mp_card, i, i == #cards - 1 and getcard) - _lit:AddChild(mp_card) - end + for i = 0, (#cards) - 1 do + local mp_card = UIPackage.CreateObject("Main_Majiang", "Mp_self_card" .. b3d) + -- mp_card.icon = UIPackage.GetItemURL("Main_Majiang", "202_" .. cards[i+1]) + self:fillCard(mp_card, "202_", cards[i + 1]) + mp_card:SetScale(1.05, 1.05) + -- mp_card.x = i * mp_card.width + (i == #cards - 1 and getcard and 20 or 0) + self:setHandCardPos(mp_card, i, i == #cards - 1 and getcard) + _lit:AddChild(mp_card) + end end end function M:onTouchBegin(context) local button = context.sender local card = button.data - local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x,context.inputEvent.y)) + local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y)) card.touch_pos = xy - button.xy if self.__OnDragStart then self:__OnDragStart(card.card_item) end end -function M:onTouchMove(context) +function M:onTouchMove(context) local button = context.sender local card = button.data - local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x,context.inputEvent.y)) + local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y)) button.xy = xy - card.touch_pos end @@ -164,37 +163,37 @@ function M:__OnDragEnd(context) self.outcard_button:Dispose() self.outcard_button = nil end - local button = context.sender - -- button.onDragEnd:Set(nil) - --button:RemoveFromParent() - local card = button.data - local _room = DataManager.CurrenRoom - if not _room or _room:GetReloadStatus() then return end - - -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) - if (button.y < -150 and _room.curren_outcard_seat == _room.self_player.seat) then - self._mainView:OutCard(card.card_item) - button.touchable = false - self.outcard_button = buttond - else - self._area_handcard_list:AddChildAt(button, card.index) - button:TweenMove(card.old_postion, 0.2) - end + local button = context.sender + -- button.onDragEnd:Set(nil) + --button:RemoveFromParent() + local card = button.data + local _room = DataManager.CurrenRoom + if not _room or _room:GetReloadStatus() then return end + + -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) + if (button.y < -150 and _room.curren_outcard_seat == _room.self_player.seat) then + self._mainView:OutCard(card.card_item) + button.touchable = false + self.outcard_button = buttond + else + self._area_handcard_list:AddChildAt(button, card.index) + button:TweenMove(card.old_postion, 0.2) + end end function M:__OnClickHandCard(context) - local button = context.sender - local _carViewList = self._carViewList - for i=1,#_carViewList do - if (_carViewList[i].card ~= button) then - _carViewList[i].card.selected = false - end - end - local _room = DataManager.CurrenRoom - if (Utils.IsDoubleClick(context) and _room.curren_outcard_seat == _room.self_player.seat) then - local card = button.data - self._mainView:OutCard(card.card_item) - end + local button = context.sender + local _carViewList = self._carViewList + for i = 1, #_carViewList do + if (_carViewList[i].card ~= button) then + _carViewList[i].card.selected = false + end + end + local _room = DataManager.CurrenRoom + if (Utils.IsDoubleClick(context) and _room.curren_outcard_seat == _room.self_player.seat) then + local card = button.data + self._mainView:OutCard(card.card_item) + end end -- 获取手牌资源位置,可以在扩展中复写 @@ -204,10 +203,10 @@ end function M:Clear() MJPlayerCardInfoView.Clear(self) - for i=1,#self._carViewList do + for i = 1, #self._carViewList do self._carViewList[i].card:Dispose() end self._carViewList = {} end -return M \ No newline at end of file +return M diff --git a/wb_unity_pro/Assets/ART/base/main_majiang/ui/MajiangCard3d_atlas0.png b/wb_unity_pro/Assets/ART/base/main_majiang/ui/MajiangCard3d_atlas0.png index e078dbbb..d1dca25a 100644 Binary files a/wb_unity_pro/Assets/ART/base/main_majiang/ui/MajiangCard3d_atlas0.png and b/wb_unity_pro/Assets/ART/base/main_majiang/ui/MajiangCard3d_atlas0.png differ diff --git a/wb_unity_pro/Assets/ART/base/main_majiang/ui/MajiangCard3d_fui.bytes b/wb_unity_pro/Assets/ART/base/main_majiang/ui/MajiangCard3d_fui.bytes index f8239774..24c853b2 100644 Binary files a/wb_unity_pro/Assets/ART/base/main_majiang/ui/MajiangCard3d_fui.bytes and b/wb_unity_pro/Assets/ART/base/main_majiang/ui/MajiangCard3d_fui.bytes differ diff --git a/wb_unity_pro/Assets/ART/base/main_majiang/ui/main_majiang_fui.bytes b/wb_unity_pro/Assets/ART/base/main_majiang/ui/main_majiang_fui.bytes index 45bdd0e3..6521a589 100644 Binary files a/wb_unity_pro/Assets/ART/base/main_majiang/ui/main_majiang_fui.bytes and b/wb_unity_pro/Assets/ART/base/main_majiang/ui/main_majiang_fui.bytes differ