diff --git a/lua_probject/base_project/Game/View/Common/ModalWaitingWindow2.lua b/lua_probject/base_project/Game/View/Common/ModalWaitingWindow2.lua new file mode 100644 index 00000000..a74f978f --- /dev/null +++ b/lua_probject/base_project/Game/View/Common/ModalWaitingWindow2.lua @@ -0,0 +1,45 @@ +ModalWaitingWindow2 = { + +} + +local M = ModalWaitingWindow2 + +local modal_wait_win_url = "ui://Common/GlobalModalWaiting_jiangxi" +local modal_panel = nil +function ModalWaitingWindow2.new() + local self = setmetatable({}, { __index = M }) + self.class = "ModalWaitingWindow2" + self._view = UIPackage.CreateObjectFromURL(modal_wait_win_url) + if not modal_panel then + modal_panel = UIPackage.CreateObjectFromURL("ui://Common/UIPanel") + modal_panel.name = "GlobalModalWaiting_Win" + modal_panel:MakeFullScreen() + modal_panel:AddRelation(GRoot.inst, RelationType.Size) + end + modal_panel:AddChild(self._view) + self._view:Center() + GRoot.inst:AddChild(modal_panel) + return self +end + +function M:Show() + modal_panel.visible = true +end + +function M:Close() + modal_panel.visible = false +end + +local _inst = nil +function ModalWaitingWindow2.ShowModal() + if (_inst == nil) then + _inst = ModalWaitingWindow2.new() + end + _inst:Show() +end + +function ModalWaitingWindow2.CloseModal() + if (_inst) then + _inst:Close() + end +end diff --git a/lua_probject/base_project/Game/View/LobbyView.lua b/lua_probject/base_project/Game/View/LobbyView.lua index 6e2670ca..c81f57f2 100644 --- a/lua_probject/base_project/Game/View/LobbyView.lua +++ b/lua_probject/base_project/Game/View/LobbyView.lua @@ -95,11 +95,11 @@ function M:InitView(url) local clickTime = 0 local btn_family = self._view:GetChild("btn_family") btn_family.onClick:Add(function() - if not self._flag_loadImageSucces and clickTime < 3 then - ViewUtil.ShowOneChooose({ showText = string.format("请等待头像加载完成,再点击%d次,无视头像不加载进入圈子", 3 - clickTime) }) - clickTime = clickTime + 1 - return - end + -- if not self._flag_loadImageSucces and clickTime < 3 then + -- ViewUtil.ShowOneChooose({ showText = string.format("请等待头像加载完成,再点击%d次,无视头像不加载进入圈子", 3 - clickTime) }) + -- clickTime = clickTime + 1 + -- return + -- end local user = DataManager.SelfUser if user.group_id ~= 0 then self:ReconnectRoom(user.group_id) @@ -507,7 +507,7 @@ function M:GetPlayerInfoData() self:ShowPlayerInfo(data.raffle, data.diamo, data.newMail) if data.group_id ~= 0 then -- 重连,确保头像加载成功才能重连 - ViewUtil.ShowModalWait(self._root_view, " ") + ViewUtil.ShowModalWait2(self._root_view) coroutine.start(function() local waitTimes = 0 while not self._flag_loadImageSucces do diff --git a/lua_probject/base_project/Game/View/MainView.lua b/lua_probject/base_project/Game/View/MainView.lua index 97971789..30b2894e 100644 --- a/lua_probject/base_project/Game/View/MainView.lua +++ b/lua_probject/base_project/Game/View/MainView.lua @@ -1177,6 +1177,12 @@ end -- 标记自己托管 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 + end if self._com_tuoguan then return end diff --git a/lua_probject/base_project/Game/View/ResultView.lua b/lua_probject/base_project/Game/View/ResultView.lua index 62233aab..a063ec99 100644 --- a/lua_probject/base_project/Game/View/ResultView.lua +++ b/lua_probject/base_project/Game/View/ResultView.lua @@ -11,7 +11,13 @@ function M:Show(time) local pos = obj.xy self._view:GetChild("Frist"):TweenMove(Vector2.New(pos.x, pos.y + 200), time or 1.5) end - BaseWindow.Show(self) + if self._root then + self._root._view_clearingFather:AddChild(self._view) + self._view:AddRelation(self._root._view_clearingFather, RelationType.Size) + self._view:MakeFullScreen() + else + BaseWindow.Show(self) + end end function M:InitView() @@ -97,7 +103,11 @@ function M:init(url, isBigFull) self._animation = false self._scale = true self._full = false - BaseWindow.init(self, url) + if self._root then + self._view = UIPackage.CreateObjectFromURL(url) + else + BaseWindow.init(self, url) + end self:InitView() @@ -446,3 +456,12 @@ function M:ContinueGame(gid, pid, game_id) pid ) end + +function M:Destroy() + if self._root then + self._view:RemoveFromParent() + self._view:Dispose() + else + BaseWindow.Destroy(self) + end +end diff --git a/lua_probject/base_project/Game/View/ViewUtil.lua b/lua_probject/base_project/Game/View/ViewUtil.lua index 16dc5669..9a1a3f71 100644 --- a/lua_probject/base_project/Game/View/ViewUtil.lua +++ b/lua_probject/base_project/Game/View/ViewUtil.lua @@ -55,6 +55,24 @@ function ViewUtil.CloseModalWait() ModalWaitingWindow.CloseModal() end +function ViewUtil.ShowModalWait2(blur_view, title, time) + ViewUtil.CloseModalWait2() + ViewUtil.continue = coroutine.start( + function() + coroutine.wait(time or 1) + ModalWaitingWindow2.ShowModal() + end + ) +end + +function ViewUtil.CloseModalWait2() + if ViewUtil.continue then + coroutine.stop(ViewUtil.continue) + ViewUtil.continue = nil + end + ModalWaitingWindow2.CloseModal() +end + local _defaultTooltipWin = nil local function __waittips(obj) _defaultTooltipWin:Dispose() diff --git a/lua_probject/base_project/Game/View/init.lua b/lua_probject/base_project/Game/View/init.lua index 39ce9ebe..d6645849 100644 --- a/lua_probject/base_project/Game/View/init.lua +++ b/lua_probject/base_project/Game/View/init.lua @@ -5,6 +5,7 @@ import(".Common.BaseWindow") import(".Common.MsgWindow") import(".Common.NetResetConnectWindow") import(".Common.ModalWaitingWindow") +import(".Common.ModalWaitingWindow2") import(".Common.ImageLoad") import(".ViewUtil") @@ -17,4 +18,4 @@ import(".MainView") import(".PlayBackView") import(".RuleView") -import(".RoomInfoView") \ No newline at end of file +import(".RoomInfoView") diff --git a/lua_probject/base_project/Game/ViewManager.lua b/lua_probject/base_project/Game/ViewManager.lua index cbb65a1a..a444e935 100644 --- a/lua_probject/base_project/Game/ViewManager.lua +++ b/lua_probject/base_project/Game/ViewManager.lua @@ -60,10 +60,17 @@ local function __OnGameConnectAction(state) if state == SocketCode.Connect then ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id) return + --这两种情况默认重连 elseif state == SocketCode.DisconnectByServer then - __NetTip("网络断开连接!") + -- __NetTip("网络断开连接!") + NetResetConnectWindow.ShowNetReset() + ControllerManager.reset_join_room = 0 + ControllerManager.ResetJionRoom() elseif state == SocketCode.ExceptionOnConnect or state == SocketCode.NetworkException then - __NetTip("请检查您的网络环境!") + -- __NetTip("请检查您的网络环境!") + NetResetConnectWindow.ShowNetReset() + ControllerManager.reset_join_room = 0 + ControllerManager.ResetJionRoom() elseif state == SocketCode.Disconnect then ControllerManager.ChangeController(LoddyController) ViewManager.ChangeView(ViewManager.View_Lobby) diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua index c08b9e2f..c4e095af 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua @@ -5,7 +5,7 @@ local EXClearingView = {} local M = EXClearingView -function EXClearingView.new(blur_view, data) +function EXClearingView.new(root, data) setmetatable(M, { __index = ResultView }) local self = setmetatable({}, { __index = M }) self._full = true @@ -14,7 +14,7 @@ function EXClearingView.new(blur_view, data) self._root_view:GetChild("win_mode").visible = false self._currenIndex = 0 - self._blur_view = blur_view + self._root = root self._close_zone = false if data then self.flag_back = data.flag_back diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua index 17b6908a..ed9f6334 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua @@ -562,20 +562,23 @@ function M:OutCard(card) local _gamectr = ControllerManager.GetController(GameController) self._room.curren_outcard_seat = -1 _gamectr:SendOutCard( - { card = card, isTip = self._player_card_info[1]._ctr_tip.selectedIndex == 1 or - self._player_card_info[1]._ctr_showGuoHu.selectedIndex == 1 }, function() - local info = self._player_card_info[1] - self:RemoveCursor() - info:UpdateHandCard() + { + card = card, + isTip = self._player_card_info[1]._ctr_tip.selectedIndex == 1 or + self._player_card_info[1]._ctr_showGuoHu.selectedIndex == 1 + }, function() + local info = self._player_card_info[1] + self:RemoveCursor() + info:UpdateHandCard() - info:UpdateOutCardList(nil, card, self._cursor) - info._ctr_tip.selectedIndex = 0 - info._ctr_showGuoHu.selectedIndex = 0 - self:markOutCards(false, card) - self:PlaySound("LiChuan_MJ", self._room.self_player.self_user.sex, tostring(card)) - self:PlayMJSound("chupai.mp3") - -- self:ShowHuTip() - end) + info:UpdateOutCardList(nil, card, self._cursor) + info._ctr_tip.selectedIndex = 0 + info._ctr_showGuoHu.selectedIndex = 0 + self:markOutCards(false, card) + self:PlaySound("LiChuan_MJ", self._room.self_player.self_user.sex, tostring(card)) + self:PlayMJSound("chupai.mp3") + -- self:ShowHuTip() + end) else printlog("鬼牌不能出===>>>" .. card) end diff --git a/lua_probject/main_project/main/majiang/MJMainView.lua b/lua_probject/main_project/main/majiang/MJMainView.lua index 8891e0c6..d642d55b 100644 --- a/lua_probject/main_project/main/majiang/MJMainView.lua +++ b/lua_probject/main_project/main/majiang/MJMainView.lua @@ -51,6 +51,7 @@ function M:InitView(url, use_custom_bg, custom_bg_config) self.cHuCardEffect = self._view:GetController("cHuCardEffect") -- self.effect_ZiMo = self._view:GetChild("effect_ZiMo") self._ctr_more = self._view:GetController("more") + self._view_clearingFather = self._view:GetChild('clearing_show') self.com_notice = self._view:GetChild("com_notice") @@ -518,7 +519,8 @@ function M:OnPlayerReady(...) self._ctr_action.selectedIndex = 2 end else - self._ctr_action.selectedIndex = 1 + --江西这边没有洗牌,暂时把这个洗牌相关的准备注释了 + -- self._ctr_action.selectedIndex = 1 end else self._ctr_action.selectedIndex = 0 @@ -724,12 +726,11 @@ function M:OnResult1(...) local data = result.info_list local niao = result.niao -- self:RemoveCursor() - self._clearingView = self.EXClearingViewClass.new(self._root_view) - self._clearingView._view:GetChild('btn_setting').onClick:Set(handler(self, self.ClickSetting)) + self._clearingView = self.EXClearingViewClass.new(self) coroutine.start(function() if liuju then self:PlayMJSound("liuju.mp3") - coroutine.wait(2.7) + coroutine.wait(3) self:PlayMJSound("end_music.mp3") else self:PlayMJSound("end_music.mp3") diff --git a/lua_probject/main_project/main/majiang/MJWitnessView.lua b/lua_probject/main_project/main/majiang/MJWitnessView.lua index cd291cd4..6153b7f8 100644 --- a/lua_probject/main_project/main/majiang/MJWitnessView.lua +++ b/lua_probject/main_project/main/majiang/MJWitnessView.lua @@ -185,8 +185,8 @@ function M:OnFangziAction(...) end) clip.playing = true coroutine.start(function() - coroutine.wait(2) - effect:Dispose() + coroutine.wait(0.3) + self._popEvent = true end) self:RemoveCursor() diff --git a/wb_new_ui/assets/Common/GlobalModalWaiting_jiangxi.xml b/wb_new_ui/assets/Common/GlobalModalWaiting_jiangxi.xml index 66f24b62..5ba24abf 100644 --- a/wb_new_ui/assets/Common/GlobalModalWaiting_jiangxi.xml +++ b/wb_new_ui/assets/Common/GlobalModalWaiting_jiangxi.xml @@ -2,8 +2,8 @@ - - + + diff --git a/wb_new_ui/assets/Main_Majiang/Main_new/Clearing/clearing.xml b/wb_new_ui/assets/Main_Majiang/Main_new/Clearing/clearing.xml index b519c0a0..5c3e4dd1 100644 --- a/wb_new_ui/assets/Main_Majiang/Main_new/Clearing/clearing.xml +++ b/wb_new_ui/assets/Main_Majiang/Main_new/Clearing/clearing.xml @@ -15,6 +15,9 @@ + + + @@ -147,11 +150,8 @@ - + - - - \ No newline at end of file diff --git a/wb_new_ui/assets/Main_Majiang/Main_new/Main_new_2_jiangxi.xml b/wb_new_ui/assets/Main_Majiang/Main_new/Main_new_2_jiangxi.xml index 072f81a2..d4b23ce6 100644 --- a/wb_new_ui/assets/Main_Majiang/Main_new/Main_new_2_jiangxi.xml +++ b/wb_new_ui/assets/Main_Majiang/Main_new/Main_new_2_jiangxi.xml @@ -1,6 +1,6 @@ - + @@ -14,6 +14,9 @@ + + + @@ -46,14 +49,14 @@