diff --git a/lua_probject/base_project/Game/ExtendHotupdate.lua b/lua_probject/base_project/Game/ExtendHotupdate.lua index d7ea7bec..7f8b7834 100644 --- a/lua_probject/base_project/Game/ExtendHotupdate.lua +++ b/lua_probject/base_project/Game/ExtendHotupdate.lua @@ -46,9 +46,9 @@ ExtendHotupdate = { -- 正常 VERSION_NORMAL = 0, -- 下载 - VERSION_DOWN = 0, + VERSION_DOWN = 1, -- 更新 - VERSION_UPDATE = 0, + VERSION_UPDATE = 2, } function ExtendHotupdate.UpdateGameList(list, callback) diff --git a/lua_probject/base_project/Game/View/PlayerInfoView2.lua b/lua_probject/base_project/Game/View/PlayerInfoView2.lua index cd36e4a4..c1390c95 100644 --- a/lua_probject/base_project/Game/View/PlayerInfoView2.lua +++ b/lua_probject/base_project/Game/View/PlayerInfoView2.lua @@ -190,7 +190,7 @@ function M:UpdateScore(score, doAnimation) self._tex_score.text = tostring(score) if doAnimation then - self:ScoreAnimation(lastScore - score) + self:ScoreAnimation(score - lastScore) end end diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua index 2fce60df..bb16c171 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua @@ -184,10 +184,13 @@ function M:UpdatePlayerInfoView() end function M:NewMJPlayerCardInfoView(view, index) + return MJMainView.NewMJPlayerCardInfoView(self, view, index) + --[[ if index == 1 then return MJPlayerSelfCardInfoView.new(view, self) end return MJPlayerCardInfoView.new(view, self) + ]] end function M:EventInit() diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua index f682eae2..24efda2a 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua @@ -160,6 +160,7 @@ function M:EventInit() info:MarkBank(p.seat == _room.banker_seat) info:Ready(false) local card_info = self._player_card_info[self:GetPos(p.seat)] + card_info:Clear() card_info:UpdateHandCardWitness() end end) @@ -342,10 +343,13 @@ function M:InitPlayerInfoView() end function M:NewMJPlayerCardInfoView(view, index) + return MJMainView.NewMJPlayerCardInfoView(self, view, index) + --[[ if index == 1 then return MJPlayerSelfCardInfoView.new(view, self) end return MJPlayerCardInfoView.new(view, self) + ]] end function M:RemoveCursor() diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua index 2c36ab8b..83f496e0 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua @@ -184,10 +184,13 @@ function M:UpdatePlayerInfoView() end function M:NewMJPlayerCardInfoView(view, index) + return MJMainView.NewMJPlayerCardInfoView(self, view, index) + --[[ if index == 1 then return MJPlayerSelfCardInfoView.new(view, self) end return MJPlayerCardInfoView.new(view, self) + ]] end function M:EventInit() @@ -238,6 +241,7 @@ function M:EventInit() info:MarkBank(p.seat == _room.banker_seat) info:Ready(false) local card_info = self._player_card_info[self:GetPos(p.seat)] + card_info:Clear() card_info:UpdateHandCard() end end) diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua index d6223c81..ba1f170d 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua @@ -159,6 +159,7 @@ function M:EventInit() info:MarkBank(p.seat == _room.banker_seat) info:Ready(false) local card_info = self._player_card_info[self:GetPos(p.seat)] + card_info:Clear() card_info:UpdateHandCardWitness() end end) @@ -341,10 +342,13 @@ function M:InitPlayerInfoView() end function M:NewMJPlayerCardInfoView(view, index) + return MJMainView.NewMJPlayerCardInfoView(self, view, index) + --[[ if index == 1 then return MJPlayerSelfCardInfoView.new(view, self) end return MJPlayerCardInfoView.new(view, self) + ]] end function M:RemoveCursor() diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua index 2678ba90..566dd0a5 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua @@ -183,10 +183,13 @@ function M:UpdatePlayerInfoView() end function M:NewMJPlayerCardInfoView(view, index) + return MJMainView.NewMJPlayerCardInfoView(self, view, index) + --[[ if index == 1 then return MJPlayerSelfCardInfoView.new(view, self) end return MJPlayerCardInfoView.new(view, self) + ]] end function M:EventInit() @@ -238,6 +241,7 @@ function M:EventInit() info:MarkBank(p.seat == _room.banker_seat) info:Ready(false) local card_info = self._player_card_info[self:GetPos(p.seat)] + card_info:Clear() card_info:UpdateHandCard() end end) diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXWitnessView.lua index 87ad2468..a9b6c4fe 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXWitnessView.lua @@ -184,6 +184,7 @@ function M:EventInit() info:MarkBank(p.seat == _room.banker_seat) info:Ready(false) local card_info = self._player_card_info[self:GetPos(p.seat)] + card_info:Clear() card_info:UpdateHandCardWitness() end end) @@ -366,10 +367,13 @@ function M:InitPlayerInfoView() end function M:NewMJPlayerCardInfoView(view, index) + return MJMainView.NewMJPlayerCardInfoView(self, view, index) + --[[ if index == 1 then return MJPlayerSelfCardInfoView.new(view, self) end return MJPlayerCardInfoView.new(view, self) + ]] end function M:RemoveCursor() diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua index 071cf20a..d0586b23 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua @@ -182,10 +182,13 @@ function M:UpdatePlayerInfoView() end function M:NewMJPlayerCardInfoView(view, index) + return MJMainView.NewMJPlayerCardInfoView(self, view, index) + --[[ if index == 1 then return MJPlayerSelfCardInfoView.new(view, self) end return MJPlayerCardInfoView.new(view, self) + ]] end function M:EventInit() @@ -236,6 +239,7 @@ function M:EventInit() info:MarkBank(p.seat == _room.banker_seat) info:Ready(false) local card_info = self._player_card_info[self:GetPos(p.seat)] + card_info:Clear() card_info:UpdateHandCard() end end) diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua index 5fe70e9a..a9df19b9 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua @@ -159,6 +159,7 @@ function M:EventInit() info:MarkBank(p.seat == _room.banker_seat) info:Ready(false) local card_info = self._player_card_info[self:GetPos(p.seat)] + card_info:Clear() card_info:UpdateHandCardWitness() end end) @@ -341,10 +342,13 @@ function M:InitPlayerInfoView() end function M:NewMJPlayerCardInfoView(view, index) + return MJMainView.NewMJPlayerCardInfoView(self, view, index) + --[[ if index == 1 then return MJPlayerSelfCardInfoView.new(view, self) end return MJPlayerCardInfoView.new(view, self) + ]] end function M:RemoveCursor() diff --git a/lua_probject/main_project/main/majiang/MJMainView.lua b/lua_probject/main_project/main/majiang/MJMainView.lua index 986bcc68..f5b59013 100644 --- a/lua_probject/main_project/main/majiang/MJMainView.lua +++ b/lua_probject/main_project/main/majiang/MJMainView.lua @@ -586,10 +586,33 @@ function M:PlayerChangeLineState() end function M:NewMJPlayerCardInfoView(view, index) - if index == 1 then - return MJPlayerSelfCardInfoView.new(view, self) + local infoView = {} + if self._room.room_config.people_num == 2 then + if index == 1 then + infoView = MJPlayerSelfCardInfoView.new(view, self, nil, "S") + elseif index == 2 then + infoView = MJPlayerCardInfoView.new(view, self, nil, "N") + end + elseif self._room.room_config.people_num == 3 then + if index == 1 then + infoView = MJPlayerSelfCardInfoView.new(view, self, nil, "S") + elseif index == 2 then + infoView = MJPlayerCardInfoView.new(view, self, nil, "E") + elseif index == 3 then + infoView = MJPlayerCardInfoView.new(view, self, nil, "N") + end + elseif self._room.room_config.people_num == 4 then + if index == 1 then + infoView = MJPlayerSelfCardInfoView.new(view, self, nil, "S") + elseif index == 2 then + infoView = MJPlayerCardInfoView.new(view, self, nil, "E") + elseif index == 3 then + infoView = MJPlayerCardInfoView.new(view, self, nil, "N") + elseif index == 4 then + infoView = MJPlayerCardInfoView.new(view, self, nil, "W") + end end - return MJPlayerCardInfoView.new(view, self) + return infoView end function M:RemoveCursor() @@ -677,7 +700,7 @@ function M:OnResult1(...) p.total_score = data[i].total_score local card_info = self._player_card_info[self:GetPos(p.seat)] local info = self._player_info[self:GetPos(p.seat)] - card_info:Clear() + --card_info:Clear() card_info:ResetCardType() if _room:checkHpNonnegative() then p.cur_hp = data[i].total_score @@ -698,7 +721,7 @@ function M:OnResult1(...) p.fz_list = {} end DataManager.CurrenRoom.self_player.card_list = {} - self._state.selectedIndex = 2 + --self._state.selectedIndex = 2 self._clearingView = nil end) end @@ -804,9 +827,9 @@ function M:OnHuCard(...) end -- 扣分动画 - for _, player in pairs(scoreData) do - local infoView = self._player_info[self:GetPos(player.seat)] - infoView:UpdateScore(player.total_score, true) + for _, pScore in pairs(scoreData) do + local infoView = self._player_info[self:GetPos(pScore.seat)] + infoView:UpdateScore(pScore.total_score, true) end coroutine.wait(0.5) diff --git a/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua b/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua index b60a6d67..6113064f 100644 --- a/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua +++ b/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua @@ -36,12 +36,13 @@ end local M = PlayerCardInfoView --- Create a new PlayerCardInfoView -function M.new(view, mainView, record) +function M.new(view, mainView, record, direction) local self = {} setmetatable(self, { __index = M }) self._view = view self._mainView = mainView self._flag_record = record + self.direction = direction self:init() return self end @@ -63,6 +64,14 @@ function M:init() self._view_handCardList = self._view:GetChild('List_HandCard2') self._view_getCard = self._view:GetChild('Btn_HandCard2') end + + if self.direction == "S" then + self._view_outCardList.layout = FairyGUI.ListLayoutType.FlowHorizontal_left2right_bottom2top + elseif self.direction == "N" then + self._view_outCardList.layout = FairyGUI.ListLayoutType.FlowHorizontal_right2left_top2bottom + elseif self.direction == "E" then + self._view_outCardList.layout = FairyGUI.ListLayoutType.FlowVertical_right2left_bottom2top + end end function M:SetPlayer(p) @@ -465,7 +474,6 @@ function M:ResetCardType() end function M:ShowHand(cards) - self._view_handCardList:RemoveChildren() local list = self._view_handCardList @@ -476,8 +484,11 @@ function M:ShowHand(cards) end --list:RemoveChildren() + local passcard = false for _, card in pairs(cards) do - if self.winCard ~= card then + if self.winCard == cards and passcard == false then + passcard = true + else local obj = list:AddItemFromPool() obj:GetChild("icon").url = 'ui://Main_Majiang/' .. cardType .. card end @@ -489,6 +500,7 @@ function M:ShowHuCard(card) self._view_getCard:RemoveChildrenToPool() local btn_card = self._view_getCard:AddItemFromPool() btn_card:GetChild("icon").url = 'ui://Main_Majiang/' .. self._viewText_cardInfo['Out_Card'] .. card + self._ctr_getCard.selectedIndex = 1 end return M diff --git a/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua b/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua index d159dcdd..58d4415b 100644 --- a/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua +++ b/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua @@ -7,11 +7,12 @@ local PlayerSelfView = { local M = PlayerSelfView -function PlayerSelfView.new(view, mainView) +function PlayerSelfView.new(view, mainView, record, direction) setmetatable(M, { __index = MJPlayerCardInfoView }) local self = setmetatable({}, { __index = M }) self._view = view self._mainView = mainView + self.direction = direction self:init() return self end diff --git a/wb_new_ui/assets/Family/Main.xml b/wb_new_ui/assets/Family/Main.xml index 59086f8e..3e8e3a82 100644 --- a/wb_new_ui/assets/Family/Main.xml +++ b/wb_new_ui/assets/Family/Main.xml @@ -104,7 +104,7 @@ - + diff --git a/wb_new_ui/assets/Main_Majiang/Main_new/Main_new_2/Component/NewHandCard/Component/Btn_Card.xml b/wb_new_ui/assets/Main_Majiang/Main_new/Main_new_2/Component/NewHandCard/Component/Btn_Card.xml new file mode 100644 index 00000000..87b7b873 --- /dev/null +++ b/wb_new_ui/assets/Main_Majiang/Main_new/Main_new_2/Component/NewHandCard/Component/Btn_Card.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + +