57 lines
1.5 KiB
Lua
57 lines
1.5 KiB
Lua
--设置窗口对象
|
||
--author:--
|
||
|
||
|
||
local MuShi_SettingView = {}
|
||
|
||
local M = MuShi_SettingView
|
||
setmetatable(M, {__index = BaseWindow})
|
||
|
||
function MuShi_SettingView.new(blur_view)
|
||
local self = setmetatable({}, {__index = M})
|
||
self.class = 'MuShi_SettingView'
|
||
self._blur_view = blur_view
|
||
self:init('ui://Extend_Poker_MuShi/MSSettingWindow')
|
||
return self
|
||
end
|
||
|
||
function M:init(url)
|
||
BaseWindow.init(self, url)
|
||
printlog("aaaaaaaaaaaaattttttttttttttttttttttttttttt")
|
||
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')
|
||
|
||
-- 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
|
||
|
||
slider_music.onChanged:Add(
|
||
function()
|
||
GameApplication.Instance.MusicValue = slider_music.value
|
||
-- 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
|
||
end
|
||
)
|
||
|
||
|
||
|
||
end
|
||
|
||
|
||
|
||
function M:Destroy()
|
||
BaseWindow.Destroy(self)
|
||
end
|
||
|
||
return M
|