Greasy Fork is available in English.

Clothcache Filter

Plugin fuer Clothcache um imports in der minimap zu filtern

  1. // ==UserScript==
  2. // @name Clothcache Filter
  3. // @name:de Clothcache Filter
  4. // @name:en Clothcache Filter
  5. // @author sawyaz
  6. // @namespace sawyaz
  7. // @description Plugin for Clothcache to filter imports for jobs on the minimap
  8. // @description:de Plugin fuer Clothcache um imports in der minimap zu filtern
  9. // @include https://*.the-west.*/game.php*
  10. // @include https://*.tw.innogames.*/game.php*
  11. // @grant GM.xmlHttpRequest
  12. // @connect support.innogames.com
  13. // @license MIT-2.0
  14. // @version v0.0.2
  15. // ==/UserScript==
  16.  
  17. TWDS.minimap.filter = function () {
  18. TWDS.minimap.loadconfig();
  19. const config = TWDS.minimap.config || {};
  20. const container = $('<div />').css({
  21. width: '400px',
  22. minHeight: '100px',
  23. maxHeight: '400px',
  24. overflowY: 'auto'
  25. });
  26. JobList.getSortedJobs("level", null, "desc").forEach(job => {
  27. const checkboxId = `job-checkbox-${job.name.replace(/\s+/g, '-')}`;
  28. const checkbox = $('<input />', {
  29. type: 'checkbox',
  30. id: checkboxId,
  31. checked: config[job.name] || false
  32. });
  33. const label = $('<label />', {
  34. for: checkboxId,
  35. text: job.name
  36. });
  37. container.append(checkbox).append(label).append('<br>');
  38. });
  39. const saveConfig = function () {
  40. JobList.getSortedJobs("level", null, "desc").forEach(job => {
  41. const checkboxId = `job-checkbox-${job.name.replace(/\s+/g, '-')}`;
  42. config[job.name] = $(`#${checkboxId}`).is(':checked');
  43. });
  44. TWDS.minimap.config = config;
  45. TWDS.minimap.saveconfig();
  46. };
  47. (new west.gui.Dialog('Job Filter', container)).addButton('ok', saveConfig).addButton('cancel').show();
  48. };