Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat(game/five): adhere to 'mute audio on focus loss' for Citizen cod…
…e too
- Loading branch information
1 parent
1ef4e76
commit c17da3a
Showing
8 changed files
with
86 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #pragma once | ||
|
|
||
| // Returns whether or not any game-related audio should be muted as a result of 'mute on focus loss' | ||
| bool | ||
| #ifdef COMPILING_GTA_CORE_FIVE | ||
| DLL_EXPORT | ||
| #else | ||
| DLL_IMPORT | ||
| #endif | ||
| ShouldMuteGameAudio(); |
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,17 @@ | ||
| #include <StdInc.h> | ||
| #include <Hooking.h> | ||
|
|
||
| static bool* audioNotFocused; | ||
| static int* muteOnFocusLoss; | ||
|
|
||
| bool DLL_EXPORT ShouldMuteGameAudio() | ||
| { | ||
| return *audioNotFocused && *muteOnFocusLoss; | ||
| } | ||
|
|
||
| static HookFunction hookFunction([]() | ||
| { | ||
| auto location = hook::get_pattern<char>("75 17 40 38 2D ? ? ? ? 74 0E 39 2D", 5); | ||
| audioNotFocused = hook::get_address<bool*>(location); | ||
| muteOnFocusLoss = hook::get_address<int*>(location + 8); | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,6 +142,8 @@ class | |
| private: | ||
| CefString m_initUrl; | ||
|
|
||
| bool m_isMuted = false; | ||
|
|
||
| public: | ||
| ~NUIWindow(); | ||
|
|
||
|
|
||
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