yunque9/lua_probject/extend_project/extend/poker/mushi/MuShi_SettingView.lua

57 lines
1.5 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

--设置窗口对象
--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