Skip to content

Commit

Permalink
[Screenshot Improvements] Wait for window to be active for reshade …
Browse files Browse the repository at this point in the history
…screenshot
  • Loading branch information
Caraxi committed Apr 5, 2024
1 parent 7863398 commit 1c2d564
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Tweaks/HighResScreenshots.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ protected override void Enable() {
// IsInputIDClicked is called from Client::UI::UIInputModule.CheckScreenshotState, which is polled
// We change the res when the button is pressed and tell it to take a screenshot the next time it is polled
private byte IsInputIDClickedDetour(nint a1, int a2) {
if (a2 == ScreenshotButton && Config.UseReShade && Framework.Instance()->WindowInactive) return 0;

var orig = isInputIDClickedHook.Original(a1, a2);
if (AgentModule.Instance()->GetAgentByInternalId(AgentId.Configkey)->IsAgentActive()) return orig;

Expand Down Expand Up @@ -271,7 +273,7 @@ private byte IsInputIDClickedDetour(nint a1, int a2) {
SendInput.KeyUp(Config.ReShadeMainKey);
}, delayTicks: 1);

return 1;
return 0;
}

return 1;
Expand Down

0 comments on commit 1c2d564

Please sign in to comment.