Popular Post Barokai_ Posted March 4, 2016 Popular Post Share Posted March 4, 2016 (edited) Hello,I missed a possibility to hide earned trophies in the guides, so i started to create a userscript to achieve this with clicking on a toggle button. (I also used a new green '#bada55' instead of the default green for earned trophies) Have a look at the attached screenshot to see what I mean, or better have a look at this .gif: http://loigistal.at/userscripts/demo-animation.gif (was too big to upload it here). If you want to try it out, you need to have tampermonkey installed (for chrome) or greasemonkey (for firefox) and click the following link: https://github.com/Barokai/psnprofiles-enhanced/raw/master/psnprofiles-enhanced.user.js I hope this little script can be useful for someone else too, message me if you have suggestions for improvements of if you find any bugs, errors etc. // edit: added extension links and fixed typos. // edit2: changed userscript link to github repo Edited March 6, 2016 by K--Force 10 Link to comment Share on other sites More sharing options...
Fallen_Chaos_ Posted March 4, 2016 Share Posted March 4, 2016 That would be so amazing and helpful, so you don't have to dig through the clutter. 1 Link to comment Share on other sites More sharing options...
HardXDXtraga Posted March 4, 2016 Share Posted March 4, 2016 Been waiting for this for a while, it was probably suggested already but good work man, looks pretty good, I also think this should be in guides, espeacially those that have long guides Link to comment Share on other sites More sharing options...
Barokai_ Posted March 4, 2016 Author Share Posted March 4, 2016 Been waiting for this for a while, it was probably suggested already but good work man, looks pretty good, I also think this should be in guides, espeacially those that have long guides thank you! haven't found any suggestion for this, sorry if there was already something suggested for this Link to comment Share on other sites More sharing options...
AlphaTrash Posted March 4, 2016 Share Posted March 4, 2016 Great job man, that's awesome. 1 Link to comment Share on other sites More sharing options...
madbuk Posted March 4, 2016 Share Posted March 4, 2016 This is a great feature over on .org, would love to see it here too. Being able to filter the guide so you only see trophies with certain tags would be great too (especially for games with loads of missable stuff) 1 Link to comment Share on other sites More sharing options...
Pumpkin Head Cthulhu Posted March 5, 2016 Share Posted March 5, 2016 this site gets that going and i might completely stop going to ps3trophies for the checklist. Link to comment Share on other sites More sharing options...
MMDE Posted March 5, 2016 Share Posted March 5, 2016 (edited) I remember I did similar for Puppeteer. http://psnprofiles.com/forums/topic/16200-collectible-guide/#entry652120 There it was just to get a "checklist" on the tons of collectibles in the game, where many wasn't possible to track in-game, and if you forgot one it could take forever to figure out which that was. Allowed you to save the checklist! Edited March 5, 2016 by MMDE Link to comment Share on other sites More sharing options...
Satoshi Ookami Posted March 5, 2016 Share Posted March 5, 2016 It will be in the next site update. Nah, but seriously, great job. Definitely useful feature. 1 Link to comment Share on other sites More sharing options...
Barokai_ Posted March 6, 2016 Author Share Posted March 6, 2016 (edited) It will be in the next site update. really? Update to version 0.75: 1. I've added the possibility to hide trophies from the guide (even if unearned) - you just have to click the box in the overview with the trophies type - see screenshot for example, it's hard to explain, i normally speak german. for example, click on "Difficulty specific" to hide/show corresponding trophies. Note that if you've already hidden some trophies, it can happen that some are displayed again, for example: Trophy X is earned, you hide trophy X with clicking on "Toggle earned", but Trophy X is also part of "Difficulty specific" trophies - click "Difficulty specific" - all trophies with this type are hidden, but Trophy X is displayed again (as the buttons only toggle the visibility). 2. When you've toggled the visibility, an asterisk (*) is added to the clicked button. 3. Added "update" button to navigation bar, I was tired of clicking the profile first to update it Tampermonkey/Greasemonkey should update the script automatically, if you haven't installed it yet, click here: https://github.com/Barokai/psnprofiles-enhanced/raw/master/psnprofiles-enhanced.user.js Improvement suggestions and ideas are still greatly welcomed. // edit: changed userscript url to github-repo Edited March 6, 2016 by K--Force Link to comment Share on other sites More sharing options...
dernop Posted March 9, 2016 Share Posted March 9, 2016 (edited) nice. i also once started to add some features i would like to see on the page to a custom userscript. the first thing i did was showing/marking games i also own, including my progression, on the general games list and on other peoples profiles: another idea, that i never actually implemented, was to have an ability to flag games as owned or even add to different categories like "digitally", "my whateverregion alt account" and so on. and/or some kind of wishlist feature. i guess there are a ton of cool features one could do entirely on the client-side as userscript. i mean that's what they're for, basically *edit*: oh and i just remembered, i also did a small fix for the site's game search feature: http://psnprofiles.com/forums/topic/32107-bugsoddities-in-the-games-search-feature/?view=findpost&p=777278 dernop Edited March 9, 2016 by dernop Link to comment Share on other sites More sharing options...
Barokai_ Posted March 9, 2016 Author Share Posted March 9, 2016 (edited) nice. i also once started to add some features i would like to see on the page to a custom userscript. the first thing i did was showing/marking games i also own, including my progression, on the general games list and on other peoples profiles: ... *edit*: oh and i just remembered, i also did a small fix for the site's game search feature: http://psnprofiles.com/forums/topic/32107-bugsoddities-in-the-games-search-feature/?view=findpost&p=777278 dernop nice one with the search script, may i add this feature in my script? I'll add credit in the comments and on github (btw, feel free to fork the script and work on it: https://github.com/Barokai/psnprofiles-enhanced) do you still have the script to mark your owned games? If anybody finds any bugs or has ideas for it, post the here or directly on github (https://github.com/Barokai/psnprofiles-enhanced/issues), i'll work on it. // edit: added question (script to mark owned games) Edited March 9, 2016 by K--Force Link to comment Share on other sites More sharing options...
minh2t Posted March 10, 2016 Share Posted March 10, 2016 Thanks so much for this, I just added the script and it's working like a miracle. Link to comment Share on other sites More sharing options...
dernop Posted March 10, 2016 Share Posted March 10, 2016 nice one with the search script, may i add this feature in my script? I'll add credit in the comments and on github (btw, feel free to fork the script and work on it: https://github.com/Barokai/psnprofiles-enhanced) do you still have the script to mark your owned games? sure, feel free to add it i should have the script still somewhere. thought i put it on my google drive, but can't find it there right now. gotta check my pc this evening at home, should be still installed as userscript there. will reply here later today or tomorrow when i found it! Link to comment Share on other sites More sharing options...
hore Posted March 11, 2016 Share Posted March 11, 2016 (edited) Holy shit, this is awesome. Thanks a lot for making this. Is it technically possible to allow us to move the trophies' position? Like, dragging them into a certain order to help us stay organized? Not a big deal, but it would be a cool addition if it's possible (and feasible). Also, perhaps a button to load all of our games on our profile, rather than having to scroll through them to the bottom? Edited March 11, 2016 by GIONAScm2 Link to comment Share on other sites More sharing options...
dernop Posted March 11, 2016 Share Posted March 11, 2016 do you still have the script to mark your owned games? found it, here you go: $(function() { // initialize psnp page/DOM information var psnp = { id: $('div.user-menu a.dropdown-toggle span').text(), _gamesTable: $('table#gamesTable'), // game table on user profile _gameList: $('table#game_list'), _profileBar: $('div.profile-bar') }; // psnp properties $.extend(psnp, { isProfile: psnp._gamesTable[0]!==undefined && psnp._profileBar[0]!==undefined, isOwnProfile: $(psnp._profileBar).find('div.info').text().indexOf(psnp.id) > -1, isGameList: psnp._gameList.length == 1, myGames: JSON.parse(localStorage.getItem('_mygames')) || {} }); psnp.updateMyGames = function(games) { var count = 0; $.each(games, function(i, e) { psnp.myGames[e.id] = e; count++; }); localStorage.setItem('_mygames', JSON.stringify(psnp.myGames)); console.log(count + " games added/updated to localstorage."); }; /* PROFILE / GAME LIST */ psnp.gameList = (function(){ if(!psnp.isProfile) return undefined; var _games = []; // register mutationobserver for gameList to handle 'load-on-scroll' var obs = new MutationObserver(function(mutations) { parseGames(); // just re-parse all games if list has changed. }); obs.observe(psnp._gamesTable[0], { childList: true, subtree: true }); // parse PSNP games table (id, name, completion, # of trophies) function parseGames() { _games = []; psnp._gamesTable.find('tr:has(a.bold)').each(function(i,row) { var title = $(row).find('a.bold')[0]; var game = { id: title.href.match(/\/trophies\/([^\/]+)/)[1], name: title.innerText, progress: $(row).find('div.progress_outer span').text(), completed: $(row).hasClass('completed'), platinum: $(row).hasClass('platinum'), gold: $(row).find('li.gold').text(), silver: $(row).find('li.silver').text(), bronze: $(row).find('li.bronze').text(), }; if(!psnp.isOwnProfile && psnp.myGames[game.id]) { var img = $(row).find('img.trophy_image'); img.removeClass('no-border').addClass('earned'); // mark owned games } _games.push(game); }); // if this is our own profile, save the games list. if(psnp.isOwnProfile) { psnp.updateMyGames(_games); } } // parse game list initially parseGames(); return { games: _games }; })(); /* #GAMELIST# global list of games (psnprofiles.com/games) */ // Mark owned game in "Games" list if(psnp.isGameList) { psnp._gameList.find('tr:has(a.bold)').each(function(i,row) { var title = $(row).find('a.bold')[0]; var id = title.href.match(/\/trophies\/([^\/"]+)/)[1]; var img = $(row).find('img.trophy_image'); // mark owned games if(psnp.myGames[id]) { if(psnp.myGames[id].platinum) $(row).addClass('platinum'); // add platinum row style if(psnp.myGames[id].completed) $(row).addClass('completed'); // add completed row style img.removeClass('no-border').addClass('earned'); if(psnp.myGames[id].progress != '100%') img.css('border-color','yellow'); // // add completion percentage var avgProgress = $(row).children('td:eq(4)').find('span.typo-top'); console.log(avgProgress); avgProgress.text(psnp.myGames[id].progress + " / " + avgProgress.text()); } }); } }); it simply gathers the games you have from your own profile page (you have to be logged in for that to work). if you have more than 100 games you have to simply scroll down your list until you see every game. i added a mutation observer for that, _no extra calls_ are made to the psnp page/backend to keep the admin happy (that should basically be rule #1 if you're doing userscripts for a page) once it gathered all games and stored them to localstorage, it will mark your games (including your progress) on the general games' list and on other peoples profiles, so you can easily compare. personally i use this feature to sort the games list by difficulty and check off easy platinums Link to comment Share on other sites More sharing options...
MMDE Posted March 11, 2016 Share Posted March 11, 2016 Holy shit, this is awesome. Thanks a lot for making this. Is it technically possible to allow us to move the trophies' position? Like, dragging them into a certain order to help us stay organized? Not a big deal, but it would be a cool addition if it's possible (and feasible). Also, perhaps a button to load all of our games on our profile, rather than having to scroll through them to the bottom? What you ask for is possible, but the first is hard to do and takes a lot of time, must be stored as session data, and the second is not exactly along the lines of what Sly wants. Link to comment Share on other sites More sharing options...
hore Posted March 11, 2016 Share Posted March 11, 2016 What you ask for is possible, but the first is hard to do and takes a lot of time, must be stored as session data, and the second is not exactly along the lines of what Sly wants. 1. Ah that's fine then; It's not worth the effort, especially since the site's getting updated soon and we don't know all the new features it'll bring. 2. Why wouldn't Sly want that? Does it strain the entire website when you view hundreds of games or something? I don't see how it could be an issue, especially with only a minority of people using the extension & feature. Link to comment Share on other sites More sharing options...
MMDE Posted March 11, 2016 Share Posted March 11, 2016 Why wouldn't Sly want that? Does it strain the entire website when you view hundreds of games or something? I don't see how it could be an issue, especially with only a minority of people using the extension & feature. I'm pretty sure it used to show all the games on a load, and Sly has implemented it so not all loads at the same time on purpose. This feature took a lot of extra effort, I'm sure. In other words, it's intentional and exists for a reason. Link to comment Share on other sites More sharing options...
Barokai_ Posted April 8, 2016 Author Share Posted April 8, 2016 after some weeks of doing nothing, i've integrated dernop's script (see http://psnprofiles.com/forums/topic/35583-add-possibility-to-hide-earned-trophies-in-guides-with-userscript/#entry932561)and cleaned up the code a bit. new version of the script is 0.83 - see details on github: http://barokai.github.io/psnprofiles-enhanced/ 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now