diff --git a/lua_probject/base_project/Game/Controller/GameController.lua b/lua_probject/base_project/Game/Controller/GameController.lua index 725af097..bf24a0fd 100644 --- a/lua_probject/base_project/Game/Controller/GameController.lua +++ b/lua_probject/base_project/Game/Controller/GameController.lua @@ -531,11 +531,12 @@ function M:PopEvent() local _cacheEvent = self._cacheEvent if (_cacheEvent:Count() > 0) then local rawFunc = _cacheEvent:Dequeue() - return function(...) - return xpcall(rawFunc, function(e) - return debug.traceback("Lua Error: " .. tostring(e), 2) - end, ...) - end + return rawFunc + -- return function(...) + -- return xpcall(rawFunc, function(e) + -- return debug.traceback("Lua Error: " .. tostring(e), 2) + -- end, ...) + -- end end end diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index e37f9b55..bfc34dc3 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -618,7 +618,7 @@ function M:UpdateFamilyRoom(fgCtr, id) list_room.itemRenderer = function(index, obj) if index < #readyRoom then local newIndex = index + 1 - local playInfo = self._group:getPlay(roomList[newIndex].pid) + local playInfo = self._group:getPlay(readyRoom[newIndex].pid) self:FillSameRoomInfo(obj, 1, playInfo) local plist = readyRoom[newIndex].plist local insertName = "" @@ -647,7 +647,7 @@ function M:UpdateFamilyRoom(fgCtr, id) if response.ReturnCode ~= 0 then if response.ReturnCode == 10 then - self:EnterWitnesss(id, roomList[newIndex].id, playInfo.gameId, roomList[newIndex].pid) + self:EnterWitnesss(id, readyRoom[newIndex].id, playInfo.gameId, readyRoom[newIndex].pid) return end ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败') diff --git a/lua_probject/base_project/Game/View/MainView.lua b/lua_probject/base_project/Game/View/MainView.lua index 7fa7e190..ecb262cb 100644 --- a/lua_probject/base_project/Game/View/MainView.lua +++ b/lua_probject/base_project/Game/View/MainView.lua @@ -46,9 +46,11 @@ local function LoadClickData() return json.decode(json_data) end - ---lingmeng新全局标记 -lingmengxin = false +local function IsRoomOwer() + --local roomOwner = self._room.player_list[1].self_user.account_id + local roomOwner = DataManager.CurrenRoom.player_list[1].self_user.account_id + return roomOwner == DataManager.SelfUser.account_id +end -- MainView MainView = {} @@ -75,7 +77,7 @@ function M:init() UIPackage.AddPackage('base/chat/ui/Chat') self.Fix_Msg_Chat = ViewUtil.Fix_Msg_Chat -- 自动回复消息列表 self.Fix_Msg_Chat2 = nil -- 自动回复列表2 - self._scale = true + --self._scale = true self._full_offset = false self.class = "MainView" self:InitView() @@ -181,7 +183,10 @@ function M:InitView(url, isHideIpAdds) local btn_rule = self._view:GetChild('btn_rule') if btn_rule ~= nil then btn_rule.onClick:Set(function() - self._ctr_more.selectedIndex = 0 + if self._ctr_more then + --现在只有麻将才有_ctr_more + self._ctr_more.selectedIndex = 0 + end if self.RuleView == nil or self.RuleView._is_destroy then self.RuleView = RoomInfoView.new(self._room) end @@ -282,7 +287,10 @@ function M:InitView(url, isHideIpAdds) local chatText = _view:GetChild('btn_sendText') if chatText then chatText.onClick:Add(function() - self._ctr_more.selectedIndex = 0 + if self._ctr_more then + --现在只有麻将才有_ctr_more + self._ctr_more.selectedIndex = 0 + end if self._room.room_config.config.hpData.BanChat == 1 then ViewUtil.ShowBannerOnScreenCenter("本房间禁止快捷聊天") return @@ -455,41 +463,28 @@ function M:InitView(url, isHideIpAdds) end ) end - local btn_closeRoom = _view:GetChild('Btn_CloseRoom') - if btn_closeRoom ~= nil then - btn_closeRoom.onClick:Set( - function() - local tip_owner = '您是否退出房间?\n(退出房间后房间将解散)' - local tip = '您是否退出房间?' -- \n (请注意,申请洗牌后退出,不会返还洗牌分) - local tipStr = '' - if self._room.agent then - tipStr = '您是否退出房间?' - else - tipStr = self._room.owner_id == self._room.self_player.self_user.account_id and tip_owner or tip - end - local _curren_msg = MsgWindow.new(self._root_view, tipStr, MsgWindow.MsgMode.OkAndCancel) - _curren_msg.onOk:Add( - function() - if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then - ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。') + local btn_closeRoom = self._view:GetChild('btn_closeRoom') + if btn_closeRoom then + btn_closeRoom.onClick:Set(function() + if IsRoomOwer() then + self._gamectr:AskDismissRoom( + function(res) + ViewUtil.CloseModalWait() + if res.ReturnCode == 0 then + ViewManager.ChangeView(ViewManager.View_Family) else - ViewUtil.ShowModalWait(self._root_view) - self._gamectr:LevelRoom( - function(res) - ViewUtil.CloseModalWait() - if res.ReturnCode == 0 then - ViewManager.ChangeView(ViewManager.View_Lobby) - else - ViewUtil.ErrorTip(res.ReturnCode) - end - end - ) + ViewUtil.ErrorTip(res.ReturnCode) end - end - ) - _curren_msg:Show() + end) + return end - ) + self._gamectr:LevelRoom(function(res) + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode) + end + ViewManager.ChangeView(ViewManager.View_Family) + end) + end) end --[[local btn_back_lobby = _view:GetChild('btn_back_lobby') btn_back_lobby.displayObject.gameObject:SetActive(false) @@ -566,7 +561,10 @@ function M:InitView(url, isHideIpAdds) if self._viewBtn_pangGuang and self._view_WitnessPlayer and self._ctr_showWitness then self._viewBtn_pangGuang.onClick:Set(function() - self._ctr_more.selectedIndex = 0 + if self._ctr_more then + --现在只有麻将才有_ctr_more + self._ctr_more.selectedIndex = 0 + end self._ctr_showWitness.selectedIndex = 1 self:ShowWitnessPlayer() end) @@ -897,24 +895,7 @@ function M:EventInit() end ) - _gamectr:AddEventListener( - GameEvent.TupGuanOpen, - function(...) - ---- print("刷新托管数据=====") - local arg = { ... } - local p = arg[1] - local info = self._player_info[self:GetPos(p.seat)] - self._left_time = tonumber(arg[3]) or 0 - - if info and info.IsShowTGTips then - info:IsShowTGTips(arg[2], arg[3]) - end - - if info and info.SetShowTGTips then - info:SetShowTGTips(arg[2], arg[3]) - end - end - ) + _gamectr:AddEventListener(GameEvent.TupGuanOpen, handler(self, self.OnTupGuanOpen)) _gamectr:AddEventListener(GameEvent.WitnessPlayerEnter, handler(self, self.OnPlayerWitnessEnter)) @@ -1019,6 +1000,22 @@ function M:GetReadyNum() return readyNum end +function M:OnTupGuanOpen(...) + ---- print("刷新托管数据=====") + local arg = { ... } + local p = arg[1] + local info = self._player_info[self:GetPos(p.seat)] + self._left_time = tonumber(arg[3]) or 0 + + if info and info.IsShowTGTips then + info:IsShowTGTips(arg[2], arg[3]) + end + + if info and info.SetShowTGTips then + info:SetShowTGTips(arg[2], arg[3]) + end +end + function M:OnPlayerWitnessEnter(...) ---- print("刷新托管数据=====") local arg = { ... } @@ -1181,8 +1178,15 @@ function M:MarkSelfTuoguan() --托管前把弹窗啥的去一下 if self._player_card_info then local info = self._player_card_info[1] - info._ctr_tip.selectedIndex = 0 - info._ctr_showGuoHu.selectedIndex = 0 + if info._ctr_tip then + info._ctr_tip.selectedIndex = 0 + end + if info.ctr_put_card_option then + info.ctr_put_card_option.selectedIndex = 0 + end + if info._ctr_showGuoHu then + info._ctr_showGuoHu.selectedIndex = 0 + end end if self._com_tuoguan then return diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua index e8a54d68..c6fcbae0 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua @@ -221,7 +221,7 @@ function M:LoadConfigToDetailOnlyPlay(data, hpdata) returnString = string.format("%s%s", returnString, configData.zikechengshun == 0 and ",字可成顺" or ",字不可成顺") end if configData.zhuangfenfanbei then - returnString = string.format("%s%s", returnString, configData.zikechengshun == 0 and ",庄家积分翻倍" or ",庄家积分不翻倍") + returnString = string.format("%s%s", returnString, configData.zhuangfenfanbei == 0 and ",庄家积分翻倍" or ",庄家积分不翻倍") end return returnString @@ -273,7 +273,7 @@ function M:LoadConfigToDetail(data, hpdata) returnString = string.format("%s%s", returnString, configData.zikechengshun == 0 and ",字可成顺" or ",字不可成顺") end if configData.zhuangfenfanbei then - returnString = string.format("%s%s", returnString, configData.zikechengshun == 0 and ",庄家积分翻倍" or ",庄家积分不翻倍") + returnString = string.format("%s%s", returnString, configData.zhuangfenfanbei == 0 and ",庄家积分翻倍" or ",庄家积分不翻倍") end returnString = returnString .. IGameInfo.LoadConfigToDetail(self, configData, hpData) diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua index 528d6847..05da71b9 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua @@ -479,14 +479,30 @@ function M:EventInit() local total_result = arg[2] local result = arg[1] local over = arg[3] + if over == 2 then + if _room.curren_round > 0 then + self:PlayMJMusic("gameover.mp3") + end + else + self:PlayMJMusic("gameover.mp3") + end + self._clearingView = EXClearingView.new() + local liuju = result.liuju + coroutine.start(function() + if liuju then + self:PlayMJSound("liuju.mp3") + coroutine.wait(3) + self:PlayMJSound("end_music.mp3") + else + self:PlayMJSound("end_music.mp3") + end + coroutine.wait(0.5) + self._clearingView:Show() + self._popEvent = true + 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) - self._clearingView:Show() - end) self._clearingView:InitData(over, _room, result, total_result) ControllerManager.ChangeController(LoddyController) end) diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua index 38d8e0f5..50f429e1 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua @@ -481,14 +481,30 @@ function M:EventInit() local total_result = arg[2] local result = arg[1] local over = arg[3] + if over == 2 then + if _room.curren_round > 0 then + self:PlayMJMusic("gameover.mp3") + end + else + self:PlayMJMusic("gameover.mp3") + end + self._clearingView = EXClearingView.new() + local liuju = result.liuju + coroutine.start(function() + if liuju then + self:PlayMJSound("liuju.mp3") + coroutine.wait(3) + self:PlayMJSound("end_music.mp3") + else + self:PlayMJSound("end_music.mp3") + end + coroutine.wait(0.5) + self._clearingView:Show() + self._popEvent = true + 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) - self._clearingView:Show() - end) self._clearingView:InitData(over, _room, result, total_result) ControllerManager.ChangeController(LoddyController) end) diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua index 2529c57b..2e6e117f 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua @@ -478,10 +478,26 @@ function M:EventInit() local total_result = arg[2] local result = arg[1] local over = arg[3] + if over == 2 then + if _room.curren_round > 0 then + self:PlayMJMusic("gameover.mp3") + end + else + self:PlayMJMusic("gameover.mp3") + end self._clearingView = EXClearingView.new() + local liuju = result.liuju coroutine.start(function() + if liuju then + self:PlayMJSound("liuju.mp3") + coroutine.wait(3) + self:PlayMJSound("end_music.mp3") + else + self:PlayMJSound("end_music.mp3") + end coroutine.wait(0.5) self._clearingView:Show() + self._popEvent = true end) self._clearingView:InitData(over, _room, result, total_result) ControllerManager.ChangeController(LoddyController) diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua index 3059144a..10790798 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua @@ -480,14 +480,30 @@ function M:EventInit() local total_result = arg[2] local result = arg[1] local over = arg[3] + if over == 2 then + if _room.curren_round > 0 then + self:PlayMJMusic("gameover.mp3") + end + else + self:PlayMJMusic("gameover.mp3") + end + self._clearingView = EXClearingView.new() + local liuju = result.liuju + coroutine.start(function() + if liuju then + self:PlayMJSound("liuju.mp3") + coroutine.wait(3) + self:PlayMJSound("end_music.mp3") + else + self:PlayMJSound("end_music.mp3") + end + coroutine.wait(0.5) + self._clearingView:Show() + self._popEvent = true + 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) - self._clearingView:Show() - end) self._clearingView:InitData(over, _room, result, total_result) ControllerManager.ChangeController(LoddyController) end) diff --git a/lua_probject/extend_project/extend/poker/runfast/EXPlayerInfoView.lua b/lua_probject/extend_project/extend/poker/runfast/EXPlayerInfoView.lua index 3efa15c3..3f430e83 100644 --- a/lua_probject/extend_project/extend/poker/runfast/EXPlayerInfoView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/EXPlayerInfoView.lua @@ -31,6 +31,23 @@ function M:FillData(player) -- end end +function M:SetBaoDan(flag) + self._view:GetController('baodan').selectedIndex = flag and 1 or 0 +end + +function M:PlayScore(score, win) + if win then + self._view:GetController('piaoWin').selectedIndex = 1 + self._view:GetChild('text_piaoScoreAdd').text = "+" .. score + else + self._view:GetController('piaoWin').selectedIndex = 0 + self._view:GetChild('text_piaoScoreLess').text = score + end + self._view:GetTransition('piaoScore'):Play(1, 0, function() + + end) +end + function M:UpdatePiao(piao) if piao == nil or piao == -1 then self._view:GetChild("piao").text = "" diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua index 56d8c4a1..31af1af3 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua @@ -30,6 +30,7 @@ local bg_config = { function M:InitView(url) local room = self._room + self._full = true UIPackage.AddPackage("extend/poker/runfast/ui/Extend_Poker_RunFastNew") PKMainView.InitView(self, "ui://Extend_Poker_RunFastNew/RunFast_Main_New_" .. room.room_config.people_num, nil, 1, default_bg, bg_config, nil) @@ -114,7 +115,7 @@ function M:InitView(url) self.ctr_state = self._view:GetController("state") self._ctr_action = self._view:GetController("action") - self._tex_leftTime = self._view:GetChild("time"):GetChild("title") + -- self._tex_leftTime = self._view:GetChild("time"):GetChild("title") self.ctr_time = self._view:GetController("time") self._text_round = self._view:GetChild("round") self.ctr_card_eff = self._view:GetController("card_eff") @@ -190,19 +191,20 @@ function M:InitView(url) end end - if self._view:GetChild("shengyu") ~= nil then - -- body + --剩余弄在头像上,三人就会有两个剩余 + -- if self._view:GetChild("shengyu") ~= nil then + -- -- body - if room.room_config.Leaf == 1 then - -- body - self._view:GetChild("shengyu"):GetChild("shengyu").text = "剩余15张" - else - self._view:GetChild("shengyu"):GetChild("shengyu").text = "剩余16张" - end - end + -- if room.room_config.Leaf == 1 then + -- -- body + -- self._view:GetChild("shengyu"):GetChild("shengyu").text = "剩余15张" + -- else + -- self._view:GetChild("shengyu"):GetChild("shengyu").text = "剩余16张" + -- end + -- end ------------------lingmeng-------------------------- - self._tex_leftTime = self._view:GetChild('Comp_Clock'):GetChild('time') -- 重写 + -- self._tex_leftTime = self._view:GetChild('Comp_Clock'):GetChild('time') -- 重写 self._text_currenRound = self._view:GetChild('Text_CurrenRound') self._text_maxRound = self._view:GetChild('Text_MaxMaxRound') @@ -221,6 +223,18 @@ function M:InitView(url) ViewUtil.ErrorMsg(self._view, "", "该功能还未开放") end) + self._view:GetChild('text_roomId').text = self._room.room_id + self._ctr_inClear = self._view:GetController('Inclear') + self._view:GetChild('btn_ready_inClear').onClick:Set(function() + if self.result_view and self.result_view._view then + self._ctr_inClear.selectedIndex = 0 + self.result_view:ClearReady() + else + self.result_view = nil + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:ConformToNextGame() + end + end) ---------------------------------------------------- end @@ -382,7 +396,7 @@ function M:EventInit() end -- body - head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "剩" .. p.hand_count .. "张" + head_info._view:GetChild("shengyu").text = p.hand_count end p:Clear() head_info:FillData(p) @@ -485,7 +499,7 @@ function M:EventInit() end -- body - head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "剩" .. p.hand_count .. "张" + head_info._view:GetChild("shengyu").text = p.hand_count end p:Clear() head_info:FillData(p) @@ -520,6 +534,7 @@ function M:EventInit() local isNewBout = arg[2] local index = self:GetPos(seat) + self.ctr_time.selectedIndex = index -- for i=1,#self._player_info do -- if index==i then @@ -542,7 +557,19 @@ function M:EventInit() -- self.MypokerList = nil -- end end - self._left_time = 20 + for i = 1, #self._player_card_info do + local card_info = self._player_card_info[i] + if i == index then + card_info._ctr_time_clock.selectedIndex = 1 + self._tex_leftTime = card_info._view_comp_clock + else + card_info._ctr_time_clock.selectedIndex = 0 + end + end + if self._left_time and self._left_time < 20 then + self._left_time = 20 + end + if self._room.ming_card ~= nil then self._view:GetTransition("t" .. index):Play() self._room.ming_card = nil @@ -566,6 +593,7 @@ function M:EventInit() end) _gamectr:AddEventListener(RunFast_GameEvent.OnPlaySucc, function(...) + ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/playcard_chup.mp3") local arg = { ... } local p = arg[1] local card_number = arg[2] @@ -586,10 +614,10 @@ function M:EventInit() -- body if card_number ~= nil then -- body - head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "剩" .. card_number .. "张" + head_info._view:GetChild("shengyu").text = card_number end end - + head_info:SetBaoDan(card_number == 1) local card_info = self._player_card_info[index] card_info:SetOutCardInfo(p.out_card_list, false, true) @@ -602,7 +630,7 @@ function M:EventInit() if index == 1 then card_info:DeleteHandCards(p.out_card_list) else - card_info:SetRemainCardNumber(card_number == 1) + -- card_info:SetRemainCardNumber(card_number == 1) --card_info:UpdateHandPoker(card_number,false,false) -- todo end @@ -620,10 +648,8 @@ function M:EventInit() -- self:_Effect(cardstype, p) -- end -- end - self._cardCheck:InitLastCard(lastCardList) self:_Effect(self._cardCheck.type, p) - print("lingmengsound", cardstype, num, self._room.is_new_bout) self:PlaySound(p.self_user.sex, self:GetSoundFileName(self._cardCheck.type, num, self._room.is_new_bout)) -- self:PlaySound(p.self_user.sex, self:GetSoundFileName(cardstype, num, self._room.is_new_bout)) @@ -842,73 +868,86 @@ function M:EventInit() self.destory_win = nil self.destory_win = coroutine.start(function() + if win_seat == self._room.self_player.seat then + ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/end_music.mp3") + else + ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/lose_music.mp3") + end + -- -- print("11111111111111") -- coroutine.wait(1) coroutine.wait(1) - if self._room.self_player.seat == win_seat then - local sprint_seat_list = self:GetSpringSeats(info) - if #sprint_seat_list > 0 then - local url = "ui://Extend_Poker_RunFastNew/Spring" - self.WinItem_view = UIPackage.CreateObjectFromURL(url) - self._view:AddChild(self.WinItem_view) - self.WinItem_view:Center() - self.WinItem_view:GetTransition("t0"):Play() - ViewUtil.PlaySound("RunFastNew_PK", "base/common/sound/win new.mp3") - end - -- local url = #sprint_seat_list > 0 and "ui://Extend_Poker_RunFastNew/Spring" or "ui://Extend_Poker_RunFastNew/Win_Mine" - else - local beigang = false - if #self:GetSpringSeats(info) > 0 then - for i = 1, #self:GetSpringSeats(info) do - if self:GetSpringSeats(info)[i] == self._room.self_player.seat then - local url = "ui://Extend_Poker_RunFastNew/spring2" - self.WinItem_view = UIPackage.CreateObjectFromURL(url) - self._view:AddChild(self.WinItem_view) - self.WinItem_view:Center() - self.WinItem_view:GetTransition("t0"):Play() - beigang = true - end - end - end - -- if beigang == false then - -- self:CreateRankEff() - -- end - end + -- if self._room.self_player.seat == win_seat then + -- local sprint_seat_list = self:GetSpringSeats(info) + -- if #sprint_seat_list > 0 then + -- local url = "ui://Extend_Poker_RunFastNew/Spring" + -- self.WinItem_view = UIPackage.CreateObjectFromURL(url) + -- self._view:AddChild(self.WinItem_view) + -- self.WinItem_view:Center() + -- self.WinItem_view:GetTransition("t0"):Play() + -- ViewUtil.PlaySound("RunFastNew_PK", "base/common/sound/win new.mp3") + -- end + -- -- local url = #sprint_seat_list > 0 and "ui://Extend_Poker_RunFastNew/Spring" or "ui://Extend_Poker_RunFastNew/Win_Mine" + -- else + -- local beigang = false + -- if #self:GetSpringSeats(info) > 0 then + -- for i = 1, #self:GetSpringSeats(info) do + -- if self:GetSpringSeats(info)[i] == self._room.self_player.seat then + -- local url = "ui://Extend_Poker_RunFastNew/spring2" + -- self.WinItem_view = UIPackage.CreateObjectFromURL(url) + -- self._view:AddChild(self.WinItem_view) + -- self.WinItem_view:Center() + -- self.WinItem_view:GetTransition("t0"):Play() + -- beigang = true + -- end + -- end + -- end + -- -- if beigang == false then + -- -- self:CreateRankEff() + -- -- end + -- end for i = 1, #info do local player = info[i] local p = self._room:GetPlayerBySeat(player.seat) local head_info = self._player_info[self:GetPos(player.seat)] local card_info = self._player_card_info[self:GetPos(player.seat)] - if player.hp_info ~= nil and player.hp_info.cur_hp ~= nil then - p.hp_info = player.hp_info - head_info:UpdateScore(d2ad(player.hp_info.cur_hp)) - head_info._view:GetChild('zhanji').visible = true - local num = player.hp_info.total_hp - if num > 0 then - head_info._view:GetController('text_color').selectedIndex = 0 - head_info._view:GetChild('text_jifen').text = "+" .. d2ad(player.hp_info.total_hp) - else - head_info._view:GetController('text_color').selectedIndex = 1 - head_info._view:GetChild('text_jifen').text = d2ad(player.hp_info.total_hp) - end - card_info:PlayScore(d2ad(player.hp_info.round_actual_hp), false, win_seat == player.seat) - else - local rt = 1 - if self._room.hpOnOff == 1 then - rt = self._room.score_times - end - if over == 1 and self._room.hpOnOff == 1 then - head_info:UpdateScore(player.score / 10) --不可负分 - else - head_info:UpdateScore(player.score * rt) - end - card_info:PlayScore(player.winscore * rt, false, win_seat == player.seat) - end + head_info:SetBaoDan(false) + + head_info._view:GetChild('text_jifen').text = player.score + head_info:PlayScore(player.winscore, win_seat == player.seat) + -- 播放加分这是之前旧的方式 + -- if player.hp_info ~= nil and player.hp_info.cur_hp ~= nil then + -- printlog("lingmeng xiao clear1") + -- p.hp_info = player.hp_info + -- head_info:UpdateScore(d2ad(player.hp_info.cur_hp)) + -- head_info._view:GetChild('zhanji').visible = true + -- local num = player.hp_info.total_hp + -- if num > 0 then + -- head_info._view:GetController('text_color').selectedIndex = 0 + -- head_info._view:GetChild('text_jifen').text = "+" .. d2ad(player.hp_info.total_hp) + -- else + -- head_info._view:GetController('text_color').selectedIndex = 1 + -- head_info._view:GetChild('text_jifen').text = d2ad(player.hp_info.total_hp) + -- end + -- card_info:PlayScore(d2ad(player.hp_info.round_actual_hp), false, win_seat == player.seat) + -- else + -- printlog("lingmeng xiao clear2") + -- local rt = 1 + -- if self._room.hpOnOff == 1 then + -- rt = self._room.score_times + -- end + -- if over == 1 and self._room.hpOnOff == 1 then + -- head_info:UpdateScore(player.score / 10) --不可负分 + -- else + -- head_info:UpdateScore(player.score * rt) + -- end + -- card_info:PlayScore(player.winscore * rt, false, win_seat == player.seat) + -- end if player.seat ~= self._room.self_player.seat then card_info:UpdateHandPoker(player.cards, false, true) - card_info:SetRemainCardNumber(false) + -- card_info:SetRemainCardNumber(false) card_info._view_resultOut:RemoveChildrenToPool() card_info._ctr_resultOut.selectedIndex = 1 @@ -916,21 +955,26 @@ function M:EventInit() for i = 1, #player.handCards do local child_card = card_info._view_resultOut:AddItemFromPool() card_info:FillPoker(child_card, "", nil, player.handCards[i]) - coroutine.wait(0.2) + ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/fanCard.mp3") + coroutine.wait(1.5 / #player.handCards) end end end self:ChangeBgmMusic(1) -- if over == 0 then - if #self:GetSpringSeats(info) > 0 then - -- -- print("222222222222222222") - coroutine.wait(1) - else - -- -- print("333333333333333333") - -- coroutine.wait(2) - end + -- if #self:GetSpringSeats(info) > 0 then + -- -- -- print("222222222222222222") + -- coroutine.wait(1) + -- else + -- -- -- print("333333333333333333") + -- -- coroutine.wait(2) + -- end - self.result_view = RunFast_ResultView.new(self._root_view, info, self._room.room_id, over, win_seat, 0, + for i = 1, #self._player_card_info do + local card_info = self._player_card_info[i] + card_info._ctr_time_clock.selectedIndex = 0 + end + self.result_view = RunFast_ResultView.new(self, info, self._room.room_id, over, win_seat, 0, remaincards) self.result_view:Show() if self.WinItem_view ~= nil then @@ -946,7 +990,7 @@ function M:EventInit() local btn_confirm = self.result_view._view:GetChild("btn_confirm") btn_confirm.onClick:Call() end - + ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/end_music.mp3") -- local _actionView = UIPackage.CreateObject("Common", "Btn_Yellow") -- _actionView.icon = "ui://Common/btn_comfirm" -- _actionView.onClick:Set(function () @@ -975,8 +1019,12 @@ function M:EventInit() local info = arg[2] local winseat = arg[3] local dissolve = arg[4] - - self.result_view = RunFast_ResultView.new(self._root_view, info, self._room.room_id, over, winseat, dissolve, nil) + ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/end_music.mp3") + for i = 1, #self._player_card_info do + local card_info = self._player_card_info[i] + card_info._ctr_time_clock.selectedIndex = 0 + end + self.result_view = RunFast_ResultView.new(self, info, self._room.room_id, over, winseat, dissolve, nil) self.result_view:Show() ControllerManager.ChangeController(LoddyController) self:UnmarkSelfTuoguan() @@ -1047,6 +1095,7 @@ function M:ReConnectForStart() head_info:UpdateLineState(player.line_state) head_info:UpdatePiao(player.piao) + head_info:SetBaoDan(player.hand_count == 1) if head_info._view:GetChild("shengyu") ~= nil and head_info._view:GetController("shengyu") ~= nil then -- body @@ -1060,7 +1109,7 @@ function M:ReConnectForStart() end -- body - head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "剩" .. player.hand_count .. "张" + head_info._view:GetChild("shengyu").text = player.hand_count end if player.seat == self._room.self_player.seat then if player.open ~= nil and player.open == 0 and self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then @@ -1071,13 +1120,16 @@ function M:ReConnectForStart() player_card_info:InitPoker(player.hand_list, false) end else - player_card_info:SetRemainCardNumber(player.hand_count == 1) + -- player_card_info:SetRemainCardNumber(player.hand_count == 1) if player.hand_count == 1 then self.bgm_index = 2 end end if self._room.curren_turn_seat ~= player.seat then -- head_info:MarkBank(false) + player_card_info._ctr_time_clock.selectedIndex = 1 + self._tex_leftTime = player_card_info._view_comp_clock + self._left_time = 20 if player.out_card_list[1] == 0 then player_card_info:SetOutCardInfo(nil, false) else @@ -1133,7 +1185,7 @@ function M:ReconnectForClearing() end -- body - head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "剩" .. player.hand_count .. "张" + head_info._view:GetChild("shengyu").text = player.hand_count end @@ -1157,7 +1209,7 @@ function M:ReconnectForClearing() coroutine.start(function() coroutine.wait(0.3) - self.result_view = RunFast_ResultView.new(self._root_view, self._room.player_list, self._room.room_id, 0, + self.result_view = RunFast_ResultView.new(self, self._room.player_list, self._room.room_id, 0, win_seat, 0, remaincards) self.result_view:Show() local card_info = self._player_card_info[1] @@ -1347,6 +1399,14 @@ end -- -- end -- end +function M:OnTupGuanOpen(...) + ---- print("刷新托管数据=====") + local arg = { ... } + local p = arg[1] + local player_card_info = self._player_card_info[self:GetPos(p.seat)] + self._tex_leftTime = player_card_info._view_comp_clock + self._left_time = tonumber(arg[3]) or 0 +end function M:UpdateRound(round) local total_round = self._room.room_config.Times diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerPokerInfoView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerPokerInfoView.lua index 781b65a1..e6525296 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerPokerInfoView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerPokerInfoView.lua @@ -43,7 +43,8 @@ function M:init() self._view_Out = self._view:GetChild('List_Out') self._view_resultOut = self._view:GetChild('list_resultOut') self._ctr_resultOut = self._view:GetController('resultOut') - + self._ctr_time_clock = self._view:GetController('time_clock') + self._view_comp_clock = self._view:GetChild('Comp_Clock') -------------------------------------------------------------- end diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerSelfPokerInfoView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerSelfPokerInfoView.lua index e899ff4a..c6231305 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerSelfPokerInfoView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerSelfPokerInfoView.lua @@ -86,6 +86,8 @@ function M:init() self._view_Out = self._view:GetChild('List_Out') self._cardCheck = RunFast_CardCheck:InitFlag() + self._ctr_time_clock = self._view:GetController('time_clock') + self._view_comp_clock = self._view:GetChild('Comp_Clock') -------------------------------------------------------------- end @@ -1024,7 +1026,7 @@ function M:UpdateHandCardsPos() card_view.index = i card_view.btn_card.touchable = true self:UpdateCardMove(card_view.btn_card, false, false) - self:SetBtnCardColor(card_view, 1) + self:SetBtnCardColor(card_view, 0) end end diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua index 116b965d..59952dd8 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua @@ -8,14 +8,14 @@ local RunFast_ResultView = {} local M = RunFast_ResultView -function RunFast_ResultView.new(blur_view, data, roomid, over, win_seat, dissolve, remaincards) +function RunFast_ResultView.new(root, data, roomid, over, win_seat, dissolve, remaincards) setmetatable(M, { __index = ResultView }) local self = setmetatable({}, { __index = M }) self.class = "RunFast_ResultView" self._currenIndex = 0 self._close_zone = false - --self._blur_view = blur_view + self._root_runFast = root self._gamectr = ControllerManager.GetController(GameController) self:init("ui://Extend_Poker_RunFastNew/clearing_new", data, roomid, over, win_seat, dissolve, remaincards) print("=======================lingmengresult", data, roomid, over, win_seat, dissolve, remaincards) @@ -42,14 +42,33 @@ function M:init(url, data, roomid, over, win_seat, dissolve, remaincards) ViewManager.ChangeView(ViewManager.View_Family) end - if over == 0 then - self._view:GetChild('btn_nextRound').onClick:Set(function() + self._view:GetChild('btn_over1Close').onClick:Set(function() + self:Close() + self._root_runFast._ctr_inClear.selectedIndex = 1 + if over ~= 1 then + self._view:GetController('over').selectedIndex = 1 + end + end) + + self._view:GetChild('btn_nextRound').onClick:Set(function() + if over == 0 then self:Destroy() local _gamectr = ControllerManager.GetController(GameController) _gamectr:ConformToNextGame() - end) - end + else + self._view:GetController('over').selectedIndex = 1 + end + end) + self.ClearReady = function() + if over == 0 then + self:Destroy() + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:ConformToNextGame() + else + self._view:GetController('over').selectedIndex = 1 + end + end self._view:GetChild('btn_closeRound').onClick:Set(function() ViewManager.ChangeView(ViewManager.View_Family) @@ -69,14 +88,25 @@ function M:init(url, data, roomid, over, win_seat, dissolve, remaincards) end over0List.numItems = #data + if over == 1 or (not over and #data == 2) then + local bigSeat = 0 + local bigScore = 0 + for i = 1, #data do + if data[i].total_score > bigScore then + bigSeat = i + bigScore = data[i].total_score + end + end self._view:GetChild('text_roomID').text = room.room_id self._view:GetChild('text_time').text = os.date('%m-%d %H:%M', os.time()) self._view:GetChild('text_groupID').text = room.group_id or 0 for i = 1, #data do local info = data[i] local playerInfo = room:GetPlayerBySeat(info.seat) - self:FillPlayerInfoEnd(self._view:GetChild(string.format("comp_playerInfo%d_over1", i)), info, playerInfo) + printlog("lingmeng clear", playerInfo.nick_name, info.total_score, i == bigSeat) + self:FillPlayerInfoEnd(self._view:GetChild(string.format("comp_playerInfo%d_over1", i)), info, playerInfo, + i == bigSeat) end coroutine.start(function() coroutine.wait(2) @@ -85,28 +115,29 @@ function M:init(url, data, roomid, over, win_seat, dissolve, remaincards) end end -function M:FillPlayerInfoEnd(view, info, playerInfo) +function M:FillPlayerInfoEnd(view, info, playerInfo, bigWin) local room = DataManager.CurrenRoom - self:FillPlayerHead(view:GetChild('comp_playerInfo'), playerInfo) + self:FillPlayerHead(view:GetChild('comp_playerInfo'), playerInfo, bigWin) local detailList = view:GetChild('list_detail') - self:FillDetailChild(detailList:AddItemFromPool(), "单局最高得分", info.settle_log.maxscore) - self:FillDetailChild(detailList:AddItemFromPool(), "打出炸弹数", info.settle_log.boomnum) - self:FillDetailChild(detailList:AddItemFromPool(), "胜负局数", + self:FillDetailChild(detailList:AddItemFromPool(), 0, info.settle_log.maxscore) + self:FillDetailChild(detailList:AddItemFromPool(), 1, info.settle_log.boomnum) + self:FillDetailChild(detailList:AddItemFromPool(), 2, string.format("%d赢%d输", info.settle_log.winnum, room.room_config.Times - info.settle_log.winnum)) - self:FillDetailChild(detailList:AddItemFromPool(), "总积分", info.total_score) + self:FillDetailChild(detailList:AddItemFromPool(), 3, info.total_score) end -function M:FillPlayerHead(view, playerInfo) +function M:FillPlayerHead(view, playerInfo, bigWin) ImageLoad.Load(playerInfo.self_user.head_url, view:GetChild('btn_head')._iconObject) view:GetChild('text_name').text = playerInfo.self_user.nick_name view:GetChild('text|_ID').text = playerInfo.self_user.account_id + view:GetController('bigWin').selectedIndex = bigWin and 1 or 0 end -function M:FillDetailChild(view, title, value) - view:GetChild('text_title').text = title +function M:FillDetailChild(view, index, value) + view:GetController('ShowTitle').selectedIndex = index view:GetChild('text_value').text = value end diff --git a/lua_probject/main_project/main/majiang/MJMainView.lua b/lua_probject/main_project/main/majiang/MJMainView.lua index b0d4c94d..30b62ab5 100644 --- a/lua_probject/main_project/main/majiang/MJMainView.lua +++ b/lua_probject/main_project/main/majiang/MJMainView.lua @@ -21,12 +21,6 @@ M.HuCardImg = HuCardImg local default_bg = 1 -local function IsRoomOwer() - --local roomOwner = self._room.player_list[1].self_user.account_id - local roomOwner = DataManager.CurrenRoom.player_list[1].self_user.account_id - return roomOwner == DataManager.SelfUser.account_id -end - function M:InitView(url, use_custom_bg, custom_bg_config) -- 加载牌型数据 if not DataManager.CardTypeList then @@ -40,8 +34,8 @@ function M:InitView(url, use_custom_bg, custom_bg_config) self._room.card_type = DataManager.CardTypeList[tostring(self._room.game_id)] or 1 UIPackage.AddPackage("base/main_majiang/ui/Main_Majiang") - self._full = false - self._scale = true + self._full = true + -- self._scale = true MainView.InitView(self, url) self.list_otherHuEffect = self._view:GetChild("list_otherHuEffect") @@ -193,27 +187,6 @@ function M:InitView(url, use_custom_bg, custom_bg_config) end) end - self._view:GetChild('btn_closeRoom').onClick:Set(function() - if IsRoomOwer() then - self._gamectr:AskDismissRoom( - function(res) - ViewUtil.CloseModalWait() - if res.ReturnCode == 0 then - ViewManager.ChangeView(ViewManager.View_Family) - else - ViewUtil.ErrorTip(res.ReturnCode) - end - end) - return - end - self._gamectr:LevelRoom(function(res) - if res.ReturnCode ~= 0 then - ViewUtil.ErrorTip(res.ReturnCode) - end - ViewManager.ChangeView(ViewManager.View_Family) - end) - end) - self:InitXiPai() self:InitXiPai1() diff --git a/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua b/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua index ded0f03c..83d3c129 100644 --- a/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua +++ b/lua_probject/main_project/main/majiang/MJPlayerSelfCardInfoView.lua @@ -38,6 +38,11 @@ function M:init() self._viewBtn_buGuoHu.onClick:Set(function() self._ctr_tip.selectedIndex = 1 end) + + --动态分配一下子项的宽度 + -- self._view_handCardList.itemRenderer = function(index, obj) + -- obj.width = self._view_handCardList.width / 13 + -- end end function M:ShowHuTip(card_list) @@ -81,8 +86,10 @@ function M:UpdateHandCard(getcard, mp) self:ChangeMarkOutCards(context.sender.data.card_item) self:__OnClickGetCard(context) end) + printlog("lingmeng getCard", self._view_getCard.width) else btn_card = self._view_handCardList:AddItemFromPool() + btn_card.width = (GRoot.inst.width * 0.88 - self._view_handCardList.columnGap * 12) / 13 end -- btn_card.sound = "ui://Main_Majiang/click" self:FillHandCard(i, btn_card, tem_card, true) diff --git a/lua_probject/main_project/main/poker/PKCheckG.lua b/lua_probject/main_project/main/poker/PKCheckG.lua index 369b9b75..d32f3831 100644 --- a/lua_probject/main_project/main/poker/PKCheckG.lua +++ b/lua_probject/main_project/main/poker/PKCheckG.lua @@ -29,13 +29,18 @@ function M:init(url) self.coroutine = coroutine.start(function(...) self.valueTemp = 0 while self.valueTemp < 100 do + -- 让他在72的时候卡顿一下 + if self.valueTemp > 72 and self.valueTemp < 80 then + + end + self.valueTemp = self.valueTemp + math.random(4) self.silder.value = self.valueTemp coroutine.wait(0.1) end showText.text = "检测完毕,环境安全" coroutine.wait(2) - self:Destroy() + -- self:Destroy() end) end diff --git a/lua_probject/main_project/main/poker/PKSettingView.lua b/lua_probject/main_project/main/poker/PKSettingView.lua index 50f5e6da..547f4366 100644 --- a/lua_probject/main_project/main/poker/PKSettingView.lua +++ b/lua_probject/main_project/main/poker/PKSettingView.lua @@ -7,6 +7,34 @@ local PKSettingView = { __changePokerSizeCallBack = nil, } local M = PKSettingView +local function IsRoomOwer() + --local roomOwner = self._room.player_list[1].self_user.account_id + local roomOwner = DataManager.CurrenRoom.player_list[1].self_user.account_id + return roomOwner == DataManager.SelfUser.account_id +end +function M:Reflash() + if IsRoomOwer() then + self.cBtn.selectedIndex = 1 + end + + if DataManager.CurrenRoom.playing or DataManager.CurrenRoom.curren_round > 0 then + self.cBtn.selectedIndex = 1 + end + + if self._flag_witness then + self.cBtn.selectedIndex = 0 + end +end + +function M:Show() + BaseWindow.Show(self) + self:Reflash() +end + +function M:Close() + BaseWindow.Close(self) +end + function PKSettingView.new(blur_view, show_type, isjiesan, url, cardSizeHandle) setmetatable(SettingView, { __index = BaseWindow }) setmetatable(M, { __index = SettingView }) @@ -15,7 +43,10 @@ function PKSettingView.new(blur_view, show_type, isjiesan, url, cardSizeHandle) self.class = 'PKSettingView' self._currenIndex = 0 self._blur_view = blur_view + self._flag_witness = flag_witness self.onCallback = event('onCallback', true) + self._mainView = blur_view + self._close_destroy = true self.stateIndex = 0 self.cd_time = 0 self._btn_dismiss_room_enable = true @@ -36,48 +67,128 @@ function M:init(url) BaseWindow.init(self, url) local view = self._view - local slider_sound = view:GetChild('slider_vedio_sound') - local slider_music = view:GetChild('slider_vedio_music') - local btn_music = view:GetChild('btn_vedio_music') - local btn_sound = view:GetChild('btn_vedio_sound') - -- slider_sound.value = GameApplication.Instance.SoundValue - -- slider_music.value = GameApplication.Instance.MusicValue + self.slider_sound = self._view:GetChild('slider_vedio_sound') + self.slider_music = self._view:GetChild('slider_vedio_music') - slider_music.onChanged:Add(function() - -- GameApplication.Instance.MusicValue = slider_music.value - -- btn_music.selected = false - -- GameApplication.Instance.MusicMute = false; - end) + self.btn_music = self._view:GetChild('btn_vedio_music') + self.btn_sound = self._view:GetChild('btn_vedio_sound') + self.btn_cancelRoom = self._view:GetChild("btn_cancelRoom") + self.btn_closeRoom = self._view:GetChild("btn_closeRoom") - slider_sound.onChanged:Add(function() - -- GameApplication.Instance.SoundValue = slider_sound.value - -- btn_sound.selected = false - -- GameApplication.Instance.SoundMute = false; - end) + self.cBtnSelect = self._view:GetController("cBtnSelect") - btn_sound.onClick:Add(function() - -- GameApplication.Instance.SoundMute = btn_sound.selected; - end) + self.cBtn = self._view:GetController('cBtn') - btn_music.onClick:Add(function() - -- GameApplication.Instance.MusicMute = btn_music.selected; - end) + self.slider_sound.value = GameApplication.Instance.SoundValue + self.slider_music.value = GameApplication.Instance.MusicValue + self.btn_sound.selected = GameApplication.Instance.SoundMute + self.btn_music.selected = GameApplication.Instance.MusicMute - local _btn_logout = self._view:GetChild('btn_closeRoom') - _btn_logout.onClick:Set(function() - if self._blur_view.dismiss_room_cd_time > 0 then - ViewUtil.ErrorTip(nil, "您还处于解散冷却时间当中,请稍后重试!") + self.slider_music.onChanged:Add(function() + local value = math.floor(self.slider_music.value) + if value > 0 then + self.btn_music.selected = false + GameApplication.Instance.MusicMute = false; else - local _gamectr = ControllerManager.GetController(GameController) - _gamectr:AskDismissRoom() + self.btn_music.selected = true + GameApplication.Instance.MusicMute = true; end + GameApplication.Instance.MusicValue = value end) -end -function M:Show() - BaseWindow.Show(self) - -- self:showSettingOption() + self.slider_sound.onChanged:Add(function() + local value = math.floor(self.slider_sound.value) + if value > 0 then + self.btn_sound.selected = false + GameApplication.Instance.SoundMute = false; + else + self.btn_sound.selected = true + GameApplication.Instance.SoundMute = true; + end + GameApplication.Instance.SoundValue = value + end) + + self.btn_sound.onClick:Add(function() + GameApplication.Instance.SoundMute = self.btn_sound.selected; + self.slider_sound.value = 0 + GameApplication.Instance.SoundValue = 0 + end) + + self.btn_music.onClick:Add(function() + GameApplication.Instance.MusicMute = self.btn_music.selected; + end) + + + self.btn_cancelRoom.onClick:Set(function() + -- if self._mainView.dismiss_room_cd_time > 0 then + -- ViewUtil.ErrorTip(nil, "您还处于解散冷却时间当中,请稍后重试!") + -- return + -- end + + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:AskDismissRoom() + end) + + self.btn_closeRoom.onClick:Set(function() + if self._flag_witness then + local _room = DataManager.CurrenRoom + self._mainView._gamectr:ExitWitnessGame(_room.play_id, _room.game_id, _room.room_id) + self:Destroy() + ViewManager.ChangeView(ViewManager.View_Family) + return + end + + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:LevelRoom(function(res) + print("退出房间") + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode) + return + end + ViewManager.ChangeView(ViewManager.View_Family) + end) + end) + + local group = DataManager.groups:get(DataManager.CurrenRoom.group_id) + self._view:GetController('lev').selectedIndex = (group and group.lev and group.lev < 3) and 0 or 1 + self._view:GetChild("btn_jiesan").onClick:Set(function() + local _curren_msg = + MsgWindow.new( + self._root_view, + '确定要解散该房间吗?', + MsgWindow.MsgMode.OkAndCancel + ) + _curren_msg.onOk:Add( + function() + ViewUtil.ShowModalWait(self._root_view) + local fgCtr = ControllerManager.GetController(NewGroupController) + + fgCtr:FG_RemoveRoom( + DataManager.CurrenRoom.group_id, + DataManager.CurrenRoom.room_id, + function(res) + if self._is_destroy then + return + end + ViewUtil.CloseModalWait() + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode, '删除房间失败!') + return + else + if self._flag_witness then + local _room = DataManager.CurrenRoom + self._mainView._gamectr:ExitWitnessGame(_room.play_id, _room.game_id, _room.room_id) + ViewManager.ChangeView(ViewManager.View_Family) + return + end + end + end + ) + end + ) + _curren_msg:Show() + end) end function M:Destroy() diff --git a/wb_new_ui/assets/Common/buttons/Btn_close(1).xml b/wb_new_ui/assets/Common/buttons/Btn_close(1).xml index 8139736d..67972c74 100644 --- a/wb_new_ui/assets/Common/buttons/Btn_close(1).xml +++ b/wb_new_ui/assets/Common/buttons/Btn_close(1).xml @@ -3,7 +3,7 @@ - + diff --git a/wb_new_ui/assets/Main_Majiang/component/Face3.xml b/wb_new_ui/assets/Common/component/head/Face3.xml similarity index 100% rename from wb_new_ui/assets/Main_Majiang/component/Face3.xml rename to wb_new_ui/assets/Common/component/head/Face3.xml diff --git a/wb_new_ui/assets/Main_Majiang/component/MsgBubble1.xml b/wb_new_ui/assets/Common/component/head/MsgBubble1.xml similarity index 100% rename from wb_new_ui/assets/Main_Majiang/component/MsgBubble1.xml rename to wb_new_ui/assets/Common/component/head/MsgBubble1.xml diff --git a/wb_new_ui/assets/Main_Majiang/component/MsgBubble2.xml b/wb_new_ui/assets/Common/component/head/MsgBubble2.xml similarity index 100% rename from wb_new_ui/assets/Main_Majiang/component/MsgBubble2.xml rename to wb_new_ui/assets/Common/component/head/MsgBubble2.xml diff --git a/wb_new_ui/assets/Main_Majiang/component/VoiceMask(1).xml b/wb_new_ui/assets/Common/component/head/VoiceMask(1).xml similarity index 100% rename from wb_new_ui/assets/Main_Majiang/component/VoiceMask(1).xml rename to wb_new_ui/assets/Common/component/head/VoiceMask(1).xml diff --git a/wb_new_ui/assets/Main_Majiang/Main_new/Main/Image/hudong/voice/图层 1.png b/wb_new_ui/assets/Common/component/head/voice/图层 1.png similarity index 100% rename from wb_new_ui/assets/Main_Majiang/Main_new/Main/Image/hudong/voice/图层 1.png rename to wb_new_ui/assets/Common/component/head/voice/图层 1.png diff --git a/wb_new_ui/assets/Main_Majiang/Main_new/Main/Image/hudong/voice/图层 2.png b/wb_new_ui/assets/Common/component/head/voice/图层 2.png similarity index 100% rename from wb_new_ui/assets/Main_Majiang/Main_new/Main/Image/hudong/voice/图层 2.png rename to wb_new_ui/assets/Common/component/head/voice/图层 2.png diff --git a/wb_new_ui/assets/Main_Majiang/Main_new/Main/Image/hudong/voice/图层 3.png b/wb_new_ui/assets/Common/component/head/voice/图层 3.png similarity index 100% rename from wb_new_ui/assets/Main_Majiang/Main_new/Main/Image/hudong/voice/图层 3.png rename to wb_new_ui/assets/Common/component/head/voice/图层 3.png diff --git a/wb_new_ui/assets/Common/component/rule/GameRule.xml b/wb_new_ui/assets/Common/component/rule/GameRule.xml index 6ad1b81a..cfcd63f1 100644 --- a/wb_new_ui/assets/Common/component/rule/GameRule.xml +++ b/wb_new_ui/assets/Common/component/rule/GameRule.xml @@ -2,8 +2,8 @@ - - + + diff --git a/wb_new_ui/assets/Common/font/piaoScore/nscore+.png b/wb_new_ui/assets/Common/font/piaoScore/nscore+.png new file mode 100644 index 00000000..528d14ba Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/nscore+.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/nscore-.png b/wb_new_ui/assets/Common/font/piaoScore/nscore-.png new file mode 100644 index 00000000..7fdb4677 Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/nscore-.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/nscore0.png b/wb_new_ui/assets/Common/font/piaoScore/nscore0.png new file mode 100644 index 00000000..768f9761 Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/nscore0.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/nscore1.png b/wb_new_ui/assets/Common/font/piaoScore/nscore1.png new file mode 100644 index 00000000..9414cbe4 Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/nscore1.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/nscore2.png b/wb_new_ui/assets/Common/font/piaoScore/nscore2.png new file mode 100644 index 00000000..6db44f4e Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/nscore2.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/nscore3.png b/wb_new_ui/assets/Common/font/piaoScore/nscore3.png new file mode 100644 index 00000000..111046a7 Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/nscore3.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/nscore4.png b/wb_new_ui/assets/Common/font/piaoScore/nscore4.png new file mode 100644 index 00000000..4620e7c3 Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/nscore4.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/nscore5.png b/wb_new_ui/assets/Common/font/piaoScore/nscore5.png new file mode 100644 index 00000000..1862b385 Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/nscore5.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/nscore6.png b/wb_new_ui/assets/Common/font/piaoScore/nscore6.png new file mode 100644 index 00000000..871477aa Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/nscore6.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/nscore7.png b/wb_new_ui/assets/Common/font/piaoScore/nscore7.png new file mode 100644 index 00000000..e0a31958 Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/nscore7.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/nscore8.png b/wb_new_ui/assets/Common/font/piaoScore/nscore8.png new file mode 100644 index 00000000..5189707b Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/nscore8.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/nscore9.png b/wb_new_ui/assets/Common/font/piaoScore/nscore9.png new file mode 100644 index 00000000..bd38ce34 Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/nscore9.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/piaoScoreAdd.fnt b/wb_new_ui/assets/Common/font/piaoScore/piaoScoreAdd.fnt new file mode 100644 index 00000000..fbeb7160 --- /dev/null +++ b/wb_new_ui/assets/Common/font/piaoScore/piaoScoreAdd.fnt @@ -0,0 +1,13 @@ +info size=30 resizable=true colored=false +char id=43 img=diqo7jcx xoffset=0 yoffset=0 xadvance=0 +char id=45 img=diqo7jcy xoffset=0 yoffset=0 xadvance=0 +char id=48 img=diqo7jcz xoffset=0 yoffset=0 xadvance=0 +char id=49 img=diqo7jd0 xoffset=0 yoffset=0 xadvance=0 +char id=50 img=diqo7jd1 xoffset=0 yoffset=0 xadvance=0 +char id=51 img=diqo7jd2 xoffset=0 yoffset=0 xadvance=0 +char id=52 img=diqo7jd3 xoffset=0 yoffset=0 xadvance=0 +char id=53 img=diqo7jd4 xoffset=0 yoffset=0 xadvance=0 +char id=54 img=diqo7jd5 xoffset=0 yoffset=0 xadvance=0 +char id=55 img=diqo7jd6 xoffset=0 yoffset=0 xadvance=0 +char id=56 img=diqo7jd7 xoffset=0 yoffset=0 xadvance=0 +char id=57 img=diqo7jd8 xoffset=0 yoffset=0 xadvance=0 diff --git a/wb_new_ui/assets/Common/font/piaoScore/piaoScoreLess.fnt b/wb_new_ui/assets/Common/font/piaoScore/piaoScoreLess.fnt new file mode 100644 index 00000000..810f899d --- /dev/null +++ b/wb_new_ui/assets/Common/font/piaoScore/piaoScoreLess.fnt @@ -0,0 +1,13 @@ +info size=30 resizable=true colored=false +char id=43 img=diqo7jda xoffset=0 yoffset=0 xadvance=0 +char id=45 img=diqo7jdb xoffset=0 yoffset=0 xadvance=0 +char id=48 img=diqo7jdc xoffset=0 yoffset=0 xadvance=0 +char id=49 img=diqo7jdd xoffset=0 yoffset=0 xadvance=0 +char id=50 img=diqo7jde xoffset=0 yoffset=0 xadvance=0 +char id=51 img=diqo7jdf xoffset=0 yoffset=0 xadvance=0 +char id=52 img=diqo7jdg xoffset=0 yoffset=0 xadvance=0 +char id=53 img=diqo7jdh xoffset=0 yoffset=0 xadvance=0 +char id=54 img=diqo7jdi xoffset=0 yoffset=0 xadvance=0 +char id=55 img=diqo7jdj xoffset=0 yoffset=0 xadvance=0 +char id=56 img=diqo7jdk xoffset=0 yoffset=0 xadvance=0 +char id=57 img=diqo7jdl xoffset=0 yoffset=0 xadvance=0 diff --git a/wb_new_ui/assets/Common/font/piaoScore/score+.png b/wb_new_ui/assets/Common/font/piaoScore/score+.png new file mode 100644 index 00000000..66391282 Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/score+.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/score-.png b/wb_new_ui/assets/Common/font/piaoScore/score-.png new file mode 100644 index 00000000..86630c12 Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/score-.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/score0.png b/wb_new_ui/assets/Common/font/piaoScore/score0.png new file mode 100644 index 00000000..b7c82060 Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/score0.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/score1.png b/wb_new_ui/assets/Common/font/piaoScore/score1.png new file mode 100644 index 00000000..30a43bb9 Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/score1.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/score2.png b/wb_new_ui/assets/Common/font/piaoScore/score2.png new file mode 100644 index 00000000..adb2418c Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/score2.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/score3.png b/wb_new_ui/assets/Common/font/piaoScore/score3.png new file mode 100644 index 00000000..34e75fab Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/score3.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/score4.png b/wb_new_ui/assets/Common/font/piaoScore/score4.png new file mode 100644 index 00000000..77e0de6c Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/score4.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/score5.png b/wb_new_ui/assets/Common/font/piaoScore/score5.png new file mode 100644 index 00000000..6231c4e8 Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/score5.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/score6.png b/wb_new_ui/assets/Common/font/piaoScore/score6.png new file mode 100644 index 00000000..bffc4266 Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/score6.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/score7.png b/wb_new_ui/assets/Common/font/piaoScore/score7.png new file mode 100644 index 00000000..86534156 Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/score7.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/score8.png b/wb_new_ui/assets/Common/font/piaoScore/score8.png new file mode 100644 index 00000000..a68f2bae Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/score8.png differ diff --git a/wb_new_ui/assets/Common/font/piaoScore/score9.png b/wb_new_ui/assets/Common/font/piaoScore/score9.png new file mode 100644 index 00000000..122301be Binary files /dev/null and b/wb_new_ui/assets/Common/font/piaoScore/score9.png differ diff --git a/wb_new_ui/assets/Main_Majiang/images/game_icon_07.png b/wb_new_ui/assets/Common/images/game_icon_07.png similarity index 100% rename from wb_new_ui/assets/Main_Majiang/images/game_icon_07.png rename to wb_new_ui/assets/Common/images/game_icon_07.png diff --git a/wb_new_ui/assets/Common/package.xml b/wb_new_ui/assets/Common/package.xml index 5cf0b118..371567eb 100644 --- a/wb_new_ui/assets/Common/package.xml +++ b/wb_new_ui/assets/Common/package.xml @@ -2131,6 +2131,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Com_PlayerInfoClear.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Com_PlayerInfoClear.xml index 8c29dd2c..98f19d42 100644 --- a/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Com_PlayerInfoClear.xml +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Com_PlayerInfoClear.xml @@ -1,15 +1,26 @@ - + + + - - + - + - + + + + + + + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Comp_over0Title.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Comp_over0Title.xml index 9cbc7d8d..3ba0f1fb 100644 --- a/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Comp_over0Title.xml +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Comp_over0Title.xml @@ -1,16 +1,16 @@ - + - + - + - + diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Comp_playerOver0Info.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Comp_playerOver0Info.xml index 5a374639..9c5583a8 100644 --- a/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Comp_playerOver0Info.xml +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Comp_playerOver0Info.xml @@ -1,18 +1,20 @@ - + - - - + + + + + - - + + - - + + - - + + \ No newline at end of file diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Comp_playerOver1Info.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Comp_playerOver1Info.xml index b342f9cb..036a53b2 100644 --- a/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Comp_playerOver1Info.xml +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/Comp_playerOver1Info.xml @@ -1,9 +1,9 @@ - + - - - + + + diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/btn_closeRound.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/btn_closeRound.xml index 9dd9dbfe..b8f037b6 100644 --- a/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/btn_closeRound.xml +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/Clearing/Component/btn_closeRound.xml @@ -2,7 +2,9 @@ - + + +