diff --git a/lua_probject/base_project/Game/View/ViewUtil.lua b/lua_probject/base_project/Game/View/ViewUtil.lua index b1d50826..bcf2aa49 100644 --- a/lua_probject/base_project/Game/View/ViewUtil.lua +++ b/lua_probject/base_project/Game/View/ViewUtil.lua @@ -199,7 +199,7 @@ function get_majiang_prefix(game_id) end ct = ct_data[tostring(game_id)] or 0 end - local prefix = ct == 0 and "" or "a" + local prefix = ct == 0 and "" or "b" --printlog("get_majiang_prefix===>>>",prefix,ct) return prefix end diff --git a/lua_probject/base_project/Game/View/playerDetailView.lua b/lua_probject/base_project/Game/View/playerDetailView.lua index 62126f73..8f6295af 100644 --- a/lua_probject/base_project/Game/View/playerDetailView.lua +++ b/lua_probject/base_project/Game/View/playerDetailView.lua @@ -32,7 +32,6 @@ function playerDetailView:Show(player) end function playerDetailView:Init() - local selfUser = DataManager.SelfUser self.tex_name = self._view:GetChild("tex_name") self.tex_ip = self._view:GetChild("tex_ip") self.tex_id = self._view:GetChild("tex_id") diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua index 7b1ba9e8..3e71f92a 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua @@ -31,12 +31,13 @@ end -- end -- end -function M:InitData(over, room, result, total_result, callback) +function M:InitData(over, room, result, total_result, callback, isWitness, witnessCallbak) -- print("===============================InitData===========================", over, room, result, total_result) -- pt(room) -- pt(result) -- Pt(total_result) self._callback = callback + self._witnessCallbak = witnessCallbak local showClearMainBtn = self._view:GetChild("btn_showClearMain") local nextRoundBtn = self._view:GetChild("btn_nextRound") local nextRoundBtn2 = self._view:GetChild("Btn_NextRound2") @@ -46,6 +47,17 @@ function M:InitData(over, room, result, total_result, callback) local playerNum = self._view:GetController("playerNum") local showBtnTypeCtr = self._view:GetController("showType") + if result then + result.cardList = json.decode(result.cardList) + table.sort(result.cardList) + end + self.list_lastCard = self._view:GetChild('list_lastCard') + + self.list_lastCard:SetVirtual() + self.list_lastCard.itemRenderer = function(index, obj) + self:RemindCardRender(result.cardList[index + 1], obj) + end + local peopleNum = room.room_config.people_num playerNum.selectedIndex = peopleNum - 2 @@ -55,9 +67,16 @@ function M:InitData(over, room, result, total_result, callback) end) nextRoundBtn.onClick:Set(function() - local _gamectr = ControllerManager.GetController(GameController) - _gamectr:PlayerReady() - self:DestroyWithCallback() + if isWitness and isWitness == 1 then + if self._witnessCallbak then + self._witnessCallbak() + end + self:DestroyWithCallback() + else + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:PlayerReady() + self:DestroyWithCallback() + end end) @@ -71,9 +90,16 @@ function M:InitData(over, room, result, total_result, callback) _overCtr.selectedIndex = 0 self:fillResult0(room, peopleNum, result) nextRoundBtn2.onClick:Set(function() - local _gamectr = ControllerManager.GetController(GameController) - _gamectr:PlayerReady() - self:DestroyWithCallback() + if isWitness and isWitness == 1 then + if self._witnessCallbak then + self._witnessCallbak() + end + self:DestroyWithCallback() + else + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:PlayerReady() + self:DestroyWithCallback() + end end) elseif over == 1 then showBtnTypeCtr.selectedIndex = 1 @@ -103,6 +129,8 @@ function M:fillResult0(room, peopleNum, result) local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) self._view:GetChild("Label_GamePlay").title = string.format("第%s/%s局,%s", room.curren_round, room.room_config.round, gamePlay) + self.list_lastCard.numItems = #result.cardList + self._view:GetChild('n147').text = string.format("剩余%d张未显示", #result.cardList) for i = 1, peopleNum do local playerInfoComp = self._view:GetChild(string.format("Comp_Player%d", i)) @@ -191,7 +219,7 @@ function M:fillResult0(room, peopleNum, result) end end handCardList.numItems = handInfoNum - allCardsList.width = 172 * fzInfoNum + 60 + (handInfoNum - 1) * 56 + 36 * (fzInfoNum) + allCardsList.width = 234 * fzInfoNum + 78 + (handInfoNum - 1) * 74 + 36 * (fzInfoNum) if infoList.seat == room.self_player.seat then isMeCtr.selectedIndex = 1 @@ -244,7 +272,9 @@ end function M:fillResult1(room, peopleNum, total_result) local gameNameAndRoomIDText = self._view:GetChild("Text_GameNameAndRoomID") local familyIDText = self._view:GetChild("Text_FamilyID") - for i, v in pairs(room.self_player.self_user.games) do + print("lingmeng fillResult1") + pt(room) + for i, v in pairs(DataManager.SelfUser.games) do if v.game_id == room.game_id then gameNameAndRoomIDText.text = string.format("%s 房号:%s", v.name, room.room_id) end @@ -288,6 +318,15 @@ function M:fillHead(url, view) ImageLoad.Load(url, view:GetChild("Btn_Head")._iconObject) end +function M:RemindCardRender(data, obj) + local room = DataManager.CurrenRoom + obj.icon = string.format("ui://Main_Majiang/b202_%d", data) + print("lingmeng icon", obj.icon) + if room.jing == data then + obj:GetController('jing').selectedIndex = 1 + end +end + function M.HandCardSortAndJing(a, b) local jing = DataManager.CurrenRoom.jing if a == jing or b == jing then diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXGameController.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXGameController.lua index 551791a5..13725234 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXGameController.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXGameController.lua @@ -332,6 +332,9 @@ function M:OneventResult1(evt_data) --0:小结算 1:小大结算 2:大结算 self._room._reload_flag = false self._room.playing = false + if evt_data.result then + evt_data.result.cardList = evt_data.cardList + end if 0 == over then local result = evt_data.result self._cacheEvent:Enqueue(function() diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua index 1dc1b601..9b592eb4 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua @@ -31,12 +31,13 @@ end -- end -- end -function M:InitData(over, room, result, total_result, callback) +function M:InitData(over, room, result, total_result, callback, isWitness, witnessCallbak) -- print("===============================InitData===========================", over, room, result, total_result) -- pt(room) -- pt(result) -- Pt(total_result) self._callback = callback + self._witnessCallbak = witnessCallbak local showClearMainBtn = self._view:GetChild("btn_showClearMain") local nextRoundBtn = self._view:GetChild("btn_nextRound") local nextRoundBtn2 = self._view:GetChild("Btn_NextRound2") @@ -46,6 +47,17 @@ function M:InitData(over, room, result, total_result, callback) local playerNum = self._view:GetController("playerNum") local showBtnTypeCtr = self._view:GetController("showType") + if result then + result.cardList = json.decode(result.cardList) + table.sort(result.cardList) + end + self.list_lastCard = self._view:GetChild('list_lastCard') + + self.list_lastCard:SetVirtual() + self.list_lastCard.itemRenderer = function(index, obj) + self:RemindCardRender(result.cardList[index + 1], obj) + end + local peopleNum = room.room_config.people_num playerNum.selectedIndex = peopleNum - 2 @@ -55,9 +67,16 @@ function M:InitData(over, room, result, total_result, callback) end) nextRoundBtn.onClick:Set(function() - local _gamectr = ControllerManager.GetController(GameController) - _gamectr:PlayerReady() - self:DestroyWithCallback() + if isWitness and isWitness == 1 then + if self._witnessCallbak then + self._witnessCallbak() + end + self:DestroyWithCallback() + else + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:PlayerReady() + self:DestroyWithCallback() + end end) @@ -71,9 +90,16 @@ function M:InitData(over, room, result, total_result, callback) _overCtr.selectedIndex = 0 self:fillResult0(room, peopleNum, result) nextRoundBtn2.onClick:Set(function() - local _gamectr = ControllerManager.GetController(GameController) - _gamectr:PlayerReady() - self:DestroyWithCallback() + if isWitness and isWitness == 1 then + if self._witnessCallbak then + self._witnessCallbak() + end + self:DestroyWithCallback() + else + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:PlayerReady() + self:DestroyWithCallback() + end end) elseif over == 1 then showBtnTypeCtr.selectedIndex = 1 @@ -103,6 +129,8 @@ function M:fillResult0(room, peopleNum, result) local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) self._view:GetChild("Label_GamePlay").title = string.format("第%s/%s局,%s", room.curren_round, room.room_config.round, gamePlay) + self.list_lastCard.numItems = #result.cardList + self._view:GetChild('n147').text = string.format("剩余%d张未显示", #result.cardList) for i = 1, peopleNum do local playerInfoComp = self._view:GetChild(string.format("Comp_Player%d", i)) @@ -186,12 +214,13 @@ function M:fillResult0(room, peopleNum, result) handCardList:SetVirtual() handCardList.itemRenderer = function(index, obj) obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), infoList.hand_card[index + 1]) + print("obj.icon") if room.jing == infoList.hand_card[index + 1] then obj:GetController('jing').selectedIndex = 1 end end handCardList.numItems = handInfoNum - allCardsList.width = 172 * fzInfoNum + 60 + (handInfoNum - 1) * 56 + 36 * (fzInfoNum) + allCardsList.width = 234 * fzInfoNum + 78 + (handInfoNum - 1) * 74 + 36 * (fzInfoNum) if infoList.seat == room.self_player.seat then isMeCtr.selectedIndex = 1 @@ -240,7 +269,9 @@ end function M:fillResult1(room, peopleNum, total_result) local gameNameAndRoomIDText = self._view:GetChild("Text_GameNameAndRoomID") local familyIDText = self._view:GetChild("Text_FamilyID") - for i, v in pairs(room.self_player.self_user.games) do + print("lingmeng fillResult1") + pt(room) + for i, v in pairs(DataManager.SelfUser.games) do if v.game_id == room.game_id then gameNameAndRoomIDText.text = string.format("%s 房号:%s", v.name, room.room_id) end @@ -284,6 +315,14 @@ function M:fillHead(url, view) ImageLoad.Load(url, view:GetChild("Btn_Head")._iconObject) end +function M:RemindCardRender(data, obj) + local room = DataManager.CurrenRoom + obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), data) + if room.jing == data then + obj:GetController('jing').selectedIndex = 1 + end +end + function M.HandCardSortAndJing(a, b) local jing = DataManager.CurrenRoom.jing if a == jing or b == jing then diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXGameController.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXGameController.lua index 1fd228f1..c49be0c7 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXGameController.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXGameController.lua @@ -332,6 +332,9 @@ function M:OneventResult1(evt_data) --0:小结算 1:小大结算 2:大结算 self._room._reload_flag = false self._room.playing = false + if evt_data.result then + evt_data.result.cardList = evt_data.cardList + end if 0 == over then local result = evt_data.result self._cacheEvent:Enqueue(function() diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua index 0b43c9a7..ded6138b 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua @@ -47,6 +47,17 @@ function M:InitData(over, room, result, total_result, callback, isWitness, witne local playerNum = self._view:GetController("playerNum") local showBtnTypeCtr = self._view:GetController("showType") + if result then + result.cardList = json.decode(result.cardList) + table.sort(result.cardList) + end + self.list_lastCard = self._view:GetChild('list_lastCard') + + self.list_lastCard:SetVirtual() + self.list_lastCard.itemRenderer = function(index, obj) + self:RemindCardRender(result.cardList[index + 1], obj) + end + local peopleNum = room.room_config.people_num playerNum.selectedIndex = peopleNum - 2 @@ -116,6 +127,8 @@ function M:fillResult0(room, peopleNum, result) local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) self._view:GetChild("Label_GamePlay").title = string.format("第%s/%s局,%s", room.curren_round, room.room_config.round, gamePlay) + self.list_lastCard.numItems = #result.cardList + self._view:GetChild('n147').text = string.format("剩余%d张未显示", #result.cardList) for i = 1, peopleNum do local playerInfoComp = self._view:GetChild(string.format("Comp_Player%d", i)) @@ -302,6 +315,14 @@ function M:fillHead(url, view) ImageLoad.Load(url, view:GetChild("Btn_Head")._iconObject) end +function M:RemindCardRender(data, obj) + local room = DataManager.CurrenRoom + obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), data) + if room.jing == data then + obj:GetController('jing').selectedIndex = 1 + end +end + function M.HandCardSortAndJing(a, b) local jing = DataManager.CurrenRoom.jing if a == jing or b == jing then diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXGameController.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXGameController.lua index 985c8c40..32a47f1b 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXGameController.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXGameController.lua @@ -328,11 +328,14 @@ end function M:OneventResult1(evt_data) local over = evt_data.type - print("OneventResult1") + printlog("OneventResult1") pt(evt_data) --0:小结算 1:小大结算 2:大结算 self._room._reload_flag = false self._room.playing = false + if evt_data.result then + evt_data.result.cardList = evt_data.cardList + end if 0 == over then local result = evt_data.result self._cacheEvent:Enqueue(function() diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua index 0349b8a3..51d3a874 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua @@ -31,12 +31,13 @@ end -- end -- end -function M:InitData(over, room, result, total_result, callback) +function M:InitData(over, room, result, total_result, callback, isWitness, witnessCallbak) -- print("===============================InitData===========================", over, room, result, total_result) -- pt(room) -- pt(result) -- Pt(total_result) self._callback = callback + self._witnessCallbak = witnessCallbak local showClearMainBtn = self._view:GetChild("btn_showClearMain") local nextRoundBtn = self._view:GetChild("btn_nextRound") local nextRoundBtn2 = self._view:GetChild("Btn_NextRound2") @@ -46,6 +47,17 @@ function M:InitData(over, room, result, total_result, callback) local playerNum = self._view:GetController("playerNum") local showBtnTypeCtr = self._view:GetController("showType") + if result then + result.cardList = json.decode(result.cardList) + table.sort(result.cardList) + end + self.list_lastCard = self._view:GetChild('list_lastCard') + + self.list_lastCard:SetVirtual() + self.list_lastCard.itemRenderer = function(index, obj) + self:RemindCardRender(result.cardList[index + 1], obj) + end + local peopleNum = room.room_config.people_num playerNum.selectedIndex = peopleNum - 2 @@ -55,9 +67,16 @@ function M:InitData(over, room, result, total_result, callback) end) nextRoundBtn.onClick:Set(function() - local _gamectr = ControllerManager.GetController(GameController) - _gamectr:PlayerReady() - self:DestroyWithCallback() + if isWitness and isWitness == 1 then + if self._witnessCallbak then + self._witnessCallbak() + end + self:DestroyWithCallback() + else + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:PlayerReady() + self:DestroyWithCallback() + end end) endRound.onClick:Set(function() @@ -69,9 +88,16 @@ function M:InitData(over, room, result, total_result, callback) _overCtr.selectedIndex = 0 self:fillResult0(room, peopleNum, result) nextRoundBtn2.onClick:Set(function() - local _gamectr = ControllerManager.GetController(GameController) - _gamectr:PlayerReady() - self:DestroyWithCallback() + if isWitness and isWitness == 1 then + if self._witnessCallbak then + self._witnessCallbak() + end + self:DestroyWithCallback() + else + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:PlayerReady() + self:DestroyWithCallback() + end end) elseif over == 1 then showBtnTypeCtr.selectedIndex = 1 @@ -101,6 +127,8 @@ function M:fillResult0(room, peopleNum, result) local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) self._view:GetChild("Label_GamePlay").title = string.format("第%s/%s局,%s", room.curren_round, room.room_config.round, gamePlay) + self.list_lastCard.numItems = #result.cardList + self._view:GetChild('n147').text = string.format("剩余%d张未显示", #result.cardList) for i = 1, peopleNum do local playerInfoComp = self._view:GetChild(string.format("Comp_Player%d", i)) @@ -184,14 +212,13 @@ function M:fillResult0(room, peopleNum, result) table.sort(infoList.hand_card, self.HandCardSortAndJing) handCardList:SetVirtual() handCardList.itemRenderer = function(index, obj) - obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), - infoList.hand_card[index + 1]) + obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), infoList.hand_card[index + 1]) if room.jing == infoList.hand_card[index + 1] then obj:GetController('jing').selectedIndex = 1 end end handCardList.numItems = handInfoNum - allCardsList.width = 172 * fzInfoNum + 60 + (handInfoNum - 1) * 56 + 36 * (fzInfoNum) + allCardsList.width = 234 * fzInfoNum + 78 + (handInfoNum - 1) * 74 + 36 * (fzInfoNum) if infoList.seat == room.self_player.seat then isMeCtr.selectedIndex = 1 @@ -240,7 +267,9 @@ end function M:fillResult1(room, peopleNum, total_result) local gameNameAndRoomIDText = self._view:GetChild("Text_GameNameAndRoomID") local familyIDText = self._view:GetChild("Text_FamilyID") - for i, v in pairs(room.self_player.self_user.games) do + print("lingmeng fillResult1") + pt(room) + for i, v in pairs(DataManager.SelfUser.games) do if v.game_id == room.game_id then gameNameAndRoomIDText.text = string.format("%s 房号:%s", v.name, room.room_id) end @@ -284,6 +313,14 @@ function M:fillHead(url, view) ImageLoad.Load(url, view:GetChild("Btn_Head")._iconObject) end +function M:RemindCardRender(data, obj) + local room = DataManager.CurrenRoom + obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), data) + if room.jing == data then + obj:GetController('jing').selectedIndex = 1 + end +end + function M.HandCardSortAndJing(a, b) local jing = DataManager.CurrenRoom.jing if a == jing or b == jing then diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXGameController.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXGameController.lua index d885a18a..36c3b4e3 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXGameController.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXGameController.lua @@ -332,6 +332,9 @@ function M:OneventResult1(evt_data) --0:小结算 1:小大结算 2:大结算 self._room._reload_flag = false self._room.playing = false + if evt_data.result then + evt_data.result.cardList = evt_data.cardList + end if 0 == over then local result = evt_data.result self._cacheEvent:Enqueue(function() diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Component/btn_gameDismissRoom.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Component/btn_gameDismissRoom.xml new file mode 100644 index 00000000..be816b97 --- /dev/null +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Component/btn_gameDismissRoom.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + +