Achievement Filter

Filter cheevos on the cheevo page.

  1. // ==UserScript==
  2. // @name Achievement Filter
  3. // @namespace pxgamer
  4. // @version 0.7
  5. // @description Filter cheevos on the cheevo page.
  6. // @author pxgamer
  7. // @include *kat.cr/achievements/
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. var year = new Date().getFullYear();
  15.  
  16. var assigned = $('table.achTable tbody tr td.width100perc ul li span.achBadge.assignedAchievement').length;
  17. var unassigned = $('table.achTable tbody tr td.width100perc ul li span.achBadge').length - assigned;
  18.  
  19. $('table.achTable').before('<div style="margin-bottom: 5px;"><span class="showAllCheevos kaButton smallButton normalText">Show All</span> <span class="showOnlyCollected kaButton smallButton normalText">Show Only Achieved ('+assigned+')</span> <span class="showNonCollected kaButton smallButton normalText">Show Non-Collected Achievements ('+unassigned+')</span> <span class="showCurrentCheevos kaButton smallButton normalText">Show Current Achievements</span></div><hr>');
  20.  
  21. // Only show achievements you've already got
  22. $('.showOnlyCollected').on('click', function() {
  23. $('table.achTable tbody tr td.width100perc ul li').each(function() {
  24. $(this).show();
  25. });
  26. $('table.achTable tbody tr td.width100perc ul li span.achBadge').each(function() {
  27. if (!$(this).hasClass('assignedAchievement')) {
  28. $(this).parent().hide();
  29. }
  30. });
  31. });
  32.  
  33. // Only show achievements you haven't got
  34. $('.showNonCollected').on('click', function() {
  35. $('table.achTable tbody tr td.width100perc ul li').each(function() {
  36. $(this).show();
  37. });
  38. $('table.achTable tbody tr td.width100perc ul li span.achBadge').each(function() {
  39. if ($(this).hasClass('assignedAchievement')) {
  40. $(this).parent().hide();
  41. }
  42. });
  43. });
  44.  
  45. // Only current achievements
  46. $('.showCurrentCheevos').on('click', function() {
  47. $('table.achTable tbody tr td.width100perc ul li').each(function() {
  48. $(this).show();
  49. });
  50. $('table.achTable tbody tr td.width100perc ul li span.achBadge').each(function() {
  51. if (!$(this).hasClass('assignedAchievement') && $(this).children('a').children('span.achTitle').text().substring(0, 4) < year) {
  52. $(this).parent().hide();
  53. }
  54. if (!$(this).hasClass('assignedAchievement') && $(this).children('a').children('span.achTitle').text().substring($(this).children('a').children('span.achTitle').text().length - 4) < year) {
  55. $(this).parent().hide();
  56. }
  57. });
  58. });
  59.  
  60. // Show all cheevos (reset)
  61. $('.showAllCheevos').on('click', function() {
  62. $('table.achTable tbody tr td.width100perc ul li').each(function() {
  63. $(this).show();
  64. });
  65. });
  66. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址