diff --git a/lua_probject/base_project/Game/View/MainView.lua b/lua_probject/base_project/Game/View/MainView.lua index ecb262cb..db3c8d97 100644 --- a/lua_probject/base_project/Game/View/MainView.lua +++ b/lua_probject/base_project/Game/View/MainView.lua @@ -1389,10 +1389,21 @@ function M:OnUpdate() if not self._curtime then self._curtime = 15 end - if leftTime <= 3 and self._curtime ~= leftTime and leftTime ~= 0 then + if leftTime <= self._leftTime_xiangling and self._curtime ~= leftTime and leftTime ~= 0 then self._curtime = leftTime GameApplication.Instance:PlaySound('base/common/sound/timeup_alarm.mp3') end + if self._leftTime_bianhong then + if leftTime <= 5 then + if self._tex_leftTime:GetController('poker_Color') then + self._tex_leftTime:GetController('poker_Color').selectedIndex = 1 + end + else + if self._tex_leftTime:GetController('poker_Color') then + self._tex_leftTime:GetController('poker_Color').selectedIndex = 0 + end + end + end else self:onLeftTimeOver() if self._tex_leftTime then diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua index 0c821a10..035c75d7 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua @@ -80,6 +80,9 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne end) nextRoundBtn.onClick:Set(function() + if self._callback_jiangma then + self._callback_jiangma() + end if isWitness and isWitness == 1 then if self._witnessCallbak then self._witnessCallbak() @@ -106,6 +109,9 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne _overCtr.selectedIndex = 0 self:fillResult0(room, peopleNum, result) nextRoundBtn2.onClick:Set(function() + if self._callback_jiangma then + self._callback_jiangma() + end if isWitness and isWitness == 1 then if self._witnessCallbak then self._witnessCallbak() @@ -245,7 +251,7 @@ function M:fillResult0(room, peopleNum, result) end end handCardList.numItems = handInfoNum - allCardsList.width = 234 * fzInfoNum + 84 + (handInfoNum - 1) * 80 + 36 * (fzInfoNum) + allCardsList.width = 234 * fzInfoNum + 82 + (handInfoNum - 1) * 79 + 10 * (fzInfoNum) if infoList.seat == room.self_player.seat then isMeCtr.selectedIndex = 1 @@ -284,7 +290,7 @@ function M:fillResult0(room, peopleNum, result) obj:GetController('jing').selectedIndex = infoJiangma[index + 1].card == room.jing and 1 or 0 end jiangMaList.numItems = #infoJiangma - jiangMaList.columnCount = #infoJiangma / 2 + -- jiangMaList.columnCount = #infoJiangma / 2 else playerInfoComp:GetChild("text_huShow").text = "" if not room.isZiMoHu and playInfo.self_user.account_id == result.active_player then @@ -416,6 +422,10 @@ function M:GetPrefix() return prefix end +function M:SetJiangMaCallback(fct) + self._callback_jiangma = fct +end + function M:DestroyWithCallback() if self._callback then self._callback() diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua index 05da71b9..a40f6892 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua @@ -219,6 +219,10 @@ function M:EventInit() self:RemoveCursor() self._state.selectedIndex = 1 self:ShowJing() + if self._niao_View then + self._niao_View:RemoveFromParent() + self._niao_View:Dispose() + end -- self._laiziMove:Play() local list = _room.player_list for i = 1, #list do @@ -486,20 +490,23 @@ function M:EventInit() else self:PlayMJMusic("gameover.mp3") end - self._clearingView = EXClearingView.new() - local liuju = result.liuju + local liuju = result and result.liuju or nil coroutine.start(function() if liuju then self:PlayMJSound("liuju.mp3") coroutine.wait(3) self:PlayMJSound("end_music.mp3") else - self:PlayMJSound("end_music.mp3") + if over ~= 2 then + self:PlayMJSound("end_music.mp3") + end end coroutine.wait(0.5) self._clearingView:Show() self._popEvent = true end) + self._clearingView = EXClearingView.new() + -- if over < 2 or _room.curren_round > 0 then -- self:PlayMJSound("end_music.mp3") -- end @@ -795,29 +802,33 @@ function M:RunNiao(list, start_seat) local _room = self._room --local _niao_View = self._niao_View self._niao_View = UIPackage.CreateObject("Extend_MJ_FuZhou", "Panel_Birds") - self._view:AddChild(self._niao_View) + self._view:GetChild('jiangma_show'):AddChild(self._niao_View) self._niao_View:Center() local _niao_View = self._niao_View local list_niao_card = self._niao_View:GetChild("Lst_birds") list_niao_card:RemoveChildrenToPool() - for i = 1, #list do - --添加背面的麻將 - local item = list_niao_card:AddItemFromPool() - item.icon = UIPackage.GetItemURL("Main_Majiang", "202_00") - item:GetChild("tex_score").text = "+" .. list[i].score - end + -- for i = 1, #list do + -- --添加背面的麻將 + -- local item = list_niao_card:AddItemFromPool() + -- item.icon = UIPackage.GetItemURL("Main_Majiang", "202_00") + -- item:GetChild("tex_score").text = "+" .. list[i].score + -- end for i = 1, #list do --顯示正面 - local item = list_niao_card:GetChildAt(i - 1) + local item = list_niao_card:AddItemFromPool() local card = list[i].card - coroutine.wait(0.3) - item:GetTransition("appear"):Play() - item.icon = UIPackage.GetItemURL("Main_Majiang", "b201_" .. card) - if list[i].score > 0 then item:GetController("bg").selectedIndex = 1 end + coroutine.wait(2 / #list) + -- item:GetTransition("appear"):Play() + item.icon = UIPackage.GetItemURL("Main_Majiang", "b202_" .. card) + if list[i].score > 0 then + item:GetController("select").selectedIndex = 1 + else + item:GetController("select").selectedIndex = 0 + end end coroutine.start(function() - coroutine.wait(1) - _niao_View:Dispose() + coroutine.wait(0.3) + -- _niao_View:Dispose() self._popEvent = true end) end diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua index ffded275..6fc24183 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua @@ -80,6 +80,9 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne end) nextRoundBtn.onClick:Set(function() + if self._callback_jiangma then + self._callback_jiangma() + end if isWitness and isWitness == 1 then if self._witnessCallbak then self._witnessCallbak() @@ -108,6 +111,9 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne _overCtr.selectedIndex = 0 self:fillResult0(room, peopleNum, result) nextRoundBtn2.onClick:Set(function() + if self._callback_jiangma then + self._callback_jiangma() + end if isWitness and isWitness == 1 then if self._witnessCallbak then self._witnessCallbak() @@ -247,7 +253,7 @@ function M:fillResult0(room, peopleNum, result) end end handCardList.numItems = handInfoNum - allCardsList.width = 234 * fzInfoNum + 84 + (handInfoNum - 1) * 80 + 36 * (fzInfoNum) + allCardsList.width = 234 * fzInfoNum + 82 + (handInfoNum - 1) * 79 + 10 * (fzInfoNum) if infoList.seat == room.self_player.seat then isMeCtr.selectedIndex = 1 @@ -285,7 +291,7 @@ function M:fillResult0(room, peopleNum, result) obj:GetController('jing').selectedIndex = infoJiangma[index + 1].card == room.jing and 1 or 0 end jiangMaList.numItems = #infoJiangma - jiangMaList.columnCount = #infoJiangma / 2 + -- jiangMaList.columnCount = #infoJiangma / 2 else playerInfoComp:GetChild("text_huShow").text = "" if not room.isZiMoHu and playInfo.self_user.account_id == result.active_player then @@ -417,6 +423,10 @@ function M:GetPrefix() return prefix end +function M:SetJiangMaCallback(fct) + self._callback_jiangma = fct +end + function M:DestroyWithCallback() if self._callback then self._callback() diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua index 50f429e1..efcc4261 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua @@ -219,6 +219,10 @@ function M:EventInit() self:RemoveCursor() self._state.selectedIndex = 1 self:ShowJing() + if self._niao_View then + self._niao_View:RemoveFromParent() + self._niao_View:Dispose() + end self._laiziMove:Play() local list = _room.player_list for i = 1, #list do @@ -488,20 +492,23 @@ function M:EventInit() else self:PlayMJMusic("gameover.mp3") end - self._clearingView = EXClearingView.new() - local liuju = result.liuju + local liuju = result and result.liuju or nil coroutine.start(function() if liuju then self:PlayMJSound("liuju.mp3") coroutine.wait(3) self:PlayMJSound("end_music.mp3") else - self:PlayMJSound("end_music.mp3") + if over ~= 2 then + self:PlayMJSound("end_music.mp3") + end end coroutine.wait(0.5) self._clearingView:Show() self._popEvent = true end) + self._clearingView = EXClearingView.new() + -- if over < 2 or _room.curren_round > 0 then -- self:PlayMJSound("end_music.mp3") -- end @@ -797,29 +804,33 @@ function M:RunNiao(list, start_seat) local _room = self._room --local _niao_View = self._niao_View self._niao_View = UIPackage.CreateObject("Extend_MJ_JinXi", "Panel_Birds") - self._view:AddChild(self._niao_View) + self._view:GetChild('jiangma_show'):AddChild(self._niao_View) self._niao_View:Center() local _niao_View = self._niao_View local list_niao_card = self._niao_View:GetChild("Lst_birds") list_niao_card:RemoveChildrenToPool() - for i = 1, #list do - --添加背面的麻將 - local item = list_niao_card:AddItemFromPool() - item.icon = UIPackage.GetItemURL("Main_Majiang", "202_00") - item:GetChild("tex_score").text = "+" .. list[i].score - end + -- for i = 1, #list do + -- --添加背面的麻將 + -- local item = list_niao_card:AddItemFromPool() + -- item.icon = UIPackage.GetItemURL("Main_Majiang", "202_00") + -- item:GetChild("tex_score").text = "+" .. list[i].score + -- end for i = 1, #list do --顯示正面 - local item = list_niao_card:GetChildAt(i - 1) + local item = list_niao_card:AddItemFromPool() local card = list[i].card - coroutine.wait(0.3) - item:GetTransition("appear"):Play() - item.icon = UIPackage.GetItemURL("Main_Majiang", "b201_" .. card) - if list[i].score > 0 then item:GetController("bg").selectedIndex = 1 end + coroutine.wait(2 / #list) + -- item:GetTransition("appear"):Play() + item.icon = UIPackage.GetItemURL("Main_Majiang", "b202_" .. card) + if list[i].score > 0 then + item:GetController("select").selectedIndex = 1 + else + item:GetController("select").selectedIndex = 0 + end end coroutine.start(function() - coroutine.wait(1) - _niao_View:Dispose() + coroutine.wait(0.3) + -- _niao_View:Dispose() self._popEvent = true end) end diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua index b40c4444..dd7cd86b 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua @@ -246,8 +246,7 @@ function M:fillResult0(room, peopleNum, result) end end handCardList.numItems = handInfoNum - allCardsList.width = 234 * fzInfoNum + 84 + (handInfoNum - 1) * 80 + 36 * (fzInfoNum) - + allCardsList.width = 234 * fzInfoNum + 82 + (handInfoNum - 1) * 79 + 10 * (fzInfoNum) if infoList.seat == room.self_player.seat then isMeCtr.selectedIndex = 1 @@ -285,7 +284,7 @@ function M:fillResult0(room, peopleNum, result) obj:GetController('jing').selectedIndex = infoJiangma[index + 1].card == room.jing and 1 or 0 end jiangMaList.numItems = #infoJiangma - jiangMaList.columnCount = #infoJiangma / 2 + -- jiangMaList.columnCount = #infoJiangma / 2 else playerInfoComp:GetChild("text_huShow").text = "" if not room.isZiMoHu and playInfo.self_user.account_id == result.active_player then @@ -416,6 +415,10 @@ function M:GetPrefix() return prefix end +function M:SetJiangMaCallback(fct) + self._callback_jiangma = fct +end + function M:DestroyWithCallback() if self._callback then self._callback() diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua index 2e6e117f..c561ee2b 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua @@ -218,6 +218,11 @@ function M:EventInit() self:RemoveCursor() self._state.selectedIndex = 1 self:ShowJing() + if self._niao_View then + self._niao_View:RemoveFromParent() + self._niao_View:Dispose() + end + -- self._laiziMove:Play() local list = _room.player_list self._laiziMove:Play() for i = 1, #list do @@ -485,20 +490,26 @@ function M:EventInit() else self:PlayMJMusic("gameover.mp3") end - self._clearingView = EXClearingView.new() - local liuju = result.liuju + local liuju = result and result.liuju or nil coroutine.start(function() if liuju then self:PlayMJSound("liuju.mp3") coroutine.wait(3) self:PlayMJSound("end_music.mp3") else - self:PlayMJSound("end_music.mp3") + if over ~= 2 then + self:PlayMJSound("end_music.mp3") + end end coroutine.wait(0.5) self._clearingView:Show() self._popEvent = true end) + self._clearingView = EXClearingView.new() + + -- if over < 2 or _room.curren_round > 0 then + -- self:PlayMJSound("end_music.mp3") + -- end self._clearingView:InitData(over, _room, result, total_result) ControllerManager.ChangeController(LoddyController) end) @@ -791,29 +802,33 @@ function M:RunNiao(list, start_seat) local _room = self._room --local _niao_View = self._niao_View self._niao_View = UIPackage.CreateObject("Extend_MJ_LiChuan", "Panel_Birds") - self._view:AddChild(self._niao_View) + self._view:GetChild('jiangma_show'):AddChild(self._niao_View) self._niao_View:Center() local _niao_View = self._niao_View local list_niao_card = self._niao_View:GetChild("Lst_birds") list_niao_card:RemoveChildrenToPool() - for i = 1, #list do - --添加背面的麻將 - local item = list_niao_card:AddItemFromPool() - item.icon = UIPackage.GetItemURL("Main_Majiang", "202_00") - item:GetChild("tex_score").text = "+" .. list[i].score - end + -- for i = 1, #list do + -- --添加背面的麻將 + -- local item = list_niao_card:AddItemFromPool() + -- item.icon = UIPackage.GetItemURL("Main_Majiang", "202_00") + -- item:GetChild("tex_score").text = "+" .. list[i].score + -- end for i = 1, #list do --顯示正面 - local item = list_niao_card:GetChildAt(i - 1) + local item = list_niao_card:AddItemFromPool() local card = list[i].card - coroutine.wait(0.3) - item:GetTransition("appear"):Play() - item.icon = UIPackage.GetItemURL("Main_Majiang", "b201_" .. card) - if list[i].score > 0 then item:GetController("bg").selectedIndex = 1 end + coroutine.wait(2 / #list) + -- item:GetTransition("appear"):Play() + item.icon = UIPackage.GetItemURL("Main_Majiang", "b202_" .. card) + if list[i].score > 0 then + item:GetController("select").selectedIndex = 1 + else + item:GetController("select").selectedIndex = 0 + end end coroutine.start(function() - coroutine.wait(1) - _niao_View:Dispose() + coroutine.wait(0.3) + -- _niao_View:Dispose() self._popEvent = true end) end diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua index 1c980af7..fd9b3811 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua @@ -80,6 +80,9 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne end) nextRoundBtn.onClick:Set(function() + if self._callback_jiangma then + self._callback_jiangma() + end if isWitness and isWitness == 1 then if self._witnessCallbak then self._witnessCallbak() @@ -106,6 +109,9 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne _overCtr.selectedIndex = 0 self:fillResult0(room, peopleNum, result) nextRoundBtn2.onClick:Set(function() + if self._callback_jiangma then + self._callback_jiangma() + end if isWitness and isWitness == 1 then if self._witnessCallbak then self._witnessCallbak() @@ -246,7 +252,7 @@ function M:fillResult0(room, peopleNum, result) end end handCardList.numItems = handInfoNum - allCardsList.width = 234 * fzInfoNum + 84 + (handInfoNum - 1) * 80 + 36 * (fzInfoNum) + allCardsList.width = 234 * fzInfoNum + 82 + (handInfoNum - 1) * 79 + 10 * (fzInfoNum) if infoList.seat == room.self_player.seat then isMeCtr.selectedIndex = 1 @@ -284,7 +290,7 @@ function M:fillResult0(room, peopleNum, result) obj:GetController('jing').selectedIndex = infoJiangma[index + 1].card == room.jing and 1 or 0 end jiangMaList.numItems = #infoJiangma - jiangMaList.columnCount = #infoJiangma / 2 + -- jiangMaList.columnCount = #infoJiangma / 2 else playerInfoComp:GetChild("text_huShow").text = "" if not room.isZiMoHu and playInfo.self_user.account_id == result.active_player then @@ -416,6 +422,10 @@ function M:GetPrefix() return prefix end +function M:SetJiangMaCallback(fct) + self._callback_jiangma = fct +end + function M:DestroyWithCallback() if self._callback then self._callback() diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua index 10790798..984015b0 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua @@ -217,6 +217,10 @@ function M:EventInit() self:RemoveCursor() self._state.selectedIndex = 1 self:ShowJing() + if self._niao_View then + self._niao_View:RemoveFromParent() + self._niao_View:Dispose() + end -- self._laiziMove:Play() local list = _room.player_list for i = 1, #list do @@ -487,20 +491,23 @@ function M:EventInit() else self:PlayMJMusic("gameover.mp3") end - self._clearingView = EXClearingView.new() - local liuju = result.liuju + local liuju = result and result.liuju or nil coroutine.start(function() if liuju then self:PlayMJSound("liuju.mp3") coroutine.wait(3) self:PlayMJSound("end_music.mp3") else - self:PlayMJSound("end_music.mp3") + if over ~= 2 then + self:PlayMJSound("end_music.mp3") + end end coroutine.wait(0.5) self._clearingView:Show() self._popEvent = true end) + self._clearingView = EXClearingView.new() + -- if over < 2 or _room.curren_round > 0 then -- self:PlayMJSound("end_music.mp3") -- end @@ -796,30 +803,33 @@ function M:RunNiao(list, start_seat) local _room = self._room --local _niao_View = self._niao_View self._niao_View = UIPackage.CreateObject("Extend_MJ_NanCheng", "Panel_Birds") - - self._view:AddChild(self._niao_View) + self._view:GetChild('jiangma_show'):AddChild(self._niao_View) self._niao_View:Center() local _niao_View = self._niao_View local list_niao_card = self._niao_View:GetChild("Lst_birds") list_niao_card:RemoveChildrenToPool() - for i = 1, #list do - --添加背面的麻將 - local item = list_niao_card:AddItemFromPool() - item.icon = UIPackage.GetItemURL("Main_Majiang", "202_00") - item:GetChild("tex_score").text = "+" .. list[i].score - end + -- for i = 1, #list do + -- --添加背面的麻將 + -- local item = list_niao_card:AddItemFromPool() + -- item.icon = UIPackage.GetItemURL("Main_Majiang", "202_00") + -- item:GetChild("tex_score").text = "+" .. list[i].score + -- end for i = 1, #list do --顯示正面 - local item = list_niao_card:GetChildAt(i - 1) + local item = list_niao_card:AddItemFromPool() local card = list[i].card - coroutine.wait(0.3) - item:GetTransition("appear"):Play() - item.icon = UIPackage.GetItemURL("Main_Majiang", "b201_" .. card) - if list[i].score > 0 then item:GetController("bg").selectedIndex = 1 end + coroutine.wait(2 / #list) + -- item:GetTransition("appear"):Play() + item.icon = UIPackage.GetItemURL("Main_Majiang", "b202_" .. card) + if list[i].score > 0 then + item:GetController("select").selectedIndex = 1 + else + item:GetController("select").selectedIndex = 0 + end end coroutine.start(function() - coroutine.wait(1) - _niao_View:Dispose() + coroutine.wait(0.3) + -- _niao_View:Dispose() self._popEvent = true end) end diff --git a/lua_probject/extend_project/extend/poker/runfast/CardCheck.lua b/lua_probject/extend_project/extend/poker/runfast/CardCheck.lua index adb47e7a..f05dc1f4 100644 --- a/lua_probject/extend_project/extend/poker/runfast/CardCheck.lua +++ b/lua_probject/extend_project/extend/poker/runfast/CardCheck.lua @@ -52,6 +52,7 @@ function M:InitLastCard(cardList, mustPutMaxCard) self:Clear() self._flag_mustMax = mustPutMaxCard self.type = 0 + self.specilCard = {} self.lastCardNum = #cardList self._flag_allCards = false self._flag_checkLst = true @@ -95,13 +96,27 @@ function M:InitLastCard(cardList, mustPutMaxCard) print("lingmengCheckSanDai2") if self:CheckSanDai() then - self.type = self:CheckSanDai() + local a, b, c = self:CheckSanDai() + self.type = a + if b then + self.specilCard = b + end + if c then + self.lastMinCard = c + end return end print("lingmengCheckZha2") if self:CheckZha() then - self.type = self:CheckZha() + local a, b, c = self:CheckZha() + self.type = a + if b then + self.specilCard = b + end + if c then + self.lastMinCard = c + end return end if self.type == 0 then @@ -380,9 +395,10 @@ function M:CheckOutCardGetTouchSet(cardSet, cardMap, cardType, longLength) local lastCard = 0 local tempCardSet = {} local tipCardSet = {} + local ZhaCardList = {} for i = 1, #cardSet do local card = cardSet[i] - if cardMap[card].value >= cardType and card > self.lastMinCard then + if cardMap[card].value >= cardType and card > self.lastMinCard and cardMap[card].value ~= 4 then if tempLong == 0 then tempLong = 1 else @@ -406,7 +422,7 @@ function M:CheckOutCardGetTouchSet(cardSet, cardMap, cardType, longLength) if cardMap[card].value == 4 then table.insert(self.touchCardSet, card) self.touchCardMao[card] = 1 - table.insert(tipCardSet, card) + table.insert(ZhaCardList, card) end end if tempLong >= longLength then @@ -416,6 +432,9 @@ function M:CheckOutCardGetTouchSet(cardSet, cardMap, cardType, longLength) end end table.insert(tipCardSet, tempCardSet) + for i = 1, #ZhaCardList do + table.insert(tipCardSet, ZhaCardList[i]) + end return tipCardSet end @@ -491,6 +510,7 @@ function M:CheckDuiZi() end end +--三带有着不同比大小极致,需要返回是哪些牌三带和最小的三带牌 function M:CheckSanDai() --三张 if self.cardNum == 5 and M:CheckType(CardType.threeAndTwo) then @@ -498,12 +518,19 @@ function M:CheckSanDai() local k = self.cardListSord[i] local v = self.cardList[k] if v >= 3 then - return CardType.threeAndTwo + return CardType.threeAndTwo, { k }, k end end end if self.threelack and self.cardNum == 4 and self.cardSize == 2 and M:CheckType(CardType.lessThree) then + for i = 1, self.cardSize do + local k = self.cardListSord[i] + local v = self.cardList[k] + if v >= 3 then + return CardType.lessThree, { k }, k + end + end return CardType.lessThree end @@ -520,12 +547,12 @@ function M:CheckSanDai() if temp_normol_feiji and M:CheckType(CardType.normolPlant) then local last_k - local num_san = 0 + local key_table = {} for i = 1, self.cardSize do local k = self.cardListSord[i] local v = self.cardList[k] if v >= 3 then - num_san = num_san + 1 + table.insert(key_table, k) if not last_k then last_k = k else @@ -536,8 +563,8 @@ function M:CheckSanDai() end end end - if num_san >= temp_normol_feiji then - return CardType.normolPlant + if #key_table >= temp_normol_feiji then + return CardType.normolPlant, key_table, key_table[1] else return end @@ -547,7 +574,7 @@ function M:CheckSanDai() if self.threelack and M:CheckType(CardType.lessPlant) then local last_k - local num_san = 0 + local key_table = {} local num_four = 0 for i = 1, self.cardSize do local k = self.cardListSord[i] @@ -556,7 +583,7 @@ function M:CheckSanDai() if v == 4 then num_four = 1 end - num_san = num_san + 1 + table.insert(key_table, k) print("liengmengCheckthreelack2", last_k, k) if not last_k then @@ -569,10 +596,10 @@ function M:CheckSanDai() end end end - print("liengmengCheckthreelack4", num_san, self.cardNum - num_san * 3 < num_san * 2) + print("liengmengCheckthreelack4", #key_table, self.cardNum - #key_table * 3 < #key_table * 2) - if self.cardNum - num_san * 3 < num_san * 2 and not (self.cardNum == 4 and num_four == 1) then - return CardType.lessPlant + if self.cardNum - #key_table * 3 < #key_table * 2 and not (self.cardNum == 4 and num_four == 1) then + return CardType.lessPlant, key_table, key_table[1] else return end @@ -613,7 +640,7 @@ function M:CheckZha() local k = self.cardListSord[i] local v = self.cardList[k] if v == 4 then - return CardType.zhaAndThreee + return CardType.zhaAndThreee, { k }, k end end return diff --git a/lua_probject/extend_project/extend/poker/runfast/ExtendConfig.lua b/lua_probject/extend_project/extend/poker/runfast/ExtendConfig.lua index 888945bb..cbcd46a7 100644 --- a/lua_probject/extend_project/extend/poker/runfast/ExtendConfig.lua +++ b/lua_probject/extend_project/extend/poker/runfast/ExtendConfig.lua @@ -134,8 +134,6 @@ function M:FillRoomData(s2croom) if reload then local reloadInfo = s2croom["reloadInfo"] - - local playing = reloadInfo["playing"] room.curren_turn_seat = reloadInfo["active_seat"] diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_GameController.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_GameController.lua index 96b06762..2544b20c 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_GameController.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_GameController.lua @@ -225,6 +225,7 @@ function M:OnPlaySuccCheck(evt_data) local player = self._room:GetPlayerBySeat(seat) local out_card_list = self:ChangeCodeByFrom(cards, true) player.hand_count = remain + self._cardCheck:InitLastCard(out_card_list) local card_type, number, length, plan_three_count = self:GetCardListInfo(out_card_list) player.out_card_list = self:GetSortOutCardList(out_card_list, card_type, number, plan_three_count) DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPlaySucc, player, remain, card_type, number, otherList, diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua index 31af1af3..91a42ae8 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua @@ -209,7 +209,7 @@ function M:InitView(url) self._text_maxRound = self._view:GetChild('Text_MaxMaxRound') self._cardCheck = RunFast_CardCheck:InitFlag() - + self._gamectr._cardCheck = self._cardCheck self:UpdateRound(0) --按钮功能全部未开放 @@ -236,6 +236,9 @@ function M:InitView(url) end end) ---------------------------------------------------- + --闹钟倒计时报时 + self._leftTime_xiangling = 5 + self._leftTime_bianhong = true end function M:UpdateCard(index) @@ -287,6 +290,7 @@ function M:NewPlayerCardInfoView(tem, index) end function M:OnPlayerEnter(...) + ViewUtil.PlaySound("RunFastNew_PK", "base/main_majiang/sound/user_enter.mp3") MainView.OnPlayerEnter(self, ...) local arg = { ... } local p = arg[1] @@ -303,6 +307,7 @@ function M:OnPlayerEnter(...) end function M:OnPlayerReady(...) + ViewUtil.PlaySound("RunFastNew_PK", "base/main_majiang/sound/user_ready.mp3") local arg = { ... } local p = arg[1] local _room = self._room @@ -327,6 +332,7 @@ function M:OnPlayerReady(...) end function M:OnPlayerLeave(...) + ViewUtil.PlaySound("RunFastNew_PK", "base/main_majiang/sound/user_leave.mp3") MainView.OnPlayerLeave(self, ...) local _room = self._room if not _room.self_player.ready then @@ -448,8 +454,8 @@ function M:EventInit() local arg = { ... } local card = arg[1] self.ctr_state.selectedIndex = 1 - self.ctr_card_eff.selectedIndex = 1 - self:PlayCardEff(card) + -- self.ctr_card_eff.selectedIndex = 1 + -- self:PlayCardEff(card) end) _gamectr:AddEventListener(RunFast_GameEvent.OnInitCard, function(...) @@ -482,8 +488,9 @@ function M:EventInit() self.rank_view:Dispose() self.rank_view = nil end + self._ctr_inClear.selectedIndex = 0 self:UpdateRound(round) - ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/fapai.mp3") + -- ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/fapai.mp3") local list = _room.player_list for i = 1, #list do local p = list[i] @@ -557,18 +564,25 @@ function M:EventInit() -- self.MypokerList = nil -- end end - for i = 1, #self._player_card_info do - local card_info = self._player_card_info[i] - if i == index then - card_info._ctr_time_clock.selectedIndex = 1 - self._tex_leftTime = card_info._view_comp_clock - else - card_info._ctr_time_clock.selectedIndex = 0 + self._leftClock_continue = coroutine.start(function() + coroutine.wait(1.2) + for i = 1, #self._player_card_info do + local card_info = self._player_card_info[i] + if i == index then + card_info._ctr_time_clock.selectedIndex = 1 + self._tex_leftTime = card_info._view_comp_clock + else + card_info._ctr_time_clock.selectedIndex = 0 + end + if self._room.is_new_bout then + card_info.ctr_outpoker.selectedIndex = 0 + end end - end - if self._left_time and self._left_time < 20 then - self._left_time = 20 - end + if self._left_time and self._left_time < 15 then + self._left_time = 15 + end + end) + if self._room.ming_card ~= nil then self._view:GetTransition("t" .. index):Play() @@ -594,6 +608,7 @@ function M:EventInit() _gamectr:AddEventListener(RunFast_GameEvent.OnPlaySucc, function(...) ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/playcard_chup.mp3") + self._popEvent = false local arg = { ... } local p = arg[1] local card_number = arg[2] @@ -648,9 +663,10 @@ function M:EventInit() -- self:_Effect(cardstype, p) -- end -- end - self._cardCheck:InitLastCard(lastCardList) self:_Effect(self._cardCheck.type, p) - self:PlaySound(p.self_user.sex, self:GetSoundFileName(self._cardCheck.type, num, self._room.is_new_bout)) + + self:PlaySound(p.self_user.sex, + self:GetSoundFileName(self._cardCheck.type, num, self._room.is_new_bout)) -- self:PlaySound(p.self_user.sex, self:GetSoundFileName(cardstype, num, self._room.is_new_bout)) if card_number == 1 then @@ -661,7 +677,6 @@ function M:EventInit() end self._cor_sound = nil self._cor_sound = coroutine.start(function() - coroutine.wait(1) self:PlaySound(p.self_user.sex, "card_1") end) end @@ -705,6 +720,8 @@ function M:EventInit() card_info:InitPoker(self.MypokerList, false) self.MypokerList = nil end + coroutine.stop(self._leftClock_continue) + card_info._ctr_time_clock.selectedIndex = 0 card_info:SetOutCardInfo(nil, true) self:PlaySound(p.self_user.sex, "pass_" .. math.random(1, 4)) end) @@ -873,10 +890,14 @@ function M:EventInit() else ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/lose_music.mp3") end - + coroutine.stop(self._leftClock_continue) + for i = 1, #self._player_card_info do + local card_info = self._player_card_info[i] + card_info._ctr_time_clock.selectedIndex = 0 + self._left_time = 0 + end -- -- print("11111111111111") -- coroutine.wait(1) - coroutine.wait(1) -- if self._room.self_player.seat == win_seat then -- local sprint_seat_list = self:GetSpringSeats(info) -- if #sprint_seat_list > 0 then @@ -915,39 +936,24 @@ function M:EventInit() head_info._view:GetChild('text_jifen').text = player.score head_info:PlayScore(player.winscore, win_seat == player.seat) - -- 播放加分这是之前旧的方式 - -- if player.hp_info ~= nil and player.hp_info.cur_hp ~= nil then - -- printlog("lingmeng xiao clear1") - -- p.hp_info = player.hp_info - -- head_info:UpdateScore(d2ad(player.hp_info.cur_hp)) - -- head_info._view:GetChild('zhanji').visible = true - -- local num = player.hp_info.total_hp - -- if num > 0 then - -- head_info._view:GetController('text_color').selectedIndex = 0 - -- head_info._view:GetChild('text_jifen').text = "+" .. d2ad(player.hp_info.total_hp) - -- else - -- head_info._view:GetController('text_color').selectedIndex = 1 - -- head_info._view:GetChild('text_jifen').text = d2ad(player.hp_info.total_hp) - -- end - -- card_info:PlayScore(d2ad(player.hp_info.round_actual_hp), false, win_seat == player.seat) - -- else - -- printlog("lingmeng xiao clear2") - -- local rt = 1 - -- if self._room.hpOnOff == 1 then - -- rt = self._room.score_times - -- end - -- if over == 1 and self._room.hpOnOff == 1 then - -- head_info:UpdateScore(player.score / 10) --不可负分 - -- else - -- head_info:UpdateScore(player.score * rt) - -- end - -- card_info:PlayScore(player.winscore * rt, false, win_seat == player.seat) - -- end - + end + for i = 1, #info do + local player = info[i] + local p = self._room:GetPlayerBySeat(player.seat) + local head_info = self._player_info[self:GetPos(player.seat)] + local card_info = self._player_card_info[self:GetPos(player.seat)] if player.seat ~= self._room.self_player.seat then + local time = 1.5 + local oneTime = 0.2 + if #player.handCards > 5 then + time = time - #player.handCards * oneTime + else + time = 0.1 + oneTime = 1.5 / #player.handCards + end + card_info:UpdateHandPoker(player.cards, false, true) - -- card_info:SetRemainCardNumber(false) card_info._view_resultOut:RemoveChildrenToPool() card_info._ctr_resultOut.selectedIndex = 1 @@ -956,10 +962,14 @@ function M:EventInit() local child_card = card_info._view_resultOut:AddItemFromPool() card_info:FillPoker(child_card, "", nil, player.handCards[i]) ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/fanCard.mp3") - coroutine.wait(1.5 / #player.handCards) + coroutine.wait(oneTime) end + coroutine.wait(time) end end + if win_seat ~= self._room.self_player.seat then + coroutine.wait(1.5) + end self:ChangeBgmMusic(1) -- if over == 0 then -- if #self:GetSpringSeats(info) > 0 then @@ -970,10 +980,7 @@ function M:EventInit() -- -- coroutine.wait(2) -- end - for i = 1, #self._player_card_info do - local card_info = self._player_card_info[i] - card_info._ctr_time_clock.selectedIndex = 0 - end + self.result_view = RunFast_ResultView.new(self, info, self._room.room_id, over, win_seat, 0, remaincards) self.result_view:Show() @@ -1129,7 +1136,7 @@ function M:ReConnectForStart() -- head_info:MarkBank(false) player_card_info._ctr_time_clock.selectedIndex = 1 self._tex_leftTime = player_card_info._view_comp_clock - self._left_time = 20 + self._left_time = 15 if player.out_card_list[1] == 0 then player_card_info:SetOutCardInfo(nil, false) else @@ -1268,67 +1275,14 @@ end function M:_Effect(type1, player) print("lingmeng_Effect", type1) - local eff_code = 0 - if type1 == 5 or type1 == 8 or type1 == 12 then - eff_code = 1 - elseif type1 == 2 then - eff_code = 2 - elseif type1 == 10 then - eff_code = 4 - elseif type1 == 4 then - eff_code = 5 - elseif type1 == 6 then - eff_code = 3 - else + if type1 == 1 or type1 == 3 or type1 == 7 or type1 == 9 then + self._popEvent = true return end - print("lingmeng_Effect2", eff_code) local info = self._player_card_info[self:GetPos(player.seat)] - local pNode = info._mask_liangpai - local effect = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/eff_" .. eff_code) - -- local effect = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/eff2_1") - effect.touchable = false - effect:GetTransition("t0"):Play() - -- effect:SetXY((self._view.width - effect.width) / 2,(self._view.hight - effect.hight) / 2) - if eff_code == 3 then - self._view:AddChild(effect) - else - pNode:AddChild(effect) - end - - - if eff_code == 1 then - self.eff_feiji = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/eff_feiji") - self._view:AddChild(self.eff_feiji) - self.eff_feiji:Center() - self.eff_feiji:GetTransition("t0"):Play() - end - if eff_code == 3 then - effect:Center() - else - if self:GetPos(player.seat) == 1 then - effect.x, effect.y = 0, 24 - else - effect.x, effect.y = 24, 67 - end - end - - - -- effect:Center() - -- if eff_code ==3 then - -- coroutine.start(function() - -- coroutine.wait(1) - -- effect:Dispose() - -- end) - -- else - coroutine.start(function() - coroutine.wait(1) - if self.eff_feiji ~= nil then - self.eff_feiji:Dispose() - end - effect:Dispose() + info:PlayEffect(type1, function() + self._popEvent = true end) - -- end end -- function M:_Effect(type1, player) @@ -1460,23 +1414,28 @@ end function M:GetSoundFileName(type, num, isNewBout) local fileName - if type == 10 then - fileName = 4 - elseif type == 11 then - fileName = 6 - elseif type == 5 or type == 8 or type == 12 then - fileName = 7 - elseif type == 2 then - fileName = 10 - elseif type == 6 then - fileName = 11 - elseif type == 1 then - fileName = string.format("1_%d", num) - elseif type == 3 then - fileName = string.format("2_%d", num) - elseif type == 4 or type == 7 then - fileName = string.format("3_%d", num) + if type == 1 or type == 3 or type == 7 then + local num = self._cardCheck.lastMinCard + if type == 1 then + fileName = string.format("1_%d", num) + elseif type == 3 then + fileName = string.format("2_%d", num) + elseif type == 7 then + fileName = string.format("3_%d", num) + end + else + if not isNewBout and type ~= 6 then + local r = math.random(1, 3) + fileName = "dani_" .. r + else + if type == 8 or type == 12 then + fileName = 5 + else + fileName = type + end + end end + return fileName end @@ -1558,6 +1517,7 @@ function M:ChangeBgmMusic(bgm_index) end function M:OnPlayerEnter(...) + ViewUtil.PlaySound("RunFastNew_PK", "base/main_majiang/sound/user_enter.mp3") local arg = { ... } local p = arg[1] for i = 1, #self._room.player_list do diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerPokerInfoView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerPokerInfoView.lua index e6525296..7cbc6329 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerPokerInfoView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerPokerInfoView.lua @@ -163,7 +163,6 @@ function M:SetOutCardInfo(cardlist, isPass, isAnim) coroutine.stop(self.move_cor) self.move_cor = nil end - for i = 1, #cardlist do local poker_item = self._view_Out:AddItemFromPool() local code = self:ChangeCodeByTo(cardlist[i]) @@ -172,7 +171,6 @@ function M:SetOutCardInfo(cardlist, isPass, isAnim) end self.move_cor = coroutine.start(function() coroutine.wait(0.1) - ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/chupai.mp3") end) else @@ -335,6 +333,99 @@ function M:SetRemainCardNumber(isPlay) --end end +function M:PlayEffect(type, callback) + Timer.New(function() + local fristCard = self._view_Out:GetChildAt(0) + local lastCard = self._view_Out:GetChildAt(self._view_Out.numItems - 1) + local fristXy = self._view_Out:GlobalToLocal(fristCard:LocalToGlobal(Vector2.New( + fristCard.width * 0, + fristCard.height * 0.5))) + local lastXy = self._view_Out:GlobalToLocal(lastCard:LocalToGlobal( + Vector2.New(lastCard.width * 1, + lastCard.height * 0.5))) + local effect = "" + local y = 0 + local x = 0 + local width = 0 + pt("lingmeng PlayEffect1", fristXy, lastXy) + pt("lingmeng PlayEffect2", self._view_Out.xy) + if type == 10 then + effect = "te_liandui" + y = self._view_Out.y + fristXy.y + x = self._view_Out.x + (lastXy.x + fristXy.x) / 2 + pt("lingmeng PlayEffect2", x, y) + elseif type == 4 then + effect = "te_sandaidui" + y = self._view_Out.y + fristXy.y + x = self._view_Out.x + (lastXy.x + fristXy.x) / 2 + elseif type == 11 then + effect = "te_sandaidan" + y = self._view_Out.y + fristXy.y + x = self._view_Out.x + (lastXy.x + fristXy.x) / 2 + elseif type == 2 then + effect = "te_shunzi" + y = self._view_Out.y + fristXy.y + x = self._view_Out.x + (lastXy.x + fristXy.x) / 2 + width = (lastXy.x - fristXy.x) / 1.5 + elseif type == 5 or type == 8 or type == 12 then + effect = "te_feiji" + y = self._view_Out.y + fristXy.y + x = self._view_Out.x + (lastXy.x + fristXy.x) / 2 + width = (lastXy.x - fristXy.x) / 1.5 + elseif type == 6 then + effect = "te_zhadan" + y = self._view_Out.y + fristXy.y + x = self._view_Out.x + (lastXy.x + fristXy.x) / 2 + end + if #effect > 0 then + local obj = UIPackage.CreateObjectFromURL(string.format("ui://Extend_Poker_RunFastNew/%s", effect)) + obj.visible = false + self._view:AddChild(obj) + obj:SetScale(1.3, 1.3) + if y ~= 0 then + obj.y = y + end + if x ~= 0 then + obj.x = x + end + if width ~= 0 then + obj.width = width + end + obj.visible = true + if type == 2 then + obj:GetTransition('t0'):Play(1, 0, function() + obj:GetChild('n11'):TweenMoveX(width * 1.03, 0.5):OnComplete(function() + obj:Dispose() + callback() + end) + obj:GetChild('n12'):TweenMoveX(width * 1.03 - 121, 0.5) + obj:GetChild('n11'):TweenFade(0, 0.5) + obj:GetChild('n12'):TweenFade(0, 0.5) + end) + elseif type == 5 or type == 8 or type == 12 then + obj:GetTransition('t0'):Play(1, 0, function() + obj:GetChild('n13'):TweenMoveX(width * 0.7, 0.5):OnComplete(function() + obj:Dispose() + callback() + end) + obj:GetChild('n14'):TweenMoveX(width * 0.7 - 120, 0.5) + obj:GetChild('n13'):TweenFade(1, 0.2):OnComplete(function() + obj:GetChild('n13'):TweenFade(0, 0.3) + obj:GetChild('n14'):TweenFade(0, 0.3) + end) + end) + else + obj:GetTransition('t0'):Play(1, 0, function() + obj:Dispose() + callback() + end) + end + else + callback() + end + end, Time.deltaTime, 1, false):Start() +end + function M:FillPoker(poker, prefix, num, code) if num ~= nil then code = self:ChangeCodeByTo(num) diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerSelfPokerInfoView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerSelfPokerInfoView.lua index c6231305..dd7b5d93 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerSelfPokerInfoView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerSelfPokerInfoView.lua @@ -296,6 +296,7 @@ function M:InitPoker(pokerList, isPlayAni, open) -- self.cards_view:AddChild(btn_card) local card_view = NewCardView(btn_card, card_number_code, card_flower_code) self.card_list[#self.card_list + 1] = card_view + btn_card.width = (GRoot.inst.width * 0.95 - self._view_handCard.columnGap * 15) / 16 end table.sort(self.card_list, tableSortNumber) self:AddTouchMoveEvent(self._view_handCard) @@ -736,7 +737,7 @@ function M:TouchMoveEnd(context) end end - ViewUtil.PlaySound('RunFastNew_PK', 'extend/poker/runfast/sound/click.mp3') + -- ViewUtil.PlaySound('RunFastNew_PK', 'extend/poker/runfast/sound/click.mp3') Stage.inst:ResetInputState() @@ -786,6 +787,7 @@ function M:ShowOutCardOption2(lastCardList, ctr_select, mustPutMaxCard) self.tips_card_list = self._cardCheck:GetTipsList() self.touchCardSet = self._cardCheck:GetTouchSet() self.touchCardMap = self._cardCheck:GetTouchCardMap() + self.tips_click_count = 0 print("lingmengShowOutCardOption2", #self.touchCardSet) pt(self.touchCardSet) @@ -848,30 +850,43 @@ function M:ShowOutCardOption(ctr_select, type, number, length, mustPutMaxCard, p self.ctr_put_card_option.selectedIndex = ctr_select end --- function M:SetOutCardInfo(cardlist, isPass, isAnim) --- self.ctr_put_card_option.selectedIndex = 0 --- for i = 1, #self.out_card_list do --- local card = self.out_card_list[i] --- self.cards_view:RemoveChild(card, true) --- end --- self.out_card_list = {} --- if cardlist ~= nil then --- -- todo --- self:SetOutCardList(cardlist, isAnim) --- else --- if isPass == true then --- self.ctr_outpoker.selectedIndex = 2 --- for i = 1, #self.card_list do --- local card_view = self.card_list[i] --- card_view.btn_card.touchable = true --- self:UpdateCardMove(card_view.btn_card, false, false) --- self:SetBtnCardColor(card_view, 0) --- end --- else --- self.ctr_outpoker.selectedIndex = 0 --- end --- end --- end +function M:SetOutCardInfo(cardlist, isPass, isAnim) + self._view_Out:RemoveChildren(0, -1, true) + if cardlist == nil then + if isPass == true then + self.ctr_outpoker.selectedIndex = 2 + else + self.ctr_outpoker.selectedIndex = 0 + end + else + self.ctr_outpoker.selectedIndex = 1 + if isAnim then + if self.move_cor then + coroutine.stop(self.move_cor) + self.move_cor = nil + end + + for i = 1, #cardlist do + local poker_item = self._view_Out:AddItemFromPool() + local code = self:ChangeCodeByTo(cardlist[i]) + + self:FillPoker(poker_item, "", cardlist[i]) + end + self.move_cor = coroutine.start(function() + coroutine.wait(0.1) + ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/chupai.mp3") + end) + else + for i = 1, #cardlist do + local poker_item = self._view_Out:AddItemFromPool() + + local code = self:ChangeCodeByTo(cardlist[i]) + + self:FillPoker(poker_item, "", cardlist[i]) + end + end + end +end function M:SetOutCardBlack() for i = 1, #self.out_card_list do diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua index 59952dd8..810057b4 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua @@ -43,9 +43,10 @@ function M:init(url, data, roomid, over, win_seat, dissolve, remaincards) end self._view:GetChild('btn_over1Close').onClick:Set(function() - self:Close() - self._root_runFast._ctr_inClear.selectedIndex = 1 - if over ~= 1 then + if over == 0 then + self:Close() + self._root_runFast._ctr_inClear.selectedIndex = 1 + else self._view:GetController('over').selectedIndex = 1 end end) @@ -85,6 +86,7 @@ function M:init(url, data, roomid, over, win_seat, dissolve, remaincards) obj:GetChild('residue').text = #info.handCards obj:GetChild('bomb').text = info.thisboomnum obj:GetChild('score').text = info.winscore > 0 and string.format("+%d", info.winscore) or info.winscore + obj:GetController('chuntian').selectedIndex = info.chuntian and 1 or 0 end over0List.numItems = #data @@ -141,4 +143,15 @@ function M:FillDetailChild(view, index, value) view:GetChild('text_value').text = value end +function M:SetDestroryCallback(fct) + self._destoryCallback = fct +end + +function M:Destroy() + if self._destoryCallback then + self._destoryCallback() + end + getmetatable(M).__index.Destroy(self) +end + return M diff --git a/lua_probject/main_project/main/majiang/MJMainView.lua b/lua_probject/main_project/main/majiang/MJMainView.lua index 30b62ab5..29488f5b 100644 --- a/lua_probject/main_project/main/majiang/MJMainView.lua +++ b/lua_probject/main_project/main/majiang/MJMainView.lua @@ -199,6 +199,9 @@ function M:InitView(url, use_custom_bg, custom_bg_config) self._view:GetChild('wanfa_text').text = gamePlay self._laiziMove = self._view:GetTransition('laiziMove') + + --闹钟倒计时报时 + self._leftTime_xiangling = 3 end function M:ClickSetting() @@ -708,6 +711,12 @@ function M:OnResult1(...) local niao = result.niao -- self:RemoveCursor() self._clearingView = self.EXClearingViewClass.new(self) + if self._niao_View then + self._clearingView:SetJiangMaCallback(function() + self._niao_View:RemoveFromParent() + self._niao_View:Dispose() + end) + end coroutine.start(function() if liuju then self:PlayMJSound("liuju.mp3") diff --git a/wb_new_ui/assets/Extend_MJ_FuZhou/component/bird/Panel_Birds.xml b/wb_new_ui/assets/Extend_MJ_FuZhou/component/bird/Panel_Birds.xml index 47ec05f3..12e05e21 100644 --- a/wb_new_ui/assets/Extend_MJ_FuZhou/component/bird/Panel_Birds.xml +++ b/wb_new_ui/assets/Extend_MJ_FuZhou/component/bird/Panel_Birds.xml @@ -1,10 +1,15 @@ - + - - - - + + + + + + + + + diff --git a/wb_new_ui/assets/Extend_MJ_JinXi/component/bird/Panel_Birds.xml b/wb_new_ui/assets/Extend_MJ_JinXi/component/bird/Panel_Birds.xml index c8d30c1e..b2e50cbc 100644 --- a/wb_new_ui/assets/Extend_MJ_JinXi/component/bird/Panel_Birds.xml +++ b/wb_new_ui/assets/Extend_MJ_JinXi/component/bird/Panel_Birds.xml @@ -1,11 +1,23 @@ - + - - - - - + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Extend_MJ_LiChuan/component/bird/Panel_Birds.xml b/wb_new_ui/assets/Extend_MJ_LiChuan/component/bird/Panel_Birds.xml index f43016ec..b2e50cbc 100644 --- a/wb_new_ui/assets/Extend_MJ_LiChuan/component/bird/Panel_Birds.xml +++ b/wb_new_ui/assets/Extend_MJ_LiChuan/component/bird/Panel_Birds.xml @@ -1,11 +1,23 @@ - + - - - - - + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Extend_MJ_NanCheng/component/bird/Panel_Birds.xml b/wb_new_ui/assets/Extend_MJ_NanCheng/component/bird/Panel_Birds.xml index a26685ae..12e05e21 100644 --- a/wb_new_ui/assets/Extend_MJ_NanCheng/component/bird/Panel_Birds.xml +++ b/wb_new_ui/assets/Extend_MJ_NanCheng/component/bird/Panel_Birds.xml @@ -1,10 +1,15 @@ - + - - - - + + + + + + + + + diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Comp_playerOver0Info.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Comp_playerOver0Info.xml index 9c5583a8..d6ce1519 100644 --- a/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Comp_playerOver0Info.xml +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Comp_playerOver0Info.xml @@ -1,10 +1,11 @@ + - + @@ -16,5 +17,8 @@ + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Component/Btn_GamePlay.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Component/Btn_GamePlay.xml index a9a033c6..c251e48d 100644 --- a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Component/Btn_GamePlay.xml +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Component/Btn_GamePlay.xml @@ -2,7 +2,7 @@ - + diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Component/Btn_SelfCard.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Component/Btn_SelfCard.xml index 856999da..e3b6104d 100644 --- a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Component/Btn_SelfCard.xml +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Component/Btn_SelfCard.xml @@ -3,12 +3,12 @@ - - + + - - + +