Gualdimar 71 Posted March 9, 2015 from this topic: http://www.realmodscene.com/index.php?/topic/3824-aurora-quick-launch-to-start-the-last-played-game/ You can setup your own sorting script you know... you can set one up that sorts by last played game followed by alphabetical order... is it possible? as i understand, this sorting type require two cycles. first cycle sorts items by last played time, second - by name excluding first item. or you need some buffer to store last played game and in the end of sorting put it in the first place. but how can you achieve this? functions in lua files only compare two items and you can`t tell what iteration is running or what items are in process 1 Quote Share this post Link to post Share on other sites
Swizzy 2083 Posted March 9, 2015 from this topic: http://www.realmodscene.com/index.php?/topic/3824-aurora-quick-launch-to-start-the-last-played-game/ is it possible? as i understand, this sorting type require two cycles. first cycle sorts items by last played time, second - by name excluding first item. or you need some buffer to store last played game and in the end of sorting put it in the first place. but how can you achieve this? functions in lua files only compare two items and you can`t tell what iteration is running or what items are in process The way you do it is by first checking if they're on the same time, if not; compare that, if they're the same you change the comparison to title... It's all done in a single function =) Quote Share this post Link to post Share on other sites
Gualdimar 71 Posted March 9, 2015 The way you do it is by first checking if they're on the same time, if not; compare that, if they're the same you change the comparison to title... It's all done in a single function =) tried it, result: all games that i have played were sorted by time and only those with "last played time: never" - by name. here is the code: GameListSorters["MySort"] = function(Item1, Item2, Type) -- Check if sort Descending if Type == SortType.Descending then if Item2.LastPlayed.HighPart == Item1.LastPlayed.HighPart then if Item2.LastPlayed.LowPart == Item1.LastPlayed.LowPart then return string.lower(Item1.Name) > string.lower(Item2.Name) end return Item2.LastPlayed.LowPart > Item1.LastPlayed.LowPart end return Item2.LastPlayed.HighPart > Item1.LastPlayed.HighPart end -- Sort Ascending if Item2.LastPlayed.HighPart == Item1.LastPlayed.HighPart then if Item2.LastPlayed.LowPart == Item1.LastPlayed.LowPart then return string.lower(Item1.Name) < string.lower(Item2.Name) end return Item2.LastPlayed.LowPart < Item1.LastPlayed.LowPart end return Item2.LastPlayed.HighPart < Item1.LastPlayed.HighPart end Quote Share this post Link to post Share on other sites
Swizzy 2083 Posted March 9, 2015 tried it, result: all games that i have played were sorted by time and only those with "last played time: never" - by name. here is the code: GameListSorters["MySort"] = function(Item1, Item2, Type) -- Check if sort Descending if Type == SortType.Descending then if Item2.LastPlayed.HighPart == Item1.LastPlayed.HighPart then if Item2.LastPlayed.LowPart == Item1.LastPlayed.LowPart then return string.lower(Item1.Name) > string.lower(Item2.Name) end return Item2.LastPlayed.LowPart > Item1.LastPlayed.LowPart end return Item2.LastPlayed.HighPart > Item1.LastPlayed.HighPart end -- Sort Ascending if Item2.LastPlayed.HighPart == Item1.LastPlayed.HighPart then if Item2.LastPlayed.LowPart == Item1.LastPlayed.LowPart then return string.lower(Item1.Name) < string.lower(Item2.Name) end return Item2.LastPlayed.LowPart < Item1.LastPlayed.LowPart end return Item2.LastPlayed.HighPart < Item1.LastPlayed.HighPart end Yeah, that's exactly how you would do it... otherwise, what did you expect to get? all with a date specified to be first? That's also possible, you just check for whatever it would be when it's been played, and check if Item1 and 2 is set, then compare text, otherwise item1 goes before item2 or vice versa Quote Share this post Link to post Share on other sites
Gualdimar 71 Posted March 9, 2015 Yeah, that's exactly how you would do it... otherwise, what did you expect to get? all with a date specified to be first? That's also possible, you just check for whatever it would be when it's been played, and check if Item1 and 2 is set, then compare text, otherwise item1 goes before item2 or vice versa i wanted to show the last played game(only one latest title) in the begining of the list and all others in alphabetical order after it. cause the script i wrote has almost the same sorting order as the standart "Recent Activity" one. but from everything i know for now, i assume this is impossible, unless implemented in aurora. correct me if i`m wrong Quote Share this post Link to post Share on other sites
Swizzy 2083 Posted March 9, 2015 i wanted to show the last played game(only one latest title) in the begining of the list and all others in alphabetical order after it. cause the script i wrote has almost the same sorting order as the standart "Recent Activity" one. but from everything i know for now, i assume this is impossible, unless implemented in aurora. correct me if i`m wrong It's not impossible, nothing is ever "impossible", it's all a matter of thinking correctly, it's not an easy task, and quite frankly, you don't need it, if you use the Quick Browse, it should show latest played game at the top, and all of the rest after that... meaning, it should be possible to just have it set to the sort that sorts by name, and use the Quick Browse feature to see the last game you played... Quote Share this post Link to post Share on other sites
Gualdimar 71 Posted March 10, 2015 It's not impossible, nothing is ever "impossible", it's all a matter of thinking correctly, it's not an easy task, and quite frankly, you don't need it, if you use the Quick Browse, it should show latest played game at the top, and all of the rest after that... meaning, it should be possible to just have it set to the sort that sorts by name, and use the Quick Browse feature to see the last game you played... nope, quick browse(X button) shows titels in abc order, whithout last played at the top. Quote Share this post Link to post Share on other sites