Skip to content

Commit

Permalink
Merge pull request #30 from BF3RM/fix/vanilla_explosion_suppression
Browse files Browse the repository at this point in the history
fix(vanilla_explosion_suppression): turns off the vanilla explosion visual environments
  • Loading branch information
IllustrisJack authored Jan 19, 2022
2 parents c05a81f + ee6c360 commit 219ff54
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
25 changes: 25 additions & 0 deletions ext/Client/Modules/Patches.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ function Patches:__init()
ResourceManager:RegisterInstanceLoadHandler(m_MenuBgGuids.partition, m_MenuBgGuids.instance, self, self.onMenuBgLoaded)
end

function Patches:OnLevelLoaded(p_LevelName, p_GameMode, p_IsDedicatedServer)
-- Disable Vanilla Explosion VEs
if VEM_CONFIG.PATCH_EXPLOSIONS_COLOR_CORRECTION then
Patches:DisableExplosionVisualEnvironments()
end
end

function Patches:Components(p_Partition)
if p_Partition.primaryInstance:Is("MeshAsset") then
Patches:MeshAsset(p_Partition.primaryInstance)
Expand Down Expand Up @@ -150,4 +157,22 @@ function Patches:LogComponents(p_Partition)
end
end

function Patches:DisableExplosionVisualEnvironments()
-- get entityData
local explosionVES = {
blackoutVE = ResourceManager:FindInstanceByGuid(Guid("0A0EB8EE-5849-4C88-B4B9-92A9C2AA6402"), Guid("7B728DE9-327D-45E2-9309-1E602DEDFA2D")),
blastMediumVE = ResourceManager:FindInstanceByGuid(Guid("CD2CD917-DA8F-11DF-98D7-E3FCCF5294D0"), Guid("FA601D0C-F768-F778-6C3C-EF9667C4A7A4")),
blastLargeVE = ResourceManager:FindInstanceByGuid(Guid("EB5AFBB4-ED86-421E-88AE-5E0CE8B27C85"), Guid("DD94E869-9E43-43E6-B7CF-D4A9B017C693")),
blastGasMediumVE = ResourceManager:FindInstanceByGuid(Guid("D9BFDE03-6E38-4638-87BD-C79A34FBE598"), Guid("3A65A77C-10BB-4D06-8589-04C29AF89560"))
}

for _, l_EntityData in pairs(explosionVES) do
if l_EntityData ~= nil then
l_EntityData = GameEntityData(l_EntityData)
l_EntityData:MakeWritable()
l_EntityData.enabled = false
end
end
end

return Patches()
1 change: 1 addition & 0 deletions ext/Client/__init__.lua
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ end
---@param p_GameModeName string
function VEManagerClient:OnLevelLoaded(p_LevelName, p_GameModeName)
self:LoadPresets()
Patches:OnLevelLoaded(p_LevelName, p_GameModeName)
end

function VEManagerClient:OnLevelDestroy()
Expand Down
4 changes: 2 additions & 2 deletions ext/Shared/Config.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VEM_CONFIG = {
--[[ OTHER --
PATCH_EXPLOSIONS_COLOR_CORRECTION = false,]] -- Disables color correction from explosions (explosions may cause a discontinue preset effect)
-- OTHER --
PATCH_EXPLOSIONS_COLOR_CORRECTION = true, -- Disables color correction from explosions (explosions may cause a discontinue preset effect)

-- DAY-NIGHT --
DN_SUN_TIMINGS = {5.328, 21}, -- Sun times in hours (float) [sunrise, sunset]
Expand Down

0 comments on commit 219ff54

Please sign in to comment.