From cbdb58101deab1f5de92791a2d87e15427875b02 Mon Sep 17 00:00:00 2001 From: 1076390229 <1076390229@qq.com> Date: Fri, 13 Mar 2026 19:24:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E4=BF=AE=20=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E7=89=8C=E5=9E=8B=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../changdepaohuzi/PlayerSelfCardInfoView.lua | 500 +++++++++--------- .../zipai/fanpaofa/PlayerCardInfoView.lua | 2 + .../zipai/fanpaofa/PlayerSelfCardInfoView.lua | 1 + .../fanpaofa/main/ZPPlayerCardInfoView.lua | 1 + .../main/ZPPlayerSelfCardInfoView.lua | 21 +- wb_new_ui/.objs/metas/lkq9ne9s/peuq5a.info | 10 + wb_new_ui/.objs/metas/lkq9ne9s/peuq9n.info | 4 +- wb_new_ui/.objs/workspace.json | 32 +- .../Main_RunBeard/component/Main/Main_2.xml | 8 +- .../Main/component/Player_card_info_1.xml | 4 +- .../Main/component/Player_card_info_2.xml | 2 +- .../component/cards/Gcm_OutCard.xml | 12 +- .../component/option/Pop_tip_choice.xml | 32 +- .../option/component/card/Btn_Card.xml | 6 +- ...af225cb-8a9a-47a2-bc29-3c7cb2ac1880.vsidx} | Bin 1383175 -> 1383175 bytes .../v17/DocumentLayout.backup.json | 55 +- .../.vs/wb_unity_pro/v17/DocumentLayout.json | 30 +- .../main_zipai/ui/Main_RunBeard_fui.bytes | Bin 178715 -> 178717 bytes 18 files changed, 381 insertions(+), 339 deletions(-) create mode 100644 wb_new_ui/.objs/metas/lkq9ne9s/peuq5a.info rename wb_unity_pro/.vs/wb_unity_pro/FileContentIndex/{f0703e66-a55a-4f57-9473-60da44cd2a3c.vsidx => aaf225cb-8a9a-47a2-bc29-3c7cb2ac1880.vsidx} (73%) diff --git a/lua_probject/extend_project/extend/zipai/changdepaohuzi/PlayerSelfCardInfoView.lua b/lua_probject/extend_project/extend/zipai/changdepaohuzi/PlayerSelfCardInfoView.lua index 245cf0d6..0d2e1884 100644 --- a/lua_probject/extend_project/extend/zipai/changdepaohuzi/PlayerSelfCardInfoView.lua +++ b/lua_probject/extend_project/extend/zipai/changdepaohuzi/PlayerSelfCardInfoView.lua @@ -1,10 +1,10 @@ local PlayerSelfCardInfoView = require("main.zipai.ZPPlayerSelfCardInfoView") local CardCheck = require("main.zipai.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,35 +13,33 @@ 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/203_", card.card_item) 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 -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) @@ -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,184 @@ 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 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 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) 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 + 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 _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 + 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,176 +245,162 @@ 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) + coroutine.wait(0.1) self:ClearOutCard() end) end -function M:UpdateFzList( fz_list ,ispaly) - self._area_fz_list:RemoveChildren(0,-1,true) - for i = 1,#fz_list do - local fzitem=nil +function M:UpdateFzList(fz_list, ispaly) + 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 - 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 + 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.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==4 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 == 4 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 @@ -431,32 +411,31 @@ 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 -- print("ChuPaiTiShi",#mark_ting,vardump(player)) - 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 @@ -464,13 +443,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/PlayerCardInfoView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/PlayerCardInfoView.lua index 5ad67010..d7287dae 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/PlayerCardInfoView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/PlayerCardInfoView.lua @@ -198,12 +198,14 @@ function M:UpdateOutCardList(outcard, isShow, isMopai, seat) seat = 3 end if (isMopai) then + print("摸牌动作1====="..seat) if outcard ~= 0 then outcards:GetTransition("mopai" .. seat):Play(function() -- show_di_bg.visible = true end) end else + print("出牌动作1----"..seat) show_di_bg.visible = false outcards:GetTransition("cpai" .. seat):Play() end diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/PlayerSelfCardInfoView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/PlayerSelfCardInfoView.lua index d5081e3b..67f4c6a5 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/PlayerSelfCardInfoView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/PlayerSelfCardInfoView.lua @@ -280,6 +280,7 @@ function M:UpdateOutCardList(outcard, isShow, isMopai, seat) show_di_bg.visible = false end if (seat ~= nil and outcards ~= nil) then + print("摸牌动作2=====" .. seat) if (isMopai) then if outcard ~= 0 then outcards:GetTransition("mopai" .. seat):Play(function() diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerCardInfoView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerCardInfoView.lua index e76ec9d2..111b5902 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerCardInfoView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerCardInfoView.lua @@ -244,6 +244,7 @@ function M:PlayingOutCardAnima(card, seat) self._area_outcard_list:AddChild(outcards) end outcards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/203_", card) + print("弃牌动作0000==" .. seat) outcards:GetTransition("qipai" .. seat):Play() end 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 3f3e6694..4bdf159d 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerSelfCardInfoView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPPlayerSelfCardInfoView.lua @@ -530,11 +530,11 @@ function M:UpdateOutLine() elseif self:getCardSize() == 1.6 then self._data_outLinePos = 90 - (152 * 3) elseif self:getCardSize() == 1.8 then - self._data_outLinePos = 90 - (170 * 3) + self._data_outLinePos = 135 - (170 * 3) elseif self:getCardSize() == 2 then - self._data_outLinePos = 110 - (195 * 3) + self._data_outLinePos = 160 - (195 * 3) end - self._view_outLine.y = self._data_outLinePos + self._area_handcard_list.height - 60 + self._view_outLine.y = self._data_outLinePos + self._area_handcard_list.height end function M:UpdateIsOnClick(isOut) @@ -795,7 +795,7 @@ end --计算手牌位置 function M:GetHandCardPos(cards_view, cards) local x, y = 0, 0 - local card_width = self.card_width - (self._room.change_card_display == "8_" and -2 or 5) -- 牌的宽度 + local card_width = self.card_width - (self._room.change_card_display == "8_" and -2 or 5) - 2 -- 牌的宽度 local middle_x = self._area_handcard_list.width / 2 local start_x = middle_x - (cards / 2 * (card_width)) @@ -804,19 +804,19 @@ function M:GetHandCardPos(cards_view, cards) -- local card_height = self.card_hight -- y = 90 - card_height * 0.66 * cards_view.index_Y if self:getCardSize() == 1.3 then - y = 90 - (119 * cards_view.index_Y) + y = 100 - (119 * cards_view.index_Y) elseif self:getCardSize() == 1.2 then - y = 90 - (110 * cards_view.index_Y) + y = 100 - (110 * cards_view.index_Y) elseif self:getCardSize() == 0.8 then y = 100 - (85 * cards_view.index_Y) elseif self:getCardSize() == 1.5 then - y = 90 - (137 * cards_view.index_Y) + y = 100 - (137 * cards_view.index_Y) elseif self:getCardSize() == 1.6 then - y = 90 - (147 * cards_view.index_Y) + y = 100 - (147 * cards_view.index_Y) elseif self:getCardSize() == 1.8 then - y = 90 - (164 * cards_view.index_Y) + y = 100 - (135 * cards_view.index_Y) elseif self:getCardSize() == 2 then - y = 90 - (182 * cards_view.index_Y) + y = 100 - (150 * cards_view.index_Y) end return Vector2.New(x, y) end @@ -939,6 +939,7 @@ function M:PlayingOutCardAnima(card, seat) self._area_outcard_list:AddChild(outcards) end outcards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/203_", card) + print("弃牌动作000.。==" .. seat) outcards:GetTransition("qipai" .. seat):Play() end diff --git a/wb_new_ui/.objs/metas/lkq9ne9s/peuq5a.info b/wb_new_ui/.objs/metas/lkq9ne9s/peuq5a.info new file mode 100644 index 00000000..4158e42f --- /dev/null +++ b/wb_new_ui/.objs/metas/lkq9ne9s/peuq5a.info @@ -0,0 +1,10 @@ +{ + "objectStatus": { + "n48_cphv": { + "collapsed": true + }, + "n45_j34t": { + "collapsed": true + } + } +} \ No newline at end of file diff --git a/wb_new_ui/.objs/metas/lkq9ne9s/peuq9n.info b/wb_new_ui/.objs/metas/lkq9ne9s/peuq9n.info index ad079af9..c81f3ce5 100644 --- a/wb_new_ui/.objs/metas/lkq9ne9s/peuq9n.info +++ b/wb_new_ui/.objs/metas/lkq9ne9s/peuq9n.info @@ -1,9 +1,9 @@ { "objectStatus": { - "n76_oqog": { + "n77_oqog": { "collapsed": true }, - "n77_oqog": { + "n66_j4og": { "collapsed": true } } diff --git a/wb_new_ui/.objs/workspace.json b/wb_new_ui/.objs/workspace.json index 5bb22121..7944ba0f 100644 --- a/wb_new_ui/.objs/workspace.json +++ b/wb_new_ui/.objs/workspace.json @@ -3,23 +3,21 @@ "libview.iconScale": 0, "doc.openedDocs": [ "ui://lkq9ne9speuq8b", - "ui://lkq9ne9speuq6p", "ui://lkq9ne9speuq5a", "ui://lkq9ne9speuq59", + "ui://lkq9ne9speuq6p", + "ui://lkq9ne9ssyh3rk", + "ui://lkq9ne9speuq3", + "ui://lkq9ne9speuq9d", "ui://lkq9ne9speuq9f", - "ui://lkq9ne9speuq9g", - "ui://lkq9ne9speuqcv", - "ui://lkq9ne9speuqc6", - "ui://lkq9ne9speuqao", - "ui://lkq9ne9speuq5b", - "ui://1utjt0r2ufu92i", - "ui://1utjt0r2ufu92s", - "ui://1utjt0r2ufu930" + "ui://lkq9ne9speuq9", + "ui://lkq9ne9speuqcu", + "ui://lkq9ne9speuq9n" ], "test.device": "Huawei Mate20", "canvasColor": 10066329, "auxline2": true, - "doc.activeDoc": "ui://lkq9ne9speuq6p", + "doc.activeDoc": "ui://lkq9ne9speuq9n", "libview.twoColumn": false, "libview.expandedNodes": [ "27vd145b", @@ -29,21 +27,9 @@ "lkq9ne9s", "/", "lkq9ne9s", - "/component/", - "lkq9ne9s", - "/component/Main/", - "lkq9ne9s", - "/component/Main/component/", - "lkq9ne9s", - "/component/option/", - "lkq9ne9s", - "/component/option/component/", - "lkq9ne9s", - "/component/option/component/choose/", + "/buttons/", "lkq9ne9s", "/images/", - "lkq9ne9s", - "/images/cards1/", "yzaioi79", "/", "yzaioi79", diff --git a/wb_new_ui/assets/Main_RunBeard/component/Main/Main_2.xml b/wb_new_ui/assets/Main_RunBeard/component/Main/Main_2.xml index f717b608..7e763a8c 100644 --- a/wb_new_ui/assets/Main_RunBeard/component/Main/Main_2.xml +++ b/wb_new_ui/assets/Main_RunBeard/component/Main/Main_2.xml @@ -31,6 +31,10 @@ + + + + @@ -100,10 +104,6 @@ - - - -