📄 soundsettingsscript.luac.lua
字号:
Sound_SetRealValue = function(l_17_0, l_17_1)
local l_17_2 = false
if Sound_MapSettingsItemUI[l_17_0].SoundSettingType == SystemVolumeUI.SoundSettingType then
Sound_MachineStatus.SystemVolume.Value = l_17_1
if IsSimpleVolumeMode == true then
if l_17_1 == 0 then
Sound_MachineStatus.ActiveProfile.Value = Profile_Silent
end
FroceSyncAllSliderUItoRealValue()
else
FroceSyncSliderUItoRealValue(SystemSlider)
end
elseif Sound_MapSettingsItemUI[l_17_0].SoundSettingType == RingVolumeUI.SoundSettingType then
if IsSimpleVolumeMode == false then
l_17_1 = Get5ScaleValue(l_17_1)
end
Sound_MachineStatus.RingVolume.Value = l_17_1
if IsSimpleVolumeMode == true then
if l_17_1 == 0 then
Sound_MachineStatus.ActiveProfile.Value = Profile_Silent
end
FroceSyncAllSliderUItoRealValue()
else
FroceSyncSliderUItoRealValue(RingSlider)
end
elseif Sound_MapSettingsItemUI[l_17_0].SoundSettingType == NotificationsUI.SoundSettingType then
Sound_MachineStatus.EventSoundsOn.Value = l_17_1
elseif Sound_MapSettingsItemUI[l_17_0].SoundSettingType == VolumeControlUI.SoundSettingType then
if l_17_1 == true then
Sound_MachineStatus.IsSimpleMode.Value = 1
else
Sound_MachineStatus.IsSimpleMode.Value = 0
end
elseif Sound_MapSettingsItemUI[l_17_0].SoundSettingType == CalendarBasedVolumeUI.SoundSettingType then
if l_17_1 and SetPublicModeRegistry == nil then
Sound_MachineStatus.ActiveProfile.Value = Profile_Automatic
end
elseif Sound_MapSettingsItemUI[l_17_0].SoundSettingType == SilentProfileUI.SoundSettingType then
if l_17_1 then
Sound_MachineStatus.ActiveProfile.Value = Profile_Silent
end
elseif Sound_MapSettingsItemUI[l_17_0].SoundSettingType == VibrateProfileUI.SoundSettingType then
if l_17_1 then
Sound_MachineStatus.ActiveProfile.Value = Profile_Vibrate
end
elseif Sound_MapSettingsItemUI[l_17_0].SoundSettingType == NormalProfileUI.SoundSettingType then
if l_17_1 then
Sound_MachineStatus.ActiveProfile.Value = Profile_Normal
end
else
l_17_2 = true
end
return l_17_2
end
Sound_GetRealInitialValue = function(l_18_0)
local l_18_1 = nil
if Sound_MapSettingsItemUI[l_18_0].SoundSettingType == SystemVolumeUI.SoundSettingType then
l_18_1 = Sound_MachineStatus.SystemVolume.Value
if IsSimpleVolumeMode == true then
Sound_MachineStatus.RingVolume.Value = l_18_1
end
elseif Sound_MapSettingsItemUI[l_18_0].SoundSettingType == RingtoneUI.SoundSettingType then
l_18_1 = Sound_RingToneManager.CurrentRingtone.DisplayName
elseif Sound_MapSettingsItemUI[l_18_0].SoundSettingType == VibrateModeUI.SoundSettingType then
l_18_1 = Sound_GetRingModeString(Sound_MachineStatus.RingMode.Value)
elseif Sound_MapSettingsItemUI[l_18_0].SoundSettingType == RingVolumeUI.SoundSettingType then
l_18_1 = Sound_MachineStatus.RingVolume.Value
elseif Sound_MapSettingsItemUI[l_18_0].SoundSettingType == NotificationsUI.SoundSettingType then
l_18_1 = Sound_MachineStatus.EventSoundsOn.Value
elseif Sound_MapSettingsItemUI[l_18_0].SoundSettingType == VolumeControlUI.SoundSettingType then
if Sound_MachineStatus.IsSimpleMode.Value == 0 then
l_18_1 = false
IsSimpleVolumeMode = false
else
l_18_1 = true
IsSimpleVolumeMode = true
local sms = Sound_MachineStatus.SystemVolume.Value
Sound_MachineStatus.RingVolume.Value = sms
if sms == 0 then
Sound_MachineStatus.ActiveProfile.Value = Profile_Silent
end
end
elseif Sound_MapSettingsItemUI[l_18_0].SoundSettingType == CalendarBasedVolumeUI.SoundSettingType then
if SetPublicModeRegistry then
l_18_1 = Sound_MachineStatus.ActiveProfile.Value == Profile_Silent and Sound_MachineStatus.PublicModeSetting.Value == 1
else
l_18_1 = Sound_MachineStatus.ActiveProfile.Value == Profile_Automatic
end
elseif Sound_MapSettingsItemUI[l_18_0].SoundSettingType == SilentProfileUI.SoundSettingType then
if SetPublicModeRegistry then
l_18_1 = Sound_MachineStatus.ActiveProfile.Value == Profile_Silent and Sound_MachineStatus.PublicModeSetting.Value == 0
else
l_18_1 = Sound_MachineStatus.ActiveProfile.Value == Profile_Silent
end
elseif Sound_MapSettingsItemUI[l_18_0].SoundSettingType == VibrateProfileUI.SoundSettingType then
l_18_1 = Sound_MachineStatus.ActiveProfile.Value == Profile_Vibrate
elseif Sound_MapSettingsItemUI[l_18_0].SoundSettingType == NormalProfileUI.SoundSettingType then
l_18_1 = Sound_MachineStatus.ActiveProfile.Value == Profile_Normal or Sound_MachineStatus.ActiveProfile.Value == ""
end
return l_18_1
end
Sound_GetValueForElement = function(l_19_0)
local l_19_1 = nil
if _config_os == "windowsmobile" then
l_19_1 = Sound_GetRealInitialValue(l_19_0.Tag.Data)
end
local l_19_2 = l_19_0.Namespace:FindName("OnOffButtonComponent")
local l_19_3 = l_19_0.Namespace:FindName("SliderComponent")
local l_19_4 = l_19_0.Namespace:FindName("RadioButtonComponent")
if l_19_1 == nil then
if l_19_2._visible or l_19_4._visible then
l_19_1 = false
elseif l_19_3._visible then
l_19_1 = 60
else
l_19_1 = ""
end
end
return l_19_1
end
Sound_SyncUIToRealValue = function(l_20_0)
trace("Syncing UI to Real Value\n")
if l_20_0 ~= nil then
local l_20_1 = Sound_GetValueForElement(l_20_0)
local l_20_2 = l_20_0.Namespace:FindName("SliderComponent")
local l_20_3 = l_20_0.Namespace:FindName("OnOffButtonComponent")
local l_20_4 = l_20_0.Namespace:FindName("DetailText")
local l_20_5 = l_20_0.Namespace:FindName("RadioButtonComponent")
if l_20_3._visible and l_20_1 ~= l_20_3.Tag.Value then
OnOffButton_ToggleValue(l_20_3)
elseif l_20_2._visible then
SliderControl_SetValue(l_20_2, l_20_1, true)
l_20_4.String = tostring(l_20_1) .. Locale:GetString("IDS_PERCENT")
elseif l_20_5._visible then
RadioButton_SetValue(l_20_5, l_20_1)
elseif l_20_1 ~= nil then
if not SoundPageGetNewRingTones or (SoundPageGetNewRingTones and l_20_0.Tag.Data ~= 8) then
local l_20_6 = Locale:GetString("IDS_CURRENT_DETAIL")
l_20_4.String = string.format(l_20_6, l_20_1)
end
end
end
end
Sound_OnSystemVolumeChanged = function()
local l_21_0 = Sound_MapVisibleElements[SystemVolumeUI]
Sound_SyncUIToRealValue(l_21_0)
end
Sound_OnRingVolumeChanged = function()
local l_22_0 = Sound_MapVisibleElements[RingVolumeUI]
Sound_SyncUIToRealValue(l_22_0)
end
Sound_OnVibrateModeOrRingtoneChanged = function()
local l_23_0 = Sound_MapVisibleElements[VibrateModeUI]
Sound_SyncUIToRealValue(l_23_0)
l_23_0 = Sound_MapVisibleElements[RingtoneUI]
Sound_SyncUIToRealValue(l_23_0)
end
Sound_OnKeyboardValueChanged = function()
local l_24_0 = Sound_MapVisibleElements[KeyboardUI]
Sound_SyncUIToRealValue(l_24_0)
end
Sound_OnNotificationsValueChanged = function()
local l_25_0 = Sound_MapVisibleElements[NotificationsUI]
Sound_SyncUIToRealValue(l_25_0)
end
Sound_OnSimpleVolumeModeChanged = function()
local l_26_0 = Sound_MapVisibleElements[VolumeControlUI]
Sound_SyncUIToRealValue(l_26_0)
end
Sound_OnProfileValueChanged = function()
local l_27_0 = Sound_MapVisibleElements[CalendarBasedVolumeUI]
Sound_SyncUIToRealValue(l_27_0)
l_27_0 = Sound_MapVisibleElements[NormalProfileUI]
Sound_SyncUIToRealValue(l_27_0)
l_27_0 = Sound_MapVisibleElements[VibrateProfileUI]
Sound_SyncUIToRealValue(l_27_0)
l_27_0 = Sound_MapVisibleElements[SilentProfileUI]
Sound_SyncUIToRealValue(l_27_0)
end
Sound_RegisterEventCallbacks = function()
Sound_MachineStatus.RingVolume.OnValueChanged:connect(Sound_OnRingVolumeChanged)
Sound_MachineStatus.RingMode.OnValueChanged:connect(Sound_OnVibrateModeOrRingtoneChanged)
Sound_MachineStatus.CurrentRingtonePath.OnValueChanged:connect(Sound_OnVibrateModeOrRingtoneChanged)
Sound_MachineStatus.SystemVolume.OnValueChanged:connect(Sound_OnSystemVolumeChanged)
Sound_MachineStatus.EventSoundsOn.OnValueChanged:connect(Sound_OnNotificationsValueChanged)
Sound_MachineStatus.IsSimpleMode.OnValueChanged:connect(Sound_OnSimpleVolumeModeChanged)
Sound_MachineStatus.ActiveProfile.OnValueChanged:connect(Sound_OnProfileValueChanged)
if SetPublicModeRegistry then
Sound_MachineStatus.PublicModeSetting.OnValueChanged:connect(Sound_OnProfileValueChanged)
end
end
Sound_HandleOnOffKeyDown = function(l_29_0, l_29_1, l_29_2)
if l_29_1.Code == KeyCode_Return or l_29_1.Code == KeyCode_Space then
Sound_HandleOnOffToggle(l_29_0, l_29_0.Namespace:FindName("OnOffButtonComponent"))
l_29_2.value = true
end
end
Sound_HandleSliderKeyDown = function(l_30_0, l_30_1, l_30_2)
local l_30_3 = l_30_0.Namespace:FindName("SliderComponent")
local l_30_4 = -1
if l_30_1.Code == KeyCode_Left then
l_30_4 = l_30_3.Tag.Value - 10
else
if l_30_1.Code == KeyCode_Right then
l_30_4 = l_30_3.Tag.Value + 10
end
end
if l_30_4 ~= -1 then
Sound_HandleSliderSet(l_30_0, l_30_3, l_30_4)
l_30_2.value = true
end
end
Sound_HandleRadioKeyDown = function(l_31_0, l_31_1, l_31_2)
if l_31_1.Code == KeyCode_Return or l_31_1.Code == KeyCode_Space then
Sound_HandleRadioSet(l_31_0)
l_31_2.value = true
end
end
Sound_HandleDetailKeyDown = function(l_32_0, l_32_1, l_32_2)
if l_32_1.Code == KeyCode_Return or l_32_1.Code == KeyCode_Space then
Sound_HandleButtonSet(l_32_0)
l_32_2.value = true
end
end
Sound_ItemSelectedFunc = function(l_33_0)
local l_33_1 = l_33_0.Namespace:FindName("Selector")
l_33_1._visible = true
local l_33_2 = l_33_0.Namespace:FindName("Text")
local l_33_3 = l_33_0.Namespace:FindName("MainText")
local l_33_4 = l_33_0.Namespace:FindName("DetailText")
local l_33_5 = l_33_0.Namespace:FindName("OnText")
local l_33_6 = l_33_0.Namespace:FindName("OffText")
l_33_2.Color = GetMainTextSelectedColor()
l_33_3.Color = GetMainTextSelectedColor()
l_33_4.Color = GetSubTextSelectedColor()
if l_33_5 ~= nil then
l_33_5.Color = GetOnOffTextSelectedColor()
end
if l_33_6 ~= nil then
l_33_6.Color = GetOnOffTextSelectedColor()
end
end
Sound_ItemDeselectedFunc = function(l_34_0)
local l_34_1 = l_34_0.Namespace:FindName("Selector")
l_34_1._visible = false
local l_34_2 = l_34_0.Namespace:FindName("Text")
local l_34_3 = l_34_0.Namespace:FindName("MainText")
local l_34_4 = l_34_0.Namespace:FindName("DetailText")
local l_34_5 = l_34_0.Namespace:FindName("OnText")
local l_34_6 = l_34_0.Namespace:FindName("OffText")
l_34_2.Color = GetMainTextUnselectedColor()
l_34_3.Color = GetMainTextUnselectedColor()
l_34_4.Color = GetSubTextUnselectedColor()
if l_34_5 ~= nil then
l_34_5.Color = GetOnOffTextUnselectedColor()
end
if l_34_6 ~= nil then
l_34_6.Color = GetOnOffTextUnselectedColor()
end
end
FreeUnusedAssets = function(l_35_0, l_35_1, l_35_2, l_35_3, l_35_4, l_35_5, l_35_6, l_35_7)
local l_35_8 = l_35_0.Namespace:FindName("TextComponent")
local l_35_9 = l_35_0.Namespace:FindName("TextWithDetailComponent")
local l_35_10 = l_35_0.Namespace:FindName("IconComponent")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -