From de60e89361e96dc1b18f2c0c2cf24deedaeddf63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=AE=B6=E7=82=9C?= <2029049582@qq.com> Date: Thu, 26 Jun 2025 20:56:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BE=E7=82=AE=E5=8F=91=E6=89=8B=E6=84=9F?= =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=8C=E4=BB=A5=E5=8F=8A=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extend/zipai/fanpaofa/EXMainView.lua | 100 ++-- .../zipai/fanpaofa/PlayerSelfCardInfoView.lua | 517 +++++++++--------- .../extend/zipai/fanpaofa/main/ZPCardView.lua | 14 +- .../extend/zipai/fanpaofa/main/ZPMainView.lua | 133 +++-- .../main/ZPPlayerSelfCardInfoView.lua | 57 +- .../zipai/fanpaofa/main/ZPSettingView.lua | 28 +- wb_new_ui/.objs/metas/v6yvqp7w/voqg1dy.info | 19 + wb_new_ui/.objs/workspace.json | 46 +- .../component/cards/Btn_Card.xml | 11 +- .../option/component/card/Btn_Card.xml | 2 +- .../setting/images/newsetting/Component5.xml | 34 +- .../Main_RunBeard/images/cards6/204_6_101.png | Bin 0 -> 20811 bytes .../Main_RunBeard/images/cards6/204_6_102.png | Bin 0 -> 22154 bytes .../Main_RunBeard/images/cards6/204_6_103.png | Bin 0 -> 21811 bytes .../Main_RunBeard/images/cards6/204_6_104.png | Bin 0 -> 23343 bytes .../Main_RunBeard/images/cards6/204_6_105.png | Bin 0 -> 22095 bytes .../Main_RunBeard/images/cards6/204_6_106.png | Bin 0 -> 25949 bytes .../Main_RunBeard/images/cards6/204_6_107.png | Bin 0 -> 23047 bytes .../Main_RunBeard/images/cards6/204_6_108.png | Bin 0 -> 23266 bytes .../Main_RunBeard/images/cards6/204_6_109.png | Bin 0 -> 24600 bytes .../Main_RunBeard/images/cards6/204_6_110.png | Bin 0 -> 21671 bytes .../Main_RunBeard/images/cards6/204_6_201.png | Bin 0 -> 29852 bytes .../Main_RunBeard/images/cards6/204_6_202.png | Bin 0 -> 28792 bytes .../Main_RunBeard/images/cards6/204_6_203.png | Bin 0 -> 26847 bytes .../Main_RunBeard/images/cards6/204_6_204.png | Bin 0 -> 28173 bytes .../Main_RunBeard/images/cards6/204_6_205.png | Bin 0 -> 25928 bytes .../Main_RunBeard/images/cards6/204_6_206.png | Bin 0 -> 27084 bytes .../Main_RunBeard/images/cards6/204_6_207.png | Bin 0 -> 29285 bytes .../Main_RunBeard/images/cards6/204_6_208.png | Bin 0 -> 28800 bytes .../Main_RunBeard/images/cards6/204_6_209.png | Bin 0 -> 27923 bytes .../Main_RunBeard/images/cards6/204_6_210.png | Bin 0 -> 26324 bytes .../images/cards8/203_8_201(1).png | Bin 0 -> 10361 bytes .../images/cards8/203_8_202(1).png | Bin 0 -> 13070 bytes .../images/cards8/203_8_203(1).png | Bin 0 -> 10122 bytes .../images/cards8/203_8_204(1).png | Bin 0 -> 9647 bytes .../images/cards8/203_8_205(1).png | Bin 0 -> 9465 bytes .../images/cards8/203_8_206(1).png | Bin 0 -> 9950 bytes .../images/cards8/203_8_207(1).png | Bin 0 -> 13291 bytes .../images/cards8/203_8_208(1).png | Bin 0 -> 10273 bytes .../images/cards8/203_8_209(1).png | Bin 0 -> 10123 bytes .../Main_RunBeard/images/cards8/204_8_110.png | Bin 0 -> 7173 bytes .../Main_RunBeard/images/cards8/204_8_201.png | Bin 0 -> 4428 bytes .../Main_RunBeard/images/cards8/204_8_202.png | Bin 0 -> 7660 bytes .../Main_RunBeard/images/cards8/204_8_203.png | Bin 0 -> 7448 bytes .../Main_RunBeard/images/cards8/204_8_204.png | Bin 0 -> 7265 bytes .../Main_RunBeard/images/cards8/204_8_205.png | Bin 0 -> 7199 bytes .../Main_RunBeard/images/cards8/204_8_206.png | Bin 0 -> 8614 bytes .../Main_RunBeard/images/cards8/204_8_207.png | Bin 0 -> 8250 bytes .../Main_RunBeard/images/cards8/204_8_208.png | Bin 0 -> 6919 bytes .../Main_RunBeard/images/cards8/204_8_209.png | Bin 0 -> 7641 bytes .../Main_RunBeard/images/cards8/204_8_210.png | Bin 0 -> 12778 bytes wb_new_ui/assets/Main_RunBeard/package.xml | 40 ++ 52 files changed, 520 insertions(+), 481 deletions(-) create mode 100644 wb_new_ui/.objs/metas/v6yvqp7w/voqg1dy.info create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_101.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_102.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_103.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_104.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_105.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_106.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_107.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_108.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_109.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_110.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_201.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_202.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_203.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_204.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_205.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_206.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_207.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_208.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_209.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards6/204_6_210.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/203_8_201(1).png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/203_8_202(1).png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/203_8_203(1).png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/203_8_204(1).png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/203_8_205(1).png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/203_8_206(1).png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/203_8_207(1).png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/203_8_208(1).png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/203_8_209(1).png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/204_8_110.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/204_8_201.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/204_8_202.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/204_8_203.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/204_8_204.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/204_8_205.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/204_8_206.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/204_8_207.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/204_8_208.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/204_8_209.png create mode 100644 wb_new_ui/assets/Main_RunBeard/images/cards8/204_8_210.png diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua index a9adfd29..d0c3752a 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua @@ -664,7 +664,7 @@ function M:__FangziTip(tip, _uid, fptype) local count = #_tlist local zdhu = false local fpao = true - + for k = 1, #_tlist do local td = tip.tip_map_type[_tlist[k]][1] if td.type == 8 then @@ -687,7 +687,7 @@ function M:__FangziTip(tip, _uid, fptype) self._chipeng_tip = nil return end - + for k = 1, #_tlist do local td = tip.tip_map_type[_tlist[k]][1] local url = 'ui://Main_RunBeard/Btn_fztip' @@ -741,7 +741,7 @@ function M:__TipAction(context) local td = data[2] local tip_hu = data[3] local list = tip.tip_map_type[td.weight] - + if (#list > 1) or td.type == 1 then local chiflag = true for key, value in pairs(list) do @@ -752,7 +752,7 @@ function M:__TipAction(context) if #list > 1 then chiflag = false end - if tip_hu==false and chiflag then + if tip_hu == false and chiflag then _gamectr:SendAction(list[1]["id"]) self:__CloseTip() local info = self._player_card_info[1] @@ -785,7 +785,7 @@ function M:__TipAction(context) end ) - + -- self._chipeng_tip.visible = false return end @@ -944,7 +944,7 @@ end function M:OnFangziAction(...) local arg = { ... } local _player_card_info = self._player_card_info - + local fz = arg[1] local player = arg[2] local num = arg[3] @@ -958,16 +958,16 @@ function M:OnFangziAction(...) self._popEvent = false local info = _player_card_info[self:GetPos(player.seat)] - if fz.type == RB_FZType.Wei or fz.type==RB_FZType.ChouWei then + if fz.type == RB_FZType.Wei or fz.type == RB_FZType.ChouWei then coroutine.start( - function() - coroutine.wait(1.4) - info:UpdateFzList(player.fz_list, true, player.seat) - end) + function() + coroutine.wait(1.4) + info:UpdateFzList(player.fz_list, true, player.seat) + end) else info:UpdateFzList(player.fz_list, true, player.seat) --更新放子数组 end - + if (player == self._room.self_player) then if fz.type == RB_FZType.Chi then @@ -991,25 +991,24 @@ function M:OnFangziAction(...) elseif fz.type == RB_FZType.Wei then --显示wei 的牌 coroutine.start( - function() - coroutine.wait(1.4) - for i = 1, #fz.opcard do - info:DeleteHandCard(fz.opcard[i]) - end - end) + function() + coroutine.wait(1.4) + for i = 1, #fz.opcard do + info:DeleteHandCard(fz.opcard[i]) + end + end) elseif fz.type == RB_FZType.ChouWei then - --[[ for i = 1, #fz.opcard do + --[[ for i = 1, #fz.opcard do info:DeleteHandCard(fz.opcard[i]) end]] - coroutine.start( - function() - coroutine.wait(1.4) - for i = 1, #fz.opcard do - info:DeleteHandCard(fz.opcard[i]) - end - end) - + coroutine.start( + function() + coroutine.wait(1.4) + for i = 1, #fz.opcard do + info:DeleteHandCard(fz.opcard[i]) + end + end) elseif fz.type == RB_FZType.Pao then if num > 0 then for i = 1, #fz.opcard do @@ -1027,7 +1026,7 @@ function M:OnFangziAction(...) function() coroutine.wait(0.3) if fz.type ~= RB_FZType.Kan then - info:SendChangeCard() + info:SendChangeCard() end end ) @@ -1038,7 +1037,7 @@ function M:OnFangziAction(...) local info = _player_card_info[self:GetPos(player.seat)] local pNode = info._mask_liangpai local effect = UIPackage.CreateObject('Main_RunBeard', 'FzEffect') - + if fz.type == RB_FZType.Peng then -- effect:GetChild("icon2").icon = UIPackage.GetItemURL("Main_RunBeard", "peng") self:PlaySound(player.self_user.sex, 'F_Peng') @@ -1052,9 +1051,9 @@ function M:OnFangziAction(...) elseif fz.type == RB_FZType.Wei then -- effect:GetChild("icon2").icon = UIPackage.GetItemURL("Main_RunBeard", "wei") self:PlaySound(player.self_user.sex, 'F_' .. fz.card) - - info:UpdateOutCardList(fz.card,true,true,fz.from_seat) - + + info:UpdateOutCardList(fz.card, true, true, fz.from_seat) + coroutine.start( function() coroutine.wait(0.8) @@ -1065,19 +1064,18 @@ function M:OnFangziAction(...) effect.x, effect.y = -250, -200 effect:GetTransition('t0'):Play() pNode:AddChild(effect) - end) - + end) + coroutine.start( function() coroutine.wait(1.8) effect:Dispose() end ) - elseif fz.type == RB_FZType.ChouWei then self:PlaySound(player.self_user.sex, 'F_' .. fz.card) - info:UpdateOutCardList(fz.card,true,true,fz.from_seat) - + info:UpdateOutCardList(fz.card, true, true, fz.from_seat) + coroutine.start( function() coroutine.wait(1.2) @@ -1088,22 +1086,21 @@ function M:OnFangziAction(...) effect.x, effect.y = -250, -200 effect:GetTransition('t0'):Play() pNode:AddChild(effect) - end) - + end) + coroutine.start( function() coroutine.wait(1.7) effect:Dispose() end ) - elseif fz.type == RB_FZType.Pao then -- effect:GetChild("icon2").icon = UIPackage.GetItemURL("Main_RunBeard", "pao") self:PlaySound(player.self_user.sex, 'F_KaiDuo') effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'pao') elseif fz.type == RB_FZType.Ti then self:PlaySound(player.self_user.sex, 'F_' .. fz.card) - info:UpdateOutCardList(fz.card,true,true,fz.from_seat) + info:UpdateOutCardList(fz.card, true, true, fz.from_seat) effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'ti') effect.touchable = false effect.x, effect.y = -250, -200 @@ -1114,9 +1111,8 @@ function M:OnFangziAction(...) coroutine.wait(1.2) self:PlaySound(player.self_user.sex, 'F_SaoChuan') info:PlayingOutCardAnima() - end) - + coroutine.start( function() coroutine.wait(1.7) @@ -1125,8 +1121,8 @@ function M:OnFangziAction(...) ) -- effect:GetChild("icon2").icon = UIPackage.GetItemURL("Main_RunBeard", "ti") end - - if fz.type~=RB_FZType.Wei and fz.type~=RB_FZType.ChouWei then + + if fz.type ~= RB_FZType.Wei and fz.type ~= RB_FZType.ChouWei then effect.touchable = false effect.x, effect.y = -250, -200 effect:GetTransition('t0'):Play() @@ -1138,8 +1134,6 @@ function M:OnFangziAction(...) end ) end - - end if (player == self._room.self_player) then coroutine.start( @@ -1155,14 +1149,14 @@ function M:OnFangziAction(...) local p = self._room:GetPlayerBySeat(fz.from_seat) if p.DiceCard ~= nil and fz.active_card == p.DiceCard then - if fz.type==RB_FZType.Wei or fz.type==RB_FZType.ChouWei or fz.type==RB_FZType.Ti or fz.type==RB_FZType.Pao then + if fz.type == RB_FZType.Wei or fz.type == RB_FZType.ChouWei or fz.type == RB_FZType.Ti or fz.type == RB_FZType.Pao then coroutine.start( - function() - coroutine.wait(0.8) - removeOutcard:ClearOutCard() - end) + function() + coroutine.wait(0.8) + removeOutcard:ClearOutCard() + end) else - removeOutcard:ClearOutCard() + removeOutcard:ClearOutCard() end p.DiceCard = nil end diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/PlayerSelfCardInfoView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/PlayerSelfCardInfoView.lua index f470b093..d23c6cd3 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/PlayerSelfCardInfoView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/PlayerSelfCardInfoView.lua @@ -1,10 +1,10 @@ local PlayerSelfCardInfoView = import(".main.ZPPlayerSelfCardInfoView") local CardCheck = import(".main.CardCheck") local M = {} --- -function M.new(view,mainView) - setmetatable(M, {__index = PlayerSelfCardInfoView}) - local self = setmetatable({},{__index = M}) +-- +function M.new(view, mainView) + setmetatable(M, { __index = PlayerSelfCardInfoView }) + local self = setmetatable({}, { __index = M }) self.class = "PlayerSelfCardInfoView" self._view = view self._mainView = mainView @@ -13,36 +13,34 @@ function M.new(view,mainView) return self end - function M:onTouchBegin(context) - if DataManager.CurrenRoom ==nil or DataManager.CurrenRoom.self_player ==nil then + if DataManager.CurrenRoom == nil or DataManager.CurrenRoom.self_player == nil then return end local button = context.sender local card = button.data - if DataManager.CurrenRoom.curren_outcard_seat == DataManager.CurrenRoom.self_player.seat then + if DataManager.CurrenRoom.curren_outcard_seat == DataManager.CurrenRoom.self_player.seat then self:ShowHuTip(card.card_item) end - card.btn_card:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/203_",card.card_item) + card.btn_card:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/204_", card.card_item) + -- card.btn_card:GetController('touch').selectedIndex = 1 card.btn_card.sortingOrder = 100 - local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x,context.inputEvent.y)) - card.btn_card.xy = Vector2.New(card.btn_card.x+20 ,card.btn_card.y-50) + local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y)) + card.btn_card.xy = Vector2.New(card.btn_card.x + 20, card.btn_card.y - 50) card.touch_pos = xy - button.xy - end - function M:__OnDragEnd(context) - if DataManager.CurrenRoom ==nil or DataManager.CurrenRoom.self_player ==nil then + if DataManager.CurrenRoom == nil or DataManager.CurrenRoom.self_player == nil then return end if self.outcard_button then self.outcard_button = nil end local button = context.sender - + local card = button.data - + local _room = DataManager.CurrenRoom card.btn_card.sortingOrder = 0 if (button.y < -380 and _room.curren_outcard_seat == _room.self_player.seat) then @@ -53,7 +51,7 @@ function M:__OnDragEnd(context) else local isChangeCard = false self.outcard_button = nil - card.btn_card:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/201_",card.card_item) + card.btn_card:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/201_", card.card_item) self._area_handcard_list:AddChild(button) if #self.card_list == 1 then isChangeCard = false @@ -61,188 +59,188 @@ function M:__OnDragEnd(context) return end local CountCards = {} - for i=1,#self.card_list do + for i = 1, #self.card_list do local lists = {} if CountCards[self.card_list[i].index_X] == nil then - lists[#lists+1] = self.card_list[i] - CountCards[self.card_list[i].index_X]= lists + lists[#lists + 1] = self.card_list[i] + CountCards[self.card_list[i].index_X] = lists else - CountCards[self.card_list[i].index_X][#CountCards[self.card_list[i].index_X]+1] =self.card_list[i] + CountCards[self.card_list[i].index_X][#CountCards[self.card_list[i].index_X] + 1] = self.card_list[i] end end local minmark = 1 local maxmark = #self.card_list - if card == self.card_list[1] or card == self.card_list[#self.card_list] then + if card == self.card_list[1] or card == self.card_list[#self.card_list] then if self.card_list[1].index_X == self.card_list[2].index_X then - minmark =2 + minmark = 2 end - if self.card_list[#self.card_list].index_X == self.card_list[#self.card_list-1].index_X then - maxmark =#self.card_list-1 + if self.card_list[#self.card_list].index_X == self.card_list[#self.card_list - 1].index_X then + maxmark = #self.card_list - 1 end end - if button.x+button.width/2 < self.card_list[minmark].btn_card.x and #CountCards<10 then - list_remove(self.card_list,card) + if button.x + button.width / 2 < self.card_list[minmark].btn_card.x and #CountCards < 10 and button.y > -380 then + list_remove(self.card_list, card) local num = 0 - for i=1,#self.card_list do + for i = 1, #self.card_list do if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then - self.card_list[i].index_Y = self.card_list[i].index_Y - 1 + self.card_list[i].index_Y = self.card_list[i].index_Y - 1 end if card.index_X == self.card_list[i].index_X then - num = num+1 + num = num + 1 end end - if num ==0 then - for i=1,#self.card_list do - if self.card_list[i].index_X < card.index_X then - self.card_list[i].index_X = self.card_list[i].index_X + 1 - end + if num == 0 then + for i = 1, #self.card_list do + if self.card_list[i].index_X < card.index_X then + self.card_list[i].index_X = self.card_list[i].index_X + 1 + end end else - for i=1,#self.card_list do - self.card_list[i].index_X = self.card_list[i].index_X + 1 + for i = 1, #self.card_list do + self.card_list[i].index_X = self.card_list[i].index_X + 1 end end - card.index_X =1 - card.index_Y =1 - table.insert(self.card_list,1,card) + card.index_X = 1 + card.index_Y = 1 + table.insert(self.card_list, 1, card) isChangeCard = true - elseif button.x+button.width/2 > (self.card_list[maxmark].btn_card.x +button.width) and #CountCards<10 then - list_remove(self.card_list,card) + elseif button.x + button.width / 2 > (self.card_list[maxmark].btn_card.x + button.width) and #CountCards < 10 and button.y > -380 then + list_remove(self.card_list, card) local num = 0 - for i=1,#self.card_list do + for i = 1, #self.card_list do if card.index_X == self.card_list[i].index_X then - num = num+1 + num = num + 1 end if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then - self.card_list[i].index_Y = self.card_list[i].index_Y - 1 + self.card_list[i].index_Y = self.card_list[i].index_Y - 1 end end - if num ==0 then - for i=1,#self.card_list do - if self.card_list[i].index_X > card.index_X then - self.card_list[i].index_X = self.card_list[i].index_X - 1 - end + if num == 0 then + for i = 1, #self.card_list do + if self.card_list[i].index_X > card.index_X then + self.card_list[i].index_X = self.card_list[i].index_X - 1 + end end end - card.index_X =self.card_list[#self.card_list].index_X+1 - card.index_Y =1 - self.card_list[#self.card_list+1] =card + card.index_X = self.card_list[#self.card_list].index_X + 1 + card.index_Y = 1 + self.card_list[#self.card_list + 1] = card isChangeCard = true - else + else local MoveCard = false local MoveCardPos = 0 local MoveCardY = 0 - for i=1,#CountCards do + for i = 1, #CountCards do local card_view = CountCards[i][1] - if card_view~=nil then - if button.x+button.width/2 > card_view.old_postion.x and button.x+button.width/2 < (card_view.old_postion.x+button.width) then - if card ~= card_view and #CountCards[i] <4 and card.index_X ~= card_view.index_X then - + if card_view ~= nil then + if button.x + button.width / 2 > card_view.old_postion.x and button.x + button.width / 2 < (card_view.old_postion.x + button.width) and button.y > -380 then + if card ~= card_view and #CountCards[i] < 4 and card.index_X ~= card_view.index_X then MoveCardPos = i - MoveCardY = #CountCards[i]+1 + MoveCardY = #CountCards[i] + 1 MoveCard = true - list_remove(self.card_list,card) + list_remove(self.card_list, card) end end end end local MoveCardindex = 0 - -- local MoveCardY = 0 - if button.x+button.width/2 > card.old_postion.x and button.x+button.width/2 < (card.old_postion.x+button.width) then - if #CountCards[card.index_X]>1 then - for i=1,#CountCards[card.index_X] do + -- local MoveCardY = 0 + print("lingmeng end", button.y, MoveCard, button.y > -380, + button.x + button.width / 2 > card.old_postion.x and + button.x + button.width / 2 < (card.old_postion.x + button.width) and button.y > -380) + if button.x + button.width / 2 > card.old_postion.x and button.x + button.width / 2 < (card.old_postion.x + button.width) and button.y > -380 then + if #CountCards[card.index_X] > 1 then + for i = 1, #CountCards[card.index_X] do local _cv = CountCards[card.index_X][i] if _cv ~= card then - if button.y+button.height/2 > _cv.btn_card.y and button.y+button.height/2 < (_cv.btn_card.y+button.height) then + if button.y + button.height / 2 > _cv.btn_card.y and button.y + button.height / 2 < (_cv.btn_card.y + button.height) then --向下移動 - if ((button.y+button.height/2) +20) > (card.old_postion.y+button.height) then - MoveCardindex = -1 - MoveCardPos = card.index_X - MoveCardY = _cv.index_Y - MoveCard = true - list_remove(self.card_list,card) - --向上移動 - elseif ((button.y+button.height/2) -20) < card.old_postion.y then - MoveCardindex = 1 - MoveCardPos = card.index_X - MoveCardY = _cv.index_Y - MoveCard = true - list_remove(self.card_list,card) - end - elseif i == #CountCards[card.index_X] and button.y+button.height/2 < _cv.btn_card.y then - MoveCardindex = 1 - MoveCardPos = card.index_X - MoveCardY = _cv.index_Y - MoveCard = true - list_remove(self.card_list,card) - elseif i == 1 and button.y+button.height/2 > (_cv.btn_card.y+button.width) then - MoveCardindex = -1 - MoveCardPos = card.index_X - MoveCardY = _cv.index_Y - MoveCard = true - list_remove(self.card_list,card) + if ((button.y + button.height / 2) + 20) > (card.old_postion.y + button.height) then + MoveCardindex = -1 + MoveCardPos = card.index_X + MoveCardY = _cv.index_Y + MoveCard = true + list_remove(self.card_list, card) + --向上移動 + elseif ((button.y + button.height / 2) - 20) < card.old_postion.y then + MoveCardindex = 1 + MoveCardPos = card.index_X + MoveCardY = _cv.index_Y + MoveCard = true + list_remove(self.card_list, card) + end + elseif i == #CountCards[card.index_X] and button.y + button.height / 2 < _cv.btn_card.y then + MoveCardindex = 1 + MoveCardPos = card.index_X + MoveCardY = _cv.index_Y + MoveCard = true + list_remove(self.card_list, card) + elseif i == 1 and button.y + button.height / 2 > (_cv.btn_card.y + button.width) then + MoveCardindex = -1 + MoveCardPos = card.index_X + MoveCardY = _cv.index_Y + MoveCard = true + list_remove(self.card_list, card) end end end end - end - if MoveCard ==true and MoveCardindex ==0 then + print("lingmeng end", MoveCard, MoveCardindex) + if MoveCard == true and MoveCardindex == 0 then local num = 0 - for i=1,#self.card_list do + for i = 1, #self.card_list do if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then - self.card_list[i].index_Y = self.card_list[i].index_Y - 1 + self.card_list[i].index_Y = self.card_list[i].index_Y - 1 end if card.index_X == self.card_list[i].index_X then - num = num+1 + num = num + 1 end end - if num ==0 then - for i=1,#self.card_list do - if self.card_list[i].index_X > card.index_X then - self.card_list[i].index_X = self.card_list[i].index_X - 1 - end + if num == 0 then + for i = 1, #self.card_list do + if self.card_list[i].index_X > card.index_X then + self.card_list[i].index_X = self.card_list[i].index_X - 1 + end end if MoveCardPos > card.index_X then - MoveCardPos = MoveCardPos-1 + MoveCardPos = MoveCardPos - 1 end end - card.index_X =MoveCardPos - card.index_Y =MoveCardY - for i=#self.card_list,1,-1 do + card.index_X = MoveCardPos + card.index_Y = MoveCardY + for i = #self.card_list, 1, -1 do if MoveCardPos == self.card_list[i].index_X then - table.insert(self.card_list,(i+1),card) + table.insert(self.card_list, (i + 1), card) break end end isChangeCard = true - --上下移动 - elseif MoveCard ==true and MoveCardindex ~= 0 then - for i=1,#self.card_list do - if card.index_X == self.card_list[i].index_X then + --上下移动 + elseif MoveCard == true and MoveCardindex ~= 0 then + for i = 1, #self.card_list do + if card.index_X == self.card_list[i].index_X then --向下移动 if MoveCardindex == -1 then - if self.card_list[i].index_Y < card.index_Y and self.card_list[i].index_Y >= MoveCardY then + if self.card_list[i].index_Y < card.index_Y and self.card_list[i].index_Y >= MoveCardY then self.card_list[i].index_Y = self.card_list[i].index_Y + 1 - end - --向上移动 + --向上移动 else - if self.card_list[i].index_Y > card.index_Y and self.card_list[i].index_Y <= MoveCardY then - self.card_list[i].index_Y = self.card_list[i].index_Y - 1 - + if self.card_list[i].index_Y > card.index_Y and self.card_list[i].index_Y <= MoveCardY then + self.card_list[i].index_Y = self.card_list[i].index_Y - 1 end end end end - card.index_X =MoveCardPos - card.index_Y =MoveCardY - for i=#self.card_list,1,-1 do - if MoveCardPos == self.card_list[i].index_X and self.card_list[i].index_Y == (MoveCardY-1) then - table.insert(self.card_list,(i+1),card) + card.index_X = MoveCardPos + card.index_Y = MoveCardY + for i = #self.card_list, 1, -1 do + if MoveCardPos == self.card_list[i].index_X and self.card_list[i].index_Y == (MoveCardY - 1) then + table.insert(self.card_list, (i + 1), card) break - elseif MoveCardPos == self.card_list[i].index_X and self.card_list[i].index_Y == (MoveCardY+1) then - table.insert(self.card_list,i,card) + elseif MoveCardPos == self.card_list[i].index_X and self.card_list[i].index_Y == (MoveCardY + 1) then + table.insert(self.card_list, i, card) break end end @@ -251,187 +249,170 @@ function M:__OnDragEnd(context) isChangeCard = false self._area_handcard_list:AddChild(button) end - - end + end self:UpdateHandCardsPos() - if isChangeCard ==true then + if isChangeCard == true then self:SendChangeCard() end end end -function M:UpdateOutCardList(outcard,isShow,isMopai,seat) - if(isShow == nil) then - isShow = false +function M:UpdateOutCardList(outcard, isShow, isMopai, seat) + if (isShow == nil) then + isShow = false end - if(isMopai == nil) then - isMopai = false + if (isMopai == nil) then + isMopai = false end - self._area_outcard_list:RemoveChildren(0,-1,true) - local outcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Gcm_OutCard") - - if outcard==0 then - --outcards:GetChild("icon").icon ="ui://Main_RunBeard/202_1_300" + self._area_outcard_list:RemoveChildren(0, -1, true) + local outcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Gcm_OutCard") + + if outcard == 0 then + --outcards:GetChild("icon").icon ="ui://Main_RunBeard/202_1_300" else - outcards:GetChild("icon").icon =self:getCardItem("ui://Main_RunBeard/203_",outcard) + outcards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/203_", outcard) end - outcards.x,outcards.y = 0,0 - local show_di_bg = outcards:GetChild("show_di_bg") + outcards.x, outcards.y = 0, 0 + local show_di_bg = outcards:GetChild("show_di_bg") --show_di_bg.visible = true - if(isShow)then - if outcard == 0 then - show_di_bg.visible = false - end - if(seat ~= nil and outcards~=nil)then - if(isMopai)then - if outcard ~= 0 then - outcards:GetTransition("mopai"..seat):Play(function( ) - -- show_di_bg.visible = true - - end) - end + if (isShow) then + if outcard == 0 then + show_di_bg.visible = false + end + if (seat ~= nil and outcards ~= nil) then + if (isMopai) then + if outcard ~= 0 then + outcards:GetTransition("mopai" .. seat):Play(function() + -- show_di_bg.visible = true + end) + end else - show_di_bg.visible = false - outcards:GetTransition("cpai"..seat):Play() + show_di_bg.visible = false + outcards:GetTransition("cpai" .. seat):Play() end - else - --show_di_bg.visible = true - end + else + --show_di_bg.visible = true + end else - show_di_bg.visible = false + show_di_bg.visible = false end self._area_outcard_list:AddChild(outcards) end --弃牌 -function M:UpdateQiPai( qi_list,isplay) - self._area_qipai_list:RemoveChildren(0,-1,true) - for i=1,#qi_list do - local qicards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Qipai") - qicards:GetChild("icon").icon =self:getCardItem("ui://Main_RunBeard/202_",qi_list[i]) - if(isplay)then - if(i == #qi_list) then - qicards:GetTransition("t0"):Play() +function M:UpdateQiPai(qi_list, isplay) + self._area_qipai_list:RemoveChildren(0, -1, true) + for i = 1, #qi_list do + local qicards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Qipai") + qicards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/202_", qi_list[i]) + if (isplay) then + if (i == #qi_list) then + qicards:GetTransition("t0"):Play() end - end - self._area_qipai_list:AddChild(qicards) - end + end + self._area_qipai_list:AddChild(qicards) + end end --摸牌动画 -function M:PlayingOutCardAnima( card) +function M:PlayingOutCardAnima(card) coroutine.start(function() - coroutine.wait(0.1) - -- self._bgview.selectedIndex = 1 + coroutine.wait(0.1) + -- self._bgview.selectedIndex = 1 self:ClearOutCard() end) end -function M:UpdateFzList( fz_list ,ispaly) - +function M:UpdateFzList(fz_list, ispaly) --printlog("UpdateFzList area_fz_list2") - self._area_fz_list:RemoveChildren(0,-1,true) - for i = 1,#fz_list do - local fzitem=nil + self._area_fz_list:RemoveChildren(0, -1, true) + for i = 1, #fz_list do + local fzitem = nil if fz_list[i].type ~= RB_FZType.Kan then - fzitem =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/ComponentNew") - if(ispaly == false)then - fzitem:RemoveChildren(0,-1,true) + fzitem = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/ComponentNew") + if (ispaly == false) then + fzitem:RemoveChildren(0, -1, true) end end - + if fz_list[i].type == RB_FZType.Chi or fz_list[i].type == RB_FZType.Bi then - - local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") - fzcards:GetChild("card_"..1).icon = self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].active_card) + local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + fzcards:GetChild("card_" .. 1).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].active_card) fzcards:GetController("c2").selectedIndex = 1 - fzcards:GetChild("card_"..2).icon = self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].opcard[1]) - fzcards:GetChild("card_"..3).icon = self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].opcard[2]) - fzcards.x,fzcards.y = 0,0 - - self:playAnim(fzitem,fzcards,#fz_list,i,ispaly) + fzcards:GetChild("card_" .. 2).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].opcard[1]) + fzcards:GetChild("card_" .. 3).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].opcard[2]) + fzcards.x, fzcards.y = 0, 0 + self:playAnim(fzitem, fzcards, #fz_list, i, ispaly) elseif fz_list[i].type == RB_FZType.Peng then - - local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") - for j=1,3 do - fzcards:GetChild("card_"..j).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + for j = 1, 3 do + fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card) end - fzcards.x,fzcards.y = 0,0 - self:playAnim(fzitem,fzcards,#fz_list,i,ispaly) - + fzcards.x, fzcards.y = 0, 0 + self:playAnim(fzitem, fzcards, #fz_list, i, ispaly) elseif fz_list[i].type == RB_FZType.Wei then - - local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") - fzcards:GetController("c1").selectedIndex=1 - for j=1,3 do - if j==1 then - fzcards:GetChild("card_"..j).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + fzcards:GetController("c1").selectedIndex = 1 + for j = 1, 3 do + if j == 1 then + fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card) else - fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300" + fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300" end end - fzcards.x,fzcards.y = 0,0 - self:playAnim(fzitem,fzcards,#fz_list,i,ispaly) + fzcards.x, fzcards.y = 0, 0 + self:playAnim(fzitem, fzcards, #fz_list, i, ispaly) elseif fz_list[i].type == RB_FZType.ChouWei then - local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") - for j=1,2 do - fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300" + local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") + for j = 1, 2 do + fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300" end - fzcards:GetChild("card_"..3).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) - fzcards.x,fzcards.y = 0,0 - self:playAnim(fzitem,fzcards,#fz_list,i,ispaly) - + fzcards:GetChild("card_" .. 3).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card) + fzcards.x, fzcards.y = 0, 0 + self:playAnim(fzitem, fzcards, #fz_list, i, ispaly) elseif fz_list[i].type == RB_FZType.Pao then - - local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4") - for j=1,4 do - fzcards:GetChild("card_"..j).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4") + for j = 1, 4 do + fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card) end - fzcards.x,fzcards.y = 0,0 - self:playAnim(fzitem,fzcards,#fz_list,i,ispaly) - + fzcards.x, fzcards.y = 0, 0 + self:playAnim(fzitem, fzcards, #fz_list, i, ispaly) elseif fz_list[i].type == RB_FZType.Ti then - - local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4") - for j=1,4 do - if j==1 then - fzcards:GetChild("card_"..j).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) + local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4") + for j = 1, 4 do + if j == 1 then + fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card) else - fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300" + fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300" end end - fzcards.x,fzcards.y = 0,0 - self:playAnim(fzitem,fzcards,#fz_list,i,ispaly) - + fzcards.x, fzcards.y = 0, 0 + self:playAnim(fzitem, fzcards, #fz_list, i, ispaly) end end - - end - -function M:playAnim( fzitem,fzcards, size,i,ispaly ) - if(ispaly == nil)then - ispaly =false - end - if(ispaly and i == size)then - local faArray= fzitem:GetChild("chiwei") - if(faArray~=nil)then - faArray:AddChild(fzcards) - else - fzitem:AddChild(fzcards) - end - else - fzitem:AddChild(fzcards) - end - self._area_fz_list:AddChild(fzitem) +function M:playAnim(fzitem, fzcards, size, i, ispaly) + if (ispaly == nil) then + ispaly = false + end + if (ispaly and i == size) then + local faArray = fzitem:GetChild("chiwei") + if (faArray ~= nil) then + faArray:AddChild(fzcards) + else + fzitem:AddChild(fzcards) + end + else + fzitem:AddChild(fzcards) + end + self._area_fz_list:AddChild(fzitem) end - - --出牌提示动画 - function M:ChuPaiTiShi() - if DataManager.CurrenRoom ==nil or DataManager.CurrenRoom.self_player ==nil then +--出牌提示动画 +function M:ChuPaiTiShi() + if DataManager.CurrenRoom == nil or DataManager.CurrenRoom.self_player == nil then return end local chu_player = DataManager.CurrenRoom.self_player @@ -442,31 +423,30 @@ end selfplayeTable.paoCount = chu_player.paoCount selfplayeTable.hu_xi = chu_player.hu_xi local player = membe_deep_clone(selfplayeTable) - local mark_ting= {} - for i=1,#DataManager.CurrenRoom.self_player.handcard_list do - local card = DataManager.CurrenRoom.self_player.handcard_list[i] + local mark_ting = {} + for i = 1, #DataManager.CurrenRoom.self_player.handcard_list do + local card = DataManager.CurrenRoom.self_player.handcard_list[i] list_remove(player.handcard_list, card) local _player = membe_deep_clone(player) - local tingList = CardCheck.tingPai(_player,DataManager.CurrenRoom) + local tingList = CardCheck.tingPai(_player, DataManager.CurrenRoom) local isKan = false - for j=1,#player.fz_list do + for j = 1, #player.fz_list do if card == player.fz_list[j].card and player.fz_list[j].type == RB_FZType.Kan then - isKan =true + isKan = true end end if #tingList > 0 and isKan == false then - - mark_ting[#mark_ting+1] = card + mark_ting[#mark_ting + 1] = card end table.insert(player.handcard_list, card) - table.sort( player.handcard_list, ViewUtil.HandCardSort) + table.sort(player.handcard_list, ViewUtil.HandCardSort) end - if DataManager.CurrenRoom.curren_outcard_seat == DataManager.CurrenRoom.self_player.seat then - self._view :GetController("chupai").selectedIndex =1 - if #mark_ting>0 then - for i=1,#mark_ting do - for k=1,#self.card_list do - local card_view= self.card_list[k] + if DataManager.CurrenRoom.curren_outcard_seat == DataManager.CurrenRoom.self_player.seat then + self._view:GetController("chupai").selectedIndex = 1 + if #mark_ting > 0 then + for i = 1, #mark_ting do + for k = 1, #self.card_list do + local card_view = self.card_list[k] if card_view.card_item == mark_ting[i] then card_view.btn_card:GetController("mark_ting").selectedIndex = 1 end @@ -474,13 +454,12 @@ end end end else - self._view :GetController("chupai").selectedIndex =0 - for k=1,#self.card_list do - local card_view= self.card_list[k] + self._view:GetController("chupai").selectedIndex = 0 + for k = 1, #self.card_list do + local card_view = self.card_list[k] card_view.btn_card:GetController("mark_ting").selectedIndex = 0 - end end end -return M \ No newline at end of file +return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPCardView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPCardView.lua index c1926c94..82a56410 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPCardView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPCardView.lua @@ -1,5 +1,3 @@ - - local M = { btn_card = nil, card_item = 0, @@ -13,7 +11,7 @@ local M = { function M.InitCardView(card_code, index_X, index_Y, type) -- setmetatable(M, {__index = CardView}) - local self = setmetatable({}, {__index = M}) + local self = setmetatable({}, { __index = M }) self._room = DataManager.CurrenRoom self.btn_card = self:InitUI(card_code, type) self.card_item = card_code @@ -64,7 +62,7 @@ function M:getCardSize() if self._room.change_card_size ~= nil then return self._room.change_card_size else - return 1 + return 1.2 end end @@ -111,10 +109,10 @@ end function M:UpdateScale() local size = self._room.change_card_size - -- card_view.btn_card:GetChild("icon").icon = self:getHandCardItem("ui://Main_RunBeard/201_", card_view.card_item) - self.icon:SetScale(size, size) - self.btn_card:GetChild("n6"):SetScale(size, size) - -- self:getCardWidth() + -- card_view.btn_card:GetChild("icon").icon = self:getHandCardItem("ui://Main_RunBeard/201_", card_view.card_item) + self.icon:SetScale(size, size) + self.btn_card:GetChild("n6"):SetScale(size, size) + -- self:getCardWidth() end return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPMainView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPMainView.lua index c72fde90..0aeb7e6d 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPMainView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPMainView.lua @@ -8,7 +8,7 @@ local M = { default_btn = false } -setmetatable(M, {__index = MainView}) +setmetatable(M, { __index = MainView }) local default_bg = 1 @@ -31,7 +31,7 @@ function M:InitView(url, isdisplay, open_social, change_card_size, qihu) else self._view:GetChild('di_text').text = self._room.room_config:GetGameName() .. ' ' .. qihu .. '胡息1起' end - + self._view:GetController('bg_state').selectedIndex = id - 1 end self.cd_time = 0 @@ -90,11 +90,11 @@ function M:InitView(url, isdisplay, open_social, change_card_size, qihu) local typeface = _data['game_cardsize'] local _gamectr = self._gamectr if typeface == 0 then - self._room.change_card_size = 1.2 + self._room.change_card_size = 1.4 elseif typeface == 1 then - self._room.change_card_size = 1 + self._room.change_card_size = 1.2 elseif typeface == 2 then - self._room.change_card_size = 0.8 + self._room.change_card_size = 1.2 end else self._room.change_card_size = change_card_size @@ -126,7 +126,7 @@ function M:InitView(url, isdisplay, open_social, change_card_size, qihu) self._room.fangyan_typeface = typeface end end ---printlog("OneventResultinit3") + --printlog("OneventResultinit3") local _player_card_info = self._player_card_info for i = 1, _room.room_config.people_num do local tem = self._view:GetChild('player_card_info' .. i) @@ -160,9 +160,9 @@ function M:InitView(url, isdisplay, open_social, change_card_size, qihu) self._ctr_action = self._view:GetController('action') if _room.banker_seat == _room.self_player.seat and readyNum > 1 and readyNum == _room.room_config.people_num then elseif not _room.self_player.ready then - local round=DataManager.CurrenRoom.room_config.config.times or 1 - local xpconfig=DataManager.CurrenRoom.room_config.config.xi_pai - --[[if xpconfig then + local round = DataManager.CurrenRoom.room_config.config.times or 1 + local xpconfig = DataManager.CurrenRoom.room_config.config.xi_pai + --[[if xpconfig then if round>1 then self._ctr_action.selectedIndex = 1 else @@ -173,7 +173,6 @@ function M:InitView(url, isdisplay, open_social, change_card_size, qihu) self._ctr_action.selectedIndex = 1 end]] self._ctr_action.selectedIndex = 2 - else self._ctr_action.selectedIndex = 0 end @@ -182,75 +181,70 @@ function M:InitView(url, isdisplay, open_social, change_card_size, qihu) --printlog("OneventResultinit6") self:showBackBtnView() --printlog("OneventResultinit7") - self:InitXiPai() + self:InitXiPai() --printlog("OneventResultinit8") - self:InitXiPai1() + self:InitXiPai1() --printlog("OneventResultinit9") end function M:InitXiPai() - self._xipaiPanel = UIPackage.CreateObjectFromURL("ui://Common/panel_handzipai02") - self._root_view:AddChild(self._xipaiPanel) - - local offset = get_offset(self._full_offset) + self._xipaiPanel = UIPackage.CreateObjectFromURL("ui://Common/panel_handzipai02") + self._root_view:AddChild(self._xipaiPanel) + + local offset = get_offset(self._full_offset) self._xipaiPanel.width = GRoot.inst.width - (offset * 2) self._xipaiPanel.height = GRoot.inst.height self._xipaiPanel.x = offset - - self._xipaiPanel.visible=false - --self:PlayXiPai() + + self._xipaiPanel.visible = false + --self:PlayXiPai() end function M:PlayXiPai(xipaiCallBack) - if self._xipaiPanel then - coroutine.start(function() - self._xipaiPanel.visible=true - self._xipaiPanel:GetTransition("XiPai"):Play() - coroutine.wait(3.5) - self._xipaiPanel.visible=false - if xipaiCallBack then - xipaiCallBack() - end - end) - - - end + if self._xipaiPanel then + coroutine.start(function() + self._xipaiPanel.visible = true + self._xipaiPanel:GetTransition("XiPai"):Play() + coroutine.wait(3.5) + self._xipaiPanel.visible = false + if xipaiCallBack then + xipaiCallBack() + end + end) + end end function M:InitXiPai1() - self._xipaiPanel1 = UIPackage.CreateObjectFromURL("ui://Common/panel_handzipai03") - self._root_view:AddChild(self._xipaiPanel1) - - local offset = get_offset(self._full_offset) + self._xipaiPanel1 = UIPackage.CreateObjectFromURL("ui://Common/panel_handzipai03") + self._root_view:AddChild(self._xipaiPanel1) + + local offset = get_offset(self._full_offset) self._xipaiPanel1.width = GRoot.inst.width - (offset * 2) self._xipaiPanel1.height = GRoot.inst.height self._xipaiPanel1.x = offset - - self._xipaiPanel1.visible=false - --self:PlayXiPai() + + self._xipaiPanel1.visible = false + --self:PlayXiPai() end function M:PlayXiPai1(xipaiCallBack) - if self._xipaiPanel1 then - coroutine.start(function() - self._xipaiPanel1.visible=true - self._xipaiPanel1:GetTransition("XiPai"):Play() - coroutine.wait(3.5) - self._xipaiPanel1.visible=false - if xipaiCallBack then - xipaiCallBack() - end - end) - - - end + if self._xipaiPanel1 then + coroutine.start(function() + self._xipaiPanel1.visible = true + self._xipaiPanel1:GetTransition("XiPai"):Play() + coroutine.wait(3.5) + self._xipaiPanel1.visible = false + if xipaiCallBack then + xipaiCallBack() + end + end) + end end - function M:NewSettingView(cardIndex) - local settingView = ZPSettingView.new(self._view, 2, self.default_btn,cardIndex) + local settingView = ZPSettingView.new(self._view, 2, self.default_btn, cardIndex) settingView:FillBgSection( function(url) LoadGameBg(url, self._root_view) @@ -307,12 +301,13 @@ end -- 设置 更新 手牌大小 function M:UpdateCardSize(index) + print("lingmeng UpdateCardSize") if index == 0 then - self._room.change_card_size = 1.2 + self._room.change_card_size = 1.4 elseif index == 1 then - self._room.change_card_size = 1 + self._room.change_card_size = 1.2 elseif index == 2 then - self._room.change_card_size = 0.8 + self._room.change_card_size = 1.2 end local info = self._player_card_info[1] info:UpdateCardSize() @@ -322,10 +317,11 @@ end function M:UpdateFangyan(index) self._room.fangyan_typeface = index end + --刷新手牌排列 按钮 三种 排列方法 在 PendulumRule 里 function M:ResetHandCard(...) local btn_reset = self._view:GetChild('btn_reset') - --btn_reset.visible=false + --btn_reset.visible=false btn_reset.onClick:Set( function(...) if self._popEvent == false then @@ -354,7 +350,7 @@ function M:ResetHandCard(...) Utils.SaveLocalFile(key, json.encode(_data)) local x = _data['index'] local card_info = self._player_card_info[1] - ----printlog("1111111111111111111111111",x) + ----printlog("1111111111111111111111111",x) card_info:InitHandCard(false, x) end ) @@ -363,7 +359,7 @@ end function M:showBackBtnView() local btn_back_lobby = self._view:GetChild('btn_back_lobby') local btn_jiesan_lobby1 = self._view:GetChild('Btn_jiesan_lobby') - --btn_jiesan_lobby1.displayObject.gameObject:SetActive(false) + --btn_jiesan_lobby1.displayObject.gameObject:SetActive(false) --btn_jiesan_lobby1:GetChild("n8").displayObject.gameObject:SetActive(false) if (btn_jiesan_lobby1 ~= nil) then btn_jiesan_lobby1.onClick:Set( @@ -391,20 +387,21 @@ function M:onDisBandTimer() end self.cd_coroutine = coroutine.start( - function() - while (self.cd_time > 0) do - self.cd_time = self.cd_time - 1 - self.cd_time = math.max(0, self.cd_time) - if self.cd_time > 0 then - coroutine.wait(1) + function() + while (self.cd_time > 0) do + self.cd_time = self.cd_time - 1 + self.cd_time = math.max(0, self.cd_time) + if self.cd_time > 0 then + coroutine.wait(1) + end end end - end - ) + ) end function M:Destroy() UIPackage.RemovePackage('base/main_zipai/ui/Main_RunBeard') MainView.Destroy(self) end + return M diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerSelfCardInfoView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerSelfCardInfoView.lua index 234c5ec4..df3917be 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerSelfCardInfoView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerSelfCardInfoView.lua @@ -211,11 +211,13 @@ function M:InitHandCard(isPlayAni, index) for j = 1, #pokerList[i] do local card_code = pokerList[i][j] local btn_card = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Btn_Card') + print("lingmeng", self._room.change_card_display, card_code) btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_code) btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize()) btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize()) - self.card_width = 95 * self:getCardSize() - self.card_hight = 123 * self:getCardSize() + btn_card:GetChild('n9'):SetScale(self:getCardSize(), self:getCardSize()) + self.card_width = btn_card.width * self:getCardSize() + self.card_hight = btn_card.height * self:getCardSize() local x, y = 500, (j * 85) - 500 btn_card:SetXY(x, y) self._area_handcard_list:AddChild(btn_card) @@ -259,11 +261,14 @@ function M:InitHandCard(isPlayAni, index) for j = 1, #pokerList[i] do local card_code = pokerList[i][j] local btn_card = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Btn_Card') + print("lingmeng", self._room.change_card_display, card_code) + btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_code) btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize()) btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize()) - self.card_width = 95 * self:getCardSize() - self.card_hight = 123 * self:getCardSize() + btn_card:GetChild('n9'):SetScale(self:getCardSize(), self:getCardSize()) + self.card_width = btn_card.width * self:getCardSize() + self.card_hight = btn_card.height * self:getCardSize() self._area_handcard_list:AddChild(btn_card) self._area_handcard_list:SetChildIndex(btn_card, 5 - j) local card_view = NewCardView(btn_card, card_code, i, j) @@ -310,8 +315,8 @@ function M:UpdateHandCards(list) btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_code) btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize()) btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize()) - self.card_width = 87 * self:getCardSize() - self.card_hight = 110 * self:getCardSize() + self.card_width = btn_card.width * self:getCardSize() + self.card_hight = btn_card.height * self:getCardSize() local card_view = NewCardView(btn_card, card_code, list[i].index_X, list[i].index_Y) --存牌堆 self.card_list[#self.card_list + 1] = card_view @@ -368,8 +373,7 @@ function M:onTouchBegin(context) self:ShowHuTip(card.card_item) end card.btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/203_', card.card_item) - -- card.btn_card.sortingOrder = 100 - + -- card.btn_card.sortingOrder = 100 local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y)) card.btn_card.xy = Vector2.New(card.btn_card.x + 20, card.btn_card.y - 50) card.touch_pos = xy - button.xy @@ -380,6 +384,7 @@ function M:onTouchMove(context) local card = button.data local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y)) button.xy = xy - card.touch_pos + print("lingmeng", xy.x, xy.y) end --出牌提示动画 @@ -461,7 +466,7 @@ function M:UpdateHandCardsPos() card_view.btn_card:RemoveFromParent() self._area_handcard_list:AddChild(card_view.btn_card) card_view.old_postion = self:GetHandCardPos(card_view, #CountCards) - card_view.btn_card:TweenMove(card_view.old_postion, 0.3) + card_view.btn_card:TweenMove(card_view.old_postion, 0.2) end self:ShowHuTip() end @@ -477,13 +482,17 @@ function M:UpdateCardDisplay() local card_view = self.card_list[i] card_view.btn_card:RemoveFromParent() card_view.btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_view.card_item) + self.card_width = card_view.btn_card.width * self:getCardSize() + self.card_hight = card_view.btn_card.height * self:getCardSize() self._area_handcard_list:AddChild(card_view.btn_card) - card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, #CountCards), 0.3) + -- card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, #CountCards), 0.3) end + self:UpdateHandCardsPos() end --更新手牌大小 function M:UpdateCardSize() + print("lingmeng UpdateCardSize") local CountCards = {} for i = 1, #self.card_list do CountCards[self.card_list[i].index_X] = @@ -495,11 +504,12 @@ function M:UpdateCardSize() card_view.btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_view.card_item) card_view.btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize()) card_view.btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize()) - self.card_width = 87 * self:getCardSize() - self.card_hight = 110 * self:getCardSize() + self.card_width = card_view.btn_card.width * self:getCardSize() + self.card_hight = card_view.btn_card.height * self:getCardSize() self._area_handcard_list:AddChild(card_view.btn_card) - card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, #CountCards), 0.3) + -- card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, #CountCards), 0.3) end + self:UpdateHandCardsPos() end function M:UpdateIsOnClick(isOut) @@ -509,6 +519,7 @@ end -- 结束 拖拽事件 -- 根据牌结束点的位置 判断是出牌还是调整位置 button.xy 和 牌的xy比较 function M:__OnDragEnd(context) + print("lingmeng buyaojina __OnDragEnd") if DataManager.CurrenRoom == nil or DataManager.CurrenRoom.self_player == nil then return end @@ -764,13 +775,15 @@ function M:GetHandCardPos(cards_view, cards) local start_x = middle_x - (cards / 2 * (card_width)) x = start_x + (card_width) * (cards_view.index_X - 1) - if self:getCardSize() == 1 then - y = 90 - (85 * cards_view.index_Y) - elseif self:getCardSize() == 1.2 then - y = 90 - (110 * cards_view.index_Y) - elseif self:getCardSize() == 0.8 then - y = 100 - (65 * cards_view.index_Y) - end + local card_height = self.card_hight + y = 90 - card_height * 0.66 * cards_view.index_Y + -- if self:getCardSize() == 1.4 then + -- y = 90 - (85 * cards_view.index_Y) + -- elseif self:getCardSize() == 1.2 then + -- y = 90 - (110 * cards_view.index_Y) + -- elseif self:getCardSize() == 0.8 then + -- y = 100 - (65 * cards_view.index_Y) + -- end return Vector2.New(x, y) end @@ -858,7 +871,7 @@ end --出牌 function M:UpdateOutCardList(outcard) - printlog("UpdateOutCardListss"..outcard) + printlog("UpdateOutCardListss" .. outcard) self._area_outcard_list:RemoveChildren(0, -1, true) local outcards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Gcm_OutCard') if outcard == 0 then @@ -910,7 +923,7 @@ function M:getCardSize() if self._room.change_card_size ~= nil then return self._room.change_card_size else - return 1 + return 1.2 end end diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPSettingView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPSettingView.lua index 7a049228..77e78793 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPSettingView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPSettingView.lua @@ -15,10 +15,10 @@ local ZPSettingView = { } local M = ZPSettingView -function ZPSettingView.new(blur_view, index, open_social,cardIndex) - setmetatable(SettingView, {__index = BaseWindow}) - setmetatable(M, {__index = SettingView}) - local self = setmetatable({}, {__index = M}) +function ZPSettingView.new(blur_view, index, open_social, cardIndex) + setmetatable(SettingView, { __index = BaseWindow }) + setmetatable(M, { __index = SettingView }) + local self = setmetatable({}, { __index = M }) self.class = 'ZPSettingView' self._currenIndex = 0 self._blur_view = blur_view @@ -27,13 +27,13 @@ function ZPSettingView.new(blur_view, index, open_social,cardIndex) self.cd_time = 0 self._btn_dismiss_room_enable = false self._close_destroy = true - self.bigSize = 1.2 - self.mediumSize = 1 - self.smallSize = 0.8 + self.bigSize = 1.4 + self.mediumSize = 1.2 + self.smallSize = 1.2 self._full = true self._anim_pop = 2 self._open_social = open_social - self._cardType=cardIndex + self._cardType = cardIndex self:init('ui://Main_RunBeard/New_SettingWindow') return self end @@ -72,13 +72,12 @@ function M:init(url) local room = DataManager.CurrenRoom local c1 = self._view:GetController('cards') - if self._cardType then - c1.selectedIndex = self._cardType - end - + if self._cardType then + c1.selectedIndex = self._cardType + end + local size = self._view:GetController('size') if room.change_card_size ~= nil then - if room.change_card_size == self.bigSize then size.selectedIndex = 0 elseif room.change_card_size == self.mediumSize then @@ -235,6 +234,7 @@ function M:Show() self:UpdateIndex() self:UpdateCardSizeIndex() end + --根据存的数据改变设置里面的控制器 function M:UpdateIndex() @@ -257,6 +257,7 @@ function M:UpdateIndex() end end end + function M:UpdateCardSizeIndex() local room = DataManager.CurrenRoom local size = self._view:GetController('size') @@ -321,6 +322,7 @@ function M:FillBgSection(cb, game_id, default_bg, room, qihu) end end end + function M:Destroy() local bg_id = self._view:GetController('bg').selectedIndex + 1 if self._bg ~= bg_id then diff --git a/wb_new_ui/.objs/metas/v6yvqp7w/voqg1dy.info b/wb_new_ui/.objs/metas/v6yvqp7w/voqg1dy.info new file mode 100644 index 00000000..4de2595d --- /dev/null +++ b/wb_new_ui/.objs/metas/v6yvqp7w/voqg1dy.info @@ -0,0 +1,19 @@ +{ + "objectStatus": { + "n50_mk2u": { + "collapsed": true + }, + "n46_mk2u": { + "hidden": true + }, + "n60_mk2u": { + "hidden": true + }, + "n45_mk2u": { + "hidden": true + }, + "n65_mk2u": { + "hidden": true + } + } +} \ No newline at end of file diff --git a/wb_new_ui/.objs/workspace.json b/wb_new_ui/.objs/workspace.json index e027424f..ead7b2b2 100644 --- a/wb_new_ui/.objs/workspace.json +++ b/wb_new_ui/.objs/workspace.json @@ -1,5 +1,5 @@ { - "libview.firstColumnWidth": 297, + "libview.firstColumnWidth": 522, "expanded_nodes": [ "27vd145b", "/", @@ -8,42 +8,36 @@ ], "libview.iconScale": 0, "doc.openedDocs": [ - "ui://2d9xdj6zfn7fao", - "ui://m7iejg4610snh5j", - "ui://m7iejg46kwi0hk0", - "ui://v0j9abjygq7m8f", - "ui://m7iejg46giw8hf7", - "ui://m7iejg46jiu8hef", - "ui://m7iejg46kwi0hma", - "ui://v6yvqp7wf55qwa", - "ui://v6yvqp7wf55qw5", - "ui://v6yvqp7wf55qvx", - "ui://m7iejg46kwi0hm5", - "ui://v6yvqp7wf55qw4", - "ui://2d9xdj6zm16m7dqt", - "ui://ppu1wv76j4mf9j", - "ui://ppu1wv76j4mf9k", - "ui://ppu1wv7699wej", - "ui://ppu1wv76j4mf9d", - "ui://ppu1wv76j4mf9e", - "ui://2d9xdj6zoviicm0" + "ui://v6yvqp7wyfzf1h4", + "ui://v6yvqp7wcyprwq", + "ui://v6yvqp7wlvh412c" ], "test.device": "720p Phone", "canvasColor": 10066329, "auxline2": true, - "doc.activeDoc": "ui://v0j9abjygq7m8f", + "doc.activeDoc": "ui://v6yvqp7wcyprwq", "libview.twoColumn": false, "libview.expandedNodes": [ - "v0j9abjy", - "/", - "v0j9abjy", - "/Main_style_2/", "v6yvqp7w", "/", "v6yvqp7w", "/component/", "v6yvqp7w", - "/image/" + "/component/cards/", + "v6yvqp7w", + "/component/option/", + "v6yvqp7w", + "/component/option/component/", + "v6yvqp7w", + "/component/option/component/card/", + "v6yvqp7w", + "/image/", + "v6yvqp7w", + "/images/", + "v6yvqp7w", + "/images/cards6/", + "v6yvqp7w", + "/images/cards8/" ], "auxline1": true, "snapToGrid": true, diff --git a/wb_new_ui/assets/Main_RunBeard/component/cards/Btn_Card.xml b/wb_new_ui/assets/Main_RunBeard/component/cards/Btn_Card.xml index 947cb958..3dfa477c 100644 --- a/wb_new_ui/assets/Main_RunBeard/component/cards/Btn_Card.xml +++ b/wb_new_ui/assets/Main_RunBeard/component/cards/Btn_Card.xml @@ -1,17 +1,20 @@ - + + - - + + - + +