master
罗家炜 2025-04-26 16:16:02 +08:00
parent 5bb5f1774b
commit 0e262ec7bc
2 changed files with 73 additions and 73 deletions

View File

@ -11,10 +11,10 @@ local M = {}
local bg_config = {
{ id = 1, url = "extend/majiang/nancheng/bg/bg1", thumb = "ui://Extend_MJ_NanCheng/bg1" },
{ id = 2, url = "extend/majiang/nancheng/bg/bg2", thumb = "ui://Extend_MJ_NanCheng/bg2" },
{ id = 3, url = "extend/majiang/nancheng/bg/bg3", thumb = "ui://Extend_MJ_NanCheng/bg3" },
{ id = 4, url = "extend/majiang/nancheng/bg/bg4", thumb = "ui://Extend_MJ_NanCheng/bg4" }
{ id = 1, url = "extend/majiang/fuzhou/bg/bg1", thumb = "ui://Extend_MJ_FuZhou/bg1" },
{ id = 2, url = "extend/majiang/fuzhou/bg/bg2", thumb = "ui://Extend_MJ_FuZhou/bg2" },
{ id = 3, url = "extend/majiang/fuzhou/bg/bg3", thumb = "ui://Extend_MJ_FuZhou/bg3" },
{ id = 4, url = "extend/majiang/fuzhou/bg/bg4", thumb = "ui://Extend_MJ_FuZhou/bg4" }
}
--- Create a new ZZ_MainView
function M.new()
@ -108,40 +108,40 @@ function M:InitView(url)
end)
local btn_closeRoom = self._view:GetChild("btn_setting")
self._view:GetChild('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, '房间已开始,无法退出游戏。')
else
ViewUtil.ShowModalWait(self._root_view)
self._gamectr:LevelRoom(
function(res)
ViewUtil.CloseModalWait()
if res.ReturnCode == 0 then
ViewManager.ChangeView(ViewManager.View_Family)
else
ViewUtil.ErrorTip(res.ReturnCode)
end
self._view:GetChild('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, '房间已开始,无法退出游戏。')
else
ViewUtil.ShowModalWait(self._root_view)
self._gamectr:LevelRoom(
function(res)
ViewUtil.CloseModalWait()
if res.ReturnCode == 0 then
ViewManager.ChangeView(ViewManager.View_Family)
else
ViewUtil.ErrorTip(res.ReturnCode)
end
)
end
end
)
end
)
_curren_msg:Show()
--]]
end)
end
)
_curren_msg:Show()
--]]
end)
btn_closeRoom.onClick:Add(handler(self, function()
local settingView = SettingView.new(self)
@ -157,7 +157,7 @@ function M:InitView(url)
end
function M:__BuGang(cardInfo, callback)
local _gang_tip_choice = UIPackage.CreateObject("Extend_MJ_NanCheng", "Gang_tip_choice")
local _gang_tip_choice = UIPackage.CreateObject("Extend_MJ_FuZhou", "Gang_tip_choice")
_gang_tip_choice.visible = true
local list_card = _gang_tip_choice:GetChild("list_card")

View File

@ -11,10 +11,10 @@ local M = {}
local bg_config = {
{ id = 1, url = "extend/majiang/nancheng/bg/bg1", thumb = "ui://Extend_MJ_NanCheng/bg1" },
{ id = 2, url = "extend/majiang/nancheng/bg/bg2", thumb = "ui://Extend_MJ_NanCheng/bg2" },
{ id = 3, url = "extend/majiang/nancheng/bg/bg3", thumb = "ui://Extend_MJ_NanCheng/bg3" },
{ id = 4, url = "extend/majiang/nancheng/bg/bg4", thumb = "ui://Extend_MJ_NanCheng/bg4" }
{ id = 1, url = "extend/majiang/lichuan/bg/bg1", thumb = "ui://Extend_MJ_LiChuan/bg1" },
{ id = 2, url = "extend/majiang/lichuan/bg/bg2", thumb = "ui://Extend_MJ_LiChuan/bg2" },
{ id = 3, url = "extend/majiang/lichuan/bg/bg3", thumb = "ui://Extend_MJ_LiChuan/bg3" },
{ id = 4, url = "extend/majiang/lichuan/bg/bg4", thumb = "ui://Extend_MJ_LiChuan/bg4" }
}
--- Create a new ZZ_MainView
function M.new()
@ -106,40 +106,40 @@ function M:InitView(url)
end)
local btn_closeRoom = self._view:GetChild("btn_setting")
self._view:GetChild('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, '房间已开始,无法退出游戏。')
else
ViewUtil.ShowModalWait(self._root_view)
self._gamectr:LevelRoom(
function(res)
ViewUtil.CloseModalWait()
if res.ReturnCode == 0 then
ViewManager.ChangeView(ViewManager.View_Family)
else
ViewUtil.ErrorTip(res.ReturnCode)
end
self._view:GetChild('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, '房间已开始,无法退出游戏。')
else
ViewUtil.ShowModalWait(self._root_view)
self._gamectr:LevelRoom(
function(res)
ViewUtil.CloseModalWait()
if res.ReturnCode == 0 then
ViewManager.ChangeView(ViewManager.View_Family)
else
ViewUtil.ErrorTip(res.ReturnCode)
end
)
end
end
)
end
)
_curren_msg:Show()
--]]
end)
end
)
_curren_msg:Show()
--]]
end)
btn_closeRoom.onClick:Add(handler(self, function()
local settingView = SettingView.new(self)