Vast Performance Improvement to Is Game In Fore Ground of OS
Dear Community,
If you didnt know, I offer you a node that allows you to always know if your game is the foreground window in your end user's OS!
You can track this bool on a timer to know when the user has tabbed out of the game, and then when they tab back in!
You can use this knowledge to display messages, pause single player games, or throttle usage of resources if your game is no longer in the foreground!
Just another way to write polite and resource-efficient software, for you, from me!

~~~
Performance Improvement
I am very happy to announce I've vastly improved my internal implementation of this ndoe!
My code went from this:
old version
to this!
new version!
The latter is very efficient to call frequently and is operating system independent just like the first version.
Enjoy!
New Download (29mb, Media Fire)
https://www.mediafire.com/?ieovbd5l9d7yub2
Please note my downloads also include these packaged binaries:
1. Win64 Development
2. Win32 Shipping
3. HTML5 Development
Please see my instructions for Packaging UE4 Plugins With Your Game.
Donations can be sent to me via:
http://lightningfitness.org/donate/
♥
Rama
Dear Community,
If you didnt know, I offer you a node that allows you to always know if your game is the foreground window in your end user's OS!
You can track this bool on a timer to know when the user has tabbed out of the game, and then when they tab back in!
You can use this knowledge to display messages, pause single player games, or throttle usage of resources if your game is no longer in the foreground!
Just another way to write polite and resource-efficient software, for you, from me!

~~~
Performance Improvement
I am very happy to announce I've vastly improved my internal implementation of this ndoe!
My code went from this:
old version
Code:
//Iterate Over Actors UWorld* TheWorld = NULL; for ( TObjectIterator<AActor> Itr; Itr; ++Itr ) { TheWorld = Itr->GetWorld(); if (TheWorld) break; //~~~~~~~~~~~~~~~~~~~~~~~ } //Get Player ULocalPlayer* VictoryPlayer = TheWorld->GetFirstLocalPlayerFromController(); if (!VictoryPlayer) return false; //~~~~~~~~~~~~~~~~~~~~ //get view port ptr UGameViewportClient * VictoryViewportClient = Cast < UGameViewportClient > (VictoryPlayer->ViewportClient); if (!VictoryViewportClient) return false; //~~~~~~~~~~~~~~~~~~~~ FViewport * VictoryViewport = VictoryViewportClient->Viewport; if (!VictoryViewport) return false; //~~~~~~~~~~~~~~~~~~~~ return VictoryViewport->IsForegroundWindow();
new version!
Code:
bool UVictoryBPFunctionLibrary::ClientWindow__GameWindowIsForeGroundInOS() { return FPlatformProcess::IsThisApplicationForeground(); }
Enjoy!
New Download (29mb, Media Fire)
https://www.mediafire.com/?ieovbd5l9d7yub2
Please note my downloads also include these packaged binaries:
1. Win64 Development
2. Win32 Shipping
3. HTML5 Development
Please see my instructions for Packaging UE4 Plugins With Your Game.
Donations can be sent to me via:
http://lightningfitness.org/donate/
♥
Rama
Comment