diff --git a/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua b/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua index 723e1aea..1007a2e2 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua @@ -392,7 +392,7 @@ function M:NumberRecordDetailRender() self._viewList_players:RemoveChildrenToPool() for j = 1, #info.totalScore do local obj = self._viewList_players:AddItemFromPool() - self:RecordItemPlayersRender(json.decode(info.round_1), obj) + self:RecordItemPlayersRender(info.totalScore[j], obj) end self.ctr_numberRecord.selectedIndex = 3 end) @@ -500,7 +500,7 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj) end function M:RecordItemPlayersRender(data, obj) - obj:GetChild('n2').text = data.nick + obj.text = data.nick end function M:NumverRankRenderer(groupId) diff --git a/lua_probject/base_project/Game/View/Family/FamilyRecord.lua b/lua_probject/base_project/Game/View/Family/FamilyRecord.lua index 81975670..de7d76a8 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyRecord.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyRecord.lua @@ -162,7 +162,7 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj) end function M:RecordItemPlayersRender(data, obj) - obj:GetChild('n2').text = data.nick + obj.text = data.nick end function M:RecordItemRenderer(data, obj) @@ -179,7 +179,7 @@ function M:RecordItemRenderer(data, obj) self._viewList_players:RemoveChildrenToPool() for j = 1, #data.totalScore do local obj = self._viewList_players:AddItemFromPool() - self:RecordItemPlayersRender(json.decode(data.round_1), obj) + self:RecordItemPlayersRender(data.totalScore[j], obj) end self._ctr_cWindow.selectedIndex = 1 end) diff --git a/lua_probject/base_project/Game/View/SettingView.lua b/lua_probject/base_project/Game/View/SettingView.lua index 1a97ec85..e455173d 100644 --- a/lua_probject/base_project/Game/View/SettingView.lua +++ b/lua_probject/base_project/Game/View/SettingView.lua @@ -6,10 +6,10 @@ local TableBG = import 'Game.Data.TableBG' local SettingView = {} local M = SettingView -setmetatable(M, {__index = BaseWindow}) +setmetatable(M, { __index = BaseWindow }) function SettingView.new(blur_view) - local self = setmetatable({}, {__index = M}) + local self = setmetatable({}, { __index = M }) self.class = 'SettingView' self._currenIndex = 0 self._blur_view = blur_view @@ -24,47 +24,46 @@ function SettingView.new(blur_view) end function M:init(url) - BaseWindow.init(self, url) local view = self._view local slider_sound = view:GetChild('slider_sound') local slider_music = view:GetChild('slider_music') - -- local btn_music = view:GetChild('btn_music') - -- local btn_sound = view:GetChild('btn_sound') + local btn_music = view:GetChild('btn_music') + local btn_sound = view:GetChild('btn_sound') - -- btn_music.selected = (GameApplication.Instance.MusicValue < 5 and false or true) + btn_music.selected = (GameApplication.Instance.MusicValue < 5 and false or true) slider_sound.value = GameApplication.Instance.SoundValue slider_music.value = GameApplication.Instance.MusicValue - -- btn_sound.selected = GameApplication.Instance.SoundValue < 5 and false or true + btn_sound.selected = GameApplication.Instance.SoundValue < 5 and false or true slider_music.onChanged:Add( function() GameApplication.Instance.MusicValue = slider_music.value - -- btn_music.selected = GameApplication.Instance.MusicValue < 5 and false or true + btn_music.selected = GameApplication.Instance.MusicValue < 5 and false or true end ) slider_sound.onChanged:Add( function() GameApplication.Instance.SoundValue = slider_sound.value - -- btn_sound.selected = GameApplication.Instance.SoundValue < 5 and false or true + btn_sound.selected = GameApplication.Instance.SoundValue < 5 and false or true end ) - -- btn_sound.onChanged:Add( - -- function() - -- GameApplication.Instance.SoundValue = btn_sound.selected and 50 or 0 - -- slider_sound.value = GameApplication.Instance.SoundValue - -- end - -- ) + btn_sound.onChanged:Add( + function() + GameApplication.Instance.SoundValue = btn_sound.selected and 50 or 0 + slider_sound.value = GameApplication.Instance.SoundValue + end + ) - -- btn_music.onChanged:Add( - -- function() - -- GameApplication.Instance.MusicValue = btn_music.selected and 50 or 0 - -- slider_music.value = GameApplication.Instance.MusicValue - -- end - -- ) + btn_music.onChanged:Add( + function() + GameApplication.Instance.MusicValue = btn_music.selected and 50 or 0 + slider_music.value = GameApplication.Instance.MusicValue + end + ) self._stateController = view:GetController('state') self.cd_time_text = view:GetChild('n35') @@ -111,22 +110,24 @@ function M:init(url) end ) end - -- local btn_close = self._view:GetChild("btn_close") - -- if btn_close then - -- btn_close.onClick:Add(function( ... ) + local btn_close = self._view:GetChild("btn_close") + if btn_close then + btn_close.onClick:Add(function(...) - -- end) - -- end + end) + end end --赋值bg_config function M:GetBGConfig() return TableBG.GetBGConfig() end + --获得背景 function M:GetBgByGameId(game_id) return TableBG.GetTableBG(game_id) end + --显示背景选项,并加载背景 function M:FillBgSection(cb, game_id, default_bg, bg_config) local view = self._view @@ -137,14 +138,14 @@ function M:FillBgSection(cb, game_id, default_bg, bg_config) local config = bg_config[i] local item = lst_bg:AddItemFromPool() item.icon = config.thumb - --printlog("显示背景选项,并加载背景",item.icon) + --printlog("显示背景选项,并加载背景",item.icon) item.data = config if i > 6 then ctr_bg:AddPage(i - 1) end item.onClick:Add( function(index) - cb(config.url,i) + cb(config.url, i) end ) end @@ -167,20 +168,20 @@ function M:Show() if self._stateController.selectedIndex == 2 and self.cd_time_text ~= nil then self.cd_coroutine = coroutine.start( - function() - while (self.cd_time > 0) do - self:SetCanDissroom(false) - self.cd_time = self.cd_time - 1 - self.cd_time = math.max(0, self.cd_time) - self.cd_time_text.text = tostring(math.ceil(self.cd_time)) - if self.cd_time > 0 then - coroutine.wait(1) + function() + while (self.cd_time > 0) do + self:SetCanDissroom(false) + self.cd_time = self.cd_time - 1 + self.cd_time = math.max(0, self.cd_time) + self.cd_time_text.text = tostring(math.ceil(self.cd_time)) + if self.cd_time > 0 then + coroutine.wait(1) + end end + self:SetCanDissroom(self._btn_dismiss_room_enable) + self.cd_time_text.text = '' end - self:SetCanDissroom(self._btn_dismiss_room_enable) - self.cd_time_text.text = '' - end - ) + ) end end diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua index aeaf2792..bfd7961d 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua @@ -182,7 +182,6 @@ function M:LoadConfigToDetail(data, hpdata) configData = json.decode(data) end - pt("lingemng", data) local hpData = configData.hpData or hpdata if type(hpData) == 'string' then hpData = json.decode(hpData) diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua index ecf19337..7ead374c 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua @@ -177,7 +177,7 @@ function M:LoadConfigToDetail(data, hpdata) returnString = string.format("%s人数%s人", returnString, configData.maxPlayers) returnString = string.format("%s,%s,%s,%s", returnString, - configData.zimo == 0 and "可点炮,可自摸" or "只能自摸", + configData.zimo == 0 and "可点炮,可自摸" or "必须自摸", configData.tuoguan == 0 and string.format("%d秒后自动托管", configData.tuoguan_active_time) or "不能托管", configData.jingbibo == 1 and "有精必博" or "有精可胡") diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua index 90596f8a..ecdf4b5f 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua @@ -162,7 +162,7 @@ function M:UpdatePlayerInfoView() local _player_info = self._player_info local list = self._room.player_list - for i = 1, self._room.room_config.people_num do + for i = 1, #list do local seat = self:GetPos(list[i].seat) local tem = self._view:GetChild(string.format("player_info%d_%d", seat, (self._state.selectedIndex % 2) + 1)) _player_info[seat] = PlayerInfoView.new(tem, self) @@ -771,56 +771,6 @@ function M:_ChiView(tiplist, callback) self._pop_tip_choice = _pop_tip_choice end -function M:OnFangziAction(...) - self:__CloseTip() - local arg = { ... } - local _player_card_info = self._player_card_info - local fz = arg[1] - local player = arg[2] - local index = arg[3] - local info = _player_card_info[self:GetPos(player.seat)] - -- local pNode = info._mask_liangpai - local effect = UIPackage.CreateObject("Extend_MJ_LiChuan", "FzEffect") - if fz.type == FZType.Peng then - self:PlaySound("LiChuan_MJ", player.self_user.sex, "peng") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰") - -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框") - elseif fz.type == FZType.Chi then - self:PlaySound("LiChuan_MJ", player.self_user.sex, "chi") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃") - else - self:PlaySound("LiChuan_MJ", player.self_user.sex, "gang") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠") - -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框") - end - effect.touchable = false - effect:GetTransition("t2"):Play() - -- pNode:AddChild(effect) - coroutine.start(function() - coroutine.wait(0.3) - self._popEvent = true - end) - coroutine.start(function() - coroutine.wait(2) - effect:Dispose() - end) - - self:RemoveCursor() - if (player.seat ~= fz.from_seat) then - local fs_info = _player_card_info[self:GetPos(fz.from_seat)] - fs_info:UpdateOutCardList() - end - local seat = (self._room.room_config.people_num == 2 and fz.from_seat == 2) and 2 or fz.from_seat - 1 - info:UpdateFzList(fz, index, true, seat) - local getcard = fz.type == FZType.Peng or fz.type == FZType.Chi - printlog(getcard) - info:UpdateHandCard(getcard) - self:__CloseTip() -end - function M:RunNiao(list, start_seat) local _room = self._room --local _niao_View = self._niao_View @@ -938,6 +888,9 @@ function M:ReloadRoom(bskip) if bskip == nil or bskip == false then if p.ready and room.playing == false then self._player_info[self:GetPos(p.seat)]:Ready(true) + if room.self_player.seat == p.seat then + self._ctr_action.selectedIndex = 0 + end end end if p.piao_niao ~= nil and p.piao_niao > 0 then diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXWitnessView.lua index 9cb80434..ac49d519 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXWitnessView.lua @@ -191,8 +191,6 @@ function M:EventInit() print("lingmeng witness FZTips") end) - _gamectr:AddEventListener(TX_GameEvent.FangziAction, handler(self, self.OnFangziAction)) - _gamectr:AddEventListener(TX_GameEvent.ZPHuCard, function(...) self._popEvent = false self._left_time = 0 @@ -326,7 +324,7 @@ function M:EventInit() -- self:RemoveCursor() if self._clearingView == nil then self._clearingView = EXClearingView.new(self._root_view) - self._clearingView._view:GetChild('btn_setting').onClick:Set(handler(self,self.ClickSetting)) + self._clearingView._view:GetChild('btn_setting').onClick:Set(handler(self, self.ClickSetting)) coroutine.start(function() coroutine.wait(0.5) self._clearingView:Show() @@ -357,7 +355,7 @@ function M:EventInit() info._view:GetController("text_color").selectedIndex = 1 info._view:GetChild("text_jifen").text = num end - + info._view:GetChild("mask_piao").title = "" info._view:GetController("piao_niao").selectedIndex = 0 p.fz_list = {} @@ -403,17 +401,17 @@ function M:EventInit() print("lingmeng witness EventResidueCard") end) - --替换mianview的事件 - _gamectr:AddEventListener( - GameEvent.PlayerState, - function(...) - printlog("lingmeng OnEventOnlineState") - local arg = { ... } - local p = arg[1] - local info = self._player_info[self:GetPos(p.seat)] - info._ctr_offline.selectedIndex = p.line_state == 0 and 1 or 0 - end - ) + --替换mianview的事件 + _gamectr:AddEventListener( + GameEvent.PlayerState, + function(...) + printlog("lingmeng OnEventOnlineState") + local arg = { ... } + local p = arg[1] + local info = self._player_info[self:GetPos(p.seat)] + info._ctr_offline.selectedIndex = p.line_state == 0 and 1 or 0 + end + ) end function M:InitPlayerInfoView() @@ -421,7 +419,7 @@ function M:InitPlayerInfoView() local _player_info = self._player_info for i = 1, self._room.room_config.people_num do local tem = self._view:GetChild(string.format("player_info%d_2", i)) - _player_info[i] = PlayerInfoView.new(tem, self,true) + _player_info[i] = PlayerInfoView.new(tem, self, true) tem.visible = false end end @@ -449,67 +447,6 @@ function M:UpdateCardBox(seat) self._ctr_cardbox.selectedIndex = index end -function M:OnFangziAction(...) - local arg = { ... } - local _player_card_info = self._player_card_info - local fz = arg[1] - local player = arg[2] - local index = arg[3] - local info = _player_card_info[self:GetPos(player.seat)] - -- local pNode = info._mask_liangpai - - - - local arg = { ... } - local _player_card_info = self._player_card_info - local fz = arg[1] - local player = arg[2] - local index = arg[3] - local info = _player_card_info[self:GetPos(player.seat)] - -- local pNode = info._mask_liangpai - local effect = UIPackage.CreateObject("Extend_MJ_LiChuan", "FzEffect") - if fz.type == FZType.Peng then - self:PlaySound("LiChuan_MJ", player.self_user.sex, "peng") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰") - -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框") - elseif fz.type == FZType.Chi then - self:PlaySound("LiChuan_MJ", player.self_user.sex, "chi") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃") - else - self:PlaySound("LiChuan_MJ", player.self_user.sex, "gang") - effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠") - effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠") - -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框") - end - effect.touchable = false - effect:GetTransition("t2"):Play() - -- pNode:AddChild(effect) - coroutine.start(function() - coroutine.wait(0.3) - self._popEvent = true - end) - coroutine.start(function() - coroutine.wait(2) - effect:Dispose() - end) - - self:RemoveCursor() - if (player.seat ~= fz.from_seat) then - local fs_info = _player_card_info[self:GetPos(fz.from_seat)] - fs_info:UpdateOutCardList() - end - local seat = (self._room.room_config.people_num == 2 and fz.from_seat == 2) and 2 or fz.from_seat - 1 - info:UpdateFzList(fz, index, true, seat) - - --因为观战没有手牌,等预处理完扣牌数之后矫正一次(最粗暴的修正方式,手牌数等于13-3*吃碰数) - - info._player.hand_left_count = 14 - 3 * #info._player.fz_list - info:UpdateHandCardWitness(true) - -- self:__CloseTip() -end - local majiang_asset_path = "base/main_majiang/sound/" function M:PlayMJSound(path) ViewUtil.PlaySound(self.asset_group, majiang_asset_path .. path) diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua index a9a44f4c..2734c94b 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua @@ -208,9 +208,9 @@ function M:LoadConfigToDetail(data, hpdata) configData.jiangma and string.format("奖%d", configData.jiangma * 2) or "不奖", configData.shaozhuang == 1 and ",有烧庄" or "", configData.zuoma == 0 and ",庄家坐马" or "", - configData.zimo == 0 and ",可点炮,可自摸" or ",只能自摸", + configData.zimo == 0 and ",可点炮,可自摸" or ",必须自摸", configData.tuoguan and string.format(",%d秒后自动托管", configData.tuoguan_active_time) or ",不能托管", - configData.jiahu == 0 and ",可以假胡" or "", configData.fengding and ",封顶20炮" or "", + configData.jiahu == 0 and ",可以假胡" or "", configData.fengding == 0 and ",封顶20炮" or "", configData.zhuanwan == 0 and "大转弯" or "小转弯") if configData.GPSDetection then diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua index 3af85240..263c203d 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua @@ -263,9 +263,9 @@ function M:EventInit() info:UpdateHandCard() local outcard = UIPackage.CreateObjectFromURL(_gcm_outcard_url) info:UpdateOutCardList(outcard, card, self._cursor) - + self:PlayMJSound("chupai.mp3") -self:PlaySound("NanCheng_MJ", p.self_user.sex, tostring(card)) + self:PlaySound("NanCheng_MJ", p.self_user.sex, tostring(card)) if seat == _room.self_player.seat then _room.curren_outcard_seat = -1 end @@ -893,13 +893,13 @@ function M:ReloadRoom(bskip) -- self._room._reload_flag = true -- end + local flag_action = 0 if bskip == nil or bskip == false then if not room.playing then self._state.selectedIndex = 2 self._ctr_action.selectedIndex = 1 else self._state.selectedIndex = 1 - self._ctr_action.selectedIndex = 0 self._room._reload_flag = true end end @@ -923,7 +923,6 @@ function M:ReloadRoom(bskip) head_info._view:GetController('text_color').selectedIndex = 1 head_info._view:GetChild('text_jifen').text = num --d2ad(num) end - if p.seat == room.last_outcard_seat then local card = p.outcard_list[#p.outcard_list] info:UpdateOutCardList(nil, card, self._cursor) @@ -936,12 +935,16 @@ function M:ReloadRoom(bskip) if p.seat == room.banker_seat then head_info:MarkBank(true) end + -- if p.ready then -- self._player_info[self:GetPos(p.seat)]:Ready(true) -- end if bskip == nil or bskip == false then if p.ready and room.playing == false then self._player_info[self:GetPos(p.seat)]:Ready(true) + if room.self_player.seat == p.seat then + self._ctr_action.selectedIndex = 0 + end end end if p.piao_niao ~= nil and p.piao_niao > 0 then diff --git a/lua_probject/main_project/main/majiang/MJMainView.lua b/lua_probject/main_project/main/majiang/MJMainView.lua index 33c33df6..139eb7fc 100644 --- a/lua_probject/main_project/main/majiang/MJMainView.lua +++ b/lua_probject/main_project/main/majiang/MJMainView.lua @@ -215,7 +215,7 @@ function M:InitView(url, use_custom_bg, custom_bg_config) self:InitXiPai() self:InitXiPai1() - self.btn_setting.onClick:Set(handler(self,self.ClickSetting)) + self.btn_setting.onClick:Set(handler(self, self.ClickSetting)) end function M:ClickSetting() @@ -723,7 +723,7 @@ function M:OnResult1(...) -- end -- self:RemoveCursor() self._clearingView = self.EXClearingViewClass.new(self._root_view) - self._clearingView._view:GetChild('btn_setting').onClick:Set(handler(self,self.ClickSetting)) + self._clearingView._view:GetChild('btn_setting').onClick:Set(handler(self, self.ClickSetting)) coroutine.start(function() coroutine.wait(0.5) self._clearingView:Show() @@ -880,6 +880,52 @@ function M:OnHuCard(...) end) end +function M:OnFangziAction(...) + self:__CloseTip() + local arg = { ... } + local _player_card_info = self._player_card_info + local fz = arg[1] + local player = arg[2] + local index = arg[3] + local info = _player_card_info[self:GetPos(player.seat)] + local loader_HuEffect = info._viewClip_Peng_Gang + local effects = "" + if fz.type == FZType.Peng then + effects = "clip_peng" + elseif fz.type == FZType.Chi then + + else + effects = "clip_gang" + end + local clip = UIPackage.CreateObjectFromURL(string.format("ui://Main_Majiang/%s", effects)) + clip:SetSize(loader_HuEffect.width, loader_HuEffect.height) + loader_HuEffect:AddChild(clip) + clip:SetPlaySettings(0, -1, 1, -1) + clip.onPlayEnd:Add(function() + if clip.parent then + clip.parent:RemoveChild(clip) + end + clip:Dispose() + end) + clip.playing = true + coroutine.start(function() + coroutine.wait(0.3) + self._popEvent = true + end) + + self:RemoveCursor() + if (player.seat ~= fz.from_seat) then + local fs_info = _player_card_info[self:GetPos(fz.from_seat)] + fs_info:UpdateOutCardList() + end + local seat = (self._room.room_config.people_num == 2 and fz.from_seat == 2) and 2 or fz.from_seat - 1 + info:UpdateFzList(fz, index, true, seat) + local getcard = fz.type == FZType.Peng or fz.type == FZType.Chi + printlog(getcard) + info:UpdateHandCard(getcard) + self:__CloseTip() +end + function M:ShowJing() if self._room.jing then self.jing.visible = true diff --git a/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua b/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua index aa53771e..93e061ac 100644 --- a/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua +++ b/lua_probject/main_project/main/majiang/MJPlayerCardInfoView.lua @@ -57,6 +57,7 @@ function M:init() self._viewList_HuEffect = self._view:GetChild("list_HuEffect") self._viewLoader_selfHuCardEffect = self._view:GetChild("loader_selfHuCardEffect") self._viewClip_effect_ZiMo = self._view:GetChild("effect_ZiMo") + self._viewClip_Peng_Gang = self._view:GetChild("area_clip_pg") self._view_getCard = self._view:GetChild('Btn_HandCard') self._ctr_getCard = self._view:GetController('getCard') @@ -503,7 +504,7 @@ function M:ShowHand(cards) if self._viewText_cardInfo['show_columnGap'] and list.columnGap ~= tonumber(self._viewText_cardInfo['show_columnGap']) then list.columnGap = tonumber(self._viewText_cardInfo['show_columnGap']) end - list:RemoveChildren() + list:RemoveChildren(0, -1, true) --list:RemoveChildren() local passcard = false for _, card in pairs(cards) do diff --git a/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua b/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua index 646c592b..22938a74 100644 --- a/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua +++ b/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua @@ -85,6 +85,7 @@ function M:UpdateHandCard(getcard, mp) else btn_card = self._view_handCardList:AddItemFromPool() end + -- btn_card.sound = "ui://Main_Majiang/click" self:FillHandCard(i, btn_card, tem_card, true) -- btn_card.onClick:Set(handler(self, self.__OnClickHandCard)) end @@ -145,7 +146,7 @@ function M:onTouchMove(context) local cardWidth = button.width; local grap = self._view_handCardList.columnGap local chooseIndex = math.floor(touchPos.x / (cardWidth + grap)) - if self._last_chooseIndex ~= chooseIndex then + if self._last_chooseIndex ~= chooseIndex and self._view_handCardList.selectedIndex ~= chooseIndex then self._last_chooseIndex = chooseIndex self._mainView:PlayMJSound("clickCard.mp3") end diff --git a/lua_probject/main_project/main/majiang/MJSettingViewNew.lua b/lua_probject/main_project/main/majiang/MJSettingViewNew.lua index 5254eca5..17b64fb0 100644 --- a/lua_probject/main_project/main/majiang/MJSettingViewNew.lua +++ b/lua_probject/main_project/main/majiang/MJSettingViewNew.lua @@ -131,10 +131,10 @@ function M:init(url) self.btn_cancelRoom.onClick:Set(function() - if self._mainView.dismiss_room_cd_time > 0 then - ViewUtil.ErrorTip(nil, "您还处于解散冷却时间当中,请稍后重试!") - return - end + -- if self._mainView.dismiss_room_cd_time > 0 then + -- ViewUtil.ErrorTip(nil, "您还处于解散冷却时间当中,请稍后重试!") + -- return + -- end local _gamectr = ControllerManager.GetController(GameController) _gamectr:AskDismissRoom() diff --git a/lua_probject/main_project/main/majiang/MJWitnessView.lua b/lua_probject/main_project/main/majiang/MJWitnessView.lua index fcf28657..ca83b66a 100644 --- a/lua_probject/main_project/main/majiang/MJWitnessView.lua +++ b/lua_probject/main_project/main/majiang/MJWitnessView.lua @@ -50,7 +50,7 @@ function M:InitView() TableBG.LoadTableBG(default_bg, self._room.game_id, self._root_view, bg_config) self.btn_setting = self._view:GetChild("btn_setting") - self.btn_setting.onClick:Set(handler(self,self.ClickSetting)) + self.btn_setting.onClick:Set(handler(self, self.ClickSetting)) end function M:ClickSetting() @@ -83,21 +83,32 @@ function M:EventInit() if self._clearingView then self._clearingView:Destroy() self._clearingView = nil + local list = _room.player_list + for i = 1, #list do + local p = list[i] + local info = self._player_info[self:GetPos(p.seat)] + info:MarkBank(p.seat == _room.banker_seat) + info:Ready(false) + local card_info = self._player_card_info[self:GetPos(p.seat)] + card_info:Clear() + card_info:UpdateHandCardWitness() + end + else + local list = _room.player_list + for i = 1, #list do + local p = list[i] + local info = self._player_info[self:GetPos(p.seat)] + info:FillData(p) + info:MarkBank(p.seat == _room.banker_seat) + info:Ready(false) + local card_info = self._player_card_info[self:GetPos(p.seat)] + card_info:Clear() + card_info:UpdateHandCardWitness() + end end self:UpdateRound() self:RemoveCursor() self._state.selectedIndex = 4 - local list = _room.player_list - for i = 1, #list do - local p = list[i] - local info = self._player_info[self:GetPos(p.seat)] - info:FillData(p) - info:MarkBank(p.seat == _room.banker_seat) - info:Ready(false) - local card_info = self._player_card_info[self:GetPos(p.seat)] - card_info:Clear() - card_info:UpdateHandCardWitness() - end end) _gamectr:AddEventListener(TX_GameEvent.EventTurn, function(...) @@ -130,6 +141,65 @@ function M:EventInit() _room.curren_outcard_seat = -1 end end) + + _gamectr:AddEventListener(TX_GameEvent.FangziAction, handler(self, self.OnFangziAction)) +end + +function M:OnFangziAction(...) + local arg = { ... } + local _player_card_info = self._player_card_info + local fz = arg[1] + local player = arg[2] + local index = arg[3] + local info = _player_card_info[self:GetPos(player.seat)] + -- local pNode = info._mask_liangpai + + + + local arg = { ... } + local _player_card_info = self._player_card_info + local fz = arg[1] + local player = arg[2] + local index = arg[3] + local info = _player_card_info[self:GetPos(player.seat)] + local loader_HuEffect = info._viewClip_Peng_Gang + local effects = "" + if fz.type == FZType.Peng then + effects = "clip_peng" + elseif fz.type == FZType.Chi then + + else + effects = "clip_gang" + end + local clip = UIPackage.CreateObjectFromURL(string.format("ui://Main_Majiang/%s", effects)) + clip:SetSize(loader_HuEffect.width, loader_HuEffect.height) + loader_HuEffect:AddChild(clip) + clip:SetPlaySettings(0, -1, 1, -1) + clip.onPlayEnd:Add(function() + if clip.parent then + clip.parent:RemoveChild(clip) + end + clip:Dispose() + end) + clip.playing = true + coroutine.start(function() + coroutine.wait(2) + effect:Dispose() + end) + + self:RemoveCursor() + if (player.seat ~= fz.from_seat) then + local fs_info = _player_card_info[self:GetPos(fz.from_seat)] + fs_info:UpdateOutCardList() + end + local seat = (self._room.room_config.people_num == 2 and fz.from_seat == 2) and 2 or fz.from_seat - 1 + info:UpdateFzList(fz, index, true, seat) + + --因为观战没有手牌,等预处理完扣牌数之后矫正一次(最粗暴的修正方式,手牌数等于13-3*吃碰数) + + info._player.hand_left_count = 14 - 3 * #info._player.fz_list + info:UpdateHandCardWitness(true) + -- self:__CloseTip() end return M diff --git a/wb_new_ui/assets/Family/Record/Component/Item_title.xml b/wb_new_ui/assets/Family/Record/Component/Item_title.xml index 58298a06..17985510 100644 --- a/wb_new_ui/assets/Family/Record/Component/Item_title.xml +++ b/wb_new_ui/assets/Family/Record/Component/Item_title.xml @@ -1,11 +1,12 @@ - + - + +