Greasy Fork is available in English.

The West - westernblumis Toolkit

Some useful improvements for The West

  1. // ==UserScript==
  2. // @name The West - westernblumis Toolkit
  3. // @namespace westernblumi
  4. // @include https://*.the-west.*/game.php*
  5. // @author westernblumi (updated by Tom Robert)
  6. // @version 1.09
  7. // @grant none
  8. // @description Some useful improvements for The West
  9. // ==/UserScript==
  10. (function (fn) {
  11. var script = document.createElement('script');
  12. script.setAttribute('type', 'application/javascript');
  13. script.textContent = '(' + fn.toString() + ')();';
  14. document.body.appendChild(script);
  15. document.body.removeChild(script);
  16. }) (function () {
  17.  
  18. WTKstart = {
  19. langs: {
  20. en: {
  21. language: 'English',
  22. features: 'Features',
  23. FeatRemoveTownBlinkEvent: 'Removes flashing from the forum menu item',
  24. FeatNewStatistics: 'Adds adventure statistics ',
  25. FeatOpenTrader: 'Opens the mobil traider, when new items are available',
  26. FeatDailyItemHelper: 'Adds a new button in the side menu for daily quest items',
  27. FeatAdventureBlockPlayer: 'Enables ignoring other players in adventure',
  28. save: 'Save',
  29. saveMessage: 'Settings saved',
  30. settings: 'Settings',
  31. ghostTown: 'Ghost town',
  32. indianVillage: 'Indian village',
  33. monday: 'Monday',
  34. tuesday: 'Tuesday',
  35. wednesday: 'Wednesday',
  36. thursday: 'Thursday',
  37. friday: 'Friday',
  38. saturday: 'Saturday',
  39. sunday: 'Sunday',
  40. saloon: 'Saloon',
  41. shortName: 'WTK',
  42. dailyItems: 'Products for daily quests',
  43. showDailyItems: 'Show products for daily quests',
  44. adventuresPlayed: 'Adventures played',
  45. adventuresKnockouts: 'Enemys knocked out',
  46. adventuresMiss: 'Missed shots',
  47. adventuresDodges: 'Dodged shots',
  48. adventures: 'Adventures',
  49. getData: 'Show data',
  50. updateMessage: 'A new version of the script is available',
  51. ignore: 'Ignore',
  52. dontIgnore: 'Don\'t ignore anymore',
  53. reportOffense: 'Report offense',
  54. willBeIgnored: 'will be ignored',
  55. willNotBeIgnored: 'will not be ignored anymore',
  56. churchLevels: 'Levels',
  57. FeatChurchLevels: 'Shows how many additional church levels you can build in your town',
  58. deleteMarkedItems: 'Delete marked items',
  59. youHaveFound: 'You have found following item:',
  60. itemFinder: 'Item Finder',
  61. FeatWindowPin: 'Opens nearly all windows at a defined position',
  62. setPosition: 'Set position',
  63. progress: 'Progress',
  64. progressTooltip: 'The progress shows how far your town is with the building of the current building stage',
  65. FeatFormattedRankings: 'Formats ranking data and shows the different to better players',
  66. FeatShowFort: 'Links the report of a fortbattle declaration to a certain fort instead of the fortbattle overview window',
  67. FeatBuildingProgress: 'Show the construction progress in a building window',
  68. FeatImprovedBuildCityhall: 'Show only buildings that have not been fully built',
  69. searchItem: 'Search Item',
  70. search: 'Search',
  71. whatItemsWouldYouLikeToSearchFor: 'What items would you like to search for?',
  72. howManyOfThemWouldYouLikeToCollect: 'How many of these do you want to collect?',
  73. nameOfTheItem: 'Name of the item:',
  74. numberOfItems: 'Number of items:',
  75. searchResult: 'Search result',
  76. itemAmountMustBeHigherThan0: 'The number of items must be greater than 0!',
  77. nameCannotBeEmpty: 'The name must not be empty!',
  78. emptySearchResult: 'Sorry, your search does not return any results. Please check your input. Maybe the item is already on your list!',
  79. thereAreMoreItems: 'The search yielded more results.',
  80. restrictYourSearch: 'Narrow the search to get more precise results.',
  81. help: 'Help',
  82. back: 'Go back',
  83. itemFinderHelpContent: '<b>Add:</b><ol style="padding-inline-start: 40px;"><li>Click on <b>Search Item</b>. This will open the search dialog<br></li><li>Enter the name of the item you want to search for.<br>Please enter how many of them you want to search. Click on <b>Search</b></li><li>A dialog with the search results opens</li><li>Click on the item you want to add to your list</li></ol><br><b>Delete:</b><ol style="padding-inline-start: 40px;"><li>Click on an item. The item will then become transparent</li><li>Click on <b>Delete marked items</b> to delete the selected items</li></ol><br><b>Enable alarm:</b><ol style="padding-inline-start: 40px;"><li>Click on the lower area with the number of items you are looking for</li><li>The area gets a yellow frame, the alarm is activated<br>and you will be notified as soon as the item you are looking for is found</li><li>Click on the area again and the frame and the alarm will be removed again</li></ol>',
  84. FeatExtendedBBCodes: 'Show correct BB-codes for color, size and images also in profiles, telegrams and notes. This will work only for people who have the script installed. All other player will still see these "wrong" codes'
  85. },
  86. de: {
  87. language: 'German (Deutsch)',
  88. features: 'Features',
  89. FeatRemoveTownBlinkEvent: 'Entfernt das Blinken des Stadtforums im Menü',
  90. FeatNewStatistics: 'Fügt Abenteuer Statistiken hinzu',
  91. FeatOpenTrader: 'Öffnet den fahrenden Händler, wenn neue Items verfügbar sind',
  92. FeatDailyItemHelper: 'Fügt im Seitenmenü einen Button für tägliche Questprodukte hinzu',
  93. FeatAdventureBlockPlayer: 'Erlaubt das Ignorieren von anderen Spielern im Abenteuer',
  94. save: 'Speichern',
  95. saveMessage: 'Erfolgreich gespeichert',
  96. settings: 'Einstellungen',
  97. ghostTown: 'Geisterstadt',
  98. indianVillage: 'Indianerdorf',
  99. monday: 'Montag',
  100. tuesday: 'Dienstag',
  101. wednesday: 'Mittwoch',
  102. thursday: 'Donnerstag',
  103. friday: 'Freitag',
  104. saturday: 'Samstag',
  105. sunday: 'Sonntag',
  106. saloon: 'Saloon',
  107. shortName: 'WTK',
  108. dailyItems: 'Produkte für tägliche Quests',
  109. showDailyItems: 'Zeige Produkte für tägliche Quests',
  110. adventuresPlayed: 'Abenteuer absolviert',
  111. adventuresKnockouts: 'Im Abenteuer KO geschossen',
  112. adventuresMiss: 'Fehlschüsse',
  113. adventuresDodges: 'Ausweicher',
  114. adventures: 'Abenteuer',
  115. getData: 'Daten anzeigen',
  116. updateMessage: 'Eine neue Version des Skriptes ist jetzt verfügbar',
  117. ignore: 'Ignorieren',
  118. dontIgnore: 'Nicht mehr ignorieren',
  119. reportOffense: 'Verstoß melden',
  120. willBeIgnored: 'wird jetzt ignoriert',
  121. willNotBeIgnored: 'wird jetzt nicht mehr ignoriert',
  122. churchLevels: 'Stufen',
  123. FeatChurchLevels: 'Zeigt an, wie viele Kirchenstufen man noch bauen kann',
  124. deleteMarkedItems: 'Markierte Items löschen',
  125. youHaveFound: 'Du hast folgenden Gegenstand gefunden:',
  126. itemFinder: 'Item Finder',
  127. FeatWindowPin: 'Öffnet die Fenster immer an einer bestimmten Stelle',
  128. setPosition: 'Position setzen',
  129. progress: 'Fortschritt',
  130. progressTooltip: 'Der Fortschritt gibt an, wie weit die Stufe des Gebäudes schon ausgebaut ist.',
  131. FeatFormattedRankings: 'Formatiert die Daten in der Rangliste und zeigt als Tooltip die Differenz zum besser plazierten Spieler',
  132. FeatShowFort: 'Verlinke im Bericht einer Fortmapfankündigung das konkrete Fort anstatt nur die Fortkampf Übersicht',
  133. FeatBuildingProgress: 'Zeige im Ausbaufenster auch den Baufortschritt',
  134. FeatImprovedBuildCityhall: 'Zeige nur Gebäude die noch ausgebaut werden können',
  135. searchItem: 'Item suchen',
  136. search: 'Suchen',
  137. whatItemsWouldYouLikeToSearchFor: 'Nach welchen Gegenständen möchtest du suchen?',
  138. howManyOfThemWouldYouLikeToCollect: 'Wie viele davon möchtest du sammeln?',
  139. nameOfTheItem: 'Name des Gegenstandes:',
  140. numberOfItems: 'Anzahl der Gegenstände:',
  141. searchResult: 'Suchergebnis',
  142. itemAmountMustBeHigherThan0: 'Die Anzahl der Gegenstände muss größer als 0 sein!',
  143. nameCannotBeEmpty: 'Der Name darf nicht leer sein!',
  144. emptySearchResult: 'Deine Suche liefert leider keine Ergebnisse. Überprüfe bitte deine Eingabe. Vielleicht ist der Gegenstand auch schon auf deiner Liste!',
  145. thereAreMoreItems: 'Die Suche lieferte mehr Ergebnisse.',
  146. restrictYourSearch: 'Schränke die Suche ein, um genauere Ergebnisse zu erhalten.',
  147. help: 'Hilfe',
  148. back: 'Zurück',
  149. itemFinderHelpContent: '<b>Hinzufügen:</b><ol style="padding-inline-start: 40px;"><li>Klick auf <b>Item suchen</b>. Daraufhin öffnet sich der Such-Dialog</li><li>Gib den Namen des Items an, das du suchen möchtest.<br>Trage ein, wie viele davon du suchen möchtest. Klick auf <b>Suchen</b></li><li>Ein Dialog mit den Suchergebnissen öffnet sich</li><li>Klick auf das Item, das du deiner Liste hinzufügen möchtest</li></ol><br><b>Löschen:</b><ol style="padding-inline-start: 40px;"><li>Klick auf ein Item. Das Item wird daraufhin transparent</li><li>Klick auf <b>Markierte Items löschen</b>, um die markierten Elemente zu löschen</li></ol><br><b>Alarm einschalten:</b><ol style="padding-inline-start: 40px;"><li>Klick auf den unteren Bereich mit der Anzahl der gesuchten Items</li><li>Der Bereich erhält einen gelben Rahmen, der Alarm ist somit aktiviert<br>und du wirst benachrichtigt, sobald das gesuchte Item gefunden wurde</li><li>Klickst du nochmal auf den Bereich wird der Rahmen und der Alarm wieder entfernt</li></ol>',
  150. FeatExtendedBBCodes: 'Zeige BB-Codes für Farbe, Größe und Bilder auch in Profilen, Telegrammen und Notizen richtig an. Das ganze funktioniert nur für Spieler, die das Skript auch installiert haben. Alle anderen sehen weiterhin die "falschen" Codes'
  151. },
  152. pl: {
  153. language: 'Polish',
  154. features: 'Funkcje',
  155. FeatRemoveTownBlinkEvent: 'Usuń migające okna z menu',
  156. FeatNewStatistics: 'Dodaj Przygody do statystyk',
  157. FeatOpenTrader: ' Otwórz wędrownego handlarza, gdy są dostępne nowe przedmioty',
  158. FeatDailyItemHelper: 'Doda dodatkowy przycisk w menu, odpowiedzialny za dzienne zadania',
  159. FeatAdventureBlockPlayer: 'Enables ignoring other players in adventure',
  160. save: 'Zapisz',
  161. saveMessage: 'Zapisano',
  162. settings: 'Opcje',
  163. ghostTown: 'Miasto Widmo',
  164. indianVillage: 'Wioska Indiańska Waupee',
  165. monday: 'Poniedziałek',
  166. tuesday: 'Wtorek',
  167. wednesday: 'Środa',
  168. thursday: 'Czwartek',
  169. friday: 'Piątek',
  170. saturday: 'Sobota',
  171. sunday: 'Niedziela',
  172. saloon: 'Saloon',
  173. shortName: 'WTK',
  174. dailyItems: 'Produkty do dziennych zadań',
  175. showDailyItems: 'Pokaż produkty do dziennych zadań',
  176. adventuresPlayed: 'Rozegrane przygody',
  177. adventuresKnockouts: 'Omdleni przeciwnicy',
  178. adventuresMiss: 'Nietrafione strzały',
  179. adventuresDodges: 'Trafione strzały',
  180. adventures: 'Przygody',
  181. getData: 'Pokaż dane',
  182. updateMessage: 'Nowa wersja skryptu jest dostępna',
  183. ignore: 'Ignore',
  184. dontIgnore: 'Don\'t ignore anymore',
  185. reportOffense: 'Report offense',
  186. willBeIgnored: 'will be ignored',
  187. willNotBeIgnored: 'will not be ignored anymore',
  188. churchLevels: 'Levels',
  189. FeatChurchLevels: 'Shows how many additional church levels you can build in your town',
  190. deleteMarkedItems: 'Delete marked items',
  191. youHaveFound: 'You have found following item:',
  192. itemFinder: 'Item Finder',
  193. FeatWindowPin: 'Opens nearly all windows at a defined position',
  194. setPosition: 'Set position',
  195. progress: 'Progress',
  196. progressTooltip: 'The progress shows how far your town is with the building of the current building stage',
  197. FeatFormattedRankings: 'Formats ranking data and shows the different to better players',
  198. FeatShowFort: 'Links the report of a fortbattle declaration to a certain fort instead of the fortbattle overview window',
  199. FeatBuildingProgress: 'Show the construction progress in a building window',
  200. FeatImprovedBuildCityhall: 'Show only buildings that have not been fully built',
  201. searchItem: 'Search Item',
  202. search: 'Search',
  203. whatItemsWouldYouLikeToSearchFor: 'What items would you like to search for?',
  204. howManyOfThemWouldYouLikeToCollect: 'How many of these do you want to collect?',
  205. nameOfTheItem: 'Name of the item:',
  206. numberOfItems: 'Number of items:',
  207. searchResult: 'Search result',
  208. itemAmountMustBeHigherThan0: 'The number of items must be greater than 0!',
  209. nameCannotBeEmpty: 'The name must not be empty!',
  210. emptySearchResult: 'Sorry, your search does not return any results. Please check your input. Maybe the item is already on your list!',
  211. thereAreMoreItems: 'The search yielded more results.',
  212. restrictYourSearch: 'Narrow the search to get more precise results.',
  213. help: 'Help',
  214. back: 'Go back',
  215. itemFinderHelpContent: '<b>Add:</b><ol style="padding-inline-start: 40px;"><li>Click on <b>Search Item</b>. This will open the search dialog<br></li><li>Enter the name of the item you want to search for.<br>Please enter how many of them you want to search. Click on <b>Search</b></li><li>A dialog with the search results opens</li><li>Click on the item you want to add to your list</li></ol><br><b>Delete:</b><ol style="padding-inline-start: 40px;"><li>Click on an item. The item will then become transparent</li><li>Click on <b>Delete marked items</b> to delete the selected items</li></ol><br><b>Enable alarm:</b><ol style="padding-inline-start: 40px;"><li>Click on the lower area with the number of items you are looking for</li><li>The area gets a yellow frame, the alarm is activated<br>and you will be notified as soon as the item you are looking for is found</li><li>Click on the area again and the frame and the alarm will be removed again</li></ol>',
  216. FeatExtendedBBCodes: 'Show correct BB-codes for color, size and images also in profiles, telegrams and notes. This will work only for people who have the script installed. All other player will still see these "wrong" codes'
  217. },
  218. es: {
  219. language: 'Spanish',
  220. features: 'Funciones',
  221. FeatRemoveTownBlinkEvent: 'Elimina parpadeo del elemento del menú del foro',
  222. FeatNewStatistics: 'Agrega estadísticas de aventuras',
  223. FeatOpenTrader: 'Abre el vendedor ambulante, cuando hay nuevos artículos disponibles',
  224. FeatDailyItemHelper: 'Agrega un nuevo botón en el menú lateral para los artículos de búsqeudas diarias',
  225. FeatAdventureBlockPlayer: 'Permite ignorar a otros jugadores en la aventura',
  226. save: 'Guardar',
  227. saveMessage: 'Ajustes guardados',
  228. settings: 'Ajustes',
  229. ghostTown: 'Ciudad fantasma',
  230. indianVillage: 'Pueblo indio',
  231. monday: 'Lunes',
  232. tuesday: 'Martes',
  233. wednesday: 'Miércoles',
  234. thursday: 'Jueves',
  235. friday: 'Viernes',
  236. saturday: 'Sábado',
  237. sunday: 'Domingo',
  238. saloon: 'Salón',
  239. shortName: 'WTK',
  240. dailyItems: 'Productos para búsquedas diarias',
  241. showDailyItems: 'Mostrar productos para búsquedas diarias',
  242. adventuresPlayed: 'Aventuras jugadas',
  243. adventuresKnockouts: 'Enemigos desmayados',
  244. adventuresMiss: 'Tiros fallados',
  245. adventuresDodges: 'Tiros eludidos',
  246. adventures: 'Adventuras',
  247. getData: 'Mostrar datos',
  248. updateMessage: 'Una nueva versión del script está disponible',
  249. ignore: 'Ignorar',
  250. dontIgnore: 'No ignorar más',
  251. reportOffense: 'Informar insulto',
  252. willBeIgnored: 'será ignorado',
  253. willNotBeIgnored: 'ya no será ignorado',
  254. churchLevels: 'Niveles',
  255. FeatChurchLevels: 'Muestra cuántos niveles adicionales de la Iglesia puede construir en su ciudad',
  256. deleteMarkedItems: 'Borrar artículos marcados',
  257. youHaveFound: 'Has encontrado el siguiente artículo:',
  258. itemFinder: 'Buscador artículos',
  259. FeatWindowPin: 'Abrir casi todas las ventanas en una posición definida',
  260. setPosition: 'Fijar posición',
  261. progress: 'Progreso',
  262. progressTooltip: 'El progreso muestra en qué punto está la construcción de su ciudad con respecto al actual estado de la construcción',
  263. FeatFormattedRankings: 'Formatea los datos de clasificación y muestra las diferencias de los mejores jugadores ',
  264. FeatShowFort: 'Enlaza al informe de una declaración de batalla de un determinado fuerte en lugar de a la ventana resumen ',
  265. FeatBuildingProgress: 'Muestra el progreso de construcción en la ventana del edificio',
  266. FeatImprovedBuildCityhall: 'Muestra solo los edificios que no están completamente construidos',
  267. searchItem: 'Search Item',
  268. search: 'Search',
  269. whatItemsWouldYouLikeToSearchFor: 'What items would you like to search for?',
  270. howManyOfThemWouldYouLikeToCollect: 'How many of these do you want to collect?',
  271. nameOfTheItem: 'Name of the item:',
  272. numberOfItems: 'Number of items:',
  273. searchResult: 'Search result',
  274. itemAmountMustBeHigherThan0: 'The number of items must be greater than 0!',
  275. nameCannotBeEmpty: 'The name must not be empty!',
  276. emptySearchResult: 'Sorry, your search does not return any results. Please check your input. Maybe the item is already on your list!',
  277. thereAreMoreItems: 'The search yielded more results.',
  278. restrictYourSearch: 'Narrow the search to get more precise results.',
  279. help: 'Help',
  280. back: 'Go back',
  281. itemFinderHelpContent: '<b>Add:</b><ol style="padding-inline-start: 40px;"><li>Click on <b>Search Item</b>. This will open the search dialog<br></li><li>Enter the name of the item you want to search for.<br>Please enter how many of them you want to search. Click on <b>Search</b></li><li>A dialog with the search results opens</li><li>Click on the item you want to add to your list</li></ol><br><b>Delete:</b><ol style="padding-inline-start: 40px;"><li>Click on an item. The item will then become transparent</li><li>Click on <b>Delete marked items</b> to delete the selected items</li></ol><br><b>Enable alarm:</b><ol style="padding-inline-start: 40px;"><li>Click on the lower area with the number of items you are looking for</li><li>The area gets a yellow frame, the alarm is activated<br>and you will be notified as soon as the item you are looking for is found</li><li>Click on the area again and the frame and the alarm will be removed again</li></ol>',
  282. FeatExtendedBBCodes: 'Show correct BB-codes for color, size and images also in profiles, telegrams and notes. This will work only for people who have the script installed. All other player will still see these "wrong" codes'
  283. },
  284. }
  285. };
  286.  
  287. WTK = {
  288. version: '1.09',
  289. name: 'The West - westernblumis Toolkit',
  290. author: 'westernblumi',
  291. website: 'https://greasyfork.org/de/scripts/29596-the-west-westernblumis-toolkit',
  292. Data: {},
  293. loaded: [],
  294. Features: {
  295. RemoveTownBlinkEvent: false,
  296. NewStatistics: true,
  297. OpenTrader: false,
  298. DailyItemHelper: true,
  299. AdventureBlockPlayer: true,
  300. ChurchLevels: true,
  301. FormattedRankings: true,
  302. WindowPin: false,
  303. ShowFort: true,
  304. BuildingProgress: true,
  305. ImprovedBuildCityhall: true,
  306. ExtendedBBCodes: true,
  307. },
  308. Images: {
  309. menudailyitems: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QCsRXhpZgAATU0AKgAAAAgACQEaAAUAAAABAAAAegEbAAUAAAABAAAAggEoAAMAAAABAAIAAAExAAIAAAARAAAAigMBAAUAAAABAAAAnAMDAAEAAAABAAAAAFEQAAEAAAABAQAAAFERAAQAAAABAAAOw1ESAAQAAAABAAAOwwAAAAAAAXbyAAAD6AABdvIAAAPocGFpbnQubmV0IDQuMC4xMwAAAAGGoAAAsY//2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE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iv7+I4drZblksTHMlU+pr6tRoxwFGlRdHDUI0ZU6qVSU6qrf2jOc+ad+aHvOaqSt9Vfts/8FZvA37R/wC0/wDC/wCPnwQ0a0+GFt8HD4K+Ifg/w74nvvBdu1p8X/FGtH4gfFnxVDJu1XXdP13xJ8Sls9KudW0fxLHPqfhTwb4IuVt9NuY7e10mp/wUD/4Kbfs8ftRfGi7+JXhj4PWFl4N0fRGsPhl4f1X4peDoNOs9d8W+Jbj4i/FDXx4A02PVftnj7xX8WPGfjPVLfUdJu5dd1e6l8M2WrI9gY9Jtvyf+AfU/9hHWf/SnT6/XKw/1vgH/ALHv4ff+nXUa6+J+KFgcViMuxGEr4qjmE44jF+yzCWCc3h1JqlH2WGnKFGUfclSUnTajTcoydOFscjyJ1cHluY4bFU8LVoYath8NGWEWJ9ksRXlSnVlKpXTrVl7NSjUmk4qdaC92rI+OfCvxu1Twj4X8N+FLSL4zaLa+GNB0fw9baPqV3oU+o6Tb6Lp1vpsOmX85gtDNe2EdstrdSm1tjJPFI5t4SfLUr9CfF/8AyNnij/sYtb/9OVzRX56+JMPWbqyyuN6rdR3rYaWs2pP3pZc3LVvV3b3d3e/uvLXSbpqsmqb5E+SrG/J7qdo4lJfCtEklslZH/9k=',
  311. },
  312. updateLang: function () {
  313. var languages = WTKstart.langs;
  314. WTK.lang = languages[Game.locale.substr(0, 2)] ? Game.locale.substr(0, 2) : 'en';
  315. WTKlang = languages[WTK.lang];
  316. },
  317. };
  318. WTK.updateLang();
  319. WTK.Skript = {
  320. init: function () {
  321. var menuContainer = $('<div class="menulink" onclick="WTK.GUI.openMenu();" title="' + WTK.name + '" />').css('background-image', 'url(' + WTK.Images.menu + ')').css('background-position', '0px 0px').on('mouseenter', function () {
  322. $(this).css('background-position', '-25px 0px');
  323. }).on('mouseleave', function () {
  324. $(this).css('background-position', '0px 0px');
  325. });
  326. $('#ui_menubar').append($('<div id="WTK_menubutton" class="ui_menucontainer" />').append(menuContainer).append('<div class="menucontainer_bottom" />'));
  327.  
  328. var styling = $('<style></style>').text(
  329. '.WTK_find_notifcation {position: absolute;width: 51px;color: #fff;min-width: 23px;line-height: 12px;font-size: 10px;bottom: 3px;left: 2px;text-align: center;background: rgba(127, 111, 85, 0.7);border-radius: 0 2px 0 2px;box-shadow: 0px -1px 2px #000000;font-weight: bold;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;padding: 0 2px;opacity: 1;}' +
  330. '.WTK_find_notifcation_highlight {border: 2px;border-color: yellow;border-style: solid;width: 48px;}' +
  331. '.WTK_item_border {border: transparent;border-style: solid;border-width: 2px;border-radius: 5px;}' +
  332. '.WTK_item_border_green {border: green;border-style: solid;border-width: 2px;border-radius: 5px;}'
  333. );
  334. $('head').append(styling);
  335.  
  336. WTK.Skript.updateFeat();
  337. },
  338. updateFeat: function () {
  339. var saved = localStorage.getItem('WTKFeaturestest');
  340. WTK.Data = saved && saved.indexOf('{') === 0 && JSON.parse(saved) || {};
  341. for (var k in WTK.Features) {
  342. if (WTK.Skript.getFeature(k) && !WTK.loaded.includes(k)) {
  343. try {
  344. WTK.loaded.push(k);
  345. WTK[k].init();
  346. } catch (e) {}
  347. }
  348. }
  349. WTK.ExtendedItemFinder.init();
  350. },
  351. getFeature: function (name) {
  352. return (WTK.Data[name] !== undefined) ? WTK.Data[name] : WTK.Features[name];
  353. },
  354. };
  355.  
  356. WTK.GUI = {
  357. openMenu: function () {
  358. WTK.GUI.open();
  359. WTK.GUI.openSettings();
  360. },
  361. window: {},
  362. checkbox: {},
  363. open: function () {
  364. WTK.GUI.window = wman.open('WTKMenuWindow', WTK.name, 'noreload').setMiniTitle(WTKlang.shortName).setMaxSize(1268, 838);
  365. WTK.GUI.window.addTab(WTKlang.settings, 'WTKSettingsTab', WTK.GUI.openSettings);
  366. WTK.GUI.window.addTab(WTKlang.dailyItems, 'WTKDailyItemsTab', WTK.DailyItemHelper.showDailyItems);
  367. WTK.GUI.window.addTab(WTKlang.itemFinder, 'WTKExtendedItemFinder', WTK.ExtendedItemFinder.showExtendedItemFinder);
  368. },
  369. getDefault: function (tab) {
  370. WTK.GUI.window.setResizeable(false).setSize(748, 471).clearContentPane().removeClass('nocloseall').setTitle(WTK.name);
  371. WTK.GUI.window.dontCloseAll = false;
  372. $(WTK.GUI.window.getContentPane()).css('margin-top', '10px');
  373. var wnd = WTK.GUI.window.getMainDiv();
  374. $('.textart_title', wnd).css('display', '');
  375. WTK.GUI.window.activateTab(tab);
  376. },
  377. openSettings: function () {
  378. WTK.GUI.getDefault('WTKSettingsTab');
  379.  
  380. var featScroll = new west.gui.Scrollpane();
  381.  
  382. featScroll.appendContent('<h2>' + WTKlang.features + '</h2>');
  383. for (var k in WTK.Features) {
  384. WTK.GUI.checkbox[k] = new west.gui.Checkbox().setLabel(WTKlang['Feat' + k]).setSelected(WTK.Skript.getFeature(k)).appendTo(featScroll.getContentPane());
  385. if(k == 'WindowPin'){
  386. var button1 = new west.gui.Button(WTKlang.setPosition, function () {
  387. WTK.WindowPin.getNewPinPosition();
  388. });
  389. featScroll.appendContent(button1.getMainDiv());
  390. }
  391. featScroll.appendContent('<br><div style="height:5px;" />');
  392. }
  393. featScroll.appendContent('<br>');
  394. $(featScroll.getMainDiv()).css({
  395. 'height': '310px',
  396. 'margin-bottom': '10px',
  397. });
  398. var button2 = new west.gui.Button(WTKlang.save, function () {
  399. for (var k in WTK.GUI.checkbox) {
  400. WTK.Data[k] = WTK.GUI.checkbox[k].isSelected();
  401. }
  402. localStorage.setItem('WTKFeaturestest', JSON.stringify(WTK.Data));
  403. WTK.Skript.updateFeat();
  404. new UserMessage(WTKlang.saveMessage, 'success').show();
  405. });
  406. $(WTK.GUI.window.getContentPane()).append(featScroll.getMainDiv()).append(button2.getMainDiv());
  407. },
  408. };
  409.  
  410. WTK.RemoveTownBlinkEvent = {
  411. init: function () {
  412. setTimeout((function () {
  413. $('div.city > div.city').removeClass('dock-highlight');
  414. }), 1000);
  415. //The West Menu
  416. setTimeout((function () {
  417. $('#TWM_bottombar div.city > div.Stadt').removeClass('TWM_highlight');
  418. }), 1000);
  419. },
  420. };
  421.  
  422. WTK.NewStatistics = {
  423. init: function () {
  424. AchievementStatistic.backup_init = AchievementStatistic.init;
  425. AchievementStatistic.init = function(){
  426. if(this.playerid == Character.playerId){
  427. var that=this;
  428. Ajax.remoteCall('achievement','get_statistic',{
  429. playerid:this.playerid
  430. },function(json){
  431. var table=new west.gui.Table().addColumn('desc').addColumn('value').appendToCell('head','desc').appendToCell('head','value');
  432. var i=0;
  433. $.each(json.stats,function(k,v){
  434. if(i!=0)
  435. table.appendRow();
  436. table.appendRow($('<h2>'+k+'</h2>'));
  437. $.each(v,function(kk,vv){
  438. table.appendRow().appendToCell(-1,'desc',kk).appendToCell(-1,'value',format_number(vv));
  439. });
  440. i++;
  441. });
  442. var button3 = new west.gui.Button(WTKlang.getData, WTK.NewStatistics.getDataAdventuresDodges);
  443. table.appendRow().appendToCell(-1,'desc',WTKlang.adventuresDodges).appendToCell(-1,'value',button3.getMainDiv());
  444. var button4 = new west.gui.Button(WTKlang.getData, WTK.NewStatistics.getDataAdventuresMiss);
  445. table.appendRow().appendToCell(-1,'desc',WTKlang.adventuresMiss).appendToCell(-1,'value',button4.getMainDiv());
  446.  
  447. that.window.$('div.achievement-statistic',AchievementWindow.DOM).empty();
  448. table.appendTo(that.window.$('div.achievement-statistic',AchievementWindow.DOM));
  449. },this);
  450. } else {
  451. AchievementStatistic.backup_init.call(this);
  452. }
  453. return this;
  454. };
  455. },
  456.  
  457. getDataAdventuresMiss: function () {
  458. Ajax.remoteCall('achievement','track',{achvid: 60031}, function(json)
  459. {
  460. if(!json.error){
  461. MessageSuccess(WTKlang.adventuresMiss + ': ' + json.current).show();
  462. }
  463. Ajax.remoteCall('achievement','untrack',{}, function(json){});
  464. });
  465.  
  466.  
  467. },
  468.  
  469. getDataAdventuresDodges: function () {
  470. Ajax.remoteCall('achievement','track',{achvid: 60028}, function(json)
  471. {
  472. if(!json.error){
  473. MessageSuccess(WTKlang.adventuresDodges + ': ' + json.current).show();
  474. }
  475. Ajax.remoteCall('achievement','untrack',{}, function(json){});
  476. });
  477.  
  478.  
  479. },
  480. };
  481.  
  482. WTK.OpenTrader = {
  483. init: function () {
  484. setTimeout((function () {
  485. setInterval(WTK.OpenTrader.checkTrader, 10000);
  486. }), 10000);
  487.  
  488. },
  489. checkTrader: function(){
  490. if(WTK.OpenTrader.TraderTime == undefined){
  491. Ajax.remoteCallMode('shop_trader', 'index', {}, function (response) {
  492. WTK.OpenTrader.TraderTime = response.traderTime;
  493. if((WTK.OpenTrader.TraderTime -(new Date()).getTime() / 1000) > 86385) {
  494. west.window.shop.open('wear_window').showCategory('trader');
  495. Character.setToRead('trader', false);
  496. }
  497. });
  498. }
  499. if(Math.round((new Date()).getTime() / 1000) > WTK.OpenTrader.TraderTime){
  500. Ajax.remoteCallMode('shop_trader', 'index', {}, function (response) {
  501. WTK.OpenTrader.TraderTime = response.traderTime;
  502. });
  503. west.window.shop.open('wear_window').showCategory('trader');
  504. Character.setToRead('trader', false);
  505. }
  506. },
  507. };
  508.  
  509. WTK.DailyItemHelper = {
  510.  
  511. ghostTown: [
  512. {minLevel:21,maxLevel:50,amount:1,itemID: 715},
  513. {minLevel:27,maxLevel:60,amount:1,itemID: 760},
  514. {minLevel:28,maxLevel:60,amount:1,itemID: 759},
  515. {minLevel:37,maxLevel:70,amount:1,itemID: 792},
  516. {minLevel:62,maxLevel:100,amount:1,itemID: 794},
  517. {minLevel:73,amount:1,itemID:1817},
  518. {minLevel:80,amount:1,itemID:1819},
  519. {minLevel:120,amount:4,itemID:2442},
  520. {minLevel:151,amount:1,itemID:52967},
  521. {minLevel:151,amount:2,itemID:52957},
  522. {minLevel:151,amount:1,itemID:52944},
  523. {minLevel:151,amount:4,itemID:52968},
  524. {minLevel:151,amount:3,itemID:52954},
  525. {minLevel:151,amount:5,itemID:52946},
  526. {minLevel:151,amount:2,itemID:52964},
  527. {minLevel:151,amount:1,itemID:52932},
  528. ],
  529. indianVillage: [
  530. {minLevel:13,maxLevel:40,amount:1,itemID:714},
  531. {minLevel:34,maxLevel:60,amount:1,itemID:718},
  532. {minLevel:41,maxLevel:70,amount:1,itemID:724},
  533. {minLevel:50,maxLevel:80,amount:1,itemID:1812},
  534. {minLevel:56,maxLevel:80,amount:1,itemID:1813},
  535. {minLevel:63,maxLevel:100,amount:1,itemID:1708},
  536. {minLevel:71,amount:1,itemID:780},
  537. {minLevel:90,amount:1,itemID:1821},
  538. {minLevel:100,amount:1,itemID:1826},
  539. {minLevel:120,amount:1,itemID:2441},
  540. {minLevel:151,amount:4,itemID:52965},
  541. {minLevel:151,amount:1,itemID:52935},
  542. {minLevel:151,amount:1,itemID:52952},
  543. {minLevel:151,amount:2,itemID:52945},
  544. {minLevel:151,amount:1,itemID:52938},
  545. {minLevel:151,amount:5,itemID:52951},
  546. {minLevel:151,amount:1,itemID:52933},
  547. {minLevel:151,amount:3,itemID:52963},
  548. ],
  549. daily: {
  550. sunday: [
  551. {minLevel:13,maxLevel:47,amount:1,itemID:716},
  552. {minLevel:15,maxLevel:43,amount:1,itemID:742},
  553. {minLevel:17,maxLevel:51,amount:1,itemID:720},
  554. {minLevel:37,maxLevel:80,amount:1,itemID:792},
  555. {minLevel:48,maxLevel:80,amount:1,itemID:719},
  556. {minLevel:52,maxLevel:69,amount:1,itemID:768},
  557. {minLevel:81,amount:1,itemID:1708},
  558. {minLevel:81,amount:1,itemID:751},
  559. {minLevel:120,amount:5,itemID:2447},
  560. {minLevel:120,amount:1,itemID:2430},
  561. {minLevel:151,maxLevel:199,amount:5,itemID:52949},
  562. {minLevel:151,maxLevel:199,amount:1,itemID:52937},
  563. {minLevel:200,amount:1,itemID:52960},
  564. {minLevel:200,amount:2,itemID:52970},
  565. ],
  566. monday: [
  567. {minLevel:3,maxLevel:46,amount:1,itemID:702},
  568. {minLevel:26,maxLevel:40,amount:1,itemID:761},
  569. {minLevel:27,maxLevel:36,amount:1,itemID:760},
  570. {minLevel:38,maxLevel:64,amount:1,itemID:792},
  571. {minLevel:65,amount:1,itemID:1814},
  572. {minLevel:71,amount:1,itemID:780},
  573. {minLevel:120,amount:1,itemID:2444},
  574. {minLevel:151,maxLevel:199,amount:2,itemID:52942},
  575. {minLevel:151,maxLevel:199,amount:2,itemID:52936},
  576. {minLevel:200,amount:1,itemID:52969},
  577. {minLevel:200,amount:2,itemID:52972},
  578. ],
  579. tuesday: [
  580. {minLevel:11,maxLevel:57,amount:1,itemID:766},
  581. {minLevel:45,maxLevel:80,amount:1,itemID:778},
  582. {minLevel:81,amount:1,itemID:1818},
  583. {minLevel:81,amount:1,itemID:756},
  584. {minLevel:120,amount:5,itemID:2456},
  585. {minLevel:120,amount:2,itemID:2450},
  586. {minLevel:151,maxLevel:199,amount:2,itemID:52947},
  587. {minLevel:151,maxLevel:199,amount:1,itemID:52941},
  588. {minLevel:200,amount:6,itemID:52962},
  589. {minLevel:200,amount:1,itemID:52956},
  590. ],
  591. wednesday: [
  592. {minLevel:4,maxLevel:67,amount:1,itemID:700},
  593. {minLevel:15,maxLevel:49,amount:1,itemID:791},
  594. {minLevel:18,maxLevel:49,amount:1,itemID:767},
  595. {minLevel:48,maxLevel:79,amount:1,itemID:1812},
  596. {minLevel:120,amount:1,itemID:2434},
  597. {minLevel:120,amount:1,itemID:2449},
  598. {minLevel:151,maxLevel:199,amount:1,itemID:52939},
  599. {minLevel:151,maxLevel:199,amount:3,itemID:52950},
  600. {minLevel:200,amount:2,itemID:52971},
  601. {minLevel:200,amount:7,itemID:52975},
  602. ],
  603. thursday: [
  604. {minLevel:8,maxLevel:56,amount:1,itemID:708},
  605. {minLevel:28,maxLevel:58,amount:1,itemID:759},
  606. {minLevel:59,maxLevel:74,amount:1,itemID:752},
  607. {minLevel:63,maxLevel:87,amount:1,itemID:1708},
  608. {minLevel:75,amount:1,itemID:730},
  609. {minLevel:120,amount:3,itemID:2433},
  610. {minLevel:151,maxLevel:199,amount:5,itemID:52953},
  611. {minLevel:151,maxLevel:199,amount:1,itemID:52943},
  612. {minLevel:200,amount:3,itemID:52966},
  613. {minLevel:200,amount:1,itemID:52961},
  614. ],
  615. friday: [
  616. {minLevel:3,maxLevel:61,amount:1,itemID:705},
  617. {minLevel:21,maxLevel:42,amount:1,itemID:715},
  618. {minLevel:42,maxLevel:75,amount:1,itemID:1811},
  619. {minLevel:62,maxLevel:88,amount:1,itemID:794},
  620. {minLevel:89,amount:1,itemID:1824},
  621. {minLevel:120,amount:1,itemID:2451},
  622. {minLevel:120,amount:2,itemID:2453},
  623. {minLevel:151,maxLevel:199,amount:2,itemID:52940},
  624. {minLevel:151,maxLevel:199,amount:2,itemID:52955},
  625. {minLevel:200,amount:1,itemID:52973},
  626. {minLevel:200,amount:10,itemID:52959},
  627. ],
  628. saturday: [
  629. {minLevel:5,maxLevel:41,amount:1,itemID:707},
  630. {minLevel:5,maxLevel:51,amount:1,itemID:1807},
  631. {minLevel:35,maxLevel:53,amount:1,itemID:737},
  632. {minLevel:42,maxLevel:75,amount:1,itemID:725},
  633. {minLevel:52,maxLevel:77,amount:1,itemID:768},
  634. {minLevel:76,amount:1,itemID:1756},
  635. {minLevel:78,amount:1,itemID:1819},
  636. {minLevel:79,amount:1,itemID:764},
  637. {minLevel:81,amount:1,itemID:794},
  638. {minLevel:120,amount:5,itemID:2435},
  639. {minLevel:151,maxLevel:199,amount:1,itemID:52948},
  640. {minLevel:151,maxLevel:199,amount:1,itemID:52934},
  641. {minLevel:200,amount:3,itemID:52974},
  642. {minLevel:200,amount:10,itemID:52958},
  643. ],
  644. },
  645. others: [
  646. {minLevel: 10, amount: 15, itemID: 2160},
  647. {minLevel: 10, amount: 15, itemID: 2161},
  648. {minLevel: 10, amount: 15, itemID: 2162},
  649. {minLevel: 10, amount: 15, itemID: 2163},
  650.  
  651. {minLevel: 20, amount: 1, profession: 1, itemID: 1940},
  652. {minLevel: 20, amount: 1, profession: 1, itemID: 1871},
  653. {minLevel: 20, amount: 1, profession: 1, itemID: 1879},
  654.  
  655. {minLevel: 20, amount: 1, profession: 2, itemID: 1939},
  656. {minLevel: 20, amount: 1, profession: 2, itemID: 1890},
  657. {minLevel: 20, amount: 1, profession: 2, itemID: 1898},
  658.  
  659. {minLevel: 20, amount: 1, profession: 3, itemID: 1938},
  660. {minLevel: 20, amount: 1, profession: 3, itemID: 1910},
  661. {minLevel: 20, amount: 1, profession: 3, itemID: 1916},
  662.  
  663. {minLevel: 20, amount: 1, profession: 4, itemID: 1937},
  664. {minLevel: 20, amount: 1, profession: 4, itemID: 1928},
  665. {minLevel: 20, amount: 1, profession: 4, itemID: 1934},
  666. ],
  667. init: function () {
  668. var menuContainer = $('<div class="menulink" onclick="WTK.DailyItemHelper.showDailyItems();" title="' + WTKlang.showDailyItems + '" />').css('background-image', 'url(' + WTK.Images.menudailyitems + ')').css('background-position', '0px 0px').on('mouseenter', function () {
  669. $(this).css('background-position', '-25px 0px');
  670. }).on('mouseleave', function () {
  671. $(this).css('background-position', '0px 0px');
  672. });
  673. $('#ui_menubar').append($('<div id="WTK_menubutton_DailyItemHelper" class="ui_menucontainer" />').append(menuContainer).append('<div class="menucontainer_bottom" />'));
  674. },
  675. baseIdDone: 0,
  676. getQuestsFromArray: function(questArray) {
  677. var text = '';
  678. for (var quest of questArray) {
  679. if (!this.baseIdDone)
  680. quest.itemID *= 1000;
  681. if(!quest.profession || quest.profession == Character.professionId) {
  682. if(quest.minLevel <= Character.level && (!quest.maxLevel || Character.level <= quest.maxLevel)){
  683. var color = 'black';
  684. if(Bag.getItemCount(quest.itemID) < quest.amount){
  685. color = 'red';
  686. }
  687. text += '<span style="color: ' + color + '";>' + ItemManager.get(quest.itemID).name + ' ' +Bag.getItemCount(quest.itemID) + '/' + quest.amount + '</span><br>';
  688. }
  689. }
  690. }
  691. return text;
  692. },
  693.  
  694. showDailyItems: function() {
  695. WTK.GUI.open();
  696. WTK.GUI.getDefault('WTKDailyItemsTab');
  697. var scrollPane = new west.gui.Scrollpane();
  698. scrollPane.appendContent('<div style="float: left; padding: 10px 30px 5px 5px;"><b>'+WTKlang.saloon + ':</b><br>'+WTK.DailyItemHelper.getQuestsFromArray(WTK.DailyItemHelper.others)+'</div>');
  699. scrollPane.appendContent('<div style="float: left; padding: 10px 30px 5px 5px;"><b>'+WTKlang.indianVillage + ':</b><br>'+WTK.DailyItemHelper.getQuestsFromArray(WTK.DailyItemHelper.indianVillage)+'</div>');
  700. scrollPane.appendContent('<div style="float: left; padding: 10px 30px 5px 5px;"><b>'+WTKlang.ghostTown + ':</b><br>'+WTK.DailyItemHelper.getQuestsFromArray(WTK.DailyItemHelper.ghostTown)+'</div>');
  701. scrollPane.appendContent('<div style="clear:both"></div>');
  702. scrollPane.appendContent('<div style="float: left; padding: 10px 30px 5px 5px;"><b>'+WTKlang.monday + ':</b><br>'+WTK.DailyItemHelper.getQuestsFromArray(WTK.DailyItemHelper.daily.monday)+'</div>');
  703. scrollPane.appendContent('<div style="float: left; padding: 10px 30px 5px 5px;"><b>'+WTKlang.tuesday + ':</b><br>'+WTK.DailyItemHelper.getQuestsFromArray(WTK.DailyItemHelper.daily.tuesday)+'</div>');
  704. scrollPane.appendContent('<div style="float: left; padding: 10px 30px 5px 5px;"><b>'+WTKlang.wednesday + ':</b><br>'+WTK.DailyItemHelper.getQuestsFromArray(WTK.DailyItemHelper.daily.wednesday)+'</div>');
  705. scrollPane.appendContent('<div style="float: left; padding: 10px 30px 5px 5px;"><b>'+WTKlang.thursday + ':</b><br>'+WTK.DailyItemHelper.getQuestsFromArray(WTK.DailyItemHelper.daily.thursday)+'</div>');
  706. scrollPane.appendContent('<div style="float: left; padding: 10px 30px 5px 5px;"><b>'+WTKlang.friday + ':</b><br>'+WTK.DailyItemHelper.getQuestsFromArray(WTK.DailyItemHelper.daily.friday)+'</div>');
  707. scrollPane.appendContent('<div style="float: left; padding: 10px 30px 5px 5px;"><b>'+WTKlang.saturday + ':</b><br>'+WTK.DailyItemHelper.getQuestsFromArray(WTK.DailyItemHelper.daily.saturday)+'</div>');
  708. scrollPane.appendContent('<div style="float: left; padding: 10px 30px 5px 5px;"><b>'+WTKlang.sunday + ':</b><br>'+WTK.DailyItemHelper.getQuestsFromArray(WTK.DailyItemHelper.daily.sunday)+'</div>');
  709. scrollPane.appendContent('<div style="clear:both"></div>');
  710. $(WTK.GUI.window.getContentPane()).append(scrollPane.getMainDiv());
  711. WTK.DailyItemHelper.baseIdDone = 1;
  712. },
  713. };
  714.  
  715. WTK.AdventureBlockPlayer = {
  716. blockedUsers: [],
  717.  
  718. init: function () {
  719. Chat.Formatter.backup_formatMessage = Chat.Formatter.formatMessage;
  720. Chat.Formatter.formatMessage = function (msg, from, time, highlight, classNames) {
  721. classNames = classNames || '';
  722. var newDiv = $('<div></div>');
  723. newDiv.html(from);
  724. var short_name = $('.client_name', newDiv).text();
  725. if(WTK.AdventureBlockPlayer.blockedUsers.includes(short_name)){
  726. return;
  727. } else {
  728. return["<table cellpadding='0' cellspacing='0' class='" + classNames + "'>", "<tr>", "<td style='white-space: nowrap;' class='chat_info'>", "<span class='chat_time'>[" + Chat.Formatter.formatTime(time) + "]</span>", "<span class='chat_from'>" + from + "</span>", "&nbsp;", "</td>", "<td class='chat_text " + (highlight ? "chat_highlight" : "") + "'>", msg, "</td>", "</tr>", "</table>"].join("");
  729. }
  730. };
  731.  
  732. ChatWindow.Client.backup_onClick = ChatWindow.Client.onClick;
  733. ChatWindow.Client.onClick = function (args, id) {
  734.  
  735. var client = Chat.Resource.Manager.getClient(id), isOnline;
  736. if (!client || client.myself)return;
  737. isOnline = Chat.Resource.Client.STATUS_OFFLINE != client.statusId;
  738. if (client.mpi) {
  739. var onAction = function (id) {
  740. switch (id) {
  741. case 0:
  742. Suggestion.showPopup('mpi', client.pname, client.id);
  743. break;
  744. case 1:
  745. if (WTK.AdventureBlockPlayer.blockedUsers.includes(client.pname)) {
  746.  
  747. WTK.AdventureBlockPlayer.blockedUsers = jQuery.grep(WTK.AdventureBlockPlayer.blockedUsers, function(value) {
  748. return value != client.pname;
  749. });
  750. MessageSuccess(client.pname + ' ' + WTKlang.willNotBeIgnored).show();
  751. }
  752. else {
  753. WTK.AdventureBlockPlayer.blockedUsers.push(client.pname);
  754. localStorage.setItem('WTKAdventureBlockedPlayers', JSON.stringify(WTK.AdventureBlockPlayer.blockedUsers));
  755. MessageSuccess(client.pname + ' ' + WTKlang.willBeIgnored).show();
  756. }
  757. break;
  758. }
  759. };
  760. var selectbox = new west.gui.Selectbox().setHeader(client.pname).addItem(0, WTKlang.reportOffense).addItem(1, WTK.AdventureBlockPlayer.blockedUsers.includes(client.pname) ? WTKlang.dontIgnore : WTKlang.ignore).addListener(onAction).show(args[0]);
  761. }
  762. else {
  763. ChatWindow.Client.backup_onClick.call(this, args, id);
  764. }
  765.  
  766. };
  767.  
  768. var savedBlockedUsers = JSON.parse(localStorage.getItem('WTKAdventureBlockedPlayers'));
  769. if(savedBlockedUsers != null){
  770. WTK.AdventureBlockPlayer.blockedUsers = savedBlockedUsers;
  771. }
  772. },
  773.  
  774.  
  775. };
  776.  
  777. WTK.ChurchLevels = {
  778. init: function () {
  779. BuildWindow.updateLaborPoints_backup = BuildWindow.updateLaborPoints;
  780. BuildWindow.updateLaborPoints = function (points) {
  781. BuildWindow.updateLaborPoints_backup.call(this, points);
  782. if(this.building == 'church' && points > 0) {
  783. var stageCount = Math.floor(this.window.$("div.build_progress_nfo > span.text_bold").text()/15);
  784. this.window.$("div.build_progress_nfo").append(' (' + (stageCount >= 0 ? '+' : '') + stageCount + ' ' + WTKlang.churchLevels + ')');
  785. }
  786. };
  787. },
  788. };
  789.  
  790. WTK.FormattedRankings = {
  791. init: function () {
  792. RankingWindow.Cities.updateTable_backup = RankingWindow.Cities.updateTable;
  793. RankingWindow.Cities.updateTable = function (be_data) {
  794. RankingWindow.Cities.updateTable_backup.call(this, be_data);
  795. var elementsLength = $('.town_points_sum:not(div.cell.cell_2)').length;
  796. for(var i = 0; i < elementsLength; i++){
  797. $('.town_points_sum:not(div.cell.cell_2)')[i].innerText = format_number($('.town_points_sum:not(div.cell.cell_2)')[i].innerText);
  798. if(i != 0){
  799. $('.town_points_sum:not(div.cell.cell_2)')[i].title = format_number(deformat_number($('.town_points_sum:not(div.cell.cell_2)')[i].innerText)-deformat_number($('.town_points_sum:not(div.cell.cell_2)')[i-1].innerText));
  800. }
  801. $('.town_points:not(div.cell.cell_3)')[i].innerText = format_number($('.town_points:not(div.cell.cell_3)')[i].innerText);
  802. if(i != 0){
  803. $('.town_points:not(div.cell.cell_3)')[i].title = format_number(deformat_number($('.town_points:not(div.cell.cell_3)')[i].innerText)-deformat_number($('.town_points:not(div.cell.cell_3)')[i-1].innerText));
  804. }
  805. $('.town_fort_points:not(div.cell.cell_4)')[i].innerText = format_number($('.town_fort_points:not(div.cell.cell_4)')[i].innerText);
  806. $('.town_member_points:not(div.cell.cell_5)')[i].innerText = format_number($('.town_member_points:not(div.cell.cell_5)')[i].innerText);
  807. $('.town_duel_points:not(div.cell.cell_6)')[i].innerText = format_number($('.town_duel_points:not(div.cell.cell_6)')[i].innerText);
  808. }
  809. };
  810.  
  811. RankingWindow.Duels.updateTable_backup = RankingWindow.Duels.updateTable;
  812. RankingWindow.Duels.updateTable = function (be_data) {
  813. RankingWindow.Duels.updateTable_backup.call(this, be_data);
  814. var elementsLength = $('.duel_exp:not(div.cell.cell_2)').length;
  815. for(var i = 0; i < elementsLength; i++){
  816. $('.duel_exp:not(div.cell.cell_2)')[i].innerText = format_number($('.duel_exp:not(div.cell.cell_2)')[i].innerText);
  817. if(i != 0){
  818. $('.duel_exp:not(div.cell.cell_2)')[i].title = format_number(deformat_number($('.duel_exp:not(div.cell.cell_2)')[i].innerText)-deformat_number($('.duel_exp:not(div.cell.cell_2)')[i-1].innerText));
  819. }
  820. $('.duel_win:not(div.cell.cell_3)')[i].innerText = format_number($('.duel_win:not(div.cell.cell_3)')[i].innerText);
  821. $('.duel_loss:not(div.cell.cell_4)')[i].innerText = format_number($('.duel_loss:not(div.cell.cell_4)')[i].innerText);
  822. $('.duel_diff:not(div.cell.cell_5)')[i].innerText = format_number($('.duel_diff:not(div.cell.cell_5)')[i].innerText);
  823. }
  824. };
  825.  
  826. RankingWindow.Experience.updateTable_backup = RankingWindow.Experience.updateTable;
  827. RankingWindow.Experience.updateTable = function (be_data) {
  828. RankingWindow.Experience.updateTable_backup.call(this, be_data);
  829. var elementsLength = $('.exp_exp:not(div.cell.cell_3)').length;
  830. for(var i = 0; i < elementsLength; i++){
  831. $('.exp_exp:not(div.cell.cell_3)')[i].innerText = format_number($('.exp_exp:not(div.cell.cell_3)')[i].innerText);
  832. if(i != 0){
  833. $('.exp_exp:not(div.cell.cell_3)')[i].title = format_number(deformat_number($('.exp_exp:not(div.cell.cell_3)')[i].innerText)-deformat_number($('.exp_exp:not(div.cell.cell_3)')[i-1].innerText));
  834. }
  835. }
  836. };
  837.  
  838. RankingWindow.FortBattles.updateTable_backup = RankingWindow.FortBattles.updateTable;
  839. RankingWindow.FortBattles.updateTable = function (be_data) {
  840. RankingWindow.FortBattles.updateTable_backup.call(this, be_data);
  841. var elementsLength = $('.forts_score:not(div.cell.cell_2)').length;
  842. for(var i = 0; i < elementsLength; i++){
  843. $('.forts_score:not(div.cell.cell_2)')[i].innerText = format_number($('.forts_score:not(div.cell.cell_2)')[i].innerText);
  844. if(i != 0){
  845. $('.forts_score:not(div.cell.cell_2)')[i].title = format_number(deformat_number($('.forts_score:not(div.cell.cell_2)')[i].innerText)-deformat_number($('.forts_score:not(div.cell.cell_2)')[i-1].innerText));
  846. }
  847. $('.forts_damage_dealt:not(div.cell.cell_3)')[i].innerText = format_number($('.forts_damage_dealt:not(div.cell.cell_3)')[i].innerText);
  848. $('.forts_hits_taken:not(div.cell.cell_4)')[i].innerText = format_number($('.forts_hits_taken:not(div.cell.cell_4)')[i].innerText);
  849. $('.forts_dodges:not(div.cell.cell_5)')[i].innerText = format_number($('.forts_dodges:not(div.cell.cell_5)')[i].innerText);
  850. }
  851. };
  852.  
  853. RankingWindow.Crafting.updateTable_backup = RankingWindow.Crafting.updateTable;
  854. RankingWindow.Crafting.updateTable = function (be_data) {
  855. RankingWindow.Crafting.updateTable_backup.call(this, be_data);
  856. var elementsLength = $('.craft_score:not(div.cell.cell_2)').length;
  857. for(var i = 0; i < elementsLength; i++){
  858. $('.craft_score:not(div.cell.cell_2)')[i].innerText = format_number($('.craft_score:not(div.cell.cell_2)')[i].innerText);
  859. $('.craft_items_created:not(div.cell.cell_3)')[i].innerText = format_number($('.craft_items_created:not(div.cell.cell_3)')[i].innerText);
  860. }
  861. };
  862. },
  863. };
  864.  
  865. WTK.WindowPin = {
  866. newPos: {left: -1, top: -1,},
  867. saveMousPos: function (event) {
  868. WTK.WindowPin.newPos = {left: event.clientX, top: event.clientY,};
  869. localStorage.setItem('WTKPinPosition', JSON.stringify(WTK.WindowPin.newPos));
  870. document.removeEventListener("click", WTK.WindowPin.saveMousPos);
  871. $('body').removeClass('WTK_overlay');
  872. },
  873. getNewPinPosition: function () {
  874. var styling = $('<style></style>').text('.WTK_overlay { background-image: none; opacity:0.2; background-color:#000; position:fixed; width:100%; height:100%; top:0px; left:0px; z-index:1000;}');
  875. $('head').append(styling);
  876. $('body').addClass('WTK_overlay');
  877. setTimeout((function () {
  878. document.addEventListener("click", WTK.WindowPin.saveMousPos);
  879. }), 100);
  880.  
  881. },
  882. init: function () {
  883. var tempPos = JSON.parse(localStorage.getItem('WTKPinPosition'));
  884. if(tempPos != null && tempPos.left >= 0 && tempPos.top >= 0){
  885. WTK.WindowPin.newPos = tempPos;
  886.  
  887. Inventory.dock = function (dockedWindow) {
  888. Inventory.window.center = function () {
  889. var max_window_size_difference = 100;
  890. var $inventory = $('#windows .inventory'),
  891. $docklet = $(dockedWindow.divMain),
  892. offset_left,
  893. offset_top,
  894. inventory_position = {},
  895. docklet_position = {};
  896. offset_left = ($(document).outerWidth() - $inventory.outerWidth() - $docklet.outerWidth()) >> 1;
  897. if (offset_left < 0) {
  898. inventory_position.left = $(document).outerWidth() - $inventory.outerWidth() + 7;
  899. docklet_position.left = 0;
  900. } else {
  901. inventory_position.left = WTK.WindowPin.newPos.left + $docklet.outerWidth() - 13;
  902. docklet_position.left = WTK.WindowPin.newPos.left;
  903. }
  904. inventory_position.top = ($(document).outerHeight() - $inventory.outerHeight()) >> 1;
  905. if ($docklet.outerHeight() < ($inventory.outerHeight() + max_window_size_difference)) {
  906. offset_top = Math.min(($(document).outerHeight() - $docklet.outerHeight()) >> 1, ($(document).outerHeight() - $inventory.outerHeight()) >> 1);
  907. inventory_position.top = docklet_position.top = WTK.WindowPin.newPos.top;
  908. } else {
  909. docklet_position.top = ($(document).outerHeight() - $docklet.outerHeight()) >> 1;
  910. }
  911. $docklet.css({
  912. left: docklet_position.left + 'px',
  913. top: docklet_position.top + 'px'
  914. });
  915. $inventory.css({
  916. left: inventory_position.left + 'px',
  917. top: inventory_position.top + 'px'
  918. });
  919. };
  920. if (Inventory.dockedWindow) {
  921. Inventory.undock();
  922. }
  923. Inventory.dockedWindow = dockedWindow;
  924. Inventory.window.addClass('docked_' + dockedWindow.id);
  925. Inventory.window.addClass('focused_' + dockedWindow.id);
  926. EventHandler.listen("window_closed_" + dockedWindow.id, Inventory.undock, Inventory);
  927. Inventory.window.center();
  928. };
  929.  
  930. $.fn.center = function (x, y, relative) {
  931. var p = this.position();
  932. if (!relative)
  933. relative = $(window);
  934. if (x !== false) {
  935. var w = this.outerWidth();
  936. var sw = relative.outerWidth();
  937. this.first().css('left', (WTK.WindowPin.newPos.left-20) + "px");
  938. }
  939. if (y !== false) {
  940. var h = this.outerHeight();
  941. var sh = relative.outerHeight();
  942. this.first().css('top', (WTK.WindowPin.newPos.top-20) + "px");
  943. }
  944. return this;
  945. };
  946. }
  947. },
  948. setNewPos: function(){
  949.  
  950. },
  951. };
  952.  
  953. WTK.ShowFort = {
  954. init: function () {
  955. ReportWindow.init_content_backup = ReportWindow.init_content;
  956. ReportWindow.init_content = function (data){
  957. ReportWindow.init_content_backup.call(this, data);
  958. if(data.reportType == 'fortbattle' && data.reportInfo.subtype == 'declare'){
  959. WTK.ShowFort.getFortID(data.reportInfo.fortname, data.report_id);
  960. }
  961. };
  962. },
  963.  
  964. getFortID: function (fortName, report_id) {
  965. Ajax.remoteCall('fort_overview', 'search_fort', {
  966. fortNames: fortName
  967. }, function (json) {
  968. if (!json.error) {
  969. if (json["0"]) {
  970. for (var fo in json) {
  971. if(json[fo].name == fortName){
  972. $('#rp_report-'+report_id+' .fort_muster a:first-child').replaceWith('<a href="javascript:void(FortWindow.open('+json[fo].fort_id+', '+json[fo].fort_x+', '+json[fo].fort_y+'));">'+json[fo].name+'</a>');
  973. }
  974. }
  975. }
  976. }
  977. });
  978. },
  979. };
  980.  
  981. WTK.BuildingProgress = {
  982. init: function () {
  983. BuildWindow.initInfo_backup = BuildWindow.initInfo;
  984. BuildWindow.initInfo = function (data) {
  985. BuildWindow.initInfo_backup.call(this, data);
  986. var tmp = $('<div class="rp_row_jobdata row_build_' + 'hammer' + '" title="' + WTKlang.progress.escapeHTML() + ':&nbsp;' + WTKlang.progressTooltip + '">' + '<span class="rp_jobdata_label_icon"><img src="https://westde.innogamescdn.com/images/icons/' + 'hammer' + '.png" alt="" /></span>' + '<span class="rp_jobdata_label text_bold">' + WTKlang.progress + '</span>' + '<span class="rp_jobdata_text text_bold"></span>' + '</div>');
  987. $('span.rp_jobdata_text', tmp).append(new west.gui.Progressbar(data.build_point, data.build_point_limit).getMainDiv());
  988. $('.build-'+data.x+'-'+data.y+'-'+ data.build_key +' div.build_info').append(tmp);
  989. };
  990. },
  991. };
  992.  
  993. WTK.ImprovedBuildCityhall = {
  994. init: function () {
  995. CityhallWindow.Build.fillContent_backup = CityhallWindow.Build.fillContent;
  996. CityhallWindow.Build.fillContent = function (data) {
  997. this.table.clearBody();
  998. for (var i = 0; i < data.length; i++) {
  999. var r = data[i];
  1000. var buildtext;
  1001. if (!this.main.ownTown){
  1002. this.table.appendRow();
  1003. buildtext = r.name;
  1004. this.table.appendToCell(-1, "building_foreign", buildtext).appendToCell(-1, "stage", r.stage + " / " + (r.infinite ? "<img src='https://westde.innogamescdn.com/images/xp_inf_000.png' style='padding-bottom: 4px;'/>" : r.maxStage));
  1005. } else if (r.stage == r.maxStage && !r.infinite) {
  1006.  
  1007. } else {
  1008. this.table.appendRow();
  1009. buildtext = '<a href="#" onClick="javascript:void(BuildWindow.open(' + Character.homeTown.town_id + ', ' + Character.homeTown.x + ', ' + Character.homeTown.y + ', \'' + r.key + '\', false));">' + r.name + '</a></span>';
  1010. this.table.appendToCell(-1, "building", buildtext).appendToCell(-1, "stage", r.stage + " / " + (r.infinite ? "<img src='https://westde.innogamescdn.com/images/xp_inf_000.png' style='padding-bottom: 4px;'/>" : r.maxStage)).appendToCell(-1, "progress", new west.gui.Progressbar(r.buildPoints, r.nextStagePoints).getMainDiv());
  1011. }
  1012. }
  1013. };
  1014. },
  1015. };
  1016.  
  1017. WTK.ExtendedItemFinder = {
  1018. itemsToFind: [],
  1019. searchResultDialog: null,
  1020. searchDialog: null,
  1021.  
  1022. init: function () {
  1023. var savedItemsToFindOriginal = JSON.parse(localStorage.getItem('WTKItemFinderItems'));
  1024. if(savedItemsToFindOriginal != null){
  1025. for (var i = 0; i < savedItemsToFindOriginal.length; i++) {
  1026. var item = {id: savedItemsToFindOriginal[i], targetAmount: 1, showNotification: true};
  1027. WTK.ExtendedItemFinder.itemsToFind.push(item);
  1028. }
  1029. localStorage.removeItem('WTKItemFinderItems');
  1030. localStorage.setItem('WTKExtendedItemFinderItems', JSON.stringify(WTK.ExtendedItemFinder.itemsToFind));
  1031. } else {
  1032. var savedItemsToFind = JSON.parse(localStorage.getItem('WTKExtendedItemFinderItems'));
  1033. if(savedItemsToFind != null){
  1034. WTK.ExtendedItemFinder.itemsToFind = savedItemsToFind;
  1035. }
  1036. }
  1037. WTK.ExtendedItemFinder.initFindNotification();
  1038. },
  1039.  
  1040. showExtendedItemFinder: function() {
  1041. WTK.GUI.open();
  1042. WTK.GUI.getDefault('WTKExtendedItemFinder');
  1043. var scrollPane = new west.gui.Scrollpane();
  1044.  
  1045. var itemSearchButton = new west.gui.Button(WTKlang.searchItem, function() {
  1046. WTK.ExtendedItemFinder.showSearchDialog();
  1047. });
  1048.  
  1049. var deleteButton = new west.gui.Button(WTKlang.deleteMarkedItems, function() {
  1050. WTK.ExtendedItemFinder.deleteSelectedItems();
  1051. }).addClass('inactive');
  1052.  
  1053. var helpButton = new west.gui.Button(WTKlang.help, function() {
  1054. WTK.ExtendedItemFinder.helpDialog = new west.gui.Dialog(WTKlang.help, $('<div>').append(WTKlang.itemFinderHelpContent)).addButton(WTKlang.back);
  1055. WTK.ExtendedItemFinder.helpDialog.show();
  1056. });
  1057. scrollPane.appendContent(itemSearchButton.getMainDiv());
  1058. scrollPane.appendContent(deleteButton.getMainDiv());
  1059. scrollPane.appendContent(helpButton.getMainDiv());
  1060.  
  1061. var itemsToFind = WTK.ExtendedItemFinder.itemsToFind;
  1062. var targetAmount = 1;
  1063. for (var i = 0; i < itemsToFind.length; i++) {
  1064. var itemId = itemsToFind[i].id;
  1065. var item = ItemManager.get(itemId);
  1066. var popup = new ItemPopup(item,{}).popup;
  1067. var div;
  1068. var classToSet = '';
  1069. if(itemsToFind[i].showNotification == true)
  1070. classToSet = 'WTK_find_notifcation_highlight';
  1071. if(Bag.getItemCount(itemId) >= itemsToFind[i].targetAmount){
  1072. div = $('<div>').append('<div class="item item_inventory hasMousePopup WTK_item_border_green" title="' + popup.getXHTML().escapeHTML() + '"><img class="tw_item item_inventory_img dnd_draggable" src="' + item.image + '" alt='+itemId+'>'+'<div class="' + classToSet + ' WTK_find_notifcation">'+ Bag.getItemCount(itemId) + ' / ' + itemsToFind[i].targetAmount +'</div>'+'<span class="count-required"><p/></span></div>');
  1073. } else {
  1074. div = $('<div>').append('<div class="item item_inventory hasMousePopup WTK_item_border" title="' + popup.getXHTML().escapeHTML() + '"><img class="tw_item item_inventory_img dnd_draggable" src="' + item.image + '" alt='+itemId+'>'+'<div class="' + classToSet + ' WTK_find_notifcation">' + Bag.getItemCount(itemId) + ' / ' + itemsToFind[i].targetAmount +'</div>'+'<span class="count-required"><p/></span></div>');
  1075. }
  1076. div.children("div").children("div").off("click").click(function () {
  1077. $(this).toggleClass("WTK_find_notifcation_highlight");
  1078. WTK.ExtendedItemFinder.toogleNotification($(this).parent().find("img").attr("alt"));
  1079. });
  1080. div.find("img").off("click").click(function () {
  1081. $(this).parent().parent().toggleClass("opacity05");
  1082. if($('.active_tab_id_WTKExtendedItemFinder').find('.opacity05').length == 0){
  1083. $('.WTKMenuWindow').find($('.tw2gui_button')).last().prev().addClass('inactive');
  1084. } else {
  1085. $('.WTKMenuWindow').find($('.tw2gui_button')).last().prev().removeClass('inactive');
  1086. }
  1087. });
  1088. scrollPane.appendContent(div);
  1089. }
  1090. var placeHolder = '';
  1091. // for (var i = 0; i <= (itemsToFind.length - itemsToFind.length % 10) / 10; i++) {
  1092. // placeHolder += '<div style="height: 64px;" ondrop="WTK.ExtendedItemFinder.dropItem(event)" ondragover="WTK.ExtendedItemFinder.allowDrop(event)"/>';
  1093. // }
  1094. placeHolder = '<div style="height: ' + 66 * Math.ceil(itemsToFind.length / 10) + 'px;" />';
  1095.  
  1096. scrollPane.appendContent(placeHolder);
  1097. $(WTK.GUI.window.getContentPane()).append(scrollPane.getMainDiv());
  1098. $('.WTKMenuWindow').find($('.tw2gui_button')).first().css('margin-bottom', '5px');
  1099. },
  1100.  
  1101. deleteSelectedItems: function(){
  1102. var selectedItems = $('.active_tab_id_WTKExtendedItemFinder').find('.opacity05');
  1103. for (var i = 0; i < selectedItems.length; i++) {
  1104. var id = selectedItems[i].childNodes[0].childNodes[0].alt;
  1105. WTK.ExtendedItemFinder.itemsToFind = jQuery.grep(WTK.ExtendedItemFinder.itemsToFind, function(value) {
  1106. return value.id != id;
  1107. });
  1108. }
  1109. localStorage.setItem('WTKExtendedItemFinderItems', JSON.stringify(WTK.ExtendedItemFinder.itemsToFind));
  1110. WTK.ExtendedItemFinder.showExtendedItemFinder();
  1111. },
  1112.  
  1113. toogleNotification: function(item_id){
  1114. WTK.ExtendedItemFinder.itemsToFind
  1115. for (var i = 0; i < WTK.ExtendedItemFinder.itemsToFind.length; i++) {
  1116. var entry = WTK.ExtendedItemFinder.itemsToFind[i];
  1117. if (entry.id == item_id) {
  1118. entry.showNotification = ! entry.showNotification;
  1119. WTK.ExtendedItemFinder.itemsToFind[i] = entry;
  1120. localStorage.setItem('WTKExtendedItemFinderItems', JSON.stringify(WTK.ExtendedItemFinder.itemsToFind));
  1121. }
  1122. }
  1123. },
  1124.  
  1125. searchForItems: function(){
  1126. var name = $('#WTKExtendedItemFinder_searchDialog_name').val();
  1127. var amount = parseInt($('#WTKExtendedItemFinder_searchDialog_targetAmount').val());
  1128. var searchResult = [];
  1129. var searchMaximum = Math.floor(($( window ).height() - 230) / 16);
  1130. for(var oldItemId = 1; oldItemId < 253801 && searchResult.length < searchMaximum; oldItemId++){
  1131. var newItemId = oldItemId * 1000;
  1132. if(ItemManager.get(newItemId) != undefined && ItemManager.get(newItemId).name.toLowerCase().indexOf(name.toLowerCase()) >= 0 && WTK.ExtendedItemFinder.isAlreadyOnTheList(newItemId) == false){
  1133. searchResult.push(newItemId);
  1134. }
  1135. }
  1136. if(searchResult.length > 0){
  1137. var contentDiv = "";
  1138. for (var i = 0; i < searchResult.length; i++) {
  1139. var item_id = searchResult[i];
  1140. var item = ItemManager.get(item_id);
  1141. var popup = new ItemPopup(item,{}).popup;
  1142. contentDiv += '<a class="hasMousePopup" title="' + popup.getXHTML().escapeHTML() + '" href="javascript:void(WTK.ExtendedItemFinder.addItemToItemsToSearch(' + item_id + ',' + amount + '))">' + item.name + '</a> ' + WTK.ExtendedItemFinder.getColoredString(Bag.getItemCount(item.item_id), amount) + '<br>';
  1143. }
  1144. if(searchResult.length == searchMaximum){
  1145. contentDiv += '<br><b>' + WTKlang.thereAreMoreItems + '<br>' + WTKlang.restrictYourSearch + '</b>';
  1146. }
  1147. new west.gui.Dialog(WTKlang.searchResult, $(contentDiv)).addButton(WTKlang.back, function(){
  1148. WTK.ExtendedItemFinder.showSearchDialog(name, amount);
  1149. }).addButton('cancel').show();
  1150. } else {
  1151. MessageHint(WTKlang.emptySearchResult).show();
  1152. }
  1153. },
  1154.  
  1155. inputIsValid: function(){
  1156. var targetAmount = parseInt($('#WTKExtendedItemFinder_searchDialog_targetAmount').val());
  1157. var name = $('#WTKExtendedItemFinder_searchDialog_name').val();
  1158. if (name == undefined || name.length <= 0){
  1159. MessageError(WTKlang.nameCannotBeEmpty).show();
  1160. return false;
  1161. } else if (targetAmount == undefined || Number.isNaN(targetAmount) || targetAmount <= 0) {
  1162. MessageError(WTKlang.itemAmountMustBeHigherThan0).show();
  1163. return false;
  1164. }
  1165. return true;
  1166. },
  1167.  
  1168. addItemToItemsToSearch: function(item_id, targetAmountValue) {
  1169. if(WTK.ExtendedItemFinder.isAlreadyOnTheList(item_id) == false){
  1170. var item = {id: item_id, targetAmount: targetAmountValue, showNotification: false};
  1171. WTK.ExtendedItemFinder.itemsToFind.push(item);
  1172. localStorage.setItem('WTKExtendedItemFinderItems', JSON.stringify(WTK.ExtendedItemFinder.itemsToFind));
  1173. WTK.ExtendedItemFinder.showExtendedItemFinder();
  1174. }
  1175. },
  1176.  
  1177. showSearchDialog: function(nameInputValue, targetAmoundInputValue) {
  1178. var contentDiv = $('<div style="text-align: center;">');
  1179. contentDiv.append(WTKlang.whatItemsWouldYouLikeToSearchFor + '<br><b>' + WTKlang.nameOfTheItem + '<b>');
  1180. var nameInput = new west.gui.Textfield('WTKExtendedItemFinder_searchDialog_name').setSize(10).setClass4Input('input_layout');
  1181. nameInput.setValue(nameInputValue)
  1182. contentDiv.append(nameInput.getMainDiv());
  1183. contentDiv.append('<br>' + WTKlang.howManyOfThemWouldYouLikeToCollect + '<br><b>' + WTKlang.numberOfItems + '<b>');
  1184. var targetAmoundInput = new west.gui.Textfield('WTKExtendedItemFinder_searchDialog_targetAmount').onlyNumeric().setSize(10).setClass4Input('input_layout');
  1185. targetAmoundInput.setValue(targetAmoundInputValue);
  1186. contentDiv.append(targetAmoundInput.getMainDiv());
  1187. WTK.ExtendedItemFinder.searchDialog = new west.gui.Dialog(WTKlang.searchItem, $(contentDiv)).addButton(WTKlang.search, function () {
  1188. if(WTK.ExtendedItemFinder.inputIsValid()){
  1189. WTK.ExtendedItemFinder.searchForItems();
  1190. } else {
  1191. WTK.ExtendedItemFinder.showSearchDialog($('#WTKExtendedItemFinder_searchDialog_name').val(), $('#WTKExtendedItemFinder_searchDialog_targetAmount').val());
  1192. }
  1193. }).addButton('cancel');
  1194. WTK.ExtendedItemFinder.searchDialog.show();
  1195. $('#WTKExtendedItemFinder_searchDialog_name').focus()
  1196. $('#WTKExtendedItemFinder_searchDialog_targetAmount').val(1);
  1197. },
  1198.  
  1199. isAlreadyOnTheList: function(item_id) {
  1200. for(var i = 0; i < WTK.ExtendedItemFinder.itemsToFind.length; i++){
  1201. if(WTK.ExtendedItemFinder.itemsToFind[i].id == item_id){
  1202. return true;
  1203. }
  1204. }
  1205. return false;
  1206. },
  1207.  
  1208. getColoredString: function(currentAmount, targetAmount) {
  1209. var color = targetAmount > currentAmount ? 'red' : 'green';
  1210. return '<span class="text_' + color + ' bold">' + currentAmount + '/' + targetAmount + '</span>';
  1211. },
  1212. initFindNotification: function() {
  1213. Bag.handleChanges_backup = Bag.handleChanges;
  1214. Bag.handleChanges = function (changes, from) {
  1215. var i = 0, l = changes.length, item;
  1216. for (i; i < l; i++) {
  1217. if (changes[i].count > 0 && WTK.ExtendedItemFinder.isAlreadyOnTheList(changes[i].item_id) && from != 'wear') {
  1218. var item2 = ItemManager.get(changes[i].item_id);
  1219. var popup = new ItemPopup(item2,{}).popup;
  1220. new west.gui.Dialog(WTKlang.itemFinder, '<div class="item item_inventory hasMousePopup" title="' + popup.getXHTML().escapeHTML() + '"><img class="tw_item item_inventory_img dnd_draggable" src="' + item2.image + '"></div>' + WTKlang.youHaveFound + '<br><br><div style="text-align: center;"><b>' + item2.name +'</b></div><br>').addButton('ok').setModal(true, false, {
  1221. bg : "https://westde.innogamescdn.com/images/curtain_bg.png", opacity : 0.7
  1222. }).setHeight('40px').show();
  1223. }
  1224. }
  1225. Bag.handleChanges_backup.call(this, changes, from);
  1226. }
  1227. },
  1228. isItemOnNotificationList: function(item_id) {
  1229. for(var i = 0; i < WTK.ExtendedItemFinder.itemsToFind.length; i++){
  1230. if(WTK.ExtendedItemFinder.itemsToFind[i].id == item_id && WTK.ExtendedItemFinder.itemsToFind[i].showNotification == true){
  1231. return true;
  1232. }
  1233. }
  1234. return false;
  1235. }
  1236. };
  1237.  
  1238. WTK.ExtendedBBCodes = {
  1239. init: function () {
  1240. Game.TextHandler.parse_backup = Game.TextHandler.parse;
  1241. Game.TextHandler.parse = function (text) {
  1242. text = WTK.ExtendedBBCodes.replaceColor(text);
  1243. text = WTK.ExtendedBBCodes.replaceSize(text);
  1244. text = WTK.ExtendedBBCodes.replaceImage(text);
  1245. return Game.TextHandler.parse_backup.call(this, text);
  1246. }
  1247. },
  1248. replaceColor: function (text) {
  1249. var resultArray = text.match(/\[color=[a-z]*\]/g);
  1250. if (resultArray != null) {
  1251. for (var i = 0; i <resultArray.length; i++) {
  1252. var color = resultArray[i].replace('[color=','').replace(']','');
  1253. text = text.replace(/\[color=[a-z]*\]/,'<span style="color:' + color + '">').replace(/\[\/color\]/,'</span>');
  1254. }
  1255. }
  1256. return text;
  1257. },
  1258. replaceSize: function (text) {
  1259. var resultArray = text.match(/\[size=[0-9]*\]/g);
  1260. if (resultArray != null) {
  1261. for (var i = 0; i <resultArray.length; i++) {
  1262. var size = resultArray[i].replace('[size=','').replace(']','');
  1263. text = text.replace(/\[size=[0-9]*\]/,'<span style="font-size:' + size + 'px">').replace(/\[\/size\]/,'</span>');
  1264. }
  1265. }
  1266. return text;
  1267. },
  1268. replaceImage: function (text) {
  1269. return text.replace(/\[img\]/g,'<img src="').replace(/\[\/img\]/g,'"/>');
  1270. },
  1271. };
  1272.  
  1273. WTK.Skript.init();
  1274. });