Advertisement
Guest User

BigBrother Patch

a guest
Sep 12th, 2013
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 8.95 KB | None | 0 0
  1. diff -ru BigBrother/BigBrother.lua BigBrother_NEW/BigBrother.lua
  2. --- BigBrother/BigBrother.lua   2013-09-12 20:10:11.000000000 +0100
  3. +++ BigBrother_NEW/BigBrother.lua   2013-09-12 19:39:54.000000000 +0100
  4. @@ -78,6 +78,24 @@
  5.     self:ToggleBuffWindow()
  6.  end
  7.  
  8. +function addon:Print(...)
  9. +    addon:GetSelfChatFrame(addon.db.profile.SelfChatFrame):AddMessage(strjoin(" ", tostringall(...)))
  10. +end
  11. +
  12. +
  13. +function addon:ConfirmChatFrame(msg)
  14. +    BigBrother:Print(string.format(color, (addon.db.profile.ShortChat and "[BB]" or "[Big Brother]")) .. ": " .. L["BigBrother will use this window for self output"])
  15. +end
  16. +
  17. +function addon:GetSelfChatFrame(...)
  18. +    -- return current chatframe
  19. +    local frameid = addon.db.profile.SelfChatFrame
  20. +    local f = getglobal("ChatFrame" .. frameid)
  21. +    local name = GetChatWindowInfo(frameid)
  22. +    if (not (f and string.len(name))) then f = DEFAULT_CHAT_FRAME end
  23. +    return f
  24. +end
  25. +
  26.  function addon:OnTextUpdate()
  27.     self:SetText("BigBrother")
  28.    local f = addon.minimapFrame;
  29. @@ -111,6 +129,8 @@
  30.    Taunt = false,
  31.    Interrupt = false,
  32.    Dispel = false,
  33. +  SelfChatFrame = 0, -- 0 = defaultchatframe/fallback
  34. +  ShortChat = false,
  35.  })
  36.  
  37.  -- ACE options menu
  38. @@ -602,6 +622,111 @@
  39.              },
  40.            }
  41.          },
  42. +        selfchatwindow = {
  43. +            name = L["Self Chat Window"],
  44. +            desc = L["Set which chat window to use for SELF output"],
  45. +            type = 'group',
  46. +            args = {
  47. +                chatframe1 = {
  48. +                    name = "1:" .. getglobal("ChatFrame1").name,
  49. +                    desc = L["Chat Window"] .. " 1",
  50. +                    type = 'toggle',
  51. +                    order = 1,
  52. +                    get = function() return addon:GetSelfChatFrame() == getglobal("ChatFrame1") end,
  53. +                    set = function(v) addon.db.profile.SelfChatFrame = 1; addon:ConfirmChatFrame() end,
  54. +                    hidden = function() local name = GetChatWindowInfo(1); return string.len(name) == 0 end,
  55. +                },
  56. +                chatframe2 = {
  57. +                    name = "2:" .. getglobal("ChatFrame2").name,
  58. +                    desc = L["Chat Window"] .. " 2",
  59. +                    type = 'toggle',
  60. +                    order = 2,
  61. +                    get = function() return addon:GetSelfChatFrame() == getglobal("ChatFrame2") end,
  62. +                    set = function(v) addon.db.profile.SelfChatFrame = 2; addon:ConfirmChatFrame() end,
  63. +                    hidden = function() local name = GetChatWindowInfo(2); return string.len(name) == 0 end,
  64. +                },
  65. +                chatframe3 = {
  66. +                    name = "3:" .. getglobal("ChatFrame3").name,
  67. +                    desc = L["Chat Window"] .. " 3",
  68. +                    type = 'toggle',
  69. +                    order = 3,
  70. +                    get = function() return addon:GetSelfChatFrame() == getglobal("ChatFrame3") end,
  71. +                    set = function(v) addon.db.profile.SelfChatFrame = 3; addon:ConfirmChatFrame() end,
  72. +                    hidden = function() local name = GetChatWindowInfo(3); return string.len(name) == 0 end,
  73. +                },
  74. +                chatframe4 = {
  75. +                    name = "4:" .. getglobal("ChatFrame4").name,
  76. +                    desc = L["Chat Window"] .. " 4",
  77. +                    type = 'toggle',
  78. +                    order = 4,
  79. +                    get = function() return addon:GetSelfChatFrame() == getglobal("ChatFrame4") end,
  80. +                    set = function(v) addon.db.profile.SelfChatFrame = 4; addon:ConfirmChatFrame() end,
  81. +                    hidden = function() local name = GetChatWindowInfo(4); return string.len(name) == 0 end,
  82. +                },
  83. +                chatframe5 = {
  84. +                    name = "5:" .. getglobal("ChatFrame5").name,
  85. +                    desc = L["Chat Window"] .. " 5",
  86. +                    type = 'toggle',
  87. +                    order = 5,
  88. +                    get = function() return addon:GetSelfChatFrame() == getglobal("ChatFrame5") end,
  89. +                    set = function(v) addon.db.profile.SelfChatFrame = 5; addon:ConfirmChatFrame() end,
  90. +                    hidden = function() local name = GetChatWindowInfo(5); return string.len(name) == 0 end,
  91. +                },
  92. +                chatframe6 = {
  93. +                    name = "6:" .. getglobal("ChatFrame6").name,
  94. +                    desc = L["Chat Window"] .. " 6",
  95. +                    type = 'toggle',
  96. +                    order = 6,
  97. +                    get = function() return addon:GetSelfChatFrame() == getglobal("ChatFrame6") end,
  98. +                    set = function(v) addon.db.profile.SelfChatFrame = 6; addon:ConfirmChatFrame() end,
  99. +                    hidden = function() local name = GetChatWindowInfo(6); return string.len(name) == 0 end,
  100. +                },
  101. +                chatframe7 = {
  102. +                    name = "7:" .. getglobal("ChatFrame7").name,
  103. +                    desc = L["Chat Window"] .. " 7",
  104. +                    type = 'toggle',
  105. +                    order = 7,
  106. +                    get = function() return addon:GetSelfChatFrame() == getglobal("ChatFrame7") end,
  107. +                    set = function(v) addon.db.profile.SelfChatFrame = 7; addon:ConfirmChatFrame() end,
  108. +                    hidden = function() local name = GetChatWindowInfo(7); return string.len(name) == 0 end,
  109. +                },
  110. +                chatframe8 = {
  111. +                    name = "8:" .. getglobal("ChatFrame8").name,
  112. +                    desc = L["Chat Window"] .. " 8",
  113. +                    type = 'toggle',
  114. +                    order = 8,
  115. +                    get = function() return addon:GetSelfChatFrame() == getglobal("ChatFrame8") end,
  116. +                    set = function(v) addon.db.profile.SelfChatFrame = 8; addon:ConfirmChatFrame() end,
  117. +                    hidden = function() local name = GetChatWindowInfo(8); return string.len(name) == 0 end,
  118. +                },
  119. +                chatframe9 = {
  120. +                    name = "9:" .. getglobal("ChatFrame9").name,
  121. +                    desc = L["Chat Window"] .. " 9",
  122. +                    type = 'toggle',
  123. +                    order = 9,
  124. +                    get = function() return addon:GetSelfChatFrame() == getglobal("ChatFrame9") end,
  125. +                    set = function(v) addon.db.profile.SelfChatFrame = 9; addon:ConfirmChatFrame() end,
  126. +                    hidden = function() local name = GetChatWindowInfo(9); return string.len(name) == 0 end,
  127. +                },
  128. +                chatframe10 = {
  129. +                    name = "10:" .. getglobal("ChatFrame10").name,
  130. +                    desc = L["Chat Window"] .. " 10",
  131. +                    type = 'toggle',
  132. +                    order = 10,
  133. +                    get = function() return addon:GetSelfChatFrame() == getglobal("ChatFrame10") end,
  134. +                    set = function(v) addon.db.profile.SelfChatFrame = 10; addon:ConfirmChatFrame() end,
  135. +                    hidden = function() local name = GetChatWindowInfo(10); return string.len(name) == 0 end,
  136. +                },
  137. +            },
  138. +        },
  139. +        shortchat = {
  140. +          name  = L["Short Chat Prefix"],
  141. +          desc = L["Shortens chat lines by changing [Big Brother] to [BB]"],
  142. +          type = 'toggle',
  143. +          get = function() return addon.db.profile.ShortChat end,
  144. +          set = function(v) addon.db.profile.ShortChat = v end,
  145. +          map = { [false] = "|cffff4040Disabled|r", [true] = "|cff40ff40Enabled|r" }
  146. +        },
  147.        }
  148.      },
  149.      buffcheck = {
  150. @@ -609,7 +734,7 @@
  151.        desc = L["Pops up a window to check various raid/elixir buffs (drag the bottom to resize)."],
  152.        type = 'execute',
  153.        func = function() BigBrother:ToggleBuffWindow() end,
  154. -    }
  155. +    },
  156.    }
  157.  }
  158.  
  159. @@ -1076,9 +1201,9 @@
  160.      local output = SYMDECODE(spam, false)
  161.      output = SPELLDECODE(output)
  162.      local data = SYMDECODE(spam, true)
  163. -    local link = "24Hplayer::BigBrother:"..time()..":"..data.."24h24cff8888ff[Big Brother]24r24h24h: "
  164. +    local link = "24Hplayer::BigBrother:"..time()..":"..data.."24h24cff8888ff" .. (addon.db.profile.ShortChat and "[BB]" or "[Big Brother]") .. "24r24h24h: "
  165.      --addon:Print(output)
  166. -    print(link..output)
  167. +    BigBrother:Print(link..output)
  168.    end
  169.    
  170.    local it = select(2, IsInInstance())
  171. diff -ru BigBrother/locale.lua BigBrother_NEW/locale.lua
  172. --- BigBrother/locale.lua   2013-09-12 20:10:11.000000000 +0100
  173. +++ BigBrother_NEW/locale.lua   2013-09-12 19:05:29.000000000 +0100
  174. @@ -32,6 +32,10 @@
  175.  Ld["Crit chance"] = "Crit chance"
  176.  Ld["Custom"] = "Custom"
  177.  Ld["Custom Channel"] = "Custom Channel"
  178. +Ld["Self Chat Window"] = "Self Chat Window"
  179. +Ld["Set which chat window to use for SELF output"] = "Set which chat window to use for SELF output"
  180. +Ld["Chat Window"] = "Chat Window"
  181. +Ld["BigBrother will use this window for self output"] = "BigBrother will use this window for self output"
  182.  Ld["Damage"] = "Damage"
  183.  Ld["Dispel"] = "Dispel"
  184.  Ld["Electrified"] = "Electrified"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement