Skip to content

Commit

Permalink
(0.638.0.6380612)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgoMoose authored and github-actions[bot] committed Aug 15, 2024
1 parent adc420b commit f50003f
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 9 deletions.
37 changes: 34 additions & 3 deletions src/PlayerModulePatched/CameraModule/TransparencyController.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
37 changes: 34 additions & 3 deletions src/PlayerModuleUnpatched/CameraModule/TransparencyController.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/VersionInfo.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "0.633.1.6330512",
"guid": "version-d662de9eda0c4cec"
"version": "0.638.0.6380612",
"guid": "version-f626628767584980"
}
2 changes: 1 addition & 1 deletion wally.toml
Original file line number Diff line number Diff line change
@@ -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"

Expand Down

0 comments on commit f50003f

Please sign in to comment.