diff --git a/lua_probject/base_project/Game/Controller/GameController.lua b/lua_probject/base_project/Game/Controller/GameController.lua index 696d0432..d8e837f5 100644 --- a/lua_probject/base_project/Game/Controller/GameController.lua +++ b/lua_probject/base_project/Game/Controller/GameController.lua @@ -166,7 +166,7 @@ function M:ExitWitnessGame(pid, gid, rid) _data["room_id"] = rid -- _data["session"] = _client:getSession() _client:send(Protocol.GAME_Exit_WITNESS_ROOM, _data) - _client:destroy() + -- _client:destroy() end --聊天 diff --git a/lua_probject/base_project/Game/View/Family/FamilyMsgDiamond.lua b/lua_probject/base_project/Game/View/Family/FamilyMsgDiamond.lua index c71a1fb0..3b634fc3 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMsgDiamond.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMsgDiamond.lua @@ -10,7 +10,7 @@ function M.New(data, callback) local self = setmetatable({}, { __index = M }) self._full = true self.class = "com_FamilyMsgRecord" - BaseWindow.init(self, 'ui://Family/com_FamilyMsgRecord') + BaseWindow.init(self, 'ui://Family/com_FamilyMsgDiamond') self.data = data self:Init() self.closeCallback = callback diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index 6373d0d7..d16c54d8 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -675,7 +675,7 @@ function M:UpdateFamilyRoom(fgCtr, id) self:EnterWitnesss(id, startRoom[newIndex].id, playInfo.gameId, startRoom[newIndex].pid) end) obj:GetChild('btn_jiesan').onClick:Set(function() - self:JieSanRomm(id, readyRoom[newIndex].id) + self:JieSanRomm(id, startRoom[newIndex].id) end) else local newIndex = index - #readyRoom + 1 @@ -1062,6 +1062,7 @@ local MORE_LIST = { name = "关闭旁观", Fct = M.SetCanWatch }, + } function M:ChangeOther() @@ -1112,7 +1113,7 @@ function M:RefalshMoreBtn() elseif self._group.isOpenChatRoom == 0 then tex = "打开聊天室" end - MORE_LIST[4].name = tex + MORE_LIST[5].name = tex local tex = "" if self._group.isWatch == 1 then @@ -1120,7 +1121,7 @@ function M:RefalshMoreBtn() elseif self._group.isWatch == 0 then tex = "打开观战" end - MORE_LIST[5].name = tex + MORE_LIST[6].name = tex local tex = "" if self._group.ban then diff --git a/lua_probject/base_project/Game/View/Lobby/LobbyRecordView.lua b/lua_probject/base_project/Game/View/Lobby/LobbyRecordView.lua index d44a05b9..33312ce3 100644 --- a/lua_probject/base_project/Game/View/Lobby/LobbyRecordView.lua +++ b/lua_probject/base_project/Game/View/Lobby/LobbyRecordView.lua @@ -110,7 +110,7 @@ end function M:RecordDetailRenderer(index, obj, data) local score = data.totalScore[index + 1].score obj:GetController('colour').selectedIndex = score >= 0 and 1 or 0 - obj:GetChild('text_score').text = string.format("%s%d", score > 0 and "+" or "", score) + obj:GetChild('text_score').text = string.format("%s%d", score >= 0 and "+" or "", score) obj:GetChild('text_name').text = data.totalScore[index + 1].nick end @@ -128,7 +128,7 @@ function M:PlayerScoreRenderer(index, obj) obj:GetChild('text_time').text = os.date("%m-%d\n%H:%M:%S", tonumber(data.create_time)) local list_playerScore = obj:GetChild('list_playerScore') list_playerScore.itemRenderer = function(index1, obj1) - obj1.text = string.format("%s%d", data[string.format("round_%d", index + 1)][index1 + 1].score > 0 and "+" or "", + obj1.text = string.format("%s%d", data[string.format("round_%d", index + 1)][index1 + 1].score >= 0 and "+" or "", data[string.format("round_%d", index + 1)][index1 + 1].score) end list_playerScore.numItems = data.Info.peopleNum diff --git a/lua_probject/base_project/Game/View/PlayBackView.lua b/lua_probject/base_project/Game/View/PlayBackView.lua index 1f7b88bb..2bb272a2 100644 --- a/lua_probject/base_project/Game/View/PlayBackView.lua +++ b/lua_probject/base_project/Game/View/PlayBackView.lua @@ -42,6 +42,7 @@ function M:InitView(url) contentPane.height = self._view.height contentPane:Center() + self.com_notice = self._view:GetChild("com_notice") local panel_record = self._view:GetChild('panel_record') self._record = panel_record local btn_LastRound = panel_record:GetChild('btn_LastRound') @@ -152,6 +153,15 @@ function M:InitView(url) ) end + --没有update先不显示跑马灯 + self.com_notice.visible = false + -- local text_notice = self.com_notice:GetChild("text_notice") + -- text_notice.text = DataManager.GameNotice[self.noticeIndex] + -- local speed = 44 + -- local time = text_notice.width / speed + + -- text_notice.x = self.com_notice.width + self._eventmap = {} end diff --git a/lua_probject/base_project/Game/View/PlayerInfoView2.lua b/lua_probject/base_project/Game/View/PlayerInfoView2.lua index c0902b8e..0adfc2d1 100644 --- a/lua_probject/base_project/Game/View/PlayerInfoView2.lua +++ b/lua_probject/base_project/Game/View/PlayerInfoView2.lua @@ -46,6 +46,7 @@ function M:init() self._ctr_read = view:GetController('read') self._ctr_offline = view:GetController('offline') self._tex_score = view:GetChild('text_jifen') + self._mask_voice = view:GetChild('mask_voice') self._btn_head = view:GetChild('btn_head') self._ctr_bank = view:GetController('bank') @@ -112,6 +113,16 @@ function M:OnUpdate() self:muShiPlayerUpdate() end end + if self.voiceTimePlay then + if self.voiceTime > 0 then + self.voiceTime = self.voiceTime - Time.deltaTime + self._mask_voice.text = math.floor(self.voiceTime) + else + self.voiceTimePlay = false + self._ctr_mask_voice.selectedIndex = 0 + GameApplication.Instance.StopMusic = GameApplication.Instance.StopMusic - 1 + end + end end function M:FillData(player) @@ -236,7 +247,7 @@ end -- 表情 语音 function M:ShowInteraction(type, str) if type == 3 then - print("lingmeng ShowInteractionq",str) + print("lingmeng ShowInteractionq", str) Voice.DownLoad( str, function(clip) @@ -244,7 +255,7 @@ function M:ShowInteraction(type, str) if (clip) then print("lingmeng ShowInteraction1") self:ShowMaskVoice(clip.length) - GameApplication.Instance:PlayVoice(clip) + GameApplication.Instance:PlayVoice(clip, 3) print("lingmeng ShowInteraction2") end end @@ -308,17 +319,22 @@ end function M:ShowMaskVoice(time, mask) mask = mask or true - GameApplication.Instance.StopMusic = GameApplication.Instance.StopMusic + 1 if (mask) then self._ctr_mask_voice.selectedIndex = 1 end - if (self.__runwait_voice ~= nil) then - coroutine.stop(self.__runwait_voice) + if (self.voiceTimePlay) then + -- coroutine.stop(self.__runwait_voice) GameApplication.Instance.StopMusic = GameApplication.Instance.StopMusic - 1 end - self.__runwait_voice = nil - self.__runwait_voice = coroutine.start(self.__WaitMaskVoice, self, time) + -- self._mask_voice:GetTransition('t0'):Play() + self._mask_voice.text = math.floor(time) + self.voiceTime = time + self.voiceTimePlay = true + + TimerManager.AddTimer(self.OnUpdate, self) + -- self.__runwait_voice = nil + -- self.__runwait_voice = coroutine.start(self.__WaitMaskVoice, self, time) end function M:__WaitMaskVoice(time) diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua index c457d5cd..c9fdd63c 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua @@ -289,6 +289,18 @@ function M:fillResult1(room, peopleNum, total_result) local familyIDText = self._view:GetChild("Text_FamilyID") print("lingmeng fillResult1") pt(room) + --初始化大赢家和最佳炮手 + local bigWin = { seat = -1, score = 0 } + local bestPao = { seat = -1, times = 0 } + --循环数据得出分数最大的大赢家,以及点炮次数最多的最佳炮手 + for i = 1, #total_result.info_list do + if total_result.info_list[i].total_score > bigWin.score then + bigWin = { seat = total_result.info_list[i].seat, score = total_result.info_list[i].total_score } + end + if total_result.info_list[i].settle_log.fangpao and total_result.info_list[i].settle_log.fangpao > bestPao.times then + bestPao = { seat = total_result.info_list[i].seat, times = total_result.info_list[i].settle_log.fangpao } + end + end 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) @@ -326,6 +338,16 @@ function M:fillResult1(room, peopleNum, total_result) totalInfoList.settle_log.fanggang or 0) resultInfoComp:GetController("win").selectedIndex = totalInfoList.total_score >= 0 and 1 or 0 + if totalInfoList.seat == bigWin.seat then + resultInfoComp:GetController("bigWin").selectedIndex = 1 + -- else + -- resultInfoComp:GetController("bigWin").selectedIndex = 0 + end + if totalInfoList.seat == bestPao.seat then + resultInfoComp:GetController("fangPao").selectedIndex = 1 + -- else + -- resultInfoComp:GetController("fangPao").selectedIndex = 0 + end 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 f27fc9de..fcf44781 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua @@ -93,10 +93,6 @@ function M:InitView(url) if room.playing or room.curren_round > 0 then self:ReloadRoom() end - - ---------为了下次复现出牌情况 - --self._viewText_testName = self._view:GetChild('text_testName') - --self._viewText_testName.text = 0 end function M:__BuGang(cardInfo, callback) @@ -149,7 +145,7 @@ function M:IsShowGangZi(btn, isShow) end function M:UpdateRound() - self._view:GetChild("text_round").text = string.format("局数:%d /%d", self._room.curren_round, + self._view:GetChild("text_round").text = string.format("局数:%d/%d", self._room.curren_round, self._room.room_config.round) end @@ -223,9 +219,9 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.SendCards, function(...) -- self:ShowHuTip() - --测试用记录出牌权次数 --self._viewText_testName.text = 0 self:UpdateRound() + self:RemoveCursor() self._state.selectedIndex = 1 self:ShowJing() local list = _room.player_list @@ -297,6 +293,102 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.ZPHuCard, function(...) MJMainView.OnHuCard(self, ...) + --[[ + self._left_time = 0 + self:UpdateCardBox(0) + self:__CloseTip() + self._popEvent = false + local arg = { ... } + local win_seat = arg[1] + local lose_seat = arg[2] + local win_card = arg[3] + local cards = arg[4] + local win_list = arg[5] + local index = self:GetPos(win_seat) + local info = self._player_card_info[index] + self:RemoveCursor() + --info:UpdateHandCard(false, false) + info:ShowHuCard(win_card) + + local obj_win_card = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Btn_Card_jiangxi") + obj_win_card.icon = "ui://Main_Majiang/b202_" .. win_card + obj_win_card:GetController("bg").selectedIndex = 1 + info._view:AddChild(obj_win_card) + obj_win_card:Center() + + local url, pNode + local player = _room:GetPlayerBySeat(win_seat) + if win_seat ~= _room.self_player.seat then + url = "ui://Main_Majiang/别人胡" + pNode = info._view + elseif win_seat == _room.self_player.seat then + url = "ui://Main_Majiang/自己胡牌" + pNode = self._view + end + if win_seat == lose_seat then + url = "ui://Main_Majiang/eff_zimo" + end + + local he = UIPackage.CreateObjectFromURL(url) + pNode:AddChild(he) + he:GetTransition("t2"):Play() + he:Center() + if _room.room_config.people_num == 2 then + if win_seat ~= _room.self_player.seat then + he.scaleY = 0.4 + he.scaleX = 0.4 + he.x = he.width * 0.4 * 0.5 * -1 + he.y = he.height * 0.4 * 0.5 * -1 + end + end + + if win_seat == _room.self_player.seat then + printlog("自己位置=====") + he:Center() + elseif url == "ui://Main_Majiang/eff_zimo" then + printlog("自摸地址==========") + he.scaleY = 0.4 + he.scaleX = 0.4 + he.x = he.width * 0.4 * 0.5 * -1 + he.y = he.height * 0.4 * 0.5 * -1 + end + + + + --- + local isZiMo = win_seat == lose_seat + DataManager.CurrenRoom.isZiMoHu = isZiMo + local hu_sound = isZiMo and ("zimo") or ("hu") + printlog("声音====>>>", hu_sound) + self:PlaySound("LiChuan_MJ", player.self_user.sex, hu_sound) + + local pNode = info._view + local url = "eff_list1" + local he_list = UIPackage.CreateObjectFromURL("ui://Extend_MJ_LiChuan/" .. url) + he_list.touchable = false + pNode:AddChild(he_list) + he_list:Center() + + coroutine.start(function() + for i = 1, #win_list do + local tem = win_list[i] + if tem.type > 0 and tem.type < 32 then + local com_name = "he" .. tem.type + printlog("声音====>>>", com_name) + ViewUtil.PlaySound("LiChuan_MJ", + string.format("extend/majiang/lichuan/sound/%s/%s.mp3", ViewUtil.Sex_Chat[player.self_user.sex], + com_name)) + local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_LiChuan/" .. com_name) + coroutine.wait(0.3) + end + end + + coroutine.wait(2) + obj_win_card:Dispose() + he:Dispose() + he_list:Dispose() + self._popEvent = true + end)]] end) _gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...) @@ -389,9 +481,9 @@ function M:EventInit() local total_result = arg[2] local result = arg[1] local over = arg[3] - if over < 2 or _room.curren_round > 0 then - self:PlayMJSound("end_music.mp3") - end + -- if over < 2 or _room.curren_round > 0 then + -- self:PlayMJSound("end_music.mp3") + -- end self._clearingView = EXClearingView.new() coroutine.start(function() coroutine.wait(0.5) @@ -750,7 +842,7 @@ function M:RunNiao(list, start_seat) local card = list[i].card coroutine.wait(0.3) item:GetTransition("appear"):Play() - item.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. card) + item.icon = UIPackage.GetItemURL("Main_Majiang", "b201_" .. card) if list[i].score > 0 then item:GetController("bg").selectedIndex = 1 end end coroutine.start(function() @@ -919,7 +1011,7 @@ function M:FillShowCards(obj, card, num) if obj.icon then obj.icon = 'ui://Main_Majiang/b201_' .. card else - obj:GetChild("icon").url = 'ui://Main_Majiang/201_' .. card + obj:GetChild("icon").url = 'ui://Main_Majiang/b201_' .. card end if obj.title then obj.title = string.format("%d张", num) diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayBackView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayBackView.lua index ed155983..3610a980 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayBackView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayBackView.lua @@ -124,7 +124,7 @@ function M:ShowStep(index) list:RemoveChildrenToPool() for i = 1, #niao_list do local item = list:AddItemFromPool() - item.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. niao_list[i].card) + item.icon = UIPackage.GetItemURL("Main_Majiang", "b201_" .. niao_list[i].card) if niao_list[i].score > 0 then item:GetController("bg").selectedIndex = 2 end diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayerInfoView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayerInfoView.lua index b59c479c..ac74d71b 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayerInfoView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXPlayerInfoView.lua @@ -4,11 +4,7 @@ local PlayerInfoView2 = require("Game.View.PlayerInfoView2") local M = {} function M.new(view, mainView) - if mainView._room.room_config.people_num == 2 then - setmetatable(M, { __index = PlayerInfoView2 }) - else - setmetatable(M, { __index = PlayerInfoView }) - end + setmetatable(M, { __index = PlayerInfoView2 }) local self = setmetatable({}, { __index = M }) self._view = view self._main_view = mainView diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXSettingView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXSettingView.lua index ecd0d58c..28640424 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXSettingView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXSettingView.lua @@ -56,27 +56,27 @@ function M:init(url) self.cBtn = self._view:GetController('cBtn') - -- slider_sound.value = GameApplication.Instance.SoundValue - -- slider_music.value = GameApplication.Instance.MusicValue + slider_sound.value = GameApplication.Instance.SoundValue + slider_music.value = GameApplication.Instance.MusicValue slider_music.onChanged:Add(function() - -- GameApplication.Instance.MusicValue = slider_music.value - -- btn_music.selected = false - -- GameApplication.Instance.MusicMute = false; + GameApplication.Instance.MusicValue = slider_music.value + btn_music.selected = false + GameApplication.Instance.MusicMute = false; end) slider_sound.onChanged:Add(function() - -- GameApplication.Instance.SoundValue = slider_sound.value - -- btn_sound.selected = false - -- GameApplication.Instance.SoundMute = false; + GameApplication.Instance.SoundValue = slider_sound.value + btn_sound.selected = false + GameApplication.Instance.SoundMute = false; end) btn_sound.onClick:Add(function() - -- GameApplication.Instance.SoundMute = btn_sound.selected; + GameApplication.Instance.SoundMute = btn_sound.selected; end) btn_music.onClick:Add(function() - -- GameApplication.Instance.MusicMute = btn_music.selected; + GameApplication.Instance.MusicMute = btn_music.selected; end) local _btn_logout = self._view:GetChild('btn_cancelRoom') diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua index 04d19481..d3532956 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua @@ -6,13 +6,13 @@ local MJPlayerSelfCardInfoView = import(".MJPlayerSelfCardInfoView") local MJPlayerCardInfoView = require("main.majiang.MJPlayerCardInfoView") local SettingView = import(".EXSettingView") local TableBG = require("Game.Data.TableBG") -local WitnessView = require("Game.View.WitnessView") +local WitnessView = require("main.majiang.MJWitnessView") local MJMainView = require("main.majiang.MJMainView") +local HuCardImg = import(".HuCardImg") local Record_Event = import(".RecordEvent") - local M = {} --- Create a new @@ -26,29 +26,17 @@ function M.new() end function M:init() - self._gamectr = ControllerManager.GetController(GameController) - self._room = DataManager.CurrenRoom - self._room.Witness = true - UIPackage.AddPackage('base/chat/ui/Chat') - UIPackage.AddPackage("base/main_majiang/ui/Main_Majiang") - self._eventmap = {} - -- self._full = true - self._put_map = false - self._new_hide = false - self._queue = false - self._style = 1 - self._popEvent = true - self:InitView() - WitnessView.init(self) + getmetatable(M).__index.init(self) end -function M:InitView(url) +function M:InitView() local room = self._room + getmetatable(M).__index.InitView(self) UIPackage.AddPackage("extend/majiang/fuzhou/ui/Extend_MJ_FuZhou") - BaseView.InitView(self, string.format("ui://Main_Majiang/Main_new_%d_jiangxi", room.room_config.people_num)) self:EventInit() UpdateBeat:Add(self.OnUpdate, self) - WitnessView.InitView(self) + + self.HuCardImg = setmetatable(HuCardImg, { __index = self.HuCardImg }) local centerBox = self._view:GetChild("Comp_ConterBox") self._ctr_cardbox = centerBox:GetController("seat") @@ -70,9 +58,9 @@ function M:InitView(url) self._text_remined = self._view:GetChild('remaining_card') self._text_round = self._view:GetChild('text_round') self._cursor = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Ani_play_bj") - self._state.onChanged:Add(function() - self:UpdatePlayerInfoView() - end) + -- self._state.onChanged:Add(function() + -- self:UpdatePlayerInfoView() + -- end) self:UpdateRound() self:InitPlayerInfoView() @@ -92,8 +80,8 @@ function M:InitView(url) for i = 1, #p.fz_list do cardInfo:UpdateFzList(p.fz_list[i], -1) end - -- info:FillData(p) - -- info._view.visible = true + info:FillData(p) + info._view.visible = true end local btn_rule = self._view:GetChild('btn_rule') @@ -154,8 +142,14 @@ function M:EventInit() local _gamectr = self._gamectr _gamectr:AddEventListener(GameEvent.PlayerEnter, function(...) + self:PlayMJSound("user_enter.mp3") local arg = { ... } - print("lingmeng witness PlayerEnter") + local p = arg[1] + local info = self._player_info[self:GetPos(p.seat)] + info:FillData(p) + info._view.visible = true + info:SetPlayer(p) + info:FillData() end) _gamectr:AddEventListener(GameEvent.WitnessPlayerEnter, function(...) @@ -197,6 +191,7 @@ function M:EventInit() self._clearingView = nil end self:UpdateRound() + self:RemoveCursor() self._state.selectedIndex = 4 local list = _room.player_list for i = 1, #list do @@ -247,7 +242,7 @@ function M:EventInit() info:UpdateOutCardList(nil, nil, self._cursor) print("ling 2zhihouq") -- self:PlaySound("FuZhou_MJ", p.self_user.sex, tostring(card)) - -- self:PlayMJSound("chupai.mp3") + self:PlayMJSound("chupai.mp3") print("ling 2zhihou") if seat == _room.self_player.seat then _room.curren_outcard_seat = -1 @@ -265,7 +260,105 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.FangziAction, handler(self, self.OnFangziAction)) _gamectr:AddEventListener(TX_GameEvent.ZPHuCard, function(...) - print("lingmeng witness ZPHuCard") + self._left_time = 0 + self:UpdateCardBox(0) + local arg = { ... } + local win_seat = arg[1] + local lose_seat = arg[2] + local win_card = arg[3] + local cards = arg[4] + local win_list = arg[5] + local scoreData = arg[6] + local index = self:GetPos(win_seat) + local info = self._player_card_info[index] + local player = self._room:GetPlayerBySeat(win_seat) + info:ShowHuCard(win_card, index == 1) + + -- self.cHuCardEffect.selectedIndex = 1 + + local loader_HuEffect = info._viewLoader_selfHuCardEffect + local list_HuCardEffect = info._viewList_HuEffect + + --- + local isZiMo = win_seat == lose_seat + DataManager.CurrenRoom.isZiMoHu = isZiMo + local hu_sound = isZiMo and ("zimo") or ("hu") + printlog("声音====>>>", hu_sound) + self:PlaySound(self.asset_group, player.self_user.sex, hu_sound) + + local effects = isZiMo and ("tile_zimo") or ("tile_hu") + loader_HuEffect.visible = true + loader_HuEffect.url = "ui://Main_Majiang/" .. effects + loader_HuEffect:SetScale(2, 2) + loader_HuEffect:TweenScale(Vector2(1, 1), 0.3):SetEase(EaseType.QuartOut) + + --观战暂时把这个特效去了,现在这个特效位置也不对 + -- self.effect_ZiMo.xy = loader_HuEffect.xy + -- self.effect_ZiMo:SetPlaySettings(0, -1, 1, -1); + -- self.effect_ZiMo.visible = true + -- self.effect_ZiMo.playing = true + -- self.effect_ZiMo.onPlayEnd:Set(function() + -- self.effect_ZiMo.visible = false + -- end) + + coroutine.start(function() + coroutine.wait(0.5) + + loader_HuEffect.visible = false + local Effects = {} + for i = 1, #win_list do + local HuMsg = win_list[i] + + -- ↓↓↓先排列好特效图片 + if HuMsg.type > 2 and HuMsg.type < 32 then + -- local sound_name = string.format(self.Sound_path .. "%s/%s.mp3", + -- ViewUtil.Sex_Chat[player.self_user.sex], + -- "he" .. HuMsg.type) + -- ViewUtil.PlaySound(self.asset_group, sound_name) + self:PlaySound(self.asset_group, player.self_user.sex, "he" .. HuMsg.type) + local imgList = self.HuCardImg[HuMsg.type] + for _, img in pairs(imgList) do + local imgPath = "ui://Main_Majiang/" .. img + local imgObj = list_HuCardEffect:AddItemFromPool() + local imgLoader = imgObj:GetChild("loader_img") + imgLoader.url = imgPath + imgObj.visible = false + Effects[#Effects + 1] = imgObj + end + end + end + + -- ↓↓↓播放动画 + for _, imgObj in pairs(Effects) do + imgObj.visible = true + + local effect_xingxing = imgObj:GetChild("effect_xingxing") + effect_xingxing:SetPlaySettings(0, -1, 1, -1); + effect_xingxing.visible = true + effect_xingxing.playing = true + effect_xingxing.onPlayEnd:Set(function() + effect_xingxing.visible = false + end) + + local imgLoader = imgObj:GetChild("loader_img") + imgLoader:SetScale(2, 2) + imgLoader:Center() + imgLoader:TweenScale(Vector2(1, 1), 0.3) + coroutine.wait(0.5) + end + + -- 扣分动画 + 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) + self._popEvent = true + list_HuCardEffect:RemoveChildrenToPool() + + -- self.cHuCardEffect.selectedIndex = 0 + end) end) _gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...) @@ -293,7 +386,7 @@ function M:EventInit() -- le:Dispose() -- end) -- end - self:RemoveCursor() + -- self:RemoveCursor() if self._clearingView == nil then self._clearingView = EXClearingView.new(self._root_view) coroutine.start(function() @@ -307,7 +400,6 @@ function M:EventInit() -- if #niao == 0 then self._view:GetChild("n13").visible = false end self._clearingView:InitData(0, _room, result, nil, function(...) DataManager.CurrenRoom.self_player.card_list = {} - self._state.selectedIndex = 2 self._clearingView = nil end) end @@ -412,6 +504,12 @@ function M:PlayMJSound(path) ViewUtil.PlaySound(self.asset_group, majiang_asset_path .. path) end +function M:PlaySound(group, sex, path) + local sex_path = ViewUtil.Sex_Chat[sex] + local path1 = majiang_asset_path .. string.format("%s/%s.mp3", sex_path, path) + ViewUtil.PlaySound(group, path1) +end + function M:UpdateRound() self._view:GetChild("text_round").text = string.format("局数:%d /%d", self._room.curren_round, self._room.room_config.round) @@ -420,26 +518,26 @@ end function M:ShowJing() if self._room.jing then self.jing.visible = true - MJPlayerCardInfoView.fillCard2(self, self.jing, "202_", self._room.jing) + MJPlayerCardInfoView.fillCard2(self, self.jing, "b202_", self._room.jing) else self.jing.visible = false end end -function M:UpdatePlayerInfoView() - self._player_info = {} - local _player_info = self._player_info - local list = self._room.player_list +-- function M:UpdatePlayerInfoView() +-- self._player_info = {} +-- local _player_info = self._player_info +-- local list = self._room.player_list - for i = 1, self._room.room_config.people_num do - local seat = self:GetPos(list[i].seat) - local tem = self._view:GetChild(string.format("player_info%d_%d", seat, - (self._state.selectedIndex == 4 and 1 or 0) + 1)) - _player_info[seat] = PlayerInfoView.new(tem, self) - _player_info[seat]:FillData(list[i]) - printlog("lingmeng _player_info", tem, seat, list[i].self_user.nick_name) - end -end +-- for i = 1, self._room.room_config.people_num do +-- local seat = self:GetPos(list[i].seat) +-- local tem = self._view:GetChild(string.format("player_info%d_%d", seat, +-- (self._state.selectedIndex == 4 and 1 or 0) + 1)) +-- _player_info[seat] = PlayerInfoView.new(tem, self) +-- _player_info[seat]:FillData(list[i]) +-- printlog("lingmeng _player_info", tem, seat, list[i].self_user.nick_name) +-- end +-- end function M:OnUpdate() if (self._popEvent) then diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/ExtendConfig.lua b/lua_probject/extend_project/extend/majiang/fuzhou/ExtendConfig.lua index 0cb32845..5a652030 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/ExtendConfig.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/ExtendConfig.lua @@ -80,9 +80,7 @@ function M:FillRoomData(s2croom) if (reload) then local _reloadInfo = s2croom["reloadInfo"] - local _hand_card = _reloadInfo["hand_card"] - room.self_player.card_list = _hand_card - table.sort(_hand_card, ViewUtil.HandCardSort) + local active_seat = _reloadInfo["active_seat"] local bank_seat = _reloadInfo["banker_seat"] @@ -94,6 +92,9 @@ function M:FillRoomData(s2croom) room.curren_outcard_seat = _reloadInfo["curren_outcard_seat"] room.last_outcard_seat = last_outcard_seat room.playing = playing + local _hand_card = _reloadInfo["hand_card"] + room.self_player.card_list = _hand_card + table.sort(_hand_card, self.HandCardSortAndJing) for i = 1, #_info_list do local tem = _info_list[i] local playerid = tem["playerid"] diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua index 12ed3bb8..3af4029a 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua @@ -288,6 +288,18 @@ function M:fillResult1(room, peopleNum, total_result) local familyIDText = self._view:GetChild("Text_FamilyID") print("lingmeng fillResult1") pt(room) + --初始化大赢家和最佳炮手 + local bigWin = { seat = -1, score = 0 } + local bestPao = { seat = -1, times = 0 } + --循环数据得出分数最大的大赢家,以及点炮次数最多的最佳炮手 + for i = 1, #total_result.info_list do + if total_result.info_list[i].total_score > bigWin.score then + bigWin = { seat = total_result.info_list[i].seat, score = total_result.info_list[i].total_score } + end + if total_result.info_list[i].settle_log.fangpao and total_result.info_list[i].settle_log.fangpao > bestPao.times then + bestPao = { seat = total_result.info_list[i].seat, times = total_result.info_list[i].settle_log.fangpao } + end + end 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) @@ -325,6 +337,16 @@ function M:fillResult1(room, peopleNum, total_result) totalInfoList.settle_log.fanggang or 0) resultInfoComp:GetController("win").selectedIndex = totalInfoList.total_score >= 0 and 1 or 0 + if totalInfoList.seat == bigWin.seat then + resultInfoComp:GetController("bigWin").selectedIndex = 1 + -- else + -- resultInfoComp:GetController("bigWin").selectedIndex = 0 + end + if totalInfoList.seat == bestPao.seat then + resultInfoComp:GetController("fangPao").selectedIndex = 1 + -- else + -- resultInfoComp:GetController("fangPao").selectedIndex = 0 + end end end diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua index e39ae0ce..c15e7c37 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua @@ -144,7 +144,7 @@ function M:IsShowGangZi(btn, isShow) end function M:UpdateRound() - self._view:GetChild("text_round").text = string.format("局数:%d /%d", self._room.curren_round, + self._view:GetChild("text_round").text = string.format("局数:%d/%d", self._room.curren_round, self._room.room_config.round) end @@ -220,6 +220,7 @@ function M:EventInit() -- self:ShowHuTip() --self._viewText_testName.text = 0 self:UpdateRound() + self:RemoveCursor() self._state.selectedIndex = 1 self:ShowJing() local list = _room.player_list @@ -305,7 +306,7 @@ function M:EventInit() local index = self:GetPos(win_seat) local info = self._player_card_info[index] self:RemoveCursor() - --info:UpdateHandCard(true, false) + --info:UpdateHandCard(false, false) info:ShowHuCard(win_card) local obj_win_card = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Btn_Card_jiangxi") @@ -481,9 +482,9 @@ function M:EventInit() local total_result = arg[2] local result = arg[1] local over = arg[3] - if over < 2 or _room.curren_round > 0 then - self:PlayMJSound("end_music.mp3") - end + -- if over < 2 or _room.curren_round > 0 then + -- self:PlayMJSound("end_music.mp3") + -- end self._clearingView = EXClearingView.new() coroutine.start(function() coroutine.wait(0.5) @@ -842,7 +843,7 @@ function M:RunNiao(list, start_seat) local card = list[i].card coroutine.wait(0.3) item:GetTransition("appear"):Play() - item.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. card) + item.icon = UIPackage.GetItemURL("Main_Majiang", "b201_" .. card) if list[i].score > 0 then item:GetController("bg").selectedIndex = 1 end end coroutine.start(function() @@ -1011,7 +1012,7 @@ function M:FillShowCards(obj, card, num) if obj.icon then obj.icon = 'ui://Main_Majiang/b201_' .. card else - obj:GetChild("icon").url = 'ui://Main_Majiang/201_' .. card + obj:GetChild("icon").url = 'ui://Main_Majiang/b201_' .. card end if obj.title then obj.title = string.format("%d张", num) diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXPlayBackView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXPlayBackView.lua index 21081566..677ff84d 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXPlayBackView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXPlayBackView.lua @@ -124,7 +124,7 @@ function M:ShowStep(index) list:RemoveChildrenToPool() for i = 1, #niao_list do local item = list:AddItemFromPool() - item.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. niao_list[i].card) + item.icon = UIPackage.GetItemURL("Main_Majiang", "b201_" .. niao_list[i].card) if niao_list[i].score > 0 then item:GetController("bg").selectedIndex = 2 end diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXPlayerInfoView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXPlayerInfoView.lua index b59c479c..ac74d71b 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXPlayerInfoView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXPlayerInfoView.lua @@ -4,11 +4,7 @@ local PlayerInfoView2 = require("Game.View.PlayerInfoView2") local M = {} function M.new(view, mainView) - if mainView._room.room_config.people_num == 2 then - setmetatable(M, { __index = PlayerInfoView2 }) - else - setmetatable(M, { __index = PlayerInfoView }) - end + setmetatable(M, { __index = PlayerInfoView2 }) local self = setmetatable({}, { __index = M }) self._view = view self._main_view = mainView diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXSettingView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXSettingView.lua index 51905481..8a48ca27 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXSettingView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXSettingView.lua @@ -41,27 +41,27 @@ function M:init(url) self.cBtn = self._view:GetController('cBtn') - -- slider_sound.value = GameApplication.Instance.SoundValue - -- slider_music.value = GameApplication.Instance.MusicValue + slider_sound.value = GameApplication.Instance.SoundValue + slider_music.value = GameApplication.Instance.MusicValue slider_music.onChanged:Add(function() - -- GameApplication.Instance.MusicValue = slider_music.value - -- btn_music.selected = false - -- GameApplication.Instance.MusicMute = false; + GameApplication.Instance.MusicValue = slider_music.value + btn_music.selected = false + GameApplication.Instance.MusicMute = false; end) slider_sound.onChanged:Add(function() - -- GameApplication.Instance.SoundValue = slider_sound.value - -- btn_sound.selected = false - -- GameApplication.Instance.SoundMute = false; + GameApplication.Instance.SoundValue = slider_sound.value + btn_sound.selected = false + GameApplication.Instance.SoundMute = false; end) btn_sound.onClick:Add(function() - -- GameApplication.Instance.SoundMute = btn_sound.selected; + GameApplication.Instance.SoundMute = btn_sound.selected; end) btn_music.onClick:Add(function() - -- GameApplication.Instance.MusicMute = btn_music.selected; + GameApplication.Instance.MusicMute = btn_music.selected; end) local _btn_logout = self._view:GetChild('btn_cancelRoom') diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua index 5fe8f139..9edd1439 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua @@ -6,8 +6,9 @@ local MJPlayerSelfCardInfoView = import(".MJPlayerSelfCardInfoView") local MJPlayerCardInfoView = require("main.majiang.MJPlayerCardInfoView") local SettingView = import(".EXSettingView") local TableBG = require("Game.Data.TableBG") -local WitnessView = require("Game.View.WitnessView") +local WitnessView = require("main.majiang.MJWitnessView") local MJMainView = require("main.majiang.MJMainView") +local HuCardImg = import(".HuCardImg") local Record_Event = import(".RecordEvent") @@ -25,29 +26,17 @@ function M.new() end function M:init() - self._gamectr = ControllerManager.GetController(GameController) - self._room = DataManager.CurrenRoom - self._room.Witness = true - UIPackage.AddPackage('base/chat/ui/Chat') - UIPackage.AddPackage("base/main_majiang/ui/Main_Majiang") - self._eventmap = {} - -- self._full = true - self._put_map = false - self._new_hide = false - self._queue = false - self._style = 1 - self._popEvent = true - self:InitView() - WitnessView.init(self) + getmetatable(M).__index.init(self) end function M:InitView(url) local room = self._room + getmetatable(M).__index.InitView(self) UIPackage.AddPackage("extend/majiang/jinxi/ui/Extend_MJ_JinXi") - BaseView.InitView(self, string.format("ui://Main_Majiang/Main_new_%d_jiangxi", room.room_config.people_num)) self:EventInit() UpdateBeat:Add(self.OnUpdate, self) - WitnessView.InitView(self) + + self.HuCardImg = setmetatable(HuCardImg, { __index = self.HuCardImg }) local centerBox = self._view:GetChild("Comp_ConterBox") self._ctr_cardbox = centerBox:GetController("seat") @@ -69,19 +58,19 @@ function M:InitView(url) self._text_remined = self._view:GetChild('remaining_card') self._text_round = self._view:GetChild('text_round') self._cursor = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Ani_play_bj") - self._state.onChanged:Add(function() - self:UpdatePlayerInfoView() - end) + -- self._state.onChanged:Add(function() + -- self:UpdatePlayerInfoView() + -- end) self:UpdateRound() - -- self:InitPlayerInfoView() + self:InitPlayerInfoView() self._player_card_info = {} local _player_card_info = self._player_card_info for i = 1, #room.player_list do local p = room.player_list[i] local index = self:GetPos(p.seat) print("lingmeng index", index) - -- local info = self._player_info[index] + local info = self._player_info[index] local tem = self._view:GetChild("player_card_info" .. index) _player_card_info[index] = self:NewMJPlayerCardInfoView(tem, index) local cardInfo = _player_card_info[index] @@ -91,8 +80,8 @@ function M:InitView(url) for i = 1, #p.fz_list do cardInfo:UpdateFzList(p.fz_list[i], -1) end - -- info:FillData(p) - -- info._view.visible = true + info:FillData(p) + info._view.visible = true end local btn_rule = self._view:GetChild('btn_rule') @@ -153,8 +142,14 @@ function M:EventInit() local _gamectr = self._gamectr _gamectr:AddEventListener(GameEvent.PlayerEnter, function(...) + self:PlayMJSound("user_enter.mp3") local arg = { ... } - print("lingmeng witness PlayerEnter") + local p = arg[1] + local info = self._player_info[self:GetPos(p.seat)] + info:FillData(p) + info._view.visible = true + info:SetPlayer(p) + info:FillData() end) _gamectr:AddEventListener(GameEvent.WitnessPlayerEnter, function(...) @@ -196,6 +191,7 @@ function M:EventInit() self._clearingView = nil end self:UpdateRound() + self:RemoveCursor() self._state.selectedIndex = 4 local list = _room.player_list for i = 1, #list do @@ -246,7 +242,7 @@ function M:EventInit() info:UpdateOutCardList(nil, nil, self._cursor) print("ling 2zhihouq") --self:PlaySound("JinXi_MJ", p.self_user.sex, tostring(card)) - -- self:PlayMJSound("chupai.mp3") + self:PlayMJSound("chupai.mp3") print("ling 2zhihou") if seat == _room.self_player.seat then _room.curren_outcard_seat = -1 @@ -264,7 +260,105 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.FangziAction, handler(self, self.OnFangziAction)) _gamectr:AddEventListener(TX_GameEvent.ZPHuCard, function(...) - print("lingmeng witness ZPHuCard") + self._left_time = 0 + self:UpdateCardBox(0) + local arg = { ... } + local win_seat = arg[1] + local lose_seat = arg[2] + local win_card = arg[3] + local cards = arg[4] + local win_list = arg[5] + local scoreData = arg[6] + local index = self:GetPos(win_seat) + local info = self._player_card_info[index] + local player = self._room:GetPlayerBySeat(win_seat) + info:ShowHuCard(win_card, index == 1) + + -- self.cHuCardEffect.selectedIndex = 1 + + local loader_HuEffect = info._viewLoader_selfHuCardEffect + local list_HuCardEffect = info._viewList_HuEffect + + --- + local isZiMo = win_seat == lose_seat + DataManager.CurrenRoom.isZiMoHu = isZiMo + local hu_sound = isZiMo and ("zimo") or ("hu") + printlog("声音====>>>", hu_sound) + self:PlaySound(self.asset_group, player.self_user.sex, hu_sound) + + local effects = isZiMo and ("tile_zimo") or ("tile_hu") + loader_HuEffect.visible = true + loader_HuEffect.url = "ui://Main_Majiang/" .. effects + loader_HuEffect:SetScale(2, 2) + loader_HuEffect:TweenScale(Vector2(1, 1), 0.3):SetEase(EaseType.QuartOut) + + --观战暂时把这个特效去了,现在这个特效位置也不对 + -- self.effect_ZiMo.xy = loader_HuEffect.xy + -- self.effect_ZiMo:SetPlaySettings(0, -1, 1, -1); + -- self.effect_ZiMo.visible = true + -- self.effect_ZiMo.playing = true + -- self.effect_ZiMo.onPlayEnd:Set(function() + -- self.effect_ZiMo.visible = false + -- end) + + coroutine.start(function() + coroutine.wait(0.5) + + loader_HuEffect.visible = false + local Effects = {} + for i = 1, #win_list do + local HuMsg = win_list[i] + + -- ↓↓↓先排列好特效图片 + if HuMsg.type > 2 and HuMsg.type < 32 then + -- local sound_name = string.format(self.Sound_path .. "%s/%s.mp3", + -- ViewUtil.Sex_Chat[player.self_user.sex], + -- "he" .. HuMsg.type) + -- ViewUtil.PlaySound(self.asset_group, sound_name) + self:PlaySound(self.asset_group, player.self_user.sex, "he" .. HuMsg.type) + local imgList = self.HuCardImg[HuMsg.type] + for _, img in pairs(imgList) do + local imgPath = "ui://Main_Majiang/" .. img + local imgObj = list_HuCardEffect:AddItemFromPool() + local imgLoader = imgObj:GetChild("loader_img") + imgLoader.url = imgPath + imgObj.visible = false + Effects[#Effects + 1] = imgObj + end + end + end + + -- ↓↓↓播放动画 + for _, imgObj in pairs(Effects) do + imgObj.visible = true + + local effect_xingxing = imgObj:GetChild("effect_xingxing") + effect_xingxing:SetPlaySettings(0, -1, 1, -1); + effect_xingxing.visible = true + effect_xingxing.playing = true + effect_xingxing.onPlayEnd:Set(function() + effect_xingxing.visible = false + end) + + local imgLoader = imgObj:GetChild("loader_img") + imgLoader:SetScale(2, 2) + imgLoader:Center() + imgLoader:TweenScale(Vector2(1, 1), 0.3) + coroutine.wait(0.5) + end + + -- 扣分动画 + 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) + self._popEvent = true + list_HuCardEffect:RemoveChildrenToPool() + + -- self.cHuCardEffect.selectedIndex = 0 + end) end) _gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...) @@ -292,7 +386,7 @@ function M:EventInit() -- le:Dispose() -- end) -- end - self:RemoveCursor() + -- self:RemoveCursor() if self._clearingView == nil then self._clearingView = EXClearingView.new(self._root_view) coroutine.start(function() @@ -306,7 +400,6 @@ function M:EventInit() -- if #niao == 0 then self._view:GetChild("n13").visible = false end self._clearingView:InitData(0, _room, result, nil, function(...) DataManager.CurrenRoom.self_player.card_list = {} - self._state.selectedIndex = 2 self._clearingView = nil end) end @@ -411,6 +504,12 @@ function M:PlayMJSound(path) ViewUtil.PlaySound(self.asset_group, majiang_asset_path .. path) end +function M:PlaySound(group, sex, path) + local sex_path = ViewUtil.Sex_Chat[sex] + local path1 = majiang_asset_path .. string.format("%s/%s.mp3", sex_path, path) + ViewUtil.PlaySound(group, path1) +end + function M:UpdateRound() self._view:GetChild("text_round").text = string.format("局数:%d /%d", self._room.curren_round, self._room.room_config.round) @@ -419,26 +518,26 @@ end function M:ShowJing() if self._room.jing then self.jing.visible = true - MJPlayerCardInfoView.fillCard2(self, self.jing, "202_", self._room.jing) + MJPlayerCardInfoView.fillCard2(self, self.jing, "b202_", self._room.jing) else self.jing.visible = false end end -function M:UpdatePlayerInfoView() - self._player_info = {} - local _player_info = self._player_info - local list = self._room.player_list +-- function M:UpdatePlayerInfoView() +-- self._player_info = {} +-- local _player_info = self._player_info +-- local list = self._room.player_list - for i = 1, self._room.room_config.people_num do - local seat = self:GetPos(list[i].seat) - local tem = self._view:GetChild(string.format("player_info%d_%d", seat, - (self._state.selectedIndex == 4 and 1 or 0) + 1)) - _player_info[seat] = PlayerInfoView.new(tem, self) - _player_info[seat]:FillData(list[i]) - printlog("lingmeng _player_info", tem, seat, list[i].self_user.nick_name) - end -end +-- for i = 1, self._room.room_config.people_num do +-- local seat = self:GetPos(list[i].seat) +-- local tem = self._view:GetChild(string.format("player_info%d_%d", seat, +-- (self._state.selectedIndex == 4 and 1 or 0) + 1)) +-- _player_info[seat] = PlayerInfoView.new(tem, self) +-- _player_info[seat]:FillData(list[i]) +-- printlog("lingmeng _player_info", tem, seat, list[i].self_user.nick_name) +-- end +-- end function M:OnUpdate() if (self._popEvent) then diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua index 06b2d30e..94e180b3 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua @@ -143,7 +143,7 @@ function M:IsShowGangZi(btn, isShow) end function M:UpdateRound() - self._view:GetChild("text_round").text = string.format("局数:%d /%d", self._room.curren_round, + self._view:GetChild("text_round").text = string.format("局数:%d/%d", self._room.curren_round, self._room.room_config.round) end diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua index 6dac11c6..235a6a4c 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua @@ -56,10 +56,6 @@ function M:InitView(url) --[[ MJMainView.InitView(self, "ui://Main_Majiang/Main_new_" .. room.room_config.people_num) --]] - local config = ExtendManager.GetExtendConfig(room.game_id) - local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) - self._view:GetChild('wanfa_text').text = gamePlay self.jing = self._view:GetChild('jing') self._state.onChanged:Add(function() @@ -90,10 +86,6 @@ function M:InitView(url) if room.playing or room.curren_round > 0 then self:ReloadRoom() end - - ---------为了下次复现出牌情况 - --self._viewText_testName = self._view:GetChild('text_testName') - --self._viewText_testName.text = 0 end function M:__BuGang(cardInfo, callback) @@ -220,9 +212,9 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.SendCards, function(...) -- self:ShowHuTip() - --测试用记录出牌权次数 --self._viewText_testName.text = 0 self:UpdateRound() + self:RemoveCursor() self._state.selectedIndex = 1 self:ShowJing() local list = _room.player_list @@ -485,9 +477,9 @@ function M:EventInit() local total_result = arg[2] local result = arg[1] local over = arg[3] - if over < 2 or _room.curren_round > 0 then - self:PlayMJSound("end_music.mp3") - end + -- if over < 2 or _room.curren_round > 0 then + -- self:PlayMJSound("end_music.mp3") + -- end self._clearingView = EXClearingView.new() coroutine.start(function() coroutine.wait(0.5) @@ -847,7 +839,7 @@ function M:RunNiao(list, start_seat) local card = list[i].card coroutine.wait(0.3) item:GetTransition("appear"):Play() - item.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. card) + item.icon = UIPackage.GetItemURL("Main_Majiang", "b201_" .. card) if list[i].score > 0 then item:GetController("bg").selectedIndex = 1 end end coroutine.start(function() @@ -1016,7 +1008,7 @@ function M:FillShowCards(obj, card, num) if obj.icon then obj.icon = 'ui://Main_Majiang/b201_' .. card else - obj:GetChild("icon").url = 'ui://Main_Majiang/201_' .. card + obj:GetChild("icon").url = 'ui://Main_Majiang/b201_' .. card end if obj.title then obj.title = string.format("%d张", num) diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXPlayBackView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXPlayBackView.lua index 74dda0b8..bd11db46 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXPlayBackView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXPlayBackView.lua @@ -20,13 +20,18 @@ end function M:InitView(url) local room = self._room UIPackage.AddPackage("extend/majiang/nancheng/ui/Extend_MJ_NanCheng") - MJPlayBackView.InitView(self, string.format("ui://Main_Majiang/Main_new_%d_jiangxi", room.room_config.people_num)) + MJPlayBackView.InitView(self, string.format("ui://Main_Majiang/Main_new_%d_jiangxi", room.room_config.people_num)) local _cardbox = self._view:GetChild("cardbox") --self._view:GetChild("panel_record"):GetChild("btn_LastStep").enabled = false self._ctr_cardbox = _cardbox:GetController("c1") self._tex_round = self._view:GetChild("tex_round") self._tex_LeftCard = self._view:GetChild("remaining_card") self._anchor = self._view:GetChild("mask_tips") + + local config = ExtendManager.GetExtendConfig(room.game_id) + local mode = config:GetGameInfo() + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) + self._view:GetChild('wanfa_text').text = gamePlay self._eventmap = {} self._cmdmap = {} @@ -55,14 +60,14 @@ function M:FillRoomData(data) roominfo_panel:GetChild("tex_roomid").text = room.room_id roominfo_panel:GetChild("tex_gametype").text = room.room_config:GetGameName() - for i = 1, #room.player_list do - local p = room.player_list[i] - local card_info = _player_card_info[self:GetPos(p.seat)] - -- card_info:Clear() - table.sort(p.card_list, self.HandCardSortAndJing) - card_info:UpdateHandCard(false, true) - self._player_info[i]._view:GetController("piao_niao").selectedIndex = 0 - end + for i = 1, #room.player_list do + local p = room.player_list[i] + local card_info = _player_card_info[self:GetPos(p.seat)] + -- card_info:Clear() + table.sort(p.card_list, self.HandCardSortAndJing) + card_info:UpdateHandCard(false, true) + self._player_info[i]._view:GetController("piao_niao").selectedIndex = 0 + end self:GenerateAllStepData(data) self:UpdateStep(1) @@ -109,8 +114,8 @@ function M:ShowStep(index) end if step.cmd == Record_Event.Evt_Win then self._win_pic = UIPackage.CreateObjectFromURL("ui://Main_Majiang/胡") - local info = self._player_card_info[self:GetPos(step.win)] - info._view:AddChild(self._win_pic) + local info = self._player_card_info[self:GetPos(step.win)] + info._view:AddChild(self._win_pic) self._win_pic:Center() else if self._win_pic then @@ -124,7 +129,7 @@ function M:ShowStep(index) list:RemoveChildrenToPool() for i = 1, #niao_list do local item = list:AddItemFromPool() - item.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. niao_list[i].card) + item.icon = UIPackage.GetItemURL("Main_Majiang", "b201_" .. niao_list[i].card) if niao_list[i].score > 0 then item:GetController("bg").selectedIndex = 2 end @@ -136,27 +141,27 @@ function M:ShowStep(index) if self._niao then self._niao:Dispose() end - end - if step.cmd == Record_Event.Evt_Result then - if not self.result then - self.result = EXClearingView.new(self._root_view, { flag_back = true }) - self.result:InitData(0, self._room, step.result_data) - self.result._view.x = (GRoot.inst.width - self.result._view.width) * -0.5 - self.result._view.width = GRoot.inst.width - self.result._view.height = GRoot.inst.height - -- self.result._view:GetChild("btn_confirm").visible = false - self._anchor:AddChild(self.result._view) - self.result._view.x = self._anchor.x * -1 - self.result._view.y = self._anchor.y * -1 - else - self.result._view.visible = true - end - -- self.result._view:Center() - -- else - -- if self.result then - -- self.result._view.visible = false - -- end - end + end + if step.cmd == Record_Event.Evt_Result then + if not self.result then + self.result = EXClearingView.new(self._root_view, { flag_back = true }) + self.result:InitData(0, self._room, step.result_data) + self.result._view.x = (GRoot.inst.width - self.result._view.width) * -0.5 + self.result._view.width = GRoot.inst.width + self.result._view.height = GRoot.inst.height + -- self.result._view:GetChild("btn_confirm").visible = false + self._anchor:AddChild(self.result._view) + self.result._view.x = self._anchor.x * -1 + self.result._view.y = self._anchor.y * -1 + else + self.result._view.visible = true + end + -- self.result._view:Center() + -- else + -- if self.result then + -- self.result._view.visible = false + -- end + end end function M:GenerateAllStepData(data) @@ -287,8 +292,8 @@ function M:UpdateCardBox(seat) end function M:UpdateRound() - self._view:GetChild("text_round").text = string.format("局数:%d /%d", self._room.curren_round, - self._room.room_config.round) + self._view:GetChild("text_round").text = string.format("局数:%d/%d", self._room.curren_round, + self._room.room_config.round) end function M:UpdateStep(step) diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXPlayerInfoView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXPlayerInfoView.lua index b59c479c..ac74d71b 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXPlayerInfoView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXPlayerInfoView.lua @@ -4,11 +4,7 @@ local PlayerInfoView2 = require("Game.View.PlayerInfoView2") local M = {} function M.new(view, mainView) - if mainView._room.room_config.people_num == 2 then - setmetatable(M, { __index = PlayerInfoView2 }) - else - setmetatable(M, { __index = PlayerInfoView }) - end + setmetatable(M, { __index = PlayerInfoView2 }) local self = setmetatable({}, { __index = M }) self._view = view self._main_view = mainView diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXSettingView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXSettingView.lua index 51905481..8a48ca27 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXSettingView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXSettingView.lua @@ -41,27 +41,27 @@ function M:init(url) self.cBtn = self._view:GetController('cBtn') - -- slider_sound.value = GameApplication.Instance.SoundValue - -- slider_music.value = GameApplication.Instance.MusicValue + slider_sound.value = GameApplication.Instance.SoundValue + slider_music.value = GameApplication.Instance.MusicValue slider_music.onChanged:Add(function() - -- GameApplication.Instance.MusicValue = slider_music.value - -- btn_music.selected = false - -- GameApplication.Instance.MusicMute = false; + GameApplication.Instance.MusicValue = slider_music.value + btn_music.selected = false + GameApplication.Instance.MusicMute = false; end) slider_sound.onChanged:Add(function() - -- GameApplication.Instance.SoundValue = slider_sound.value - -- btn_sound.selected = false - -- GameApplication.Instance.SoundMute = false; + GameApplication.Instance.SoundValue = slider_sound.value + btn_sound.selected = false + GameApplication.Instance.SoundMute = false; end) btn_sound.onClick:Add(function() - -- GameApplication.Instance.SoundMute = btn_sound.selected; + GameApplication.Instance.SoundMute = btn_sound.selected; end) btn_music.onClick:Add(function() - -- GameApplication.Instance.MusicMute = btn_music.selected; + GameApplication.Instance.MusicMute = btn_music.selected; end) local _btn_logout = self._view:GetChild('btn_cancelRoom') diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua index 313bc0c0..bdcb9084 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua @@ -6,8 +6,9 @@ local MJPlayerSelfCardInfoView = import(".MJPlayerSelfCardInfoView") local MJPlayerCardInfoView = require("main.majiang.MJPlayerCardInfoView") local SettingView = import(".EXSettingView") local TableBG = require("Game.Data.TableBG") -local WitnessView = require("Game.View.WitnessView") +local WitnessView = require("main.majiang.MJWitnessView") local MJMainView = require("main.majiang.MJMainView") +local HuCardImg = import(".HuCardImg") local Record_Event = import(".RecordEvent") @@ -25,29 +26,17 @@ function M.new() end function M:init() - self._gamectr = ControllerManager.GetController(GameController) - self._room = DataManager.CurrenRoom - self._room.Witness = true - UIPackage.AddPackage('base/chat/ui/Chat') - UIPackage.AddPackage("base/main_majiang/ui/Main_Majiang") - self._eventmap = {} - -- self._full = true - self._put_map = false - self._new_hide = false - self._queue = false - self._style = 1 - self._popEvent = true - self:InitView() - WitnessView.init(self) + getmetatable(M).__index.init(self) end -function M:InitView(url) +function M:InitView() local room = self._room + getmetatable(M).__index.InitView(self) UIPackage.AddPackage("extend/majiang/nancheng/ui/Extend_MJ_NanCheng") - BaseView.InitView(self, string.format("ui://Main_Majiang/Main_new_%d_jiangxi", room.room_config.people_num)) self:EventInit() UpdateBeat:Add(self.OnUpdate, self) - WitnessView.InitView(self) + + self.HuCardImg = setmetatable(HuCardImg, { __index = self.HuCardImg }) local centerBox = self._view:GetChild("Comp_ConterBox") self._ctr_cardbox = centerBox:GetController("seat") @@ -69,12 +58,12 @@ function M:InitView(url) self._text_remined = self._view:GetChild('remaining_card') self._text_round = self._view:GetChild('text_round') self._cursor = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Ani_play_bj") - self._state.onChanged:Add(function() - self:UpdatePlayerInfoView() - end) + -- self._state.onChanged:Add(function() + -- self:UpdatePlayerInfoView() + -- end) self:UpdateRound() - -- self:InitPlayerInfoView() + self:InitPlayerInfoView() self._player_card_info = {} local _player_card_info = self._player_card_info for i = 1, #room.player_list do @@ -91,8 +80,8 @@ function M:InitView(url) for i = 1, #p.fz_list do cardInfo:UpdateFzList(p.fz_list[i], -1) end - -- info:FillData(p) - -- info._view.visible = true + info:FillData(p) + info._view.visible = true end local btn_rule = self._view:GetChild('btn_rule') @@ -153,8 +142,14 @@ function M:EventInit() local _gamectr = self._gamectr _gamectr:AddEventListener(GameEvent.PlayerEnter, function(...) + self:PlayMJSound("user_enter.mp3") local arg = { ... } - print("lingmeng witness PlayerEnter") + local p = arg[1] + local info = self._player_info[self:GetPos(p.seat)] + info:FillData(p) + info._view.visible = true + info:SetPlayer(p) + info:FillData() end) _gamectr:AddEventListener(GameEvent.WitnessPlayerEnter, function(...) @@ -196,6 +191,7 @@ function M:EventInit() self._clearingView = nil end self:UpdateRound() + self:RemoveCursor() self._state.selectedIndex = 4 local list = _room.player_list for i = 1, #list do @@ -264,7 +260,105 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.FangziAction, handler(self, self.OnFangziAction)) _gamectr:AddEventListener(TX_GameEvent.ZPHuCard, function(...) - print("lingmeng witness ZPHuCard") + self._left_time = 0 + self:UpdateCardBox(0) + local arg = { ... } + local win_seat = arg[1] + local lose_seat = arg[2] + local win_card = arg[3] + local cards = arg[4] + local win_list = arg[5] + local scoreData = arg[6] + local index = self:GetPos(win_seat) + local info = self._player_card_info[index] + local player = self._room:GetPlayerBySeat(win_seat) + info:ShowHuCard(win_card, index == 1) + + -- self.cHuCardEffect.selectedIndex = 1 + + local loader_HuEffect = info._viewLoader_selfHuCardEffect + local list_HuCardEffect = info._viewList_HuEffect + + --- + local isZiMo = win_seat == lose_seat + DataManager.CurrenRoom.isZiMoHu = isZiMo + local hu_sound = isZiMo and ("zimo") or ("hu") + printlog("声音====>>>", hu_sound) + self:PlaySound(self.asset_group, player.self_user.sex, hu_sound) + + local effects = isZiMo and ("tile_zimo") or ("tile_hu") + loader_HuEffect.visible = true + loader_HuEffect.url = "ui://Main_Majiang/" .. effects + loader_HuEffect:SetScale(2, 2) + loader_HuEffect:TweenScale(Vector2(1, 1), 0.3):SetEase(EaseType.QuartOut) + + --观战暂时把这个特效去了,现在这个特效位置也不对 + -- self.effect_ZiMo.xy = loader_HuEffect.xy + -- self.effect_ZiMo:SetPlaySettings(0, -1, 1, -1); + -- self.effect_ZiMo.visible = true + -- self.effect_ZiMo.playing = true + -- self.effect_ZiMo.onPlayEnd:Set(function() + -- self.effect_ZiMo.visible = false + -- end) + + coroutine.start(function() + coroutine.wait(0.5) + + loader_HuEffect.visible = false + local Effects = {} + for i = 1, #win_list do + local HuMsg = win_list[i] + + -- ↓↓↓先排列好特效图片 + if HuMsg.type > 2 and HuMsg.type < 32 then + -- local sound_name = string.format(self.Sound_path .. "%s/%s.mp3", + -- ViewUtil.Sex_Chat[player.self_user.sex], + -- "he" .. HuMsg.type) + -- ViewUtil.PlaySound(self.asset_group, sound_name) + self:PlaySound(self.asset_group, player.self_user.sex, "he" .. HuMsg.type) + local imgList = self.HuCardImg[HuMsg.type] + for _, img in pairs(imgList) do + local imgPath = "ui://Main_Majiang/" .. img + local imgObj = list_HuCardEffect:AddItemFromPool() + local imgLoader = imgObj:GetChild("loader_img") + imgLoader.url = imgPath + imgObj.visible = false + Effects[#Effects + 1] = imgObj + end + end + end + + -- ↓↓↓播放动画 + for _, imgObj in pairs(Effects) do + imgObj.visible = true + + local effect_xingxing = imgObj:GetChild("effect_xingxing") + effect_xingxing:SetPlaySettings(0, -1, 1, -1); + effect_xingxing.visible = true + effect_xingxing.playing = true + effect_xingxing.onPlayEnd:Set(function() + effect_xingxing.visible = false + end) + + local imgLoader = imgObj:GetChild("loader_img") + imgLoader:SetScale(2, 2) + imgLoader:Center() + imgLoader:TweenScale(Vector2(1, 1), 0.3) + coroutine.wait(0.5) + end + + -- 扣分动画 + 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) + self._popEvent = true + list_HuCardEffect:RemoveChildrenToPool() + + -- self.cHuCardEffect.selectedIndex = 0 + end) end) _gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...) @@ -292,7 +386,7 @@ function M:EventInit() -- le:Dispose() -- end) -- end - self:RemoveCursor() + -- self:RemoveCursor() if self._clearingView == nil then self._clearingView = EXClearingView.new(self._root_view) coroutine.start(function() @@ -306,7 +400,6 @@ function M:EventInit() -- if #niao == 0 then self._view:GetChild("n13").visible = false end self._clearingView:InitData(0, _room, result, nil, function(...) DataManager.CurrenRoom.self_player.card_list = {} - self._state.selectedIndex = 2 self._clearingView = nil end) end @@ -411,6 +504,12 @@ function M:PlayMJSound(path) ViewUtil.PlaySound(self.asset_group, majiang_asset_path .. path) end +function M:PlaySound(group, sex, path) + local sex_path = ViewUtil.Sex_Chat[sex] + local path1 = majiang_asset_path .. string.format("%s/%s.mp3", sex_path, path) + ViewUtil.PlaySound(group, path1) +end + function M:UpdateRound() self._view:GetChild("text_round").text = string.format("局数:%d /%d", self._room.curren_round, self._room.room_config.round) @@ -419,26 +518,26 @@ end function M:ShowJing() if self._room.jing then self.jing.visible = true - MJPlayerCardInfoView.fillCard2(self, self.jing, "202_", self._room.jing) + MJPlayerCardInfoView.fillCard2(self, self.jing, "b202_", self._room.jing) else self.jing.visible = false end end -function M:UpdatePlayerInfoView() - self._player_info = {} - local _player_info = self._player_info - local list = self._room.player_list +-- function M:UpdatePlayerInfoView() +-- self._player_info = {} +-- local _player_info = self._player_info +-- local list = self._room.player_list - for i = 1, self._room.room_config.people_num do - local seat = self:GetPos(list[i].seat) - local tem = self._view:GetChild(string.format("player_info%d_%d", seat, - (self._state.selectedIndex == 4 and 1 or 0) + 1)) - _player_info[seat] = PlayerInfoView.new(tem, self) - _player_info[seat]:FillData(list[i]) - printlog("lingmeng _player_info", tem, seat, list[i].self_user.nick_name) - end -end +-- for i = 1, self._room.room_config.people_num do +-- local seat = self:GetPos(list[i].seat) +-- local tem = self._view:GetChild(string.format("player_info%d_%d", seat, +-- (self._state.selectedIndex == 4 and 1 or 0) + 1)) +-- _player_info[seat] = PlayerInfoView.new(tem, self) +-- _player_info[seat]:FillData(list[i]) +-- printlog("lingmeng _player_info", tem, seat, list[i].self_user.nick_name) +-- end +-- end function M:OnUpdate() if (self._popEvent) then diff --git a/lua_probject/extend_project/extend/majiang/nancheng/ExtendConfig.lua b/lua_probject/extend_project/extend/majiang/nancheng/ExtendConfig.lua index 1559bc78..6a928492 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/ExtendConfig.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/ExtendConfig.lua @@ -81,9 +81,7 @@ function M:FillRoomData(s2croom) if (reload) then local _reloadInfo = s2croom["reloadInfo"] - local _hand_card = _reloadInfo["hand_card"] - room.self_player.card_list = _hand_card - table.sort(_hand_card, ViewUtil.HandCardSort) + local active_seat = _reloadInfo["active_seat"] local bank_seat = _reloadInfo["banker_seat"] @@ -96,6 +94,9 @@ function M:FillRoomData(s2croom) room.last_outcard_seat = last_outcard_seat room.playing = playing room.reload = reload + local _hand_card = _reloadInfo["hand_card"] + room.self_player.card_list = _hand_card + table.sort(_hand_card, self.HandCardSortAndJing) for i = 1, #_info_list do local tem = _info_list[i] local playerid = tem["playerid"] diff --git a/lua_probject/main_project/main/majiang/MJPlayBackView.lua b/lua_probject/main_project/main/majiang/MJPlayBackView.lua index d904fb87..953941f1 100644 --- a/lua_probject/main_project/main/majiang/MJPlayBackView.lua +++ b/lua_probject/main_project/main/majiang/MJPlayBackView.lua @@ -48,6 +48,11 @@ function M:FillRoomData() info._view.visible = true info:FillData(p) end + + local config = ExtendManager.GetExtendConfig(_room.game_id) + local mode = config:GetGameInfo() + local gamePlay = mode:LoadConfigToDetail(json.encode(_room.room_config.config), json.encode(_room.room_config.hpData)) + self._view:GetChild('wanfa_text').text = gamePlay end function M:SetCardBoxPosition() diff --git a/wb_new_ui/assets/Family/FamilyMsgRecord/Component/item_msg_diamond.xml b/wb_new_ui/assets/Family/FamilyMsgRecord/Component/item_msg_diamond.xml index ead59557..66b741aa 100644 --- a/wb_new_ui/assets/Family/FamilyMsgRecord/Component/item_msg_diamond.xml +++ b/wb_new_ui/assets/Family/FamilyMsgRecord/Component/item_msg_diamond.xml @@ -7,8 +7,9 @@ - + + \ No newline at end of file diff --git a/wb_new_ui/assets/Family/FamilyMsgRecord/com_FamilyMsgDiamond.xml b/wb_new_ui/assets/Family/FamilyMsgRecord/com_FamilyMsgDiamond.xml index 967d5a02..5c8023a3 100644 --- a/wb_new_ui/assets/Family/FamilyMsgRecord/com_FamilyMsgDiamond.xml +++ b/wb_new_ui/assets/Family/FamilyMsgRecord/com_FamilyMsgDiamond.xml @@ -7,7 +7,7 @@ - + @@ -19,9 +19,15 @@ - - - + + + + + + + + + diff --git a/wb_new_ui/assets/Family/FamilyMsgRecord/com_FamilyMsgRecord.xml b/wb_new_ui/assets/Family/FamilyMsgRecord/com_FamilyMsgRecord.xml index 5c8023a3..967d5a02 100644 --- a/wb_new_ui/assets/Family/FamilyMsgRecord/com_FamilyMsgRecord.xml +++ b/wb_new_ui/assets/Family/FamilyMsgRecord/com_FamilyMsgRecord.xml @@ -7,7 +7,7 @@ - + @@ -19,15 +19,9 @@ - - - - - - - - - + + + diff --git a/wb_new_ui/assets/Family/package.xml b/wb_new_ui/assets/Family/package.xml index 8bff6391..b2c7caf6 100644 --- a/wb_new_ui/assets/Family/package.xml +++ b/wb_new_ui/assets/Family/package.xml @@ -366,7 +366,7 @@ - + @@ -417,7 +417,7 @@ - + diff --git a/wb_new_ui/assets/Main_Majiang/Main_new/Clearing/3cd3392e-1471-4b6a-b7f8-f27a56ca117f.png b/wb_new_ui/assets/Main_Majiang/Main_new/Clearing/3cd3392e-1471-4b6a-b7f8-f27a56ca117f.png deleted file mode 100644 index 1fccd56f..00000000 Binary files a/wb_new_ui/assets/Main_Majiang/Main_new/Clearing/3cd3392e-1471-4b6a-b7f8-f27a56ca117f.png and /dev/null differ diff --git a/wb_new_ui/assets/Main_Majiang/Main_new/Clearing/Component/Btn_Head.xml b/wb_new_ui/assets/Main_Majiang/Main_new/Clearing/Component/Btn_Head.xml index 24076f60..749db91c 100644 --- a/wb_new_ui/assets/Main_Majiang/Main_new/Clearing/Component/Btn_Head.xml +++ b/wb_new_ui/assets/Main_Majiang/Main_new/Clearing/Component/Btn_Head.xml @@ -2,7 +2,7 @@ - + @@ -12,5 +12,5 @@ -