From f50003ff7245516a013c93debcb8ac30e01e7dac Mon Sep 17 00:00:00 2001 From: EgoMoose Date: Thu, 15 Aug 2024 00:25:07 +0000 Subject: [PATCH] (0.638.0.6380612) --- .../CameraModule/TransparencyController.lua | 37 +++++++++++++++++-- .../CameraModule/TransparencyController.lua | 37 +++++++++++++++++-- src/VersionInfo.json | 4 +- wally.toml | 2 +- 4 files changed, 71 insertions(+), 9 deletions(-) diff --git a/src/PlayerModulePatched/CameraModule/TransparencyController.lua b/src/PlayerModulePatched/CameraModule/TransparencyController.lua index b7b69b7..76da2cb 100644 --- a/src/PlayerModulePatched/CameraModule/TransparencyController.lua +++ b/src/PlayerModulePatched/CameraModule/TransparencyController.lua @@ -7,8 +7,30 @@ local VRService = game:GetService("VRService") local MAX_TWEEN_RATE = 2.8 -- per second +-- Classes with a LocalTransparencyModifier property that we should hide in first person +local HIDE_IN_FIRST_PERSON_CLASSES = { + "BasePart", + "Decal", + "Beam", + "ParticleEmitter", + "Trail", + "Fire", + "Smoke", + "Sparkles", + "Explosion" +} + local Util = require(script.Parent:WaitForChild("CameraUtils")) +local FFlagUserHideCharacterParticlesInFirstPerson +do + local success, result = pcall(function() + return UserSettings():IsUserFeatureEnabled("UserHideCharacterParticlesInFirstPerson") + end) + FFlagUserHideCharacterParticlesInFirstPerson = success and result +end + + --[[ The Module ]]-- local TransparencyController = {} TransparencyController.__index = TransparencyController @@ -36,12 +58,21 @@ function TransparencyController:HasToolAncestor(object: Instance) end function TransparencyController:IsValidPartToModify(part: BasePart) - if part:IsA('BasePart') or part:IsA('Decal') then - return not self:HasToolAncestor(part) + if FFlagUserHideCharacterParticlesInFirstPerson then + for _, className in HIDE_IN_FIRST_PERSON_CLASSES do + if part:IsA(className) then + return not self:HasToolAncestor(part) + end + end + else + if part:IsA('BasePart') or part:IsA('Decal') then + return not self:HasToolAncestor(part) + end end return false end + function TransparencyController:CachePartsRecursive(object) if object then if self:IsValidPartToModify(object) then @@ -167,7 +198,7 @@ function TransparencyController:Update(dt) transparency = math.clamp(Util.Round(transparency, 2), 0, 1) - -- update transparencies + -- update transparencies if self.transparencyDirty or self.lastTransparency ~= transparency then for child, _ in pairs(self.cachedParts) do if VRService.VREnabled and VRService.AvatarGestures then diff --git a/src/PlayerModuleUnpatched/CameraModule/TransparencyController.lua b/src/PlayerModuleUnpatched/CameraModule/TransparencyController.lua index b7b69b7..76da2cb 100644 --- a/src/PlayerModuleUnpatched/CameraModule/TransparencyController.lua +++ b/src/PlayerModuleUnpatched/CameraModule/TransparencyController.lua @@ -7,8 +7,30 @@ local VRService = game:GetService("VRService") local MAX_TWEEN_RATE = 2.8 -- per second +-- Classes with a LocalTransparencyModifier property that we should hide in first person +local HIDE_IN_FIRST_PERSON_CLASSES = { + "BasePart", + "Decal", + "Beam", + "ParticleEmitter", + "Trail", + "Fire", + "Smoke", + "Sparkles", + "Explosion" +} + local Util = require(script.Parent:WaitForChild("CameraUtils")) +local FFlagUserHideCharacterParticlesInFirstPerson +do + local success, result = pcall(function() + return UserSettings():IsUserFeatureEnabled("UserHideCharacterParticlesInFirstPerson") + end) + FFlagUserHideCharacterParticlesInFirstPerson = success and result +end + + --[[ The Module ]]-- local TransparencyController = {} TransparencyController.__index = TransparencyController @@ -36,12 +58,21 @@ function TransparencyController:HasToolAncestor(object: Instance) end function TransparencyController:IsValidPartToModify(part: BasePart) - if part:IsA('BasePart') or part:IsA('Decal') then - return not self:HasToolAncestor(part) + if FFlagUserHideCharacterParticlesInFirstPerson then + for _, className in HIDE_IN_FIRST_PERSON_CLASSES do + if part:IsA(className) then + return not self:HasToolAncestor(part) + end + end + else + if part:IsA('BasePart') or part:IsA('Decal') then + return not self:HasToolAncestor(part) + end end return false end + function TransparencyController:CachePartsRecursive(object) if object then if self:IsValidPartToModify(object) then @@ -167,7 +198,7 @@ function TransparencyController:Update(dt) transparency = math.clamp(Util.Round(transparency, 2), 0, 1) - -- update transparencies + -- update transparencies if self.transparencyDirty or self.lastTransparency ~= transparency then for child, _ in pairs(self.cachedParts) do if VRService.VREnabled and VRService.AvatarGestures then diff --git a/src/VersionInfo.json b/src/VersionInfo.json index 8fe5975..ecf5a48 100644 --- a/src/VersionInfo.json +++ b/src/VersionInfo.json @@ -1,4 +1,4 @@ { - "version": "0.633.1.6330512", - "guid": "version-d662de9eda0c4cec" + "version": "0.638.0.6380612", + "guid": "version-f626628767584980" } \ No newline at end of file diff --git a/wally.toml b/wally.toml index c71385f..6973e79 100644 --- a/wally.toml +++ b/wally.toml @@ -1,6 +1,6 @@ [package] name = "upliftgames/playermodule" -version = "633.1.6330512" +version = "638.0.6380612" registry = "https://github.com/UpliftGames/wally-index" realm = "shared"