Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.37 KB | None | 0 0
  1.  
  2.  
  3. LocalizedGroups = LibStub ("AceAddon-3.0"):NewAddon ("LocalizedGroups", "AceConsole-3.0", "AceEvent-3.0", "AceTimer-3.0")
  4.  
  5. local LocalizedGroups = LocalizedGroups
  6.  
  7. local f = CreateFrame ("frame", nil, UIParent)
  8. f:RegisterEvent ("LFG_LIST_SEARCH_RESULTS_RECEIVED")
  9.  
  10. function LocalizedGroups:UpdateList()
  11. LFGListSearchPanel_UpdateResultList (LFGListFrame.SearchPanel)
  12. LFGListSearchPanel_UpdateResults (LFGListFrame.SearchPanel)
  13. end
  14.  
  15. f:SetScript ("OnEvent", function (self, event, ...)
  16. LocalizedGroups:ScheduleTimer ("UpdateList", 1)
  17. end)
  18.  
  19. --> no more global calls
  20. local strsplit = strsplit
  21. local select = select
  22. local hooksecurefunc = hooksecurefunc
  23.  
  24. --> BRAZIL
  25. function LocalizedGroups:InstallHookBR()
  26. hooksecurefunc ("LFGListSearchEntry_Update", function (self)
  27. local searchResultInfo1 = C_LFGList.GetSearchResultInfo(self.resultID)
  28. local LN1 = searchResultInfo1.leaderName
  29. local activityID1 = searchResultInfo1.activityID
  30.  
  31. if (LN1 and ( LN1:find ("Azralon") or LN1:find ("Nemesis") or LN1:find ("Gallywyx") or LN1:find ("Tol Barad") or LN1:find ("Goldrinn") or not select (2, strsplit ("-", LN1)))) then
  32. local activityName = C_LFGList.GetActivityInfo (activityID1)
  33.  
  34. self.ActivityName:SetText ("|cFFFFFF00[BR]|r " .. activityName)
  35. self.ActivityName:SetTextColor (0, 1, 0)
  36. end
  37. end)
  38. end
  39.  
  40. function LocalizedGroups:ReplaceSortFuncBR()
  41. LFGListUtil_SortSearchResultsCB = function (id1, id2)
  42.  
  43. local regionID = GetCurrentRegion()
  44.  
  45. --brazil realms are under US region which has ID 1
  46. if (regionID ~= 1) then
  47. return
  48. end
  49.  
  50. local searchResultInfo1 = C_LFGList.GetSearchResultInfo(id1)
  51. local searchResultInfo2 = C_LFGList.GetSearchResultInfo(id2)
  52.  
  53. local numBNetFriends1 = searchResultInfo1.numBNetFriends
  54. local numCharFriends1 = searchResultInfo1.numCharFriends
  55. local numGuildMates1 = searchResultInfo1.numGuildMates
  56. local LN1 = searchResultInfo1.leaderName
  57.  
  58. local numBNetFriends2 = searchResultInfo2.numBNetFriends
  59. local numCharFriends2 = searchResultInfo2.numCharFriends
  60. local numGuildMates2 = searchResultInfo2.numGuildMates
  61. local LN2 = searchResultInfo2.leaderName
  62.  
  63. if (LN1 and ( LN1:find ("Azralon") or LN1:find ("Nemesis") or LN1:find ("Gallywyx") or LN1:find ("Tol Barad") or LN1:find ("Goldrinn") or not select (2, strsplit ("-", LN1)))) then
  64. if (LN2 and ( LN2:find ("Azralon") or LN2:find ("Nemesis") or LN2:find ("Gallywyx") or LN2:find ("Tol Barad") or LN2:find ("Goldrinn") or not select (2, strsplit ("-", LN2)))) then
  65. if ( numBNetFriends1 ~= numBNetFriends2 ) then
  66. return numBNetFriends1 > numBNetFriends2
  67. end
  68.  
  69. if ( numCharFriends1 ~= numCharFriends2 ) then
  70. return numCharFriends1 > numCharFriends2
  71. end
  72.  
  73. if ( numGuildMates1 ~= numGuildMates2 ) then
  74. return numGuildMates1 > numGuildMates2
  75. end
  76.  
  77. return id1 < id2
  78. end
  79.  
  80. return true
  81. end
  82.  
  83. if (LN2 and ( LN2:find ("Azralon") or LN2:find ("Nemesis") or LN2:find ("Gallywyx") or LN2:find ("Tol Barad") or LN2:find ("Goldrinn") or not select (2, strsplit ("-", LN2)))) then
  84. return false
  85. end
  86.  
  87. --If one has more friends, do that one first
  88. if ( numBNetFriends1 ~= numBNetFriends2 ) then
  89. return numBNetFriends1 > numBNetFriends2
  90. end
  91.  
  92. if ( numCharFriends1 ~= numCharFriends2 ) then
  93. return numCharFriends1 > numCharFriends2
  94. end
  95.  
  96. if ( numGuildMates1 ~= numGuildMates2 ) then
  97. return numGuildMates1 > numGuildMates2
  98. end
  99.  
  100. --If we aren't sorting by anything else, just go by ID
  101. return id1 < id2
  102.  
  103. end
  104. end
  105.  
  106. --> LATIN
  107. function LocalizedGroups:InstallHookLA()
  108. hooksecurefunc ("LFGListSearchEntry_Update", function (self)
  109. local searchResultInfo1 = C_LFGList.GetSearchResultInfo(self.resultID)
  110. local LN1 = searchResultInfo1.leaderName
  111. local activityID1 = searchResultInfo1.activityID
  112.  
  113. if (LN1 and ( LN1:find ("Quel'Thalas") or LN1:find ("Drakkari") or LN1:find ("Ragnaros") or not select (2, strsplit ("-", LN1)))) then
  114. local activityName = C_LFGList.GetActivityInfo (activityID1)
  115.  
  116. self.ActivityName:SetText ("|cFFFFFF00[LA]|r " .. activityName)
  117. self.ActivityName:SetTextColor (0, 1, 0)
  118. end
  119. end)
  120. end
  121.  
  122. function LocalizedGroups:ReplaceSortFuncLA()
  123. LFGListUtil_SortSearchResultsCB = function (id1, id2)
  124.  
  125. local searchResultInfo1 = C_LFGList.GetSearchResultInfo(id1)
  126. local searchResultInfo2 = C_LFGList.GetSearchResultInfo(id2)
  127.  
  128. local numBNetFriends1 = searchResultInfo1.numBNetFriends
  129. local numCharFriends1 = searchResultInfo1.numCharFriends
  130. local numGuildMates1 = searchResultInfo1.numGuildMates
  131. local LN1 = searchResultInfo1.leaderName
  132.  
  133. local numBNetFriends2 = searchResultInfo2.numBNetFriends
  134. local numCharFriends2 = searchResultInfo2.numCharFriends
  135. local numGuildMates2 = searchResultInfo2.numGuildMates
  136. local LN2 = searchResultInfo2.leaderName
  137. local regionID = GetCurrentRegion()
  138.  
  139. --LA realms are under US region which has ID 1, avoid issues with europe server name
  140. if (regionID ~= 1) then
  141. return
  142. end
  143.  
  144. if (LN1 and ( LN1:find ("Quel'Thalas") or LN1:find ("Drakkari") or LN1:find ("Ragnaros") or not select (2, strsplit ("-", LN1)))) then
  145. if (LN2 and ( LN2:find ("Quel'Thalas") or LN2:find ("Drakkari") or LN2:find ("Ragnaros") or not select (2, strsplit ("-", LN2)))) then
  146. if ( numBNetFriends1 ~= numBNetFriends2 ) then
  147. return numBNetFriends1 > numBNetFriends2
  148. end
  149.  
  150. if ( numCharFriends1 ~= numCharFriends2 ) then
  151. return numCharFriends1 > numCharFriends2
  152. end
  153.  
  154. if ( numGuildMates1 ~= numGuildMates2 ) then
  155. return numGuildMates1 > numGuildMates2
  156. end
  157.  
  158. return id1 < id2
  159. end
  160.  
  161. return true
  162. end
  163.  
  164. if (LN2 and ( LN2:find ("Quel'Thalas") or LN2:find ("Drakkari") or LN2:find ("Ragnaros") or not select (2, strsplit ("-", LN2)))) then
  165. return false
  166. end
  167.  
  168. --If one has more friends, do that one first
  169. if ( numBNetFriends1 ~= numBNetFriends2 ) then
  170. return numBNetFriends1 > numBNetFriends2
  171. end
  172.  
  173. if ( numCharFriends1 ~= numCharFriends2 ) then
  174. return numCharFriends1 > numCharFriends2
  175. end
  176.  
  177. if ( numGuildMates1 ~= numGuildMates2 ) then
  178. return numGuildMates1 > numGuildMates2
  179. end
  180.  
  181. --If we aren't sorting by anything else, just go by ID
  182. return id1 < id2
  183.  
  184. end
  185. end
  186.  
  187. --> OCEANIC
  188. function LocalizedGroups:InstallHookOC()
  189. hooksecurefunc ("LFGListSearchEntry_Update", function (self)
  190. local searchResultInfo1 = C_LFGList.GetSearchResultInfo(self.resultID)
  191. local LN1 = searchResultInfo1.leaderName
  192. local activityID1 = searchResultInfo1.activityID
  193.  
  194. if (LN1 and ( LN1:find ("Aman'Thul") or LN1:find ("Barthilas") or LN1:find ("Caelestrasz") or LN1:find ("Dath'Remar") or LN1:find ("Dreadmaul") or LN1:find ("Gundrak") or LN1:find ("Jubei'Thos") or LN1:find ("Khaz'goroth") or LN1:find ("Nagrand") or LN1:find ("Saurfang") or LN1:find ("Thaurissan") or LN1:find ("Frostmourne") or not select (2, strsplit ("-", LN1)))) then
  195. local activityName = C_LFGList.GetActivityInfo (activityID1)
  196.  
  197. self.ActivityName:SetText ("|cFFFFFF00[OC]|r " .. activityName)
  198. self.ActivityName:SetTextColor (0, 1, 0)
  199.  
  200.  
  201. end
  202. end)
  203. end
  204.  
  205. function LocalizedGroups:ReplaceSortFuncOC()
  206. LFGListUtil_SortSearchResultsCB = function (id1, id2)
  207.  
  208. local searchResultInfo1 = C_LFGList.GetSearchResultInfo(id1)
  209. local searchResultInfo2 = C_LFGList.GetSearchResultInfo(id2)
  210.  
  211. local numBNetFriends1 = searchResultInfo1.numBNetFriends
  212. local numCharFriends1 = searchResultInfo1.numCharFriends
  213. local numGuildMates1 = searchResultInfo1.numGuildMates
  214. local LN1 = searchResultInfo1.leaderName
  215.  
  216. local numBNetFriends2 = searchResultInfo2.numBNetFriends
  217. local numCharFriends2 = searchResultInfo2.numCharFriends
  218. local numGuildMates2 = searchResultInfo2.numGuildMates
  219. local LN2 = searchResultInfo2.leaderName
  220.  
  221. if (LN1 and ( LN1:find ("Aman'Thul") or LN1:find ("Barthilas") or LN1:find ("Caelestrasz") or LN1:find ("Dath'Remar") or LN1:find ("Dreadmaul") or LN1:find ("Gundrak") or LN1:find ("Jubei'Thos") or LN1:find ("Khaz'goroth") or LN1:find ("Nagrand") or LN1:find ("Saurfang") or LN1:find ("Thaurissan") or LN1:find ("Frostmourne") or not select (2, strsplit ("-", LN1)))) then
  222. if (LN2 and ( LN2:find ("Aman'Thul") or LN2:find ("Barthilas") or LN2:find ("Caelestrasz") or LN2:find ("Dath'Remar") or LN2:find ("Dreadmaul") or LN2:find ("Gundrak") or LN2:find ("Jubei'Thos") or LN2:find ("Khaz'goroth") or LN2:find ("Nagrand") or LN2:find ("Saurfang") or LN2:find ("Thaurissan") or LN2:find ("Frostmourne") or not select (2, strsplit ("-", LN2)))) then
  223. if ( numBNetFriends1 ~= numBNetFriends2 ) then
  224. return numBNetFriends1 > numBNetFriends2
  225. end
  226.  
  227. if ( numCharFriends1 ~= numCharFriends2 ) then
  228. return numCharFriends1 > numCharFriends2
  229. end
  230.  
  231. if ( numGuildMates1 ~= numGuildMates2 ) then
  232. return numGuildMates1 > numGuildMates2
  233. end
  234.  
  235. return id1 < id2
  236. end
  237.  
  238. return true
  239. end
  240.  
  241. if (LN2 and ( LN2:find ("Aman'Thul") or LN2:find ("Barthilas") or LN2:find ("Caelestrasz") or LN2:find ("Dath'Remar") or LN2:find ("Dreadmaul") or LN2:find ("Gundrak") or LN2:find ("Jubei'Thos") or LN2:find ("Khaz'goroth") or LN2:find ("Nagrand") or LN2:find ("Saurfang") or LN2:find ("Thaurissan") or LN2:find ("Frostmourne") or not select (2, strsplit ("-", LN2)))) then
  242. return false
  243. end
  244.  
  245. --If one has more friends, do that one first
  246. if ( numBNetFriends1 ~= numBNetFriends2 ) then
  247. return numBNetFriends1 > numBNetFriends2
  248. end
  249.  
  250. if ( numCharFriends1 ~= numCharFriends2 ) then
  251. return numCharFriends1 > numCharFriends2
  252. end
  253.  
  254. if ( numGuildMates1 ~= numGuildMates2 ) then
  255. return numGuildMates1 > numGuildMates2
  256. end
  257.  
  258. --If we aren't sorting by anything else, just go by ID
  259. return id1 < id2
  260.  
  261. end
  262. end
  263.  
  264. --> FRENCH
  265. function LocalizedGroups:InstallHookFR()
  266. hooksecurefunc ("LFGListSearchEntry_Update", function (self)
  267. local searchResultInfo1 = C_LFGList.GetSearchResultInfo(self.resultID)
  268. local LN1 = searchResultInfo1.leaderName
  269. local activityID1 = searchResultInfo1.activityID
  270.  
  271. if (LN1 and ( LN1:find ("Hyjal") or LN1:find ("Arak-arahm") or LN1:find ("Temple noir") or LN1:find ("Arathi") or LN1:find ("Archimonde") or LN1:find ("Ysondre") or LN1:find ("Chants �ternels") or LN1:find ("Cho'gall") or LN1:find ("Confr�rie du Thorium") or LN1:find ("Conseil des Ombres") or LN1:find ("Culte de la Rive noire") or LN1:find ("Dalaran") or LN1:find ("Vol'jin") or LN1:find ("Drek'Thar") or LN1:find ("Eitrigg") or LN1:find ("Sinstralis") or LN1:find ("Eldre'Thalas") or LN1:find ("Naxxramas") or LN1:find ("Varimathras") or LN1:find ("Uldaman") or LN1:find ("Garona") or LN1:find ("Illidan") or LN1:find ("Kael'thas") or LN1:find ("Sargeras") or LN1:find ("Khaz Modan") or LN1:find ("Kirin Tor") or LN1:find ("Krasus") or LN1:find ("La Croisade �carlate") or LN1:find ("Rashgarroth") or LN1:find ("Les Clairvoyants") or LN1:find ("Les Sentinelles") or LN1:find ("Mar�cage de Zangar") or LN1:find ("Medivh") or LN1:find ("Ner'zhul") or LN1:find ("Throk'Feroth") or LN1:find ("Elune") or not select (2, strsplit ("-", LN1)))) then
  272. local activityName = C_LFGList.GetActivityInfo (activityID1)
  273.  
  274. self.ActivityName:SetText ("|cFFFFFF00[OC]|r " .. activityName)
  275. self.ActivityName:SetTextColor (0, 1, 0)
  276. end
  277. end)
  278. end
  279.  
  280. function LocalizedGroups:ReplaceSortFuncFR()
  281. LFGListUtil_SortSearchResultsCB = function (id1, id2)
  282.  
  283. local searchResultInfo1 = C_LFGList.GetSearchResultInfo(id1)
  284. local searchResultInfo2 = C_LFGList.GetSearchResultInfo(id2)
  285.  
  286. local numBNetFriends1 = searchResultInfo1.numBNetFriends
  287. local numCharFriends1 = searchResultInfo1.numCharFriends
  288. local numGuildMates1 = searchResultInfo1.numGuildMates
  289. local LN1 = searchResultInfo1.leaderName
  290.  
  291. local numBNetFriends2 = searchResultInfo2.numBNetFriends
  292. local numCharFriends2 = searchResultInfo2.numCharFriends
  293. local numGuildMates2 = searchResultInfo2.numGuildMates
  294. local LN2 = searchResultInfo2.leaderName
  295.  
  296. if (LN1 and ( LN1:find ("Hyjal") or LN1:find ("Arak-arahm") or LN1:find ("Temple noir") or LN1:find ("Arathi") or LN1:find ("Archimonde") or LN1:find ("Ysondre") or LN1:find ("Chants �ternels") or LN1:find ("Cho'gall") or LN1:find ("Confr�rie du Thorium") or LN1:find ("Conseil des Ombres") or LN1:find ("Culte de la Rive noire") or LN1:find ("Dalaran") or LN1:find ("Vol'jin") or LN1:find ("Drek'Thar") or LN1:find ("Eitrigg") or LN1:find ("Sinstralis") or LN1:find ("Eldre'Thalas") or LN1:find ("Naxxramas") or LN1:find ("Varimathras") or LN1:find ("Uldaman") or LN1:find ("Garona") or LN1:find ("Illidan") or LN1:find ("Kael'thas") or LN1:find ("Sargeras") or LN1:find ("Khaz Modan") or LN1:find ("Kirin Tor") or LN1:find ("Krasus") or LN1:find ("La Croisade �carlate") or LN1:find ("Rashgarroth") or LN1:find ("Les Clairvoyants") or LN1:find ("Les Sentinelles") or LN1:find ("Mar�cage de Zangar") or LN1:find ("Medivh") or LN1:find ("Ner'zhul") or LN1:find ("Throk'Feroth") or LN1:find ("Elune") or not select (2, strsplit ("-", LN1)))) then
  297. if (LN2 and ( LN2:find ("Hyjal") or LN2:find ("Arak-arahm") or LN2:find ("Temple noir") or LN2:find ("Arathi") or LN2:find ("Archimonde") or LN2:find ("Ysondre") or LN2:find ("Chants �ternels") or LN2:find ("Cho'gall") or LN2:find ("Confr�rie du Thorium") or LN2:find ("Conseil des Ombres") or LN2:find ("Culte de la Rive noire") or LN2:find ("Dalaran") or LN2:find ("Vol'jin") or LN2:find ("Drek'Thar") or LN2:find ("Eitrigg") or LN2:find ("Sinstralis") or LN2:find ("Eldre'Thalas") or LN2:find ("Naxxramas") or LN2:find ("Varimathras") or LN2:find ("Uldaman") or LN2:find ("Garona") or LN2:find ("Illidan") or LN2:find ("Kael'thas") or LN2:find ("Sargeras") or LN2:find ("Khaz Modan") or LN2:find ("Kirin Tor") or LN2:find ("Krasus") or LN2:find ("La Croisade �carlate") or LN2:find ("Rashgarroth") or LN2:find ("Les Clairvoyants") or LN2:find ("Les Sentinelles") or LN2:find ("Mar�cage de Zangar") or LN2:find ("Medivh") or LN2:find ("Ner'zhul") or LN2:find ("Throk'Feroth") or LN2:find ("Elune") or not select (2, strsplit ("-", LN2)))) then
  298. if ( numBNetFriends1 ~= numBNetFriends2 ) then
  299. return numBNetFriends1 > numBNetFriends2
  300. end
  301.  
  302. if ( numCharFriends1 ~= numCharFriends2 ) then
  303. return numCharFriends1 > numCharFriends2
  304. end
  305.  
  306. if ( numGuildMates1 ~= numGuildMates2 ) then
  307. return numGuildMates1 > numGuildMates2
  308. end
  309.  
  310. return id1 < id2
  311. end
  312.  
  313. return true
  314. end
  315.  
  316. if (LN2 and ( LN2:find ("Hyjal") or LN2:find ("Arak-arahm") or LN2:find ("Temple noir") or LN2:find ("Arathi") or LN2:find ("Archimonde") or LN2:find ("Ysondre") or LN2:find ("Chants �ternels") or LN2:find ("Cho'gall") or LN2:find ("Confr�rie du Thorium") or LN2:find ("Conseil des Ombres") or LN2:find ("Culte de la Rive noire") or LN2:find ("Dalaran") or LN2:find ("Vol'jin") or LN2:find ("Drek'Thar") or LN2:find ("Eitrigg") or LN2:find ("Sinstralis") or LN2:find ("Eldre'Thalas") or LN2:find ("Naxxramas") or LN2:find ("Varimathras") or LN2:find ("Uldaman") or LN2:find ("Garona") or LN2:find ("Illidan") or LN2:find ("Kael'thas") or LN2:find ("Sargeras") or LN2:find ("Khaz Modan") or LN2:find ("Kirin Tor") or LN2:find ("Krasus") or LN2:find ("La Croisade �carlate") or LN2:find ("Rashgarroth") or LN2:find ("Les Clairvoyants") or LN2:find ("Les Sentinelles") or LN2:find ("Mar�cage de Zangar") or LN2:find ("Medivh") or LN2:find ("Ner'zhul") or LN2:find ("Throk'Feroth") or LN2:find ("Elune") or not select (2, strsplit ("-", LN2)))) then
  317. return false
  318. end
  319.  
  320. --If one has more friends, do that one first
  321. if ( numBNetFriends1 ~= numBNetFriends2 ) then
  322. return numBNetFriends1 > numBNetFriends2
  323. end
  324.  
  325. if ( numCharFriends1 ~= numCharFriends2 ) then
  326. return numCharFriends1 > numCharFriends2
  327. end
  328.  
  329. if ( numGuildMates1 ~= numGuildMates2 ) then
  330. return numGuildMates1 > numGuildMates2
  331. end
  332.  
  333. --If we aren't sorting by anything else, just go by ID
  334. return id1 < id2
  335.  
  336. end
  337. end
  338.  
  339. --> ITALIAN
  340. function LocalizedGroups:InstallHookIT()
  341. hooksecurefunc ("LFGListSearchEntry_Update", function (self)
  342. local searchResultInfo1 = C_LFGList.GetSearchResultInfo(self.resultID)
  343. local LN1 = searchResultInfo1.leaderName
  344. local activityID1 = searchResultInfo1.activityID
  345.  
  346. if (LN1 and ( LN1:find ("Pozzo dell'Eternit�") or LN1:find ("Nemesis") or not select (2, strsplit ("-", LN1)))) then
  347. local activityName = C_LFGList.GetActivityInfo (activityID1)
  348.  
  349. self.ActivityName:SetText ("|cFFFFFF00[LA]|r " .. activityName)
  350. self.ActivityName:SetTextColor (0, 1, 0)
  351. end
  352. end)
  353. end
  354.  
  355. function LocalizedGroups:ReplaceSortFuncIT()
  356. LFGListUtil_SortSearchResultsCB = function (id1, id2)
  357.  
  358. local searchResultInfo1 = C_LFGList.GetSearchResultInfo(id1)
  359. local searchResultInfo2 = C_LFGList.GetSearchResultInfo(id2)
  360.  
  361. local numBNetFriends1 = searchResultInfo1.numBNetFriends
  362. local numCharFriends1 = searchResultInfo1.numCharFriends
  363. local numGuildMates1 = searchResultInfo1.numGuildMates
  364. local LN1 = searchResultInfo1.leaderName
  365.  
  366. local numBNetFriends2 = searchResultInfo2.numBNetFriends
  367. local numCharFriends2 = searchResultInfo2.numCharFriends
  368. local numGuildMates2 = searchResultInfo2.numGuildMates
  369. local LN2 = searchResultInfo2.leaderName
  370.  
  371. if (LN1 and ( LN1:find ("Pozzo dell'Eternit�") or LN1:find ("Nemesis") or not select (2, strsplit ("-", LN1)))) then
  372. if (LN2 and ( LN2:find ("Pozzo dell'Eternit�") or LN2:find ("Nemesis") or not select (2, strsplit ("-", LN2)))) then
  373. if ( numBNetFriends1 ~= numBNetFriends2 ) then
  374. return numBNetFriends1 > numBNetFriends2
  375. end
  376.  
  377. if ( numCharFriends1 ~= numCharFriends2 ) then
  378. return numCharFriends1 > numCharFriends2
  379. end
  380.  
  381. if ( numGuildMates1 ~= numGuildMates2 ) then
  382. return numGuildMates1 > numGuildMates2
  383. end
  384.  
  385. return id1 < id2
  386. end
  387.  
  388. return true
  389. end
  390.  
  391. if (LN2 and ( LN2:find ("Pozzo dell'Eternit�") or LN2:find ("Nemesis") or not select (2, strsplit ("-", LN2)))) then
  392. return false
  393. end
  394.  
  395. --If one has more friends, do that one first
  396. if ( numBNetFriends1 ~= numBNetFriends2 ) then
  397. return numBNetFriends1 > numBNetFriends2
  398. end
  399.  
  400. if ( numCharFriends1 ~= numCharFriends2 ) then
  401. return numCharFriends1 > numCharFriends2
  402. end
  403.  
  404. if ( numGuildMates1 ~= numGuildMates2 ) then
  405. return numGuildMates1 > numGuildMates2
  406. end
  407.  
  408. --If we aren't sorting by anything else, just go by ID
  409. return id1 < id2
  410.  
  411. end
  412. end
  413.  
  414. --> SPAIN
  415. function LocalizedGroups:InstallHookSP()
  416. hooksecurefunc ("LFGListSearchEntry_Update", function (self)
  417. local searchResultInfo1 = C_LFGList.GetSearchResultInfo(self.resultID)
  418. local LN1 = searchResultInfo1.leaderName
  419. local activityID1 = searchResultInfo1.activityID
  420.  
  421. if (LN1 and (LN1:find ("Dun Modr") or LN1:find ("Uldum") or LN1:find ("Colinas Pardas") or LN1:find ("C'Thun") or LN1:find ("Shen'dralar") or LN1:find ("Exodar") or LN1:find ("Los Errantes") or LN1:find ("Minahonda") or LN1:find ("Sanguino") or LN1:find ("Zul'jin") or LN1:find ("Tyrande") or not select (2, strsplit ("-", LN1)))) then
  422. local activityName = C_LFGList.GetActivityInfo (activityID1)
  423.  
  424. self.ActivityName:SetText ("|cFFFFFF00[LA]|r " .. activityName)
  425. self.ActivityName:SetTextColor (0, 1, 0)
  426. end
  427. end)
  428. end
  429.  
  430. function LocalizedGroups:ReplaceSortFuncSP()
  431. LFGListUtil_SortSearchResultsCB = function (id1, id2)
  432.  
  433. local searchResultInfo1 = C_LFGList.GetSearchResultInfo(id1)
  434. local searchResultInfo2 = C_LFGList.GetSearchResultInfo(id2)
  435.  
  436. local numBNetFriends1 = searchResultInfo1.numBNetFriends
  437. local numCharFriends1 = searchResultInfo1.numCharFriends
  438. local numGuildMates1 = searchResultInfo1.numGuildMates
  439. local LN1 = searchResultInfo1.leaderName
  440.  
  441. local numBNetFriends2 = searchResultInfo2.numBNetFriends
  442. local numCharFriends2 = searchResultInfo2.numCharFriends
  443. local numGuildMates2 = searchResultInfo2.numGuildMates
  444. local LN2 = searchResultInfo2.leaderName
  445.  
  446. if (LN1 and ( LN1:find ("Dun Modr") or LN1:find ("Uldum") or LN1:find ("Colinas Pardas") or LN1:find ("C'Thun") or LN1:find ("Shen'dralar") or LN1:find ("Exodar") or LN1:find ("Los Errantes") or LN1:find ("Minahonda") or LN1:find ("Sanguino") or LN1:find ("Zul'jin") or LN1:find ("Tyrande") or not select (2, strsplit ("-", LN1)))) then
  447. if (LN2 and ( LN2:find ("Dun Modr") or LN2:find ("Uldum") or LN2:find ("Colinas Pardas") or LN2:find ("C'Thun") or LN2:find ("Shen'dralar") or LN2:find ("Exodar") or LN2:find ("Los Errantes") or LN2:find ("Minahonda") or LN2:find ("Sanguino") or LN2:find ("Zul'jin") or LN2:find ("Tyrande") or not select (2, strsplit ("-", LN2)))) then
  448. if ( numBNetFriends1 ~= numBNetFriends2 ) then
  449. return numBNetFriends1 > numBNetFriends2
  450. end
  451.  
  452. if ( numCharFriends1 ~= numCharFriends2 ) then
  453. return numCharFriends1 > numCharFriends2
  454. end
  455.  
  456. if ( numGuildMates1 ~= numGuildMates2 ) then
  457. return numGuildMates1 > numGuildMates2
  458. end
  459.  
  460. return id1 < id2
  461. end
  462.  
  463. return true
  464. end
  465.  
  466. if (LN2 and ( LN2:find ("Dun Modr") or LN2:find ("Uldum") or LN2:find ("Colinas Pardas") or LN2:find ("C'Thun") or LN2:find ("Shen'dralar") or LN2:find ("Exodar") or LN2:find ("Los Errantes") or LN2:find ("Minahonda") or LN2:find ("Sanguino") or LN2:find ("Zul'jin") or LN2:find ("Tyrande") or not select (2, strsplit ("-", LN2)))) then
  467. return false
  468. end
  469.  
  470. --If one has more friends, do that one first
  471. if ( numBNetFriends1 ~= numBNetFriends2 ) then
  472. return numBNetFriends1 > numBNetFriends2
  473. end
  474.  
  475. if ( numCharFriends1 ~= numCharFriends2 ) then
  476. return numCharFriends1 > numCharFriends2
  477. end
  478.  
  479. if ( numGuildMates1 ~= numGuildMates2 ) then
  480. return numGuildMates1 > numGuildMates2
  481. end
  482.  
  483. --If we aren't sorting by anything else, just go by ID
  484. return id1 < id2
  485.  
  486. end
  487. end
  488.  
  489. --> RUSSIAN
  490. function LocalizedGroups:InstallHookRU()
  491. hooksecurefunc ("LFGListSearchEntry_Update", function (self)
  492. local searchResultInfo1 = C_LFGList.GetSearchResultInfo(self.resultID)
  493. local LN1 = searchResultInfo1.leaderName
  494. local activityID1 = searchResultInfo1.activityID
  495.  
  496. if (LN1 and (LN1:find ("Razuvious") or LN1:find ("Thermaplugg") or LN1:find ("Soulflayer") or LN1:find ("Ashenvale") or LN1:find ("Azuregos") or LN1:find ("Blackscar") or LN1:find ("Lich King") or LN1:find ("Howling Fjord") or LN1:find ("Grom") or LN1:find ("Greymane") or LN1:find ("Gordunni") or LN1:find ("Goldrinn") or LN1:find ("Booty Bay") or LN1:find ("Galakrond") or LN1:find ("Borean Tundra") or LN1:find ("Deathguard") or LN1:find ("Deathweaver") or LN1:find ("Eversong") or LN1:find ("Deepholm") or LN1:find ("Fordragon") or not select (2, strsplit ("-", LN1)))) then
  497. local activityName = C_LFGList.GetActivityInfo (activityID1)
  498.  
  499. self.ActivityName:SetText ("|cFFFFFF00[LA]|r " .. activityName)
  500. self.ActivityName:SetTextColor (0, 1, 0)
  501. end
  502. end)
  503. end
  504.  
  505. function LocalizedGroups:ReplaceSortFuncRU()
  506. LFGListUtil_SortSearchResultsCB = function (id1, id2)
  507.  
  508. local searchResultInfo1 = C_LFGList.GetSearchResultInfo(id1)
  509. local searchResultInfo2 = C_LFGList.GetSearchResultInfo(id2)
  510.  
  511. local numBNetFriends1 = searchResultInfo1.numBNetFriends
  512. local numCharFriends1 = searchResultInfo1.numCharFriends
  513. local numGuildMates1 = searchResultInfo1.numGuildMates
  514. local LN1 = searchResultInfo1.leaderName
  515.  
  516. local numBNetFriends2 = searchResultInfo2.numBNetFriends
  517. local numCharFriends2 = searchResultInfo2.numCharFriends
  518. local numGuildMates2 = searchResultInfo2.numGuildMates
  519. local LN2 = searchResultInfo2.leaderName
  520.  
  521. if (LN1 and ( LN1:find ("Razuvious") or LN1:find ("Thermaplugg") or LN1:find ("Soulflayer") or LN1:find ("Ashenvale") or LN1:find ("Azuregos") or LN1:find ("Blackscar") or LN1:find ("Lich King") or LN1:find ("Howling Fjord") or LN1:find ("Grom") or LN1:find ("Greymane") or LN1:find ("Gordunni") or LN1:find ("Goldrinn") or LN1:find ("Booty Bay") or LN1:find ("Galakrond") or LN1:find ("Borean Tundra") or LN1:find ("Deathguard") or LN1:find ("Deathweaver") or LN1:find ("Eversong") or LN1:find ("Deepholm") or LN1:find ("Fordragon") or not select (2, strsplit ("-", LN1)))) then
  522. if (LN2 and ( LN2:find ("Razuvious") or LN2:find ("Thermaplugg") or LN2:find ("Soulflayer") or LN2:find ("Ashenvale") or LN2:find ("Azuregos") or LN2:find ("Blackscar") or LN2:find ("Lich King") or LN2:find ("Howling Fjord") or LN2:find ("Grom") or LN2:find ("Greymane") or LN2:find ("Gordunni") or LN2:find ("Goldrinn") or LN2:find ("Booty Bay") or LN2:find ("Galakrond") or LN2:find ("Borean Tundra") or LN2:find ("Deathguard") or LN2:find ("Deathweaver") or LN2:find ("Eversong") or LN2:find ("Deepholm") or LN2:find ("Fordragon") or not select (2, strsplit ("-", LN2)))) then
  523. if ( numBNetFriends1 ~= numBNetFriends2 ) then
  524. return numBNetFriends1 > numBNetFriends2
  525. end
  526.  
  527. if ( numCharFriends1 ~= numCharFriends2 ) then
  528. return numCharFriends1 > numCharFriends2
  529. end
  530.  
  531. if ( numGuildMates1 ~= numGuildMates2 ) then
  532. return numGuildMates1 > numGuildMates2
  533. end
  534.  
  535. return id1 < id2
  536. end
  537.  
  538. return true
  539. end
  540.  
  541. if (LN2 and ( LN2:find ("Razuvious") or LN2:find ("Thermaplugg") or LN2:find ("Soulflayer") or LN2:find ("Ashenvale") or LN2:find ("Azuregos") or LN2:find ("Blackscar") or LN2:find ("Lich King") or LN2:find ("Howling Fjord") or LN2:find ("Grom") or LN2:find ("Greymane") or LN2:find ("Gordunni") or LN2:find ("Goldrinn") or LN2:find ("Booty Bay") or LN2:find ("Galakrond") or LN2:find ("Borean Tundra") or LN2:find ("Deathguard") or LN2:find ("Deathweaver") or LN2:find ("Eversong") or LN2:find ("Deepholm") or LN2:find ("Fordragon") or not select (2, strsplit ("-", LN2)))) then
  542. return false
  543. end
  544.  
  545. --If one has more friends, do that one first
  546. if ( numBNetFriends1 ~= numBNetFriends2 ) then
  547. return numBNetFriends1 > numBNetFriends2
  548. end
  549.  
  550. if ( numCharFriends1 ~= numCharFriends2 ) then
  551. return numCharFriends1 > numCharFriends2
  552. end
  553.  
  554. if ( numGuildMates1 ~= numGuildMates2 ) then
  555. return numGuildMates1 > numGuildMates2
  556. end
  557.  
  558. --If we aren't sorting by anything else, just go by ID
  559. return id1 < id2
  560.  
  561. end
  562. end
  563.  
  564. --> Make a Backup first
  565. function LocalizedGroups:CreateBackup()
  566. LocalizedGroups.original_sort_func = LFGListUtil_SortSearchResultsCB
  567. end
  568.  
  569. --> Region Realm List
  570. local brazil_realm_list = {
  571. ["Azralon"] = true,
  572. ["Nemesis"] = true,
  573. ["Goldrinn"] = true,
  574. ["Tol Barad"] = true,
  575. ["Gallywyx"] = true,
  576. }
  577.  
  578. local latin_realm_list = {
  579. ["Quel'Thalas"] = true,
  580. ["Drakkari"] = true,
  581. ["Ragnaros"] = true,
  582. }
  583.  
  584. local oceanic_realm_list = {
  585. ["Aman'Thul"] = true,
  586. ["Barthilas"] = true,
  587. ["Caelestrasz"] = true,
  588. ["Dath'Remar"] = true,
  589. ["Dreadmaul"] = true,
  590. ["Gundrak"] = true,
  591. ["Jubei'Thos"] = true,
  592. ["Khaz'goroth"] = true,
  593. ["Nagrand"] = true,
  594. ["Saurfang"] = true,
  595. ["Thaurissan"] = true,
  596. ["Frostmourne"] = true,
  597. }
  598.  
  599. local french_realm_list = {
  600. ["Les Sentinelles"] = true,
  601. ["Mar�cage de Zangar"] = true,
  602. ["Medivh"] = true,
  603. ["Ner'zhul"] = true,
  604. ["Throk'Feroth"] = true,
  605. ["Elune"] = true,
  606. ["Garona"] = true,
  607. ["Illidan"] = true,
  608. ["Kael'thas"] = true,
  609. ["Sargeras"] = true,
  610. ["Khaz Modan"] = true,
  611. ["Kirin Tor"] = true,
  612. ["Krasus"] = true,
  613. ["La Croisade �carlate"] = true,
  614. ["Rashgarroth"] = true,
  615. ["Les Clairvoyants"] = true,
  616. ["Culte de la Rive noire"] = true,
  617. ["Dalaran"] = true,
  618. ["Vol'jin"] = true,
  619. ["Drek'Thar"] = true,
  620. ["Eitrigg"] = true,
  621. ["Sinstralis"] = true,
  622. ["Eldre'Thalas"] = true,
  623. ["Naxxramas"] = true,
  624. ["Varimathras"] = true,
  625. ["Uldaman"] = true,
  626. ["Hyjal"] = true,
  627. ["Arak-arahm"] = true,
  628. ["Temple noir"] = true,
  629. ["Arathi"] = true,
  630. ["Archimonde"] = true,
  631. ["Ysondre"] = true,
  632. ["Chants �ternels"] = true,
  633. ["Cho'gall"] = true,
  634. ["Confr�rie du Thorium"] = true,
  635. ["Conseil des Ombres"] = true,
  636. }
  637.  
  638. local italian_realm_list = {
  639. ["Pozzo dell'Eternit�"] = true,
  640. ["Nemesis"] = true,
  641. }
  642.  
  643. local spain_realm_list = {
  644. ["Dun Modr"] = true,
  645. ["Uldum"] = true,
  646. ["Colinas Pardas"] = true,
  647. ["C'Thun"] = true,
  648. ["Shen'dralar"] = true,
  649. ["Exodar"] = true,
  650. ["Los Errantes"] = true,
  651. ["Minahonda"] = true,
  652. ["Sanguino"] = true,
  653. ["Zul'jin"] = true,
  654. ["Tyrande"] = true,
  655. }
  656.  
  657. local russian_realm_list = {
  658. ["Howling Fjord"] = true,
  659. ["Grom"] = true,
  660. ["Greymane"] = true,
  661. ["Gordunni"] = true,
  662. ["Goldrinn"] = true,
  663. ["Booty Bay"] = true,
  664. ["Galakrond"] = true,
  665. ["Borean Tundra"] = true,
  666. ["Deathguard"] = true,
  667. ["Deathweaver"] = true,
  668. ["Eversong"] = true,
  669. ["Deepholm"] = true,
  670. ["Fordragon"] = true,
  671. ["Razuvious"] = true,
  672. ["Thermaplugg"] = true,
  673. ["Soulflayer"] = true,
  674. ["Ashenvale"] = true,
  675. ["Azuregos"] = true,
  676. ["Blackscar"] = true,
  677. ["Lich King"] = true,
  678. }
  679.  
  680. --> Install
  681. function LocalizedGroups:OnInitialize()
  682.  
  683. LocalizedGroups:ScheduleTimer ("CreateBackup", 4)
  684.  
  685. local realm = GetRealmName()
  686.  
  687. if (brazil_realm_list [realm]) then
  688. LocalizedGroups:ScheduleTimer ("InstallHookBR", 5)
  689. LocalizedGroups:ScheduleTimer ("ReplaceSortFuncBR", 5.1)
  690.  
  691. elseif (latin_realm_list [realm]) then
  692. LocalizedGroups:ScheduleTimer ("InstallHookLA", 5)
  693. LocalizedGroups:ScheduleTimer ("ReplaceSortFuncLA", 5.1)
  694.  
  695. elseif (oceanic_realm_list [realm]) then
  696. LocalizedGroups:ScheduleTimer ("InstallHookOC", 5)
  697. LocalizedGroups:ScheduleTimer ("ReplaceSortFuncOC", 5.1)
  698.  
  699. elseif (french_realm_list [realm]) then
  700. LocalizedGroups:ScheduleTimer ("InstallHookFR", 5)
  701. LocalizedGroups:ScheduleTimer ("ReplaceSortFuncFR", 5.1)
  702.  
  703. elseif (italian_realm_list [realm]) then
  704. LocalizedGroups:ScheduleTimer ("InstallHookIT", 5)
  705. LocalizedGroups:ScheduleTimer ("ReplaceSortFuncIT", 5.1)
  706.  
  707. elseif (spain_realm_list [realm]) then
  708. LocalizedGroups:ScheduleTimer ("InstallHookSP", 5)
  709. LocalizedGroups:ScheduleTimer ("ReplaceSortFuncSP", 5.1)
  710.  
  711. elseif (russian_realm_list [realm]) then
  712. LocalizedGroups:ScheduleTimer ("InstallHookRU", 5)
  713. LocalizedGroups:ScheduleTimer ("ReplaceSortFuncRU", 5.1)
  714.  
  715. end
  716.  
  717.  
  718.  
  719. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement