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

📄 clockview.luac.lua

📁 htc manila 2 sourcecode
💻 LUA
📖 第 1 页 / 共 4 页
字号:
   if l_33_0 == 1 then
      if l_33_1 + FrmClockView.PageRearrange.LvMoteRate < l_33_2 then
         LvCityRearrange:ApplyScrollDelta(Vector3F(0, FrmClockView.PageRearrange.LvMoteRate, 0))
      elseif l_33_1 < l_33_2 then
         LvCityRearrange:ApplyScrollDelta(Vector3F(0, l_33_2 - l_33_1, 0))
      else
         FrmClockView.PageRearrange.Timer:Stop()
      end
   else
      if l_33_1 - FrmClockView.PageRearrange.LvMoteRate > 0 then
         LvCityRearrange:ApplyScrollDelta(Vector3F(0, -FrmClockView.PageRearrange.LvMoteRate, 0))
      elseif l_33_1 > 0 then
         LvCityRearrange:ApplyScrollDelta(Vector3F(0, -l_33_1, 0))
      else
         FrmClockView.PageRearrange.Timer:Stop()
      end
   end
end

WorldClock.Clock.PageAdd = class(WorldClock.Clock.PageBase)
WorldClock.Clock.PageAdd.__init = function(l_34_0)
   l_34_0.Node = CityAddNode
   l_34_0.ComponentName = "CityAddComponent"
end

WorldClock.Clock.PageAdd.ShowPage = function(l_35_0)
   _application.Navigation.Title = Locale:GetString("IDS_SELECTCOUNTRY")
   _application:SetLeftSoftkey(Softkey((Locale:GetString("")), nil))
   _application:SetRightSoftkey(Softkey(Locale:GetString("IDS_CANCEL"), WorldClock.Clock.PageAdd_OnCountryRsk))
   _application.Navigation.TabVisibility = false
   _application.TouchFlo.HorizontalEnabled = false
   l_35_0.InputBoxFlag = false
   if not l_35_0.Initialized then
      l_35_0:Initialize()
      if _application.Store:GetStringValue(Lifetime_Permanent, "EnableLandscape") == "true" then
         trace("[ClockPageDelete] : EnableLandscape")
         require("WorldClock\\ClockPageAdd_Landscape")
         ClockPageAdd_Landscape = ClockPageAdd_ScreenRotation(CityPickerCam2D, CityPickerMask, CountryPickerList, CountryPickerSelector, CityPickerList, CityPickerSelector, LetterGroup, LetterPickerListView, CharacterDialogGroup)
      end
      PageCityPicker_CityItemListLayout = TileLayout()
      if _application.Orientation == ScreenOrientation_Portrait then
         PageCityPicker_CityItemListLayout:SetItemSize(480, 80, 0)
      else
         if _application.Orientation == ScreenOrientation_Landscape then
            PageCityPicker_CityItemListLayout:SetItemSize(800, 80, 0)
         end
      end
      PageCityPicker_CityItemListLayout.SelectionNode = CityPickerSelector
      CityPickerList:SetLayout(PageCityPicker_CityItemListLayout)
      PageCityPicker_CityItemListGenerator = LibraryGeneratorCity(FrmClockView.Weather:SearchCitiesInCountry("", "", 5000), CityPickerList:GetMovie(), CityPickerList.ComponentLibraryName, CityPickerList.ComponentLibraryID)
      PageCityPicker_CityItemListGenerator.ItemCreated:connect(l_35_0.OnCityItemCreated, l_35_0)
      CityPickerList:SetGenerator(PageCityPicker_CityItemListGenerator)
      PageCityPicker_CityListScrollPhysics = ScrollPhysics(CityPickerList, CityPickerList, WorldClock.Clock.PageAdd_OnCityItemSelected)
      l_35_0.CountryItemListLayout = TileLayout()
      if _application.Orientation == ScreenOrientation_Portrait then
         l_35_0.CountryItemListLayout:SetItemSize(480, 80, 0)
      else
         if _application.Orientation == ScreenOrientation_Landscape then
            l_35_0.CountryItemListLayout:SetItemSize(800, 80, 0)
         end
      end
      l_35_0.CountryItemListLayout.SelectionNode = CountryPickerSelector
      CountryPickerList:SetLayout(l_35_0.CountryItemListLayout)
      l_35_0.CountryItemListGenerator = LibraryGeneratorCity(FrmClockView.Weather:GetCountryList(), CountryPickerList:GetMovie(), CountryPickerList.ComponentLibraryName, CountryPickerList.ComponentLibraryID)
      l_35_0.CountryItemListGenerator.ItemCreated:connect(l_35_0.OnCountryItemCreated, l_35_0)
      CountryPickerList:SetGenerator(l_35_0.CountryItemListGenerator)
      CountryPickerList:Focus()
      l_35_0.CountryPhysicalScroll = ScrollPhysics(CountryPickerList, CountryPickerList, WorldClock.Clock.PageAdd_OnCountryItemSelected)
      l_35_0.CountryPhysicalScroll:ConnectMouseEvents()
      l_35_0.CityItemListLayout = TileLayout()
      if _application.Orientation == ScreenOrientation_Portrait then
         l_35_0.CityItemListLayout:SetItemSize(480, 80, 0)
      else
         if _application.Orientation == ScreenOrientation_Landscape then
            l_35_0.CityItemListLayout:SetItemSize(800, 80, 0)
         end
      end
      l_35_0.CityItemListLayout.SelectionNode = CityPickerSelector
      CityPickerList:SetLayout(l_35_0.CityItemListLayout)
      l_35_0.CityItemListGenerator = LibraryGeneratorCity(FrmClockView.Weather:SearchCitiesInCountry("", "", 5000), CityPickerList:GetMovie(), CityPickerList.ComponentLibraryName, CityPickerList.ComponentLibraryID)
      l_35_0.CityItemListGenerator.ItemCreated:connect(l_35_0.OnCityItemCreated, l_35_0)
      CityPickerList:SetGenerator(l_35_0.CityItemListGenerator)
      l_35_0.CityPhysicalScroll = ScrollPhysics(CityPickerList, CityPickerList, WorldClock.Clock.PageAdd_OnCityItemSelected)
      InputBox.onPress:connect(l_35_0.OnInputBoxPress, l_35_0)
      InputBox.OnTextChanged:connect(l_35_0.OnInputBoxTextChanged, l_35_0)
      InputBox.onFocusOut:connect(l_35_0.OnInputBoxFocusOut, l_35_0)
      trace("INPUTBOX " .. tostring(InputBox == nil) .. " LetterGroup " .. tostring(LetterGroup == nil))
      objLetterPicker = LetterPicker(LetterPickerListView, ScrubBar, WorldClock.Clock.PageAdd_OnLetterSelected, CharacterDialogGroup, LetterPickerDialogChar)
      if _application.Orientation == ScreenOrientation_Portrait then
         objLetterPicker:SetLetterFontSize(18)
         objLetterPicker:SetLetterHeight(18)
      else
         if _application.Orientation == ScreenOrientation_Landscape then
            objLetterPicker:SetLetterFontSize(11)
            objLetterPicker:SetLetterHeight(11)
         end
      end
   else
      l_35_0.CountryPhysicalScroll:ConnectMouseEvents()
      InputBox.onPress:connect(l_35_0.OnInputBoxPress, l_35_0)
      InputBox.OnTextChanged:connect(l_35_0.OnInputBoxTextChanged, l_35_0)
      InputBox.onFocusOut:connect(l_35_0.OnInputBoxFocusOut, l_35_0)
   end
   l_35_0.SelectedCountry = ""
   WorldClock.Clock.PageAdd_BackToCountry()
   l_35_0.Node._visible = true
end

WorldClock.Clock.PageAdd.HidePage = function(l_36_0)
   l_36_0.Node._visible = false
   _application.TouchFlo.HorizontalEnabled = true
   InputBox:SetShowWindowFlag(false)
   l_36_0.CountryPhysicalScroll:DisconnectMouseEvents()
   InputBox.onPress:disconnect(l_36_0.OnInputBoxPress, l_36_0)
   InputBox.OnTextChanged:disconnect(l_36_0.OnInputBoxTextChanged, l_36_0)
   InputBox.onFocusOut:disconnect(l_36_0.OnInputBoxFocusOut, l_36_0)
end

WorldClock.Clock.PageAdd_OnLetterSelected = function(l_37_0)
   if CountryPickerList._visible then
      local l = FrmClockView.Weather:GetCountryLetterIndex(l_37_0)
      CountryPickerList:GetLayout():JumpToIndex(l, ListAlignment_Top, ListAlignmentOptions_Snap)
      CountryPickerList:JumpToIndex(l)
      CountryPickerList:GetGenerator().SelectedIndex = l
   else
      if CityPickerList._visible then
         local l = FrmClockView.Weather:GetCityLetterIndex(l_37_0)
         CityPickerList:GetLayout():JumpToIndex(l, ListAlignment_Top, ListAlignmentOptions_Snap)
         CityPickerList:JumpToIndex(l)
         CityPickerList:GetGenerator().SelectedIndex = l
      end
   end
end

WorldClock.Clock.PageAdd_OnCountryRsk = function()
   FrmClockView:Switch(FrmClockView.PrevPage)
end

WorldClock.Clock.PageAdd.OnCountryItemCreated = function(l_39_0, l_39_1, l_39_2)
   local l_39_3 = l_39_2.Namespace:FindName("CityPickerCityName")
   if nil ~= l_39_3 then
      l_39_3.String = l_39_1.country
   end
   if ClockPageAdd_Landscape ~= nil then
      ClockPageAdd_Landscape:AdjustListviewItemLayout(l_39_1, l_39_2)
   end
end

WorldClock.Clock.PageAdd_OnCountryItemSelected = function(l_40_0)
   if l_40_0 < 0 then
      return 
   end
   local l_40_1 = FrmClockView.PageAdd.CountryItemListGenerator:GetData(l_40_0)
   if nil ~= l_40_1 then
      FrmClockView.PageAdd.SelectedCountry = l_40_1.country
   end
   FrmClockView.PageAdd.CityItemListGenerator.Collection = FrmClockView.Weather:SearchCitiesInCountry("", FrmClockView.PageAdd.SelectedCountry, 5000)
   InputBoxDefaultText._visible = true
   InputBox:SetShowWindowFlag(false)
   InputBox.WindowText = ""
   FrmClockView.PageAdd.InputBoxFlag = true
   CountryPickerList._visible = false
   CityPickerList._visible = true
   FrmClockView.PageAdd.CountryPhysicalScroll:DisconnectMouseEvents()
   FrmClockView.PageAdd.CityPhysicalScroll:ConnectMouseEvents()
   _application.Navigation.Title = Locale:GetString("IDS_SELECTCITY")
   _application:SetLeftSoftkey(Softkey("", nil))
   _application:SetRightSoftkey(Softkey(Locale:GetString("IDS_BACK"), WorldClock.Clock.PageAdd_BackToCountry))
end

WorldClock.Clock.PageAdd_BackToCountry = function()
   InputBoxDefaultText._visible = true
   InputBox:SetShowWindowFlag(false)
   FrmClockView.PageAdd.InputBoxFlag = true
   InputBox.WindowText = ""
   CountryPickerList._visible = true
   CityPickerList._visible = false
   _application.Navigation.Title = Locale:GetString("IDS_SELECTCOUNTRY")
   FrmClockView.PageAdd.CountryPhysicalScroll:ConnectMouseEvents()
   FrmClockView.PageAdd.CityPhysicalScroll:DisconnectMouseEvents()
   _application:SetLeftSoftkey(Softkey("", nil))
   _application:SetRightSoftkey(Softkey(Locale:GetString("IDS_CANCEL"), WorldClock.Clock.PageAdd_OnCountryRsk))
end

WorldClock.Clock.PageAdd.OnInputBoxPress = function(l_42_0)
   _application:ShowInputPanel(0)
   InputBox:SetShowWindowFlag(true)
   InputBoxDefaultText._visible = false
   LetterGroup._visible = false
end

WorldClock.Clock.PageAdd.OnInputBoxTextChanged = function(l_43_0)
   if FrmClockView.PageAdd.InputBoxFlag then
      FrmClockView.PageAdd.InputBoxFlag = false
      return 
   end
   if CountryPickerList._visible then
      FrmClockView.PageAdd.CountryItemListLayout:JumpToIndex(0, ListAlignment_Top, ListAlignmentOptions_Snap)
      CountryPickerList:JumpToIndex(0)
      FrmClockView.PageAdd.CountryItemListGenerator.SelectedIndex = 0
      FrmClockView.PageAdd.CountryItemListGenerator.Collection = FrmClockView.Weather:SearchCountries(InputBox.WindowText)
   else
      FrmClockView.PageAdd.CityItemListLayout:JumpToIndex(0, ListAlignment_Top, ListAlignmentOptions_Snap)
      CityPickerList:JumpToIndex(0)
      FrmClockView.PageAdd.CityItemListGenerator.SelectedIndex = 0
      FrmClockView.PageAdd.CityItemListGenerator.Collection = FrmClockView.Weather:SearchCitiesInCountry(InputBox.WindowText, FrmClockView.PageAdd.SelectedCountry, 5000)
   end
end

WorldClock.Clock.PageAdd.OnInputBoxFocusOut = function(l_44_0)
   _application:HideInputPanel()
   if InputBox.WindowText == "" then
      InputBoxDefaultText._visible = true
      LetterGroup._visible = true
   end
end

WorldClock.Clock.PageAdd.OnCityItemCreated = function(l_45_0, l_45_1, l_45_2)
   local l_45_3 = l_45_2.Namespace:FindName("CityPickerCityName")
   if nil ~= l_45_3 then
      l_45_3.String = l_45_1.cityName
   end
   if ClockPageAdd_Landscape ~= nil then
      ClockPageAdd_Landscape:AdjustListviewItemLayout(l_45_1, l_45_2)
   end
end

WorldClock.Clock.PageAdd_OnCityItemSelected = function(l_46_0)
   if l_46_0 < 0 then
      return 
   end
   local l_46_1 = FrmClockView.PageAdd.CityItemListGenerator:GetData(l_46_0)
   if nil ~= l_46_1 then
      if FrmClockView.PrevPage == FrmClockView.PageEdit then
         FrmClockView.PrevPage:SetTempTimeZone(l_46_1.accuweatherCode, l_46_1.cityName, l_46_1.timezone)
      else
         if FrmClockView.PrevPage == FrmClockView.PageView then
            FrmClockView.PrevPage:AddNewCity(l_46_1.accuweatherCode, l_46_1.cityName, l_46_1.timezone)
         end
      end
   end
   FrmClockView:Switch(FrmClockView.PrevPage)
end

PageSetLocalTime = class(WorldClock.Clock.PageBase)
PageSetLocalTime.__init = function(l_47_0)
   l_47_0.Node = ClockEditNode
   l_47_0.ComponentName = "SetLocalTime"
   PageSetLocalTime_TempTimeZone = CityItem()
   PageSetLocalTime_TempTime = Time_GetNow()
   PageSetLocalTime_OriginalHour = 0
   PageSetLocalTime_OriginalMinute = 0
   PageSetLocalTime_Dirty = false
   PageSetLocalTime_FirstLoad = false
end

PageSetLocalTime.ShowPage = function(l_48_0)
   trace("PageSetLocalTime:ShowPage()")
   if not l_48_0.Initialized then
      l_48_0:Initialize()
      l_48_0.ItemListLayout = TileLayout()
      if _application.Orientation == ScreenOrientation_Portrait then
         l_48_0.ItemListLayout:SetItemSize(480, 450, 0)
      else
         if _application.Orientation == ScreenOrientation_Landscape then
            l_48_0.ItemListLayout:SetItemSize(800, 450, 0)
         end
      end
      LvSetLocalTime:SetLayout(l_48_0.ItemListLayout)
      l_48_0.FakeCollection = VectorNotifyint()
      l_48_0.FakeCollection:push_back(0)
      l_48_0.ItemListGenerator = LibraryGeneratorint(l_48_0.FakeCollection, LvSetLocalTime:GetMovie(), LvSetLocalTime.ComponentLibraryName, LvSetLocalTime.ComponentLibraryID)
      l_48_0.ItemListGenerator.ItemCreated:connect(l_48_0.OnItemCreated, l_48_0)
      l_48_0.ItemListGenerator.ItemDestroyed:connect(l_48_0.OnItemDestroyed, l_48_0)
      LvSetLocalTime:SetGenerator(l_48_0.ItemListGenerator)
      LvSetLocalTime:Focus()
      PageSetLocalTime_PhysicalScroll = ScrollPhysics(LvSetLocalTime, LvSetLocalTime, nil)

⌨️ 快捷键说明

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