Skip to content

Commit

Permalink
getRunningApp is now supports PS4 games
Browse files Browse the repository at this point in the history
ORBIS_GAME added into ApplicationCategoryType
  • Loading branch information
barisyild committed Feb 21, 2025
1 parent 3efa573 commit 5cf3aeb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/cpp/extern/ApplicationCategoryType.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import cpp.Int32;

enum abstract ApplicationCategoryType(Int32) from Int32 to Int32 {
var NATIVE_GAME = 0;
var ORBIS_GAME = 61440;
var PROSPERO_NATIVE_MEDIA_APP = 65536;
var RNPS_MEDIA_APP = 65792;
var WEB_BASED_MEDIA_APP = 66048;
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/lib/Process.hx
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ class Process {
{
var processList = Process.getProcessList();
processList = processList.filter(function(proc){
return proc.categoryType == ApplicationCategoryType.NATIVE_GAME || proc.categoryType == ApplicationCategoryType.SYSTEM_BUILTIN_APP || proc.categoryType == ApplicationCategoryType.WEB_BASED_MEDIA_APP || proc.categoryType == ApplicationCategoryType.RNPS_MEDIA_APP;
return proc.categoryType == ApplicationCategoryType.NATIVE_GAME || proc.categoryType == ApplicationCategoryType.ORBIS_GAME || proc.categoryType == ApplicationCategoryType.SYSTEM_BUILTIN_APP || proc.categoryType == ApplicationCategoryType.WEB_BASED_MEDIA_APP || proc.categoryType == ApplicationCategoryType.RNPS_MEDIA_APP;
});

// First order is native games, then system apps
processList.sort(function(a, b){
if(a.categoryType == b.categoryType)
return 0;
else if(a.categoryType == ApplicationCategoryType.NATIVE_GAME)
else if(a.categoryType == ApplicationCategoryType.NATIVE_GAME || a.categoryType == ApplicationCategoryType.ORBIS_GAME)
return -1;
else
return 1;
Expand Down

0 comments on commit 5cf3aeb

Please sign in to comment.