📄 manila.luac.lua
字号:
PreviewBackground.TextureCoords:set(0, 0, PreviewBackground.Size.width / 2, PreviewBackground.Size.height / 2)
Titlebar.Position.y = 696
TitleText.Size.width = screenWidth
TitleTextLowLayer.Size.width = screenWidth
_application:ForceUpdateFrames(10)
uptabTimeout()
else if _application.Orientation == ScreenOrientation_Landscape then
trace("++++++++++[Manila.lua] : ScreenOrientation_Landscape")
screenWidth = 801
screenHeight = 480
local l_31_1 = screenHeight - 2 * SystemTitlebarHeight
Background_Cam.Viewport.value = RectF(0, 0, screenWidth, l_31_1)
Background_Cam.ViewLeft.value = 0
Background_Cam.ViewRight.value = screenWidth
Background_Cam.ViewTop.value = l_31_1
Background_Cam.ViewButtom.value = 0
Content_Cam.Viewport.value = RectF(0, 0, screenWidth, l_31_1)
Content_Cam.ViewLeft.value = 0
Content_Cam.ViewRight.value = screenWidth
Content_Cam.ViewTop.value = l_31_1
Content_Cam.ViewButtom.value = 0
previewRoot.Position.y = 208
TabBackgroundGraphicLevel0.TextureCoords:set(0, 0.39840698242188, 403, 1)
TabBackgroundGraphicLevel0.Size.width = 806
TabBackgroundGraphicLevel1.TextureCoords:set(0, 0.39840698242188, 403, 1)
TabBackgroundGraphicLevel1.Size.width = 806
BackGroundLevel0:SetTextureRef("BGLevel0_Landscape_left")
BackGroundLevel0.Position.x = 0
BackGroundLevel0.Position.y = 377
BackGroundLevel0.TextureCoords:set(0, 0, 1, 0.787109375)
BackGroundLevel0.Size.width = 512
BackGroundLevel0.Size.height = 403
BackGroundLevel0.Opacity.value = 100
BackGroundLevel0_bottom:SetTextureRef("BGLevel0_Landscape_right")
BackGroundLevel0_bottom.Position.x = 512
BackGroundLevel0_bottom.Position.y = 377
BackGroundLevel0_bottom.TextureCoords:set(0.00390625, 0, 0.6171875, 0.787109375)
BackGroundLevel0_bottom.Size.width = 314
BackGroundLevel0_bottom.Size.height = 403
BackGroundLevel0_bottom.Opacity.value = 100
BackGroundLevel1:SetTextureRef("BGLevel1_Landscape_left")
BackGroundLevel1.Position.x = 0
BackGroundLevel1.Position.y = 317
BackGroundLevel1.TextureCoords:set(0, 0, 1, 0.837890625)
BackGroundLevel1.Size.width = 512
BackGroundLevel1.Size.height = 429
BackGroundLevel1_bottom:SetTextureRef("BGLevel1_Landscape_right")
BackGroundLevel1_bottom.Position.x = 511
BackGroundLevel1_bottom.Position.y = 317
BackGroundLevel1_bottom.TextureCoords:set(0, 0, 0.609375, 0.837890625)
BackGroundLevel1_bottom.Size.width = 312
BackGroundLevel1_bottom.Size.height = 429
ModalBackground.Size.width = screenWidth + 5
ModalBackground.Size.height = l_31_1 + 1
ModalBackground.Position.y = l_31_1 + 1
ModalBackground.TextureCoords:set(0, 0, ModalBackground.Size.width / 2, ModalBackground.Size.height / 2)
iconPreviewRoot.Position.x = 326
iconPreviewRoot.Position.y = 55
PreviewTitleText.Position.x = 160
PreviewTitleText.Position.y = -110
PreviewBackground.Size.width = screenWidth + 5
PreviewBackground.Size.height = 305
PreviewBackground.TextureCoords:set(0, 0, PreviewBackground.Size.width / 2, PreviewBackground.Size.height / 2)
Titlebar.Position.y = 376
TitleText.Size.width = screenWidth
TitleTextLowLayer.Size.width = screenWidth
_application:ForceUpdateFrames(10)
end
end
TitleBarLevel1.Size.width = 804
TitleBarLevel1.TextureCoords:set(0, 0, 402, 0.9375)
layoutInitialized = false
RefreshTabControl()
end
OnVisibilityChanged = function()
trace("***********************OnVisibilityChanged\n")
end
OnNavigateHome = function(l_33_0)
trace("***********************OnNavigateHome\n")
end
RefreshTabControl = function()
trace("refreshing tab control...\n")
if _application.Navigation == nil then
trace("Navigation is invalid...\n")
return
end
if _application.Navigation.CurrentRequest == nil then
trace("CurrentRequest is invalid...\n")
if NavigateHome then
trace("CurrentRequest is invalid...NavigateHome\n")
NavigateHome()
end
return
end
rebuildNavigation(_application.Navigation.CurrentRequest.PageGroup.Level)
OnTitleChanged()
OnTitlebarVisibilityChanged()
local l_34_0 = false
bFirstRebuild = l_34_0
end
OnBackgroundAnimate = function(l_35_0)
trace("***********************OnBackgroundAnimate\n")
end
_application.Navigation.OnNavigate:connect(OnNavigate)
_application.Navigation.OnBackgroundAnimate:connect(OnBackgroundAnimate)
_application.Navigation.OnTabVisibilityChanged:connect(OnTabVisibilityChanged)
_application.Navigation.OnTabTrayOpacityChanged:connect(OnTabTrayOpacityChanged)
_application.Navigation.OnTitleChanged:connect(OnTitleChanged)
_application.Navigation.OnTitlebarVisibilityChanged:connect(OnTitlebarVisibilityChanged)
if _application.Store:GetStringValue(Lifetime_Permanent, "EnableLandscape") == "true" then
trace("Landscape mode enabled\n")
require("machine_status_svc")
machineStatus = MachineStatus()
_application.OnOrientationChanged:connect(OnOrientationChanged)
_application.OnForceShowTitleBar:connect(OnForceShowTitleBar)
else
trace("Landscape mode NOT enabled\n")
end
_application.OnVisibilityChanged:connect(OnVisibilityChanged)
_application.Navigation.OnNavigateHome:connect(OnNavigateHome)
selectorGraphic.onPress:connect(OnSelectorPress)
selectorGraphic.onRelease:connect(OnSelectorRelease)
selectorGraphic.onReleaseOutside:connect(OnSelectorReleaseOutside)
selectorGraphic.onMouseMove:connect(OnSelectorMouseMove)
TabBackgroundGraphicLevel0.onPress:connect(BlockMouseDown)
ModalBackground.onPress:connect(BlockMouseDown)
ModalBackground.onRelease:connect(BlockMouseDown)
OnTopDialogIn = function()
trace("ontopdialogin\n")
ModalOverlay._visible = true
ModalOverlay.Opacity:Interpolate(0, 100, 3, 0, Interpolate_Linear, nil)
end
OnTopDialogOut = function()
trace("ontopdialogout\n")
ModalOverlay._visible = false
local l_37_0 = GizmoDock:GetLuaNodes()
if l_37_0:size() > 0 then
trace("Child count: " .. l_37_0:size())
local l_37_1 = l_37_0:size()
l_37_1 = l_37_1 - 1
l_37_1 = l_37_0[l_37_1]
if l_37_1 ~= nil then
trace("Restoring focus to page!")
l_37_1:Focus()
end
end
if selectorIsDragging == true then
StopDrag()
end
end
_application.DialogManager.OnTopDialogIn:connect(OnTopDialogIn)
_application.DialogManager.OnTopDialogOut:connect(OnTopDialogOut)
KeyboardOnKeyDown = function(l_38_0)
if Selection:GetFocus() == nil then
handled = {}
OnKeyDown(nil, l_38_0, handled)
end
end
KeyboardOnKeyUp = function(l_39_0)
if Selection:GetFocus() == nil then
handled = {}
OnKeyUp(nil, l_39_0, handled)
end
end
OnKeyDown = function(l_40_0, l_40_1, l_40_2)
if l_40_1.Code == KeyCode_Return and delayNavFrameCount > 1 then
navigateToBucket = nil
delayNavFramecount = 0
StopDrag()
else
l_40_2.value = false
end
end
NavigateHome = function()
if _application.Navigation.CurrentRequest and
_application.Navigation.CurrentRequest.PageGroup.Level == 0 then
navigateToBucket = 0
if bFirstRebuild == true then
RefreshTabControl()
end
TabJumpTo(navigateToBucket)
Navigate(URLS[navigateToBucket], false)
else
_application.Navigation:NavigateHome()
end
end
SetPreviewVisible = function(l_42_0)
if l_42_0 then
PreviewBackground.Opacity.value = 80
PreviewTitleText.Opacity.value = 100
previewRoot.Opacity.value = 100
else
previewRoot.Opacity.value = 0
end
end
DPadNavigate = function(l_43_0, l_43_1)
if l_43_1 == nil then
l_43_1 = 0
end
inBucket = inBucket + l_43_0
if inBucket >= currentNumberOfTabs then
inBucket = 0
elseif inBucket < 0 then
inBucket = currentNumberOfTabs - 1
end
navigateToBucket = inBucket
delayNavFrameCount = l_43_1
TabJumpTo(navigateToBucket)
if 0 < l_43_1 then
SetPreviewVisible(true)
tabControl.Focusable = true
Selection:Focus(tabControl)
end
MoveToSelectionPosition(navigateToBucket)
end
OnKeyUp = function(l_44_0, l_44_1, l_44_2)
l_44_2.value = true
if l_44_1.Code == KeyCode_Home then
NavigateHome()
elseif l_44_1.Code == KeyCode_Back then
_application.Navigation:NavigateBack()
elseif l_44_1.Code == KeyCode_End then
if _application.Navigation ~= nill and
_application.Navigation.CurrentRequest ~= nil and
_application.Navigation.CurrentRequest.PageGroup ~= nil then
local x = _application.Navigation.CurrentRequest.PageGroup.Level
if x == 0 and currentNumberOfTabs > 1 then
_application.Navigation:NavigateHome()
end
end
elseif currentNumberOfTabs <= 1 then
l_44_2.value = false
elseif l_44_1.Code == KeyCode_Right then
DPadNavigate(1, 0)
elseif l_44_1.Code == KeyCode_Left then
DPadNavigate(-1, 0)
elseif l_44_1.Code == KeyCode_SwipeLeft and noSwipes == false then
DPadNavigate(1, 0)
elseif l_44_1.Code == KeyCode_SwipeRight and noSwipes == false then
DPadNavigate(-1, 0)
else
l_44_2.value = false
end
end
Keyboard.onKeyDown:connect(KeyboardOnKeyDown)
Keyboard.onKeyUp:connect(KeyboardOnKeyUp)
GizmoDock.onKeyDown:connect(OnKeyDown)
GizmoDock.onKeyUp:connect(OnKeyUp)
tabControl.onKeyUp:connect(OnKeyUp)
tabControl.onKeyDown:connect(OnKeyDown)
CacheHomePage.onKeyUp:connect(OnKeyUp)
CacheHomePage.onKeyDown:connect(OnKeyDown)
HitMaskPress = function(l_45_0, l_45_1)
trace("++++++++[Manila.lua] : HitMaskPress")
uptabTimeout()
l_45_1.value = true
end
uptabTimeout = function()
HitMask._visible = false
trace("[manila.lua] : uptabTimeout\n")
if _application.Orientation == ScreenOrientation_Landscape then
hideTabs()
Landscape_up_btn_group._visible = true
end
if _tptabTimer then
_tptabTimer.OnElapsed:disconnect(uptabTimeout)
_tptabTimer:Stop()
_tptabTimer = nil
end
end
OnTabButtonPress = function(l_47_0, l_47_1)
local l_47_2 = nil
if _application.Navigation.CurrentRequest.PageGroup.Level == 0 then
l_47_2 = "FirstLayer_dn_tab"
else
l_47_2 = "SecondLayer_dn_tab"
end
Landscape_up_btn:SetTextureRef(l_47_2)
_Store_VerticalEnabled = _application.TouchFlo.VerticalEnabled
_Store_HorizontalEnabled = _application.TouchFlo.HorizontalEnabled
_application.TouchFlo.VerticalEnabled = false
_application.TouchFlo.HorizontalEnabled = false
l_47_1.value = true
end
OnTabButtonRelease = function(l_48_0, l_48_1)
showTabs()
Landscape_up_btn_group._visible = false
HitMask._visible = true
if not _tptabTimer then
_tptabTimer = timer(2)
_tptabTimer.OnElapsed:connect(uptabTimeout)
_tptabTimer:Stop()
end
_tptabTimer:Start()
local l_48_2 = nil
if _application.Navigation.CurrentRequest.PageGroup.Level == 0 then
l_48_2 = "FirstLayer_up_tab"
else
l_48_2 = "SecondLayer_up_tab"
end
Landscape_up_btn:SetTextureRef(l_48_2)
_application.TouchFlo.VerticalEnabled = _Store_VerticalEnabled
_application.TouchFlo.HorizontalEnabled = _Store_HorizontalEnabled
l_48_1.value = true
end
OnTabButtonReleaseOutside = function(l_49_0, l_49_1)
local l_49_2 = nil
if _application.Navigation.CurrentRequest.PageGroup.Level == 0 then
l_49_2 = "FirstLayer_up_tab"
else
l_49_2 = "SecondLayer_up_tab"
end
Landscape_up_btn:SetTextureRef(l_49_2)
_application.TouchFlo.VerticalEnabled = _Store_VerticalEnabled
_application.TouchFlo.HorizontalEnabled = _Store_HorizontalEnabled
l_49_1.value = true
end
HitMask.onPress:connect(HitMaskPress)
up_btn_HitArea.onPress:connect(OnTabButtonPress)
up_btn_HitArea.onRelease:connect(OnTabButtonRelease)
up_btn_HitArea.onReleaseOutside:connect(OnTabButtonReleaseOutside)
trace("tabsShown = true\n")
tabsShown = true
if _application.Store:GetStringValue(Lifetime_Permanent, "EnableLandscape") == "true" then
OnOrientationChanged()
else
RefreshTabControl()
end
_root:stop()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -