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

📄 stock_setting.luac.lua

📁 htc manila 2 sourcecode
💻 LUA
字号:
-- Decompiled using luadec 0.6 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l ;;;;;0,0,1;;;;0,0,12,55;;0,0,18,39;7,23;;; 413575db_manila.luac 

require("hitfeedback")
require("stock_svc")
require("common")
require("theme")
ArrowSelected = nil
HandleOptionMenuBackground = function(l_1_0, l_1_1)
   l_1_1.value = true
end

HandleOptionMenuPress = function(l_2_0, l_2_1)
   l_2_0.Color = Color(187, 187, 187, 255)
   l_2_1.value = true
end

HandleOptionMenuRelease = function(l_3_0, l_3_1)
   l_3_0.Color = Color(0, 0, 0, 255)
   OptionButton:SetTextureRef("Bt_JumpMenu_Next_rest")
   OptionMenu.Opacity:Interpolate(0, 10, 0, Interpolate_Linear)
   nInterval = tableInterval[l_3_0.Tag.Data]
   if nInterval == 1 then
      OptionText.String = Locale:GetString("IDS_OPTION_DESC") .. " " .. nInterval .. " " .. Locale:GetString("IDS_MINUTE")
   else
      OptionText.String = Locale:GetString("IDS_OPTION_DESC") .. " " .. string.format(Locale:GetString("IDS_MINUTES"), nInterval)
   end
   ArrowSelected = nil
   l_3_1.value = true
end

HandleOptionMenuReleaseOutside = function(l_4_0, l_4_1)
   l_4_0.Color = Color(0, 0, 0, 255)
   l_4_1.value = true
end

Arrow_HandlePress = function(l_5_0, l_5_1)
   local l_5_2 = OptionButton
   if ArrowSelected == nil then
      l_5_2:SetTextureRef("Bt_JumpMenu_Next_press")
      trace("Show Bt_JumpMenu_Next_press")
   else
      l_5_2:SetTextureRef("Bt_JumpMenu_Pre_press")
      trace("Show Bt_JumpMenu_Pre_press")
   end
   OptionText.Color = GetOnOffTextSelectedColor()
end

Arrow_HandlerRelease = function(l_6_0, l_6_1)
   if ArrowSelected == nil then
      ArrowSelected = OptionButton
      OptionButton:SetTextureRef("Bt_JumpMenu_Pre_rest")
      trace("Show Bt_JumpMenu_Pre_rest")
      OptionMenu.Opacity:Interpolate(100, 10, 0, Interpolate_Linear)
   else
      ArrowSelected = nil
      OptionButton:SetTextureRef("Bt_JumpMenu_Next_rest")
      trace("Show Bt_JumpMenu_Next_rest")
      OptionMenu.Opacity:Interpolate(0, 10, 0, Interpolate_Linear)
   end
   OptionText.Color = Color(0, 0, 0, 255)
end

Arrow_HandlerReleaseOutside = function(l_7_0, l_7_1)
   if ArrowSelected == nil then
      OptionButton:SetTextureRef("Bt_JumpMenu_Next_rest")
      trace("Show Bt_JumpMenu_Next_rest")
   else
      OptionButton:SetTextureRef("Bt_JumpMenu_Pre_rest")
      trace("Show Bt_JumpMenu_Pre_rest")
   end
   OptionText.Color = Color(0, 0, 0, 255)
end

AutodownloadDialogReturned = function(l_8_0)
   l_8_0.OnExit:disconnect(AutodownloadDialogReturned)
   if l_8_0.Result.ExitType ~= DialogExitType_Cancel then
      CheckBox1:SetTextureRef("Check-box")
      ChkBox1Status = true
      OptionText.Color = Color(0, 0, 0, 255)
      local l_8_1 = ArrowHitArea      
      l_8_1.onPress:connect(Arrow_HandlePress)
      l_8_1.onRelease:connect(Arrow_HandlerRelease)
      l_8_1.onReleaseOutside:connect(Arrow_HandlerReleaseOutside)
   else
      CheckBox1:SetTextureRef("Check-box-empty")
      ChkBox1Status = false
      OptionText.Color = GetOnOffTextSelectedColor()
      local l_8_1 = ArrowHitArea
      l_8_1.onPress:disconnect(Arrow_HandlePress)
      l_8_1.onRelease:disconnect(Arrow_HandlerRelease)
      l_8_1.onReleaseOutside:disconnect(Arrow_HandlerReleaseOutside)
      return 
   end
end

HandleOnPressOption1Group = function(l_9_0, l_9_1)
   ArrowSelected = OptionButton
   Arrow_HandlerRelease()
   if ChkBox1Status then
      CheckBox1:SetTextureRef("Check-box-empty")
      ChkBox1Status = false
      OptionText.Color = GetOnOffTextSelectedColor()
      local l_9_2 = ArrowHitArea
      l_9_2.onPress:disconnect(Arrow_HandlePress)
      l_9_2.onRelease:disconnect(Arrow_HandlerRelease)
      l_9_2.onReleaseOutside:disconnect(Arrow_HandlerReleaseOutside)
   else
      local l_9_2 = URL("Manila://Confirmation.dialog")
      l_9_2.Parameters:AddParameter("Title", Locale:GetString("IDS_DATA_WARNING_TITLE"))
      l_9_2.Parameters:AddParameter("ContentString", Locale:GetString("IDS_AUTO_WARNING_MSG"))
      local l_9_3 = _application.DialogManager:GetDialog(l_9_2)
      l_9_3.OnExit:connect(function(l_1_0)
         AutodownloadDialogReturned(l_1_0)
      end)
      l_9_3:Show()
      return 
   end
end

RoamDialogReturned = function(l_10_0)
   l_10_0.OnExit:disconnect(RoamDialogReturned)
   if l_10_0.Result.ExitType ~= DialogExitType_Cancel then
      CheckBox2:SetTextureRef("Check-box")
      ChkBox2Status = true
      return 
   else
      return 
   end
end

HandleOnPressOption2Group = function(l_11_0, l_11_1)
   if ArrowSelected ~= nil then
      Arrow_HandlerRelease()
   end
   if ChkBox2Status then
      CheckBox2:SetTextureRef("Check-box-empty")
      ChkBox2Status = false
   else
      local l_11_2 = URL("Manila://Confirmation.dialog")
      l_11_2.Parameters:AddParameter("Title", Locale:GetString("IDS_DATA_WARNING_TITLE"))
      l_11_2.Parameters:AddParameter("ContentString", Locale:GetString("IDS_ROAM_WARNING_MSG"))
      local l_11_3 = _application.DialogManager:GetDialog(l_11_2)
      l_11_3.OnExit:connect(function(l_1_0)
         RoamDialogReturned(l_1_0)
      end)
      l_11_3:Show()
      return 
   end
end

Page_Create = function()
   OptionMenu.Opacity.value = 0
   trace("Begin Page_Create\n")
   local l_12_0 = nil
   if ChkBox1Status then
      CheckBox1:SetTextureRef("Check-box")
      OptionText.Color = Color(0, 0, 0, 255)
      local l_12_1 = ArrowHitArea
      l_12_1.onPress:connect(Arrow_HandlePress)
      l_12_1.onRelease:connect(Arrow_HandlerRelease)
      l_12_1.onReleaseOutside:connect(Arrow_HandlerReleaseOutside)
   else
      CheckBox1:SetTextureRef("Check-box-empty")
      OptionText.Color = GetOnOffTextSelectedColor()
   end  
   l_12_0 = Option1Text
   l_12_0.String = Locale:GetString("IDS_ITEM0_DESC")
   l_12_0.Color = GetOnOffTextUnselectedColor()
   G1HitBox.onPress:connect(HandleOnPressOption1Group)
   if ChkBox2Status then
      CheckBox2:SetTextureRef("Check-box")
   else
      CheckBox2:SetTextureRef("Check-box-empty")
   end
   l_12_0 = Option2Text
   l_12_0.String = Locale:GetString("IDS_ITEM1_DESC")
   l_12_0.Color = GetOnOffTextUnselectedColor()
   G2HitBox.onPress:connect(HandleOnPressOption2Group)
   if nInterval == 1 then
      OptionText.String = Locale:GetString("IDS_OPTION_DESC") .. " " .. nInterval .. " " .. Locale:GetString("IDS_MINUTE")
   else
      OptionText.String = Locale:GetString("IDS_OPTION_DESC") .. " " .. string.format(Locale:GetString("IDS_MINUTES"), nInterval)
   end
   l_12_0 = Menu
   l_12_0.onPress:connect(HandleOptionMenuBackground)
   l_12_0.onRelease:connect(HandleOptionMenuBackground)
   l_12_0.onReleaseOutside:connect(HandleOptionMenuBackground)
   local l_12_1 = {}
   l_12_1[0] = Option0
   l_12_1[1] = Option1
   l_12_1[2] = Option2
   l_12_1[3] = Option3
   l_12_1[4] = Option4
   tableInterval = {}
   tableInterval[0] = 5
   tableInterval[1] = 10
   tableInterval[2] = 15
   tableInterval[3] = 20
   tableInterval[4] = 30
   for i = 0, 4 do
      l_12_0 = l_12_1[i]
      if l_12_0 ~= nil then
         l_12_0.Tag = {}
         l_12_0.Tag.Data = i
         if tableInterval[i] == 1 then
            l_12_0.String = tableInterval[i] .. " " .. Locale:GetString("IDS_MINUTE")
         else
            l_12_0.String = string.format(Locale:GetString("IDS_MINUTES"), tableInterval[i])
         end
         l_12_0.onPress:connect(HandleOptionMenuPress)
         l_12_0.onRelease:connect(HandleOptionMenuRelease)
         l_12_0.onReleaseOutside:connect(HandleOptionMenuReleaseOutside)
      else
         trace("Get Option" .. i .. " Failed\n")
      end
   end
   trace("Finish Page_Create\n")
end

On_Menu_Done = function()
   trace("Start Done")
   _application.Store:SetIntValue(Lifetime_Permanent, "StockData.AutoDownloadOff", ChkBox1Status and 0 or 1)
   _application.Store:SetIntValue(Lifetime_Permanent, "StockManagerAUMInterval", nInterval)
   _application.Store:SetIntValue(Lifetime_Permanent, "StockData.DownloadWhenRoaming", ChkBox2Status and 1 or 0)
   _application.Navigation:NavigateBack()
end

On_Menu_Cancel = function()
   _application.Navigation:NavigateBack()
end

if _application.Store:GetStringValue(Lifetime_Permanent, "EnableLandscape") == "true" then
   trace("[StockSettingPage] : EnableLandscape")
   require("Stock\\StockSettingPage_Landscape")
   _StockDeletePage_ScreenRotation = StockSettingPage_ScreenRotation(mskSetting, Camera2d, Camera3d, OptionGroup1, OptionGroup2)
end
ChkBox1Status = _application.Store:GetIntValue(Lifetime_Permanent, "StockData.AutoDownloadOff") == 0
ChkBox2Status = _application.Store:GetIntValue(Lifetime_Permanent, "StockData.DownloadWhenRoaming") == 1
nInterval = _application.Store:GetIntValue(Lifetime_Permanent, "StockManagerAUMInterval")
if nInterval == nil or nInterval == 0 then
   _application.Store:SetIntValue(Lifetime_Permanent, "StockManagerAUMInterval", 1)
   nInterval = 1
end
StockManager = CStockManager(_application.Store)
_application:SetLeftSoftkey(Softkey(Locale:GetString("IDS_INFOR_DONE"), On_Menu_Done))
_application:SetRightSoftkey(Softkey(Locale:GetString("IDS_INFOR_CANCEL"), On_Menu_Cancel))
Page_Create()

⌨️ 快捷键说明

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