Skip to content

Commit a184f35

Browse files
EgoMoosegithub-actions[bot]
authored andcommitted
(0.698.0.6980940)
1 parent 3f2fb40 commit a184f35

14 files changed

Lines changed: 131 additions & 591 deletions

File tree

src/PlayerModulePatched/CameraModule/BaseCamera.lua

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ do
2727
FFlagUserFixGamepadMaxZoom = success and result
2828
end
2929

30-
local FFlagUserPSRemoveTouchEnabled = FlagUtil.getUserFlag("UserPSRemoveTouchEnabled")
31-
3230
local UNIT_Z = Vector3.new(0,0,1)
3331
local X1_Y0_Z1 = Vector3.new(1,0,1) --Note: not a unit vector, used for projecting onto XZ plane
3432

@@ -105,20 +103,13 @@ function BaseCamera.new()
105103

106104
self.inFirstPerson = false
107105
self.inMouseLockedMode = false
108-
if not FFlagUserPSRemoveTouchEnabled then
109-
self.portraitMode = false
110-
self.isSmallTouchScreen = false
111-
end
112106

113107
-- Used by modules which want to reset the camera angle on respawn.
114108
self.resetCameraAngle = true
115109

116110
self.enabled = false
117111

118112
self.cameraChangedConn = nil
119-
if not FFlagUserPSRemoveTouchEnabled then
120-
self.viewportSizeChangedConn = nil
121-
end
122113

123114
-- VR Support
124115
self.shouldUseVRRotation = false
@@ -431,35 +422,8 @@ function BaseCamera:GetSubjectPosition(): Vector3?
431422
return result
432423
end
433424

434-
if not FFlagUserPSRemoveTouchEnabled then
435-
function BaseCamera:OnViewportSizeChanged()
436-
local camera = game.Workspace.CurrentCamera
437-
local size = camera.ViewportSize
438-
self.portraitMode = size.X < size.Y
439-
self.isSmallTouchScreen = UserInputService.TouchEnabled and (size.Y < 500 or size.X < 700)
440-
end
441-
end
442-
443425
-- Listener for changes to workspace.CurrentCamera
444426
function BaseCamera:OnCurrentCameraChanged()
445-
if not FFlagUserPSRemoveTouchEnabled then
446-
if UserInputService.TouchEnabled then
447-
if self.viewportSizeChangedConn then
448-
self.viewportSizeChangedConn:Disconnect()
449-
self.viewportSizeChangedConn = nil
450-
end
451-
452-
local newCamera = game.Workspace.CurrentCamera
453-
454-
if newCamera then
455-
self:OnViewportSizeChanged()
456-
self.viewportSizeChangedConn = newCamera:GetPropertyChangedSignal("ViewportSize"):Connect(function()
457-
self:OnViewportSizeChanged()
458-
end)
459-
end
460-
end
461-
end
462-
463427
-- VR support additions
464428
if self.cameraSubjectChangedConn then
465429
self.cameraSubjectChangedConn:Disconnect()
@@ -584,12 +548,6 @@ function BaseCamera:Cleanup()
584548
self.subjectStateChangedConn:Disconnect()
585549
self.subjectStateChangedConn = nil
586550
end
587-
if not FFlagUserPSRemoveTouchEnabled then
588-
if self.viewportSizeChangedConn then
589-
self.viewportSizeChangedConn:Disconnect()
590-
self.viewportSizeChangedConn = nil
591-
end
592-
end
593551
if self.cameraChangedConn then
594552
self.cameraChangedConn:Disconnect()
595553
self.cameraChangedConn = nil

src/PlayerModulePatched/CameraModule/MouseLockController.lua

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ local GameSettings = Settings.GameSettings
2424
--[[ Imports ]]
2525
local CameraUtils = require(script.Parent:WaitForChild("CameraUtils"))
2626

27-
local FFlagUserPreferredInputPlayerScripts = FlagUtil.getUserFlag("UserPreferredInputPlayerScripts2")
28-
2927

3028
--[[ The Module ]]--
3129
local MouseLockController = {}
@@ -79,11 +77,9 @@ function MouseLockController.new()
7977
self:UpdateMouseLockAvailability()
8078
end)
8179

82-
if FFlagUserPreferredInputPlayerScripts then
83-
UserInputService:GetPropertyChangedSignal("PreferredInput"):Connect(function()
84-
self:UpdateMouseLockAvailability()
85-
end)
86-
end
80+
UserInputService:GetPropertyChangedSignal("PreferredInput"):Connect(function()
81+
self:UpdateMouseLockAvailability()
82+
end)
8783

8884
self:UpdateMouseLockAvailability()
8985

@@ -108,7 +104,7 @@ function MouseLockController:UpdateMouseLockAvailability()
108104
local userHasMouseLockModeEnabled = GameSettings.ControlMode == Enum.ControlMode.MouseLockSwitch
109105
local userHasClickToMoveEnabled = GameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove
110106
local userUsingKeyboardAndMouse = UserInputService.PreferredInput == Enum.PreferredInput.KeyboardAndMouse
111-
local MouseLockAvailable = (not FFlagUserPreferredInputPlayerScripts or userUsingKeyboardAndMouse) and devAllowsMouseLock and userHasMouseLockModeEnabled and not userHasClickToMoveEnabled and not devMovementModeIsScriptable
107+
local MouseLockAvailable = userUsingKeyboardAndMouse and devAllowsMouseLock and userHasMouseLockModeEnabled and not userHasClickToMoveEnabled and not devMovementModeIsScriptable
112108

113109
if MouseLockAvailable~=self.enabled then
114110
self:EnableMouseLock(MouseLockAvailable)

src/PlayerModulePatched/CameraModule/OrbitalCamera.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
2018 Camera Update - AllYourBlox
55
--]]
66

7+
local CommonUtils = script.Parent.Parent:WaitForChild("CommonUtils")
8+
local FlagUtil = require(CommonUtils:WaitForChild("FlagUtil"))
9+
local FFlagUserFixOrbitalCameraAzimuth = FlagUtil.getUserFlag("UserFixOrbitalCameraAzimuth")
10+
711
-- Local private variables and constants
812
local UNIT_Z = Vector3.new(0,0,1)
913
local X1_Y0_Z1 = Vector3.new(1,0,1) --Note: not a unit vector, used for projecting onto XZ plane
@@ -145,7 +149,8 @@ function OrbitalCamera:LoadNumberValueParameters()
145149
self:LoadOrCreateNumberValueParameter("InitialDistance", "NumberValue", nil)
146150

147151
-- Note: ReferenceAzimuth is also used as an initial value, but needs a change listener because it is used in the calculation of the limits
148-
self:LoadOrCreateNumberValueParameter("ReferenceAzimuth", "NumberValue", self.SetAndBoundsCheckAzimuthValue)
152+
self:LoadOrCreateNumberValueParameter("ReferenceAzimuth", "NumberValue",
153+
if FFlagUserFixOrbitalCameraAzimuth then self.SetAndBoundsCheckAzimuthValues else self.SetAndBoundsCheckAzimuthValue)
149154
self:LoadOrCreateNumberValueParameter("CWAzimuthTravel", "NumberValue", self.SetAndBoundsCheckAzimuthValues)
150155
self:LoadOrCreateNumberValueParameter("CCWAzimuthTravel", "NumberValue", self.SetAndBoundsCheckAzimuthValues)
151156
self:LoadOrCreateNumberValueParameter("MinElevation", "NumberValue", self.SetAndBoundsCheckElevationValues)

src/PlayerModulePatched/CameraModule/init.lua

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ end
114114

115115
local FFlagUserRespectLegacyCameraOptions = FlagUtil.getUserFlag("UserRespectLegacyCameraOptions")
116116
local FFlagUserPlayerConnectionMemoryLeak = FlagUtil.getUserFlag("UserPlayerConnectionMemoryLeak")
117-
local FFlagUserPreferredInputPlayerScripts = FlagUtil.getUserFlag("UserPreferredInputPlayerScripts2")
118117
local FFlagUserPSFixCameraControllerReset = FlagUtil.getUserFlag("UserPSFixCameraControllerReset")
118+
local FFlagUserCheckTouchControlMode = FlagUtil.getUserFlag("UserCheckTouchControlMode")
119119

120120
-- Change this later as types are added for more classes
121121
type Generic = any
@@ -191,16 +191,14 @@ function CameraModule.new()
191191

192192
self.activeTransparencyController:Enable(true)
193193

194-
if not UserInputService.TouchEnabled or FFlagUserPreferredInputPlayerScripts then
195-
self.activeMouseLockController = MouseLockController.new()
196-
assert(self.activeMouseLockController, "Strict typing check")
194+
self.activeMouseLockController = MouseLockController.new()
195+
assert(self.activeMouseLockController, "Strict typing check")
197196

198-
local toggleEvent = self.activeMouseLockController:GetBindableToggleEvent()
199-
if toggleEvent then
200-
toggleEvent:Connect(function()
201-
self:OnMouseLockToggled()
202-
end)
203-
end
197+
local toggleEvent = self.activeMouseLockController:GetBindableToggleEvent()
198+
if toggleEvent then
199+
toggleEvent:Connect(function()
200+
self:OnMouseLockToggled()
201+
end)
204202
end
205203

206204
if FFlagUserRespectLegacyCameraOptions then
@@ -227,11 +225,9 @@ function CameraModule.new()
227225
game.Workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
228226
self:OnCurrentCameraChanged()
229227
end)
230-
if FFlagUserPreferredInputPlayerScripts then
231-
UserInputService:GetPropertyChangedSignal("PreferredInput"):Connect(function()
232-
self:OnPreferredInputChanged()
233-
end)
234-
end
228+
UserInputService:GetPropertyChangedSignal("PreferredInput"):Connect(function()
229+
self:OnPreferredInputChanged()
230+
end)
235231

236232
return self
237233
end
@@ -244,13 +240,8 @@ function CameraModule:GetCameraMovementModeFromSettings(): Enum.ComputerCameraMo
244240
return CameraUtils.ConvertCameraModeEnumToStandard(Enum.ComputerCameraMovementMode.Classic)
245241
end
246242

247-
local devMode, userMode, touchMode
248-
if FFlagUserPreferredInputPlayerScripts then
249-
touchMode = (UserInputService.PreferredInput == Enum.PreferredInput.Touch)
250-
else
251-
touchMode = UserInputService.TouchEnabled
252-
end
253-
if touchMode then
243+
local devMode, userMode
244+
if UserInputService.PreferredInput == Enum.PreferredInput.Touch then
254245
devMode = CameraUtils.ConvertCameraModeEnumToStandard(Players.LocalPlayer.DevTouchCameraMode)
255246
userMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.TouchCameraMovementMode)
256247
else
@@ -577,7 +568,7 @@ function CameraModule:OnLocalPlayerCameraPropertyChanged(propertyName: string)
577568
end
578569

579570
function CameraModule:OnUserGameSettingsPropertyChanged(propertyName: string)
580-
if propertyName == "ComputerCameraMovementMode" then
571+
if propertyName == "ComputerCameraMovementMode" or (FFlagUserCheckTouchControlMode and propertyName == "TouchCameraMovementMode") then
581572
local cameraMovementMode = self:GetCameraMovementModeFromSettings()
582573
self:ActivateCameraController(CameraUtils.ConvertCameraModeEnumToStandard(cameraMovementMode))
583574
end

src/PlayerModulePatched/ControlModule/ClickToMoveController.lua

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ local CommonUtils = script.Parent.Parent:WaitForChild("CommonUtils")
2828
local FlagUtil = require(CommonUtils:WaitForChild("FlagUtil"))
2929

3030
local FFlagUserRaycastUpdateAPI = FlagUtil.getUserFlag("UserRaycastUpdateAPI")
31-
local FFlagUserPreferredInputPlayerScripts = FlagUtil.getUserFlag("UserPreferredInputPlayerScripts2")
3231

3332
--[[ Configuration ]]
3433
local ShowPath = true
@@ -901,9 +900,7 @@ function ClickToMove:DisconnectEvents()
901900
DisconnectEvent(self.renderSteppedConn)
902901
DisconnectEvent(self.characterChildRemovedConn)
903902
DisconnectEvent(self.menuOpenedConnection)
904-
if FFlagUserPreferredInputPlayerScripts then
905-
DisconnectEvent(self.preferredInputChangedConnection)
906-
end
903+
DisconnectEvent(self.preferredInputChangedConnection)
907904
end
908905

909906
function ClickToMove:OnTouchBegan(input, processed)
@@ -995,13 +992,7 @@ function ClickToMove:OnCharacterAdded(character)
995992
end)
996993

997994
local function OnCharacterChildAdded(child)
998-
local touchMode
999-
if FFlagUserPreferredInputPlayerScripts then
1000-
touchMode = (UserInputService.PreferredInput == Enum.PreferredInput.Touch)
1001-
else
1002-
touchMode = UserInputService.TouchEnabled
1003-
end
1004-
if touchMode then
995+
if UserInputService.PreferredInput == Enum.PreferredInput.Touch then
1005996
if child:IsA('Tool') then
1006997
child.ManualActivationOnly = true
1007998
end
@@ -1020,13 +1011,7 @@ function ClickToMove:OnCharacterAdded(character)
10201011
OnCharacterChildAdded(child)
10211012
end)
10221013
self.characterChildRemovedConn = character.ChildRemoved:Connect(function(child)
1023-
local touchMode
1024-
if FFlagUserPreferredInputPlayerScripts then
1025-
touchMode = (UserInputService.PreferredInput == Enum.PreferredInput.Touch)
1026-
else
1027-
touchMode = UserInputService.TouchEnabled
1028-
end
1029-
if touchMode then
1014+
if UserInputService.PreferredInput == Enum.PreferredInput.Touch then
10301015
if child:IsA('Tool') then
10311016
child.ManualActivationOnly = false
10321017
end
@@ -1036,11 +1021,9 @@ function ClickToMove:OnCharacterAdded(character)
10361021
OnCharacterChildAdded(child)
10371022
end
10381023

1039-
if FFlagUserPreferredInputPlayerScripts then
1040-
self.preferredInputChangedConnection = UserInputService:GetPropertyChangedSignal("PreferredInput"):Connect(function()
1041-
self:OnPreferredInputChanged()
1042-
end)
1043-
end
1024+
self.preferredInputChangedConnection = UserInputService:GetPropertyChangedSignal("PreferredInput"):Connect(function()
1025+
self:OnPreferredInputChanged()
1026+
end)
10441027
end
10451028

10461029
function ClickToMove:Start()
@@ -1075,13 +1058,7 @@ function ClickToMove:Enable(enable: boolean, enableWASD: boolean, touchJumpContr
10751058
self:DisconnectEvents()
10761059
CleanupPath()
10771060
-- Restore tool activation on shutdown
1078-
local touchMode
1079-
if FFlagUserPreferredInputPlayerScripts then
1080-
touchMode = (UserInputService.PreferredInput == Enum.PreferredInput.Touch)
1081-
else
1082-
touchMode = UserInputService.TouchEnabled
1083-
end
1084-
if touchMode then
1061+
if UserInputService.PreferredInput == Enum.PreferredInput.Touch then
10851062
local character = Player.Character
10861063
if character then
10871064
for _, child in pairs(character:GetChildren()) do

0 commit comments

Comments
 (0)