Jump to content
RealModScene
Swizzy

Aurora Filters by Swizzy

Recommended Posts

So, i've made 3 additional filters for Aurora since the release, and to make it easy to find them, here's a thread for them, i'll be adding more filters as i write them... (generally when someone requests yet another type of filter)

First up, you'll have to be editing 2 files for each of the filters i write, these are always located in Media\Scripts\

First filter is to Hide Kinect Games:

Filter.lua:

GameListFilterCategories["Hide Kinect"] = GameListFilterHideKinect
FilterFunctions.lua:

function GameListFilterHideKinect(Content)
	-- Return if this game isn't a kinect game
	return not bit32.btest( Content.Flags, ContentFlag.KinectCompatible )
end

Second filter is to Hide MultiDisk Games (Disk 2+):

Filter.lua:

GameListFilterCategories["Hide MultiDisc"] = GameListFilterHideMultiDisc
FilterFunctions.lua:

function GameListFilterHideMultiDisc(Content)
	-- Return if this game is disc number 1
	return Content.DiscNum <= 1
end

Third filter is to Hide Backups (files ending with .bak):

Filter.lua:

GameListFilterCategories["Hide Backups"] = GameListFilterHideBackup
FilterFunctions.lua:

function string.ends(String,End)
   return End=='' or string.sub(String,-string.len(End))==End
end

function GameListFilterHideBackup(Content)
	-- Return if this game ends with .bak
	return not string.ends(Content.Executable, ".bak")
end
  • Like 11

Share this post


Link to post
Share on other sites

As of 0.2b there's been changes made to how the user scripts are loaded, it's now dynamically loading files instead, my filters above were included with this release, but one of them was bugged (due to a change in how it works)

The "Hide Backups" script is broken in the 0.2b package, i've fixed it with this code snippet:

GameListFilterCategories.User["Hide Backups"] = function(Content)
	-- Return if this game ends with .bak
	return not (string.lower(string.sub(Content.Executable, -4)) == ".bak")
end

I've also written a script that adds filtering by name (first letter), you can filter out only those with numbers/special characters in their name or A-Z this script is here:

GameListFilterCategories.NameFilter = {}
GameListFilterCategories.NameFilter["A - F"] = {}
GameListFilterCategories.NameFilter["A - F"]["A"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "A") end
GameListFilterCategories.NameFilter["A - F"]["B"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "B") end
GameListFilterCategories.NameFilter["A - F"]["C"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "C") end
GameListFilterCategories.NameFilter["A - F"]["D"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "D") end
GameListFilterCategories.NameFilter["A - F"]["E"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "E") end
GameListFilterCategories.NameFilter["A - F"]["F"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "F") end
GameListFilterCategories.NameFilter["G - L"] = {}
GameListFilterCategories.NameFilter["G - L"]["G"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "G") end
GameListFilterCategories.NameFilter["G - L"]["H"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "H") end
GameListFilterCategories.NameFilter["G - L"]["I"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "I") end
GameListFilterCategories.NameFilter["G - L"]["J"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "J") end
GameListFilterCategories.NameFilter["G - L"]["K"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "K") end
GameListFilterCategories.NameFilter["G - L"]["L"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "L") end
GameListFilterCategories.NameFilter["M - R"] = {}
GameListFilterCategories.NameFilter["M - R"]["M"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "M") end
GameListFilterCategories.NameFilter["M - R"]["N"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "N") end
GameListFilterCategories.NameFilter["M - R"]["O"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "O") end
GameListFilterCategories.NameFilter["M - R"]["P"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "P") end
GameListFilterCategories.NameFilter["M - R"]["Q"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "Q") end
GameListFilterCategories.NameFilter["M - R"]["R"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "R") end
GameListFilterCategories.NameFilter["S - X"] = {}
GameListFilterCategories.NameFilter["S - X"]["S"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "S") end
GameListFilterCategories.NameFilter["S - X"]["T"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "T") end
GameListFilterCategories.NameFilter["S - X"]["U"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "U") end
GameListFilterCategories.NameFilter["S - X"]["V"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "V") end
GameListFilterCategories.NameFilter["S - X"]["W"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "W") end
GameListFilterCategories.NameFilter["S - X"]["X"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "X") end
GameListFilterCategories.NameFilter["Y - Z"] = {}
GameListFilterCategories.NameFilter["Y - Z"]["Y"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "Y") end
GameListFilterCategories.NameFilter["Y - Z"]["Z"] = function(Content) return (string.upper(string.sub(Content.Name, 0, 1)) == "Z") end
GameListFilterCategories.NameFilter["Other"] = function(Content) return (string.match(string.sub(Content.Name, 0, 1), "[a-zA-Z]") == nil) end
  • Like 1

Share this post


Link to post
Share on other sites

is it possible to make a script that displays the folder name that the game is in , instead of the Title that's downloaded from Marketplace or Xboxunity? Would make it a lot easier to rename games

 

So "string Directory;" instead of Title or something like that

Share this post


Link to post
Share on other sites

is it possible to make a script that displays the folder name that the game is in , instead of the Title that's downloaded from Marketplace or Xboxunity? Would make it a lot easier to rename games

 

So "string Directory;" instead of Title or something like that

Nope, that'd require a script + custom skin

Share this post


Link to post
Share on other sites

it would really be great if the updater simply exchanges such updated files in future

These files are user... not official, they were included only as a example... but yes, the one from me that was included which is broken will probably be in the next update...

But, other scripts won't be included in the updater...

Share this post


Link to post
Share on other sites

Yes, that's what i thought before i posted , but i certainly mean the "official" ones.

It's not only meant to Script files. I mean all files. Locales, Skins, xex, plugins ...

Just like Git Commits :)

Would be interesting tho. Even Custom Database would be genious. People could develop and upload updatefiles for their own plugins with their own IDs and Aurora has own Extension Manager, i dunno.

A lot of work but i guess its not the time to think of it yet i guess.

Share this post


Link to post
Share on other sites

Yes, that's what i thought before i posted , but i certainly mean the "official" ones.

It's not only meant to Script files. I mean all files. Locales, Skins, xex, plugins ...

Just like Git Commits :)

Would be interesting tho. Even Custom Database would be genious. People could develop and upload updatefiles for their own plugins with their own IDs and Aurora has own Extension Manager, i dunno.

A lot of work but i guess its not the time to think of it yet i guess.

We might take it into consideration for the future... but... for the time beeing, not comming any time soon...

Share this post


Link to post
Share on other sites

Swizzy, it´s possible to make a script that displays "Local CO-OP" games???

Thanks for all your work, bro...

 

Sm0k3 Tr4c3r

Well, for that Phoenix would need to add support for getting this information from somewhere, i'm not sure if there's a flag which says that in the xex, so... maybe if it's available from xbox.com... but... it'd still require Phoenix to add this information to the Content struct so we can process it in the script =/

Share this post


Link to post
Share on other sites

We do download this information from xbox.com.  However its not available to scripts.  I will make sure its available to scripts in the next update.  

 

We store the infromation as a packed DWORD so its going to take some bit twiddling in lua to get waht you want out of it, but has the following information:

typedef struct _GAMECAPS_FLAG_DATA {
	BOOL OfflineDolbyDigital;
	BOOL OfflineHardDriveRequired;
	BOOL OnlineHardDriveRequired;
	BOOL OnlineLeaderboards;
	BOOL OnlineContentDownload;
	BOOL OnlineVoice;
} GAMECAPS_FLAG_DATA;

typedef struct _GAMECAPS_OFFLINE_DATA {
	DWORD OfflinePlayersMin;
	DWORD OfflinePlayersMax;
	DWORD OfflineCoopPlayersMin;
	DWORD OfflineCoopPlayersMax;
	DWORD OfflineSystemLinkMin;
	DWORD OfflineSystemLinkMax;
} GAMECAPS_OFFLINE_DATA;

typedef struct _GAMECAPS_ONLINE_DATA {
	DWORD OnlineMultiplayerMin;
	DWORD OnlineMultiplayerMax;
	DWORD OnlineCoopPlayersMin;
	DWORD OnlineCoopPlayersMax;
} GAMECAPS_ONLINE_DATA;

Share this post


Link to post
Share on other sites

https://github.com/Swizzy/AuroraScripts you can find all of my scripts here now a days, for some reference of the above data structures you can check out these scripts in particular:

https://github.com/Swizzy/AuroraScripts/blob/master/Media/Scripts/UserSubtitles/CapabilitiesFlag.lua for the "GAMECAPS_FLAG_DATA" part

https://github.com/Swizzy/AuroraScripts/blob/master/Media/Scripts/UserSubtitles/CapabilitiesOffline.lua for the "GAMECAPS_OFFLINE_DATA" part

https://github.com/Swizzy/AuroraScripts/blob/master/Media/Scripts/UserSubtitles/CapabilitiesOnline.lua for the "GAMECAPS_ONLINE_DATA" part

these will show you how to use the new capabilities, they're subtitle scripts, so they'll just display information... but they'll give you a general idea of how to get hold of the information you need

For a filter type of script, check this one out: Only Local Co-Op Games

Share this post


Link to post
Share on other sites

Hi peeps i have a quick question....

I have a few trainers that are non Aurora style and when i have no filters selected to show all games the trainers are also listed and have blank covers (obviously)

Is there any way to use a filter to hide those trainers from view?

So i can have it set for my kids to view all the games without having to mess about with filters if they want to play an xbla game and then a retail disc game.

Share this post


Link to post
Share on other sites

You can build a custom filter to hide them yes, but there won't be a filter like "hide trainers" which can automatically detect trainers... it's just not possible...

You can filter them out by path, by title name, by title id etc. etc.

Aurora should really only see "default.xex" and/or god/nxe/xbla packages, so i'm not sure how these trainers showed up in your games database unless they're stored with your games, if so you could just move them to a separate folder and filter out that folder entirely (voila, any new trainer added here is hidden with a simple script)

Share this post


Link to post
Share on other sites

Yes Swizzy, you are right all my trainers are kept in the same folder as the game they are for :) 

I guess i ll have to sit and sort thru all of them and move them all to their own folder and subfolder, although as more and more trainers get Aurora-fied this will be less and less of a problem :)

Share this post


Link to post
Share on other sites

Where shall i paste the script of "Hide MultiDisk Games" to apply it and make it work ? (wolfenstein the new order shows me 4 discs and it annoys :D)

Share this post


Link to post
Share on other sites

Create a file on your computer with any name and the extension ".lua", easiest way is to just open notepad and pasting the code there, then saving as; "filename.lua" including the quotes...

Another way is to just download the script from this link: https://raw.githubusercontent.com/Swizzy/AuroraScripts/master/Media/Scripts/UserFilters/HideMultiDisc.lua

Then you just put it in Aurora\Media\Scripts\UserFilters\ and it'll be automatically loaded next time you start Aurora

  • Like 1

Share this post


Link to post
Share on other sites

I'd appreciate that filter by folder script too swizzy, when you get time of course :)

Got an example for a folder name you'd like to hide?

Share this post


Link to post
Share on other sites

Here's an example for devices: https://github.com/Swizzy/AuroraScripts/blob/master/Media/Scripts/UserFilters/ConnectX.lua

i'll make you an example later for folders on a device...

waiting for it

the list of Content properties(root, disknum, etc) i found in this topic: http://www.realmodscene.com/index.php?/topic/3570-the-aurora-scripting-how-to-guide/

is there any list of of other useful classes(ContentFlag, ContentGroup, maybe others if exist)?

upd: found it in Enums.lua

Share this post


Link to post
Share on other sites

This is a quick example which doesn't function as-is, but it's basically how you would do it...

~= nil means; we found what we're looking for (something starting with "folder\from\start")

^ = starts with

$ = ends with, so you could also do things like this:

^exactmatch$

GameListFilterCategories.User["FolderFilter"] = function(Content)
	return (string.match(Content.Directory, "^folder\from\start") ~= nil)
end
  • Like 1

Share this post


Link to post
Share on other sites

Got an example for a folder name you'd like to hide?

My folders are named... Retail, XBLA and God :)

Share this post


Link to post
Share on other sites

My folders are named... Retail, XBLA and God :)

That's the first folder on the device?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...