未跟踪文件
parent
cd6cc8b60c
commit
8f30fc3bd1
|
|
@ -0,0 +1,57 @@
|
|||
local InviteRoomView = {}
|
||||
|
||||
local function Cancel(self)
|
||||
print("不接受邀请")
|
||||
end
|
||||
|
||||
local function Enter(self)
|
||||
print("接受邀请")
|
||||
end
|
||||
|
||||
function InviteRoomView.New()
|
||||
setmetatable(InviteRoomView, { __index = BaseWindow })
|
||||
local inst = setmetatable({}, { __index = InviteRoomView })
|
||||
inst._close_destroy = true
|
||||
BaseWindow.init(inst, "ui://Family/InviteRoom")
|
||||
inst:Init()
|
||||
return inst
|
||||
end
|
||||
|
||||
function InviteRoomView:Show(data)
|
||||
self:Refalsh(data)
|
||||
BaseWindow.Show(self)
|
||||
end
|
||||
|
||||
function InviteRoomView:Refalsh(data)
|
||||
--local familyName =
|
||||
--local inviterName =
|
||||
--local gameName =
|
||||
--local roomName =
|
||||
--local game =
|
||||
|
||||
self.tex_familyName.text = familyName
|
||||
self.tex_inviterName.text = inviterName
|
||||
self.tex_gameName.text = gameName
|
||||
self.tex_roomName.text = roomName
|
||||
self.tex_game.text = game
|
||||
end
|
||||
|
||||
function InviteRoomView:Init()
|
||||
self.tex_familyName = self._view:GetChild("tex_familyName")
|
||||
self.tex_inviterName = self._view:GetChild("tex_inviterName")
|
||||
self.tex_gameName = self._view:GetChild("tex_gameName")
|
||||
self.tex_roomName = self._view:GetChild("tex_roomName")
|
||||
self.tex_game = self._view:GetChild("tex_game")
|
||||
|
||||
self.btn_enter = self._view:GetChild("btn_enter")
|
||||
self.btn_cancel = self._view:GetChild("btn_cancel")
|
||||
|
||||
self.btn_enter.onClick:Set(function()
|
||||
Enter(self)
|
||||
end)
|
||||
self.btn_cancel.onClick:Set(function()
|
||||
Cancel(self)
|
||||
end)
|
||||
end
|
||||
|
||||
return InviteRoomView
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
--设置窗口对象
|
||||
|
||||
local EXSettingView = {}
|
||||
|
||||
local M = EXSettingView
|
||||
setmetatable(M, { __index = BaseWindow })
|
||||
|
||||
function EXSettingView:Show(room)
|
||||
self._room = room
|
||||
|
||||
-- 房主,第一个进房间的人
|
||||
local roomOwner = self._room.player_list[1].self_user.account_id
|
||||
|
||||
if roomOwner == DataManager.SelfUser.account_id then
|
||||
self.cBtn.selectedIndex = 1
|
||||
else
|
||||
self.cBtn.selectedIndex = 0
|
||||
end
|
||||
|
||||
BaseWindow.Show(self)
|
||||
end
|
||||
|
||||
function EXSettingView.new(main_view, flag_witness)
|
||||
local self = setmetatable({}, { __index = M })
|
||||
self.class = 'EXSettingView'
|
||||
self._close_destroy = true
|
||||
self._mainView = main_view
|
||||
self._flag_witness = flag_witness
|
||||
self:init('ui://Main_Majiang/Setting')
|
||||
return self
|
||||
end
|
||||
|
||||
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')
|
||||
|
||||
self.cBtn = self._view:GetController('cBtn')
|
||||
|
||||
-- slider_sound.value = GameApplication.Instance.SoundValue
|
||||
-- slider_music.value = GameApplication.Instance.MusicValue
|
||||
|
||||
slider_music.onChanged:Add(function()
|
||||
-- GameApplication.Instance.MusicValue = slider_music.value
|
||||
-- btn_music.selected = false
|
||||
-- GameApplication.Instance.MusicMute = false;
|
||||
end)
|
||||
|
||||
slider_sound.onChanged:Add(function()
|
||||
-- GameApplication.Instance.SoundValue = slider_sound.value
|
||||
-- btn_sound.selected = false
|
||||
-- GameApplication.Instance.SoundMute = false;
|
||||
end)
|
||||
|
||||
btn_sound.onClick:Add(function()
|
||||
-- GameApplication.Instance.SoundMute = btn_sound.selected;
|
||||
end)
|
||||
|
||||
btn_music.onClick:Add(function()
|
||||
-- GameApplication.Instance.MusicMute = btn_music.selected;
|
||||
end)
|
||||
|
||||
local _btn_logout = self._view:GetChild('btn_cancelRoom')
|
||||
_btn_logout.onClick:Set(function()
|
||||
if self._flag_witness then
|
||||
local _room = DataManager.CurrenRoom
|
||||
pt(_room)
|
||||
self._mainView._gamectr:ExitWitnessGame(_room.play_id, _room.game_id,
|
||||
_room.room_id)
|
||||
ViewManager.ChangeView(ViewManager.View_Family)
|
||||
else
|
||||
if self._mainView.dismiss_room_cd_time > 0 then
|
||||
ViewUtil.ErrorTip(nil, "您还处于解散冷却时间当中,请稍后重试!")
|
||||
else
|
||||
local _gamectr = ControllerManager.GetController(GameController)
|
||||
_gamectr:AskDismissRoom()
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
self._view:GetChild("btn_closeRoom").onClick:Set(function()
|
||||
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)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
local MJSettingView = require("main.majiang.MJSettingViewNew")
|
||||
|
||||
local WitnessView = {}
|
||||
setmetatable(WitnessView, { __index = BaseView })
|
||||
function WitnessView:init()
|
||||
self.btn_setting = self._view:GetChild("btn_setting")
|
||||
|
||||
self.btn_setting.onClick:Set(function()
|
||||
local view = MJSettingView.new(self, true)
|
||||
view:Show()
|
||||
end)
|
||||
end
|
||||
|
||||
return WitnessView
|
||||
Loading…
Reference in New Issue