Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.64 KB | None | 0 0
  1. --- GUI_Main.old.lua    Sat Nov  1 00:16:59 2014
  2. +++ GUI_Main.lua    Sat Nov  1 00:17:22 2014
  3. @@ -151,6 +151,12 @@
  4.                 end,
  5.                 --me.DeleteCombatantWrapper,
  6.             },
  7. +           armory_link = {
  8. +               order = 50,
  9. +               name = "Show Armory Link",
  10. +               type = "execute",
  11. +               func = function() ShowArmoryLink(me) end,
  12. +           }
  13.         }
  14.     }
  15.  
  16. @@ -1828,4 +1834,51 @@
  17.  function Recount.LocalizeCombatants()
  18.     dbCombatants = Recount.db2.combatants
  19.     oldlocalizer()
  20. +end
  21. +
  22. +
  23. +
  24. +--
  25. +-- General structure of popup stolen from Prat.
  26. +StaticPopupDialogs["RECOUNT_ARMORY_LINK"] = {
  27. +   text = "Armory link : %s",
  28. +   button2 = "Ok",
  29. +   hasEditBox = true,
  30. +   hasWideEditbox = 1,
  31. +   editBoxWidth = 350,
  32. +  
  33. +   preferredIndex = 3,
  34. +  
  35. +   OnShow = function(self, ...)
  36. +       self:SetWidth(420)
  37. +
  38. +       self.editBox:SetText(StaticPopupDialogs["RECOUNT_ARMORY_LINK"].editBoxText)
  39. +       self.editBox:SetFocus()
  40. +       self.editBox:HighlightText(false)
  41. +
  42. +       local button = _G[this:GetName() .. "Button2"]
  43. +       button:ClearAllPoints()
  44. +       button:SetWidth(200)
  45. +       button:SetPoint("CENTER", editBox, "CENTER", 0, -30)
  46. +   end,
  47. +   OnHide = NOP,
  48. +        OnAccept = NOP,
  49. +        OnCancel = NOP,
  50. +   EditBoxOnEscapePressed = function(this, ...) this:GetParent():Hide() end,
  51. +   timeout = 0,
  52. +   whileDead = 1,
  53. +   hideOnEscape = 1,
  54. +}
  55. +
  56. +function ShowArmoryLink(person)
  57. +   local name, server = strsplit("-", person.name, 2)
  58. +  
  59. +   if (server == nil) then
  60. +       server = GetRealmName()
  61. +   end
  62. +
  63. +   local link = string.format("http://us.battle.net/wow/en/character/%s/%s/advanced", server, name)
  64. +
  65. +   StaticPopupDialogs["RECOUNT_ARMORY_LINK"].editBoxText = link
  66. +   StaticPopup_Show("RECOUNT_ARMORY_LINK", name)
  67.  end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement