-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #562 from sailro/noflash
Add noflash feature
- Loading branch information
Showing
7 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using EFT.Trainer.Properties; | ||
using JetBrains.Annotations; | ||
|
||
#nullable enable | ||
|
||
namespace EFT.Trainer.Features; | ||
|
||
[UsedImplicitly] | ||
internal class NoFlash : ToggleFeature | ||
{ | ||
public override string Name => Strings.FeatureNoFlashName; | ||
public override string Description => Strings.FeatureNoFlashDescription; | ||
|
||
public override bool Enabled { get; set; } = false; | ||
|
||
protected override void UpdateWhenEnabled() | ||
{ | ||
var camera = GameState.Current?.Camera; | ||
if (camera == null) | ||
return; | ||
|
||
if (camera.GetComponent<GrenadeFlashScreenEffect>() is { enabled: true } flash) | ||
{ | ||
flash.enabled = false; | ||
flash.EffectStrength = 0; | ||
} | ||
|
||
if (camera.GetComponent<EyeBurn>() is { enabled: true } eyeburn) | ||
{ | ||
eyeburn.enabled = false; | ||
eyeburn.EyesBurn = false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters