⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 soundsettingsscript.luac.lua

📁 htc manila 2 sourcecode
💻 LUA
📖 第 1 页 / 共 3 页
字号:
-- Decompiled using luadec 0.6 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l ;;0,7;0,33;0,4,5;;;;;;0,6,12,16;;0,4,54,82;0,0,10,16,20,34;0,8,12;0,0,8,12;0,1;0,0,1;;0,0,7,16,20;0,8,12,16,20,24,77;3;3;3;3;3;3;3;;;0,0,0,4,5;;;0,4,9,13,17,21,25;0,4,9,13,17,21,25;0,0,0,0,0,0,0,0,4,8,12,16,20,24,28;0,0,4,8,12,16,20,24,28,32,36,40,44,133;;0,0,1;;;;; 71e26909_manila.luac 

trace("Loading SoundsSettings Script\n")
require("ScrollPhysics")
require("theme")
require("SliderControl")
require("OnOffButtonControl")
require("RadioButtonControl")
LVPositionX = 0
LVPositionY = 0
LVWidth = 480
LVHeight = 636
ItemSizeWidth = 480
ItemSizeHeight = 81
Sound_ControlThreshold = 380
Sound_LastMouseY = 0
Sound_SliderDragging = nil
Sound_ItemListLayout = nil
Sound_ItemListGenerator = nil
Sound_MapVisibleElements = {}
Sound_MapSettingsItemUI = {}
IsSimpleVolumeMode = true
if _config_os == "windowsmobile" then
   require("machine_status_svc")
   Sound_MachineStatus = MachineStatus()
   Sound_RingToneManager = RingToneManager()
end
RingSlider = nil
SystemSlider = nil
SoundSettingsItemUI = class()
SoundSettingsItemUI.__init = function(l_1_0, l_1_1, l_1_2, l_1_3, l_1_4, l_1_5, l_1_6, l_1_7)
   l_1_0.SoundSettingType = l_1_1
   l_1_0.Text = l_1_2
   l_1_0.DetailText = l_1_3
   l_1_0.IconTexture = l_1_4
   l_1_0.OnOffButtonVisible = l_1_5
   l_1_0.SliderVisible = l_1_6
   l_1_0.RadioVisible = l_1_7
end

Sound_ResetRadioButtonComponent = function(l_2_0)
   local l_2_1 = nil
   if l_2_0 ~= nil then
      l_2_1 = l_2_0.Namespace:FindName("RadioButtonComponent")
   end
   if l_2_1 ~= nil then
     RadioButton_SetValue(l_2_1,false)
   end
end

Sound_HandleRadioSet = function(l_3_0)
   if _config_os == "windowsmobile" then
     Sound_SetRealValue(l_3_0.Tag.Data, true)
   else
     Sound_ResetRadioButtonComponent(Sound_MapVisibleElements[CalendarBasedVolumeUI])
     Sound_ResetRadioButtonComponent(Sound_MapVisibleElements[NormalProfileUI])
     Sound_ResetRadioButtonComponent(Sound_MapVisibleElements[VibrateProfileUI])
     Sound_ResetRadioButtonComponent(Sound_MapVisibleElements[SilentProfileUI])
     local l_3_1 = l_3_0.Namespace:FindName("RadioButtonComponent")
     RadioButton_SetValue(l_3_1, true)
     trace("Set radio on\n")
   end
end

Sound_HandleOnOffToggle = function(l_4_0)
   local l_4_1 = l_4_0.Namespace:FindName("OnOffButtonComponent")
   local l_4_2 = true
   if _config_os == "windowsmobile" then
      l_4_2 = Sound_SetRealValue(l_4_0.Tag.Data, not l_4_1.Tag.Value)
   end
   if l_4_2 then
      OnOffButton_ToggleValue(l_4_1)
   end
end

Sound_HandleSliderSet = function(l_5_0, l_5_1, l_5_2)
   if _config_os == "windowsmobile" then
      if IsSimpleVolumeMode == true then
         SyncSliderRealValue(l_5_2)
      else
         Sound_SetRealValue(l_5_0.Tag.Data, l_5_2)
      end
   else
      SliderControl_SetValue(l_5_1, l_5_2, true)
   end
end

Sound_HandleButtonSet = function(l_6_0)
   if Sound_MapSettingsItemUI[l_6_0.Tag.Data].SoundSettingType == RingtoneUI.SoundSettingType then
      trace("navigate to ringtones page\n")
      if _config_os == "windowsmobile" then
        _application.Navigation:Navigate(URL("Manila://settings/ringtones/ringtones.page"), true)
      end
   else
      if Sound_MapSettingsItemUI[l_6_0.Tag.Data].SoundSettingType == VibrateModeUI.SoundSettingType then
         trace("navigate to vibrate mode page\n")
         if _config_os == "windowsmobile" then
           _application.Navigation:Navigate(URL("Manila://settings/vibratemode/vibratemode.page"), true)
         end
      end
   end
end

Get5ScaleValue = function(l_7_0)
   local l_7_1 = l_7_0
   if l_7_1 > 0 and l_7_1 < 30 then
      l_7_1 = 20
   elseif l_7_1 >= 30 and l_7_1 < 50 then
      l_7_1 = 40
   elseif l_7_1 >= 50 and l_7_1 < 70 then
      l_7_1 = 60
   elseif l_7_1 >= 70 and l_7_1 < 90 then
      l_7_1 = 80
   elseif l_7_1 >= 90 and l_7_1 <= 100 then
      l_7_1 = 100
   end
   return l_7_1
end

SyncSliderbarUI = function(l_8_0)
   if RingSlider ~= nil then
     SliderControl_SetValue(RingSlider, l_8_0, false)
   end
   if SystemSlider ~= nil then
     SliderControl_SetValue(SystemSlider, l_8_0, false)
   end
end

SyncSliderRealValue = function(l_9_0)
   if RingSlider ~= nil then
      Sound_SetRealValue(RingSlider.Tag.Data, l_9_0)
   end
   if SystemSlider ~= nil then
      Sound_SetRealValue(SystemSlider.Tag.Data, l_9_0)
   end
end

FroceSyncSliderUItoRealValue = function(l_10_0)
   trace("[FroceSyncSliderUItoRealValue]")
   if l_10_0 ~= nil then
      local l_10_1 = 60
      local l_10_2 = Sound_MapVisibleElements[Sound_MapSettingsItemUI[l_10_0.Tag.Data]]
      local l_10_3 = l_10_2.Namespace:FindName("DetailText")
      l_10_1 = Sound_GetValueForElement(l_10_2)
      if l_10_0._visible then
        SliderControl_SetValue(l_10_0, l_10_1, true)
        l_10_3.String = tostring(l_10_1) .. Locale:GetString("IDS_PERCENT")
      end        
   end
end

FroceSyncAllSliderUItoRealValue = function()
   FroceSyncSliderUItoRealValue(RingSlider)
   FroceSyncSliderUItoRealValue(SystemSlider)
end

Sound_HitIndex = function(l_12_0)
   local l_12_1 = Sound_ItemListGenerator:GetItem(l_12_0)
   if l_12_1.Tag ~= nil and l_12_1.Tag.Data ~= nil then
      trace("Sounds Hit: " .. Sound_MapSettingsItemUI[l_12_1.Tag.Data].SoundSettingType .. "\n")
      if SetPublicModeRegistry then
         SetPublicModeRegistry(Sound_MapSettingsItemUI[l_12_1.Tag.Data].SoundSettingType)
      end
      if SoundPageGetNewRingTones and Sound_MapSettingsItemUI[l_12_1.Tag.Data].SoundSettingType == NewRingtoneUI.SoundSettingType then
         trace("navi to http://rtdownloads.cingular.com")
         Shell_NavigateTo(ShellLocation_Opera, "http://rtdownloads.cingular.com")
      end
      local l_12_2 = l_12_1.Namespace:FindName("SliderComponent")
      if Sound_MapSettingsItemUI[l_12_1.Tag.Data].OnOffButtonVisible then
         Sound_HandleOnOffToggle(l_12_1, onoffElement)
      else
         if Sound_MapSettingsItemUI[l_12_1.Tag.Data].SliderVisible and l_12_1._xmouse > l_12_2.Position.x then
            local l_12_3 = l_12_1._xmouse - l_12_2.Position.x
            local gvxp = SliderControl_GetValueForXPos(l_12_2, l_12_3)
            Sound_HandleSliderSet(l_12_1, l_12_2, gvxp)
         else
            if Sound_MapSettingsItemUI[l_12_1.Tag.Data].RadioVisible then
               Sound_HandleRadioSet(l_12_1)
            else
               if l_12_1.Tag ~= nil then
                  if l_12_1.Tag.Data ~= nil then
                     Sound_HandleButtonSet(l_12_1)
                  end
               end
            end
         end
      end
   end
end

Sound_HandleMouseDown = function(l_13_0, l_13_1)
   Sound_LastMouseY = l_13_0._ymouse
   Sound_SliderDragging = nil
   l_13_1.value = false
   local l_13_2 = SoundsSettingsItemListView:GetIndexAtMousePoint(l_13_0._xmouse, l_13_0._ymouse)
   if l_13_2 ~= -1 then
      local l_13_3 = Sound_ItemListGenerator:GetItem(l_13_2)
      local l_13_4 = l_13_3.Namespace:FindName("SliderComponent")
      if l_13_4 ~= nil and l_13_4._visible and l_13_0._xmouse > l_13_4.Position.x then
         local l_13_5 = l_13_0._xmouse - l_13_4.Position.x
         if SliderControl_ButtonHitTest(l_13_3, l_13_5) then
            Sound_SliderDragging = l_13_4
            l_13_1.value = true
            ListPhysics:DisconnectMouseEvents()
            if _config_os == "windowsmobile" then
               _application.TouchFlo.HorizontalEnabled = false
            end
            ListPhysics = nil
            trace("Handled\n")
         end
      end
   end
end

Sound_HandleMouseMove = function(l_14_0)
   if Sound_SliderDragging ~= nil then
      local l_14_1 = l_14_0._xmouse - Sound_SliderDragging.Position.x
      local l_14_2 = SliderControl_GetValueForXPos(Sound_SliderDragging, l_14_1)
      if IsSimpleVolumeMode == true then
         SyncSliderbarUI(l_14_2)
      else
         SliderControl_SetValue(Sound_SliderDragging, l_14_2, false)
      end
      if _config_os == "windowsmobile" and (l_14_2 <= 0 or l_14_2 >= 100) then
         if IsSimpleVolumeMode == true then
            SyncSliderRealValue(l_14_2)
         else
            Sound_SetRealValue(Sound_SliderDragging.Tag.Data, l_14_2)
         end
      end
      Sound_LastMouseY = l_14_0._ymouse
   end
end

Sound_HandleMouseRelease = function(l_15_0, l_15_1)
   if Sound_SliderDragging ~= nil then
      local l_15_2 = l_15_0._xmouse - Sound_SliderDragging.Position.x
      local l_15_3 = SliderControl_GetValueForXPos(Sound_SliderDragging, l_15_2)
      if _config_os == "windowsmobile" then
         if IsSimpleVolumeMode == true then
            SyncSliderRealValue(l_15_3)
         else
            Sound_SetRealValue(Sound_SliderDragging.Tag.Data, l_15_3)
         end
      else
         SliderControl_SetValue(Sound_SliderDragging, l_15_3, false)
      end
      trace("Handled\n")
      l_15_1.value = true
   end
   if ListPhysics == nil then
      if _config_os == "windowsmobile" then
         _application.TouchFlo.VerticalEnabled = true
         _application.TouchFlo.HorizontalEnabled = true
      end
      ListPhysics = ScrollPhysics(SoundsSettingsItemListView, SoundsSettingsItemListView, Sound_HitIndex)
      ListPhysics:ConnectMouseEvents()
   end
   Sound_SliderDragging = nil
end

Sound_GetRingModeString = function(l_16_0)
   local l_16_1 = "[[IDS_OTHER]]"
   if l_16_0 == RingModeType_Silent then
      l_16_1 = "[[IDS_SILENT]]"
   elseif l_16_0 == RingModeType_Ring then
      l_16_1 = "[[IDS_RING]]"
   elseif l_16_0 == RingModeType_Vibrate then
      l_16_1 = "[[IDS_VIBRATEONLY]]"
   elseif l_16_0 == RingModeType_VibrateThenRing then
      l_16_1 = "[[IDS_VIBRATETHENRING]]"
   elseif l_16_0 == RingModeType_VibrateAndRing then
      l_16_1 = "[[IDS_VIBRATEANDRING]]"
   elseif l_16_0 == RingModeType_IncreasingRing then
      l_16_1 = "[[IDS_INCREASINGRING]]"
   elseif l_16_0 == RingModeType_RingOnce then
      l_16_1 = "[[IDS_RINGONCE]]"
   end
   return l_16_1
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -