changeset 8:c05fd3e18b4f

Version 0.31
author Flick <flickerstreak@gmail.com>
date Tue, 20 Mar 2007 21:33:59 +0000
parents f920db5fc6b1
children 650f75d08952
files Buttons.lua Defaults.lua Options.lua README.html ReAction.toc classes/ReAction.lua classes/ReAction_ActionDisplay.lua classes/ReAction_ActionType.lua classes/ReAction_PetActionDisplay.lua classes/ReBar.lua classes/ReBar.xml libs/AceComm-2.0/AceComm-2.0.lua libs/AceDebug-2.0/AceDebug-2.0.lua libs/AceHook-2.0/AceHook-2.0.lua libs/AceHook-2.1/AceHook-2.1.lua libs/AceLocale-2.0/AceLocale-2.0.lua libs/AceLocale-2.1/AceLocale-2.1.lua libs/AceModuleCore-2.0/AceModuleCore-2.0.lua libs/AceTab-2.0/AceTab-2.0.lua main.lua
diffstat 20 files changed, 246 insertions(+), 5536 deletions(-) [+]
line wrap: on
line diff
--- a/Buttons.lua	Tue Mar 20 21:25:29 2007 +0000
+++ b/Buttons.lua	Tue Mar 20 21:33:59 2007 +0000
@@ -38,9 +38,10 @@
   showKeyBind = true,
   showStackCount = true,
   showMacroText = true,
-  showGrid = false,
   showBorder = true,
   keyBindColorCode = false,
+  hideCooldown = false,
+  hideGlobalCooldown = false,
 }
 
 PetAction.defaultProfile = {
@@ -91,6 +92,19 @@
     end
   end
 
+  local function setOpacity(field, value)
+    if not config.opacity then
+      config.opacity = { }
+    end
+    config.opacity[field] = (value and value / 100)
+    refresh()
+  end
+
+  local function getOpacity(field, default)
+    local o = config.opacity and config.opacity[field] or (default and default/100) or 1
+    return o * 100
+  end
+
   return {
     type = "group",
     args = {
@@ -111,6 +125,89 @@
         validate = { "default", "none", "alt", "ctrl", "shift", "right-click" },
       },
 
+      opacity = {
+        type = "group",
+        name = "Opacity",
+        desc = "Set options for variable button opacity",
+        args = {
+          usable = {
+            type = "range",
+            name = "Usable",
+            desc = "Button opacity when the action is currently usable",
+            min  = 0,
+            max  = 100,
+            step = 1,
+            get  = function() return getOpacity("usable") end,
+            set  = function(x) setOpacity("usable", x) end,
+            order = 1,
+          },
+
+          notUsable = {
+            type = "range",
+            name = "Not Usable",
+            desc = "Button opacity when the action is currently not usable",
+            min  = 0,
+            max  = 100,
+            step = 1,
+            get  = function() return getOpacity("notUsable") end,
+            set  = function(x) setOpacity("notUsable",x) end,
+            order = 2,
+          },
+
+          oom = {
+            type = "range",
+            name = "Out of Power",
+            desc = "Button opacity when the action is not usable due to not enough mana/energy/rage. "..
+                   "By default this uses the generic 'not-usable' setting.",
+            min  = 0,
+            max  = 100,
+            step = 1,
+            get  = function() return getOpacity("oom",getOpacity("notUsable")) end,
+            set  = function(x) setOpacity("oom", x ~= getOpacity("notUsable") and x) end,
+            order = 3,
+          },
+
+          oorange = {
+            type = "range",
+            name = "Out of Range",
+            desc = "Button opacity when the action is not usable due to the target not being in range. "..
+                   "By default this uses the generic 'not-usable' setting.",
+            min  = 0,
+            max  = 100,
+            step = 1,
+            get  = function() return getOpacity("ooRange",getOpacity("notUsable")) end,
+            set  = function(x) setOpacity("ooRange", x ~= getOpacity("notUsable") and x) end,
+            order = 4,
+          },
+
+          empty = {
+            type = "range",
+            name = "Empty Slot",
+            desc = "Button opacity when the button's action slot is empty. By default this is 0 (fully transparent), "..
+                   "but note that they still block mouse clicks. Empty slots are automatically made opaque (per the "..
+                   "'usable' opacity setting) when moving actions around.",
+            min  = 0,
+            max  = 100,
+            step = 1,
+            get  = function() return getOpacity("empty",0) end,
+            set  = function(x) setOpacity("empty",x) end,
+            order = 5,
+          },
+
+          hideEmpty = {
+            type = "toggle",
+            name = "Hide Empty Slots",
+            desc = "Hides empty action slots rather than changing their opacity. This has the advantage that empty slots "..
+                   "don't block mouse clicks. WARNING: this makes it impossible to re-arrange actions with drag-and-drop "..
+                   "while in combat.",
+            get  = function() return config.hideEmptySlots end,
+            set  = function() config.hideEmptySlots = not config.hideEmptySlots ; refresh() end,
+            order = 6,
+          },
+
+        },
+      },
+
       keyloc = {
         type = "text",
         name = "Hotkey Location",
@@ -153,12 +250,20 @@
         set  = function() config.showMacroText = not config.showMacroText ; refresh() end,
       },
 
-      showgrid = {
+      hidecooldown = {
         type = "toggle",
-        name = "Always Show Buttons",
-        desc = "Show button placeholders when no action is assigned or on the cursor. Note that buttons are always shown when bars are unlocked.",
-        get  = function() return config.showGrid end,
-        set  = function() config.showGrid = not config.showGrid ; refresh() end,
+        name = "Hide Cooldowns",
+        desc = "Hides all cooldown displays on buttons. Toggling this on does not hide currently running cooldowns.",
+        get  = function() return config.hideCooldown end,
+        set  = function() config.hideCooldown = not config.hideCooldown ; refresh() end,
+      },
+
+      hideglobalcooldown = {
+        type = "toggle",
+        name = "Hide Global Cooldown",
+        desc = "Disables the global cooldown from being displayed on buttons.",
+        get  = function() return config.hideGlobalCooldown end,
+        set  = function() config.hideGlobalCooldown = not config.hideGlobalCooldown ; refresh() end,
       },
 
       colorhotkeys = {
--- a/Defaults.lua	Tue Mar 20 21:25:29 2007 +0000
+++ b/Defaults.lua	Tue Mar 20 21:33:59 2007 +0000
@@ -89,96 +89,8 @@
     btnConfig = tcopy(defaultActionConfig),
   },
 
-  -- multibar right
-  [2] = {
-    visible = false,
-    size = 36,
-    spacing = 6,
-    rows = 12,
-    columns = 1,
-    growLeft = true,
-    growUp = false,
-    columnMajor = true,
-    pages = nil,
-    opacity = 100,
-    anchor = { 
-      frame = "UIParent",
-      point = "BOTTOMRIGHT",
-      relPoint = "BOTTOMRIGHT",
-      x = -4,
-      y = 95,
-    },
-    btnConfig = tcopy(defaultActionConfig),
-  },
-
-  -- multibar left
-  [3] = {
-    visible = false,
-    size = 36,
-    spacing = 6,
-    rows = 12,
-    columns = 1,
-    growLeft = true,
-    growUp = false,
-    columnMajor = true,
-    pages = nil,
-    opacity = 100,
-    anchor = { 
-      frame = "UIParent",
-      point = "BOTTOMRIGHT",
-      relPoint = "BOTTOMRIGHT",
-      x = -51,
-      y = 95,
-    },
-    btnConfig = tcopy(defaultActionConfig),
-  },
-
-  -- multibar bottom right
-  [4] = {
-    visible = false,
-    size = 36,
-    spacing = 6,
-    rows = 1,
-    columns = 12,
-    growLeft = false,
-    growUp = false,
-    columnMajor = false,
-    pages = nil,
-    opacity = 100,
-    anchor = { 
-      frame = "MainMenuBarArtFrame",
-      point = "BOTTOMLEFT",
-      relPoint = "BOTTOMLEFT",
-      x = 514,
-      y = 53,
-    },
-    btnConfig = tcopy(defaultActionConfig),
-  },
-
-  -- multibar bottom left
-  [5] = {
-    visible = false,
-    size = 36,
-    spacing = 6,
-    rows = 1,
-    columns = 12,
-    growLeft = false,
-    growUp = false,
-    columnMajor = false,
-    pages = nil,
-    opacity = 100,
-    anchor = { 
-      frame = "MainMenuBarArtFrame",
-      point = "BOTTOMLEFT",
-      relPoint = "BOTTOMLEFT",
-      x = 3,
-      y = 53,
-    },
-    btnConfig = tcopy(defaultActionConfig),
-  },
-
   -- pet action bar
-  [6] = {
+  [10] = {
     visible = true,
     parent = "PetActionBarFrame",
     size = 30,
@@ -218,14 +130,8 @@
   }
 end
 
-for b = 2, 5 do
-  for i = 1, 12 do
-    bars[b].btnConfig.ids[i] = { 12*(b-1) + i }
-  end
+for i = 1, 10 do
+  bars[10].btnConfig.ids[i] = { i }
 end
 
-for i = 1, 10 do
-  bars[6].btnConfig.ids[i] = { i }
-end
 
-
--- a/Options.lua	Tue Mar 20 21:25:29 2007 +0000
+++ b/Options.lua	Tue Mar 20 21:33:59 2007 +0000
@@ -53,6 +53,7 @@
       desc = "Show ActionIDs on buttons",
       get  = "AreIdsVisible",
       set  = "ToggleIds",
+      disabled = true,
     },
 
     create = {
@@ -124,15 +125,6 @@
       order = 4,
     },
 
-    showid = {
-      type = "toggle",
-      name = "Show Action IDs",
-      desc = "Show ActionIDs on buttons",
-      get  = "AreIdsVisible",
-      set  = "ToggleIds",
-      order = 5,
-    },
-
     hidedefault = {
       type = "toggle",
       name = "Hide Default Main Menu Bar",
@@ -360,18 +352,6 @@
         }
       },
       
-      opacity = {
-        type = "range",
-        name = "Opacity",
-        desc = "Set the bar alpha value, from fully transparent (0) to fully opaque (100).",
-        get = "GetOpacity",
-        set = "SetOpacity",
-        min = 0,
-        max = 100,
-        step = 1,
-        order = 6,
-      },
-      
       delete = {
         type = "execute",
         name = "Delete Bar #"..bar.barID,
--- a/README.html	Tue Mar 20 21:25:29 2007 +0000
+++ b/README.html	Tue Mar 20 21:33:59 2007 +0000
@@ -7,8 +7,8 @@
 <body bgcolor="#FFFFFF" text="#000000">
 <h1 align="center">ReAction</h1>
 <h3 align="center">AddOn for World of Warcraft</h3>
-<p><font size="2">Current Version: 0.3 (beta)<br>
-  Released: 29 Jan 2007</font><font size="2"><br>
+<p><font size="2">Current Version: 0.31 (alpha)<br>
+  Released: 02 Feb 2007</font><font size="2"><br>
   WoW Version Compatibility/TOC: 2.0.6 / TOC 20003</font></p>
 <h2>The Basics</h2>
 <p>ReAction is a replacement for the default Blizzard action bars. It allows you 
@@ -30,6 +30,7 @@
   <li>Settings can be saved per account, realm, character, class, or independent 
     profile. </li>
   <li>Compatible with OmniCC</li>
+  <li>Various configurable display options</li>
 </ul>
 <p>ReAction is built using the <a href="http://www.wowace.com/Wiki/Ace2">Ace2</a> 
   development framework.</p>
@@ -41,8 +42,8 @@
 <p>When you first enter World of Warcraft with ReAction installed, it will look 
   very similar to the default Blizzard UI, depending on what other AddOns are 
   installed. Any keybindings you have made to the action bars, however, are not 
-  in effect. Also, only the main menu bar is shown by default. The bottom left, 
-  bottom right, and two right action bars are hidden.</p>
+  in effect. Also, only the main menu bar is shown by default. Other bars can 
+  be created as desired.</p>
 <p>If you have FuBar installed, on the left side you should see the ReAction plugin 
   icon and label. If not, there should be a button on your minimap. In either 
   case, that button (the ReAction Control Button) is the gateway to configuring 
@@ -110,12 +111,11 @@
   <li>If you have a bar with empty buttons, even though they're invisible they 
     still block mouse input from reaching whatever might be under the button. 
     This is a workaround so that you can drag and drop actions onto hidden slots 
-    during combat.</li>
+    during combat. This workaround can be disabled via a configuration option, 
+    but then you can't drag and drop actions onto slots during combat. Pick your 
+    poison, it's a limitation of Blizzard's protection scheme.</li>
   <li>If you hide the default main menu bar, there is no substitute for the XP 
     bar, bag bar, or micro menu bar (although the hotkeys for them still work)</li>
-  <li>The pet bar, by default, appears underneath bar #6 (lower left). You'll 
-    have to move bar 6 out of the way if you want to move the pet bar. Also, it 
-    does not</li>
 </ul>
 <h2>Known Issues</h2>
 <ul>
@@ -156,6 +156,31 @@
   <li>Localization</li>
 </ul>
 <h2>Version History</h2>
+<p>Version 0.31:</p>
+<ul>
+  <li>Fixed a bug where action IDs &gt; 120 were being configured and allocated 
+    in certain cases</li>
+  <li>Fixed a bug where hidden paging controls were reappearing when switching 
+    pages</li>
+  <li>Fixed a script error that was popping up in certain conditions when starting 
+    keybinding mode, and causing some buttons not to be bindable</li>
+  <li>Applied a fix that will (hopefully?) eliminate errors saying ACTIONBAR_UPDATE_STATE 
+    was not registered (be on the lookout for recurrences of that one). Hopefully 
+    this fix will eliminate several other intermittent errors that I think are 
+    part of the same cause.</li>
+  <li>Added new options for controlling the opacity of buttons (which should now 
+    actually work). Previous opacity settings (if any) will be lost and will need 
+    to be re-applied after updating. There is also now a toggle to hide (rather 
+    than alpha-zero) empty buttons, at the expense of not being able to drag actions 
+    onto them during combat.</li>
+  <li>Action IDs now appear/disappear automatically when bars are unlocked. There 
+    is no longer a menu item to show/hide them.</li>
+  <li>Changed the default startup bar configuration to only be the paged main 
+    bar. This allows a default startup to create new bars without having to delete 
+    some first. Will probably simplify even further in a future patch. Note this 
+    doesn't fix the action-rearrangement setup headaches with warriors, druids, 
+    and rogues.</li>
+</ul>
 <p>Version 0.3</p>
 <ul>
   <li>Complete rewrite of the innards for better modularity</li>
--- a/ReAction.toc	Tue Mar 20 21:25:29 2007 +0000
+++ b/ReAction.toc	Tue Mar 20 21:33:59 2007 +0000
@@ -4,7 +4,7 @@
 ## DefaultState: enabled
 ## LoadOnDemand: 0
 ## Author: Flick
-## Version: 0.3
+## Version: 0.31
 ## X-Description: An action bar and button layout tool
 ## X-Category: Action Bars
 ## SavedVariables: ReActionDB
--- a/classes/ReAction.lua	Tue Mar 20 21:25:29 2007 +0000
+++ b/classes/ReAction.lua	Tue Mar 20 21:33:59 2007 +0000
@@ -76,7 +76,7 @@
   TempShow           = "function", -- TempShow(visible), calls to this can be nested so keep track.
   GetActionFrame     = "function", -- f = GetActionFrame(), return a frame derived from SecureActionButtonTemplate (note: this is inherited unimplemented from ReBar.IButton)
   GetBaseButtonSize  = "function", -- sz = GetBaseButtonSize(), return size in pixels of the nominal button (square)
-  DisplayID          = "function", -- DisplayID(id), show the action ID (or equivalent). Pass nil to hide.
+  DisplayID          = "function", -- DisplayID(show), true/false to show/hide the action ID (or equivalent)
   DisplayHotkey      = "function", -- DisplayHotkey(keyText), set the hotkey display text
 }
 
@@ -146,8 +146,8 @@
 
   if id == nil then return nil end  -- all action ids are in use
 
-  -- if a hint is given, see if that one is free instead
-  if hint and (t[hint] == nil or t[hint].inUse == false) then
+  -- if a hint is given, see if that one is free instead, as long as it's < maxIDs
+  if hint and hint > 0 and hint <= maxIDs and (t[hint] == nil or t[hint].inUse == false) then
     id = hint
   end
 
@@ -214,7 +214,7 @@
   for _, t in pairs(self.buttonTypes) do
     if t.subtype._idTbl then
       for _, tbl in pairs(t.subtype._idTbl) do
-        if tbl.button then tbl.button:DisplayID(tbl.button:GetID()) end
+        if tbl.button then tbl.button:DisplayID(true) end
       end
     end
   end
@@ -225,7 +225,7 @@
   for _, t in pairs(self.buttonTypes) do
     if t.subtype._idTbl then
       for _, tbl in pairs(t.subtype._idTbl) do
-        if tbl.button then tbl.button:DisplayID(nil) end
+        if tbl.button then tbl.button:DisplayID(false) end
       end
     end
   end
@@ -248,10 +248,12 @@
 
 function ReAction.prototype:BarUnlocked()
   self:TempShow(true)
+  self:DisplayID(true)
 end
 
 function ReAction.prototype:BarLocked()
   self:TempShow(false)
+  self:DisplayID(false)
 end
 
 function ReAction.prototype:PlaceButton(parent, point, x, y, sz)
--- a/classes/ReAction_ActionDisplay.lua	Tue Mar 20 21:25:29 2007 +0000
+++ b/classes/ReAction_ActionDisplay.lua	Tue Mar 20 21:33:59 2007 +0000
@@ -7,12 +7,22 @@
 -- This mixin uses properties of self.config to define display elements:
 --
 -- self.config = {
---   keyBindLoc = "POSITION",       -- keybind anchor location
---   stackCountLoc = "POSITION",    -- stack count anchor location
---   showKeyBind = true/false,      -- show keybind labels
---   showStackCount = true/false,   -- show stack count labels
---   showMacroText = true/false,    -- show macro name labels
---   showGrid = true/false,         -- always show empty buttons
+--   keyBindLoc = "POSITION",         -- keybind anchor location
+--   stackCountLoc = "POSITION",      -- stack count anchor location
+--   showKeyBind = true/false,        -- show keybind labels
+--   showStackCount = true/false,     -- show stack count labels
+--   showMacroText = true/false,      -- show macro name labels
+--   showGrid = true/false,           -- always show empty buttons
+--   hideCooldown = true/false,       -- hide the cooldown timer
+--   hideGlobalCooldown = true/false, -- hide cooldown timers if duration < 1.5 seconds (global)
+--   opacity = {
+--     default   = 0-100 [100],       -- button opacity when the action is usable (default opacity)
+--     notUsable = 0-100 [100],       -- button opacity when the action is not usable
+--     oom       = 0-100 [notUsable], -- button opacity when the action is not usable due to OOM
+--     ooRange   = 0-100 [notUsable], -- button opacity when the action is not usable due to out of range
+--     empty     = 0-100 [0],         -- button opacity when the action slot is empty
+--   },
+--   hideEmptySlots = true/false,   -- show/hide empty buttons rather than change opacity to 0
 -- }
 --
 
@@ -116,7 +126,7 @@
   self:DisplayVisibility()
   -- refresh the action ID display
   if ReAction.showIDs_ then
-    self:DisplayID(self:GetID())
+    self:DisplayID(true)
   end
 end
 
@@ -134,9 +144,9 @@
   return 36
 end
 
-function RAAD:DisplayID( id )
+function RAAD:DisplayID( show )
   local f = self.frames.actionID
-  if id then
+  if show then
     if not f then
       -- create the actionID label
       f = self.frames.button:CreateFontString(nil,"ARTWORK","NumberFontNormalSmall")
@@ -144,7 +154,7 @@
       f:SetTextColor( tcolor(actionIDColor) )
       self.frames.actionID = f
     end
-    f:SetText(tostring(id))
+    f:SetText(tostring(self:GetID()))
     f:Show()
   elseif f then
     f:Hide()
@@ -161,6 +171,21 @@
   f.icon:SetVertexColor(          self:GetIconColor(isUsable, notEnoughMana, outOfRange) )
   f.button:GetNormalTexture():SetVertexColor( self:GetBorderColor(isUsable, notEnoughMana, outOfRange) )
   f.hotkey:SetTextColor(          self:GetHotkeyColor(isUsable, notEnoughMana, outOfRange, f.hotkey:GetText()) )
+
+  local o 
+  if isUsable then
+    o = self.config.opacity and self.config.opacity.usable or 1
+  else
+    o = self.config.opacity and self.config.opacity.notUsable or 1
+    if notEnoughMana then
+      o = self.config.opacity and self.config.opacity.oom or o
+    elseif outOfRange then
+      o = self.config.opacity and self.config.opacity.ooRange or o
+    end
+  end
+
+  self.currentOpacity = o  -- store for use in DisplayVisibility
+  self:DisplayVisibility()
 end
 
 function RAAD:DisplayEquipped( equipped )
@@ -205,6 +230,7 @@
 end
 
 function RAAD:DisplayCooldown( start, duration, enable )
+  enable = enable and not self.config.hideCooldown and (not self.config.hideGlobalCooldown or duration > 1.5)
   CooldownFrame_SetTimer(self.frames.cooldown, start, duration, enable)
 end
 
@@ -377,15 +403,26 @@
     if not InCombatLockdown() then
       b:Hide()
     end
+  elseif self.showTmp_ and self.showTmp_ > 0 then
+    b:GetNormalTexture():SetAlpha(0.5)
+    if self:IsActionEmpty() then
+      self.frames.cooldown:Hide()
+      if not InCombatLockdown() and not b:IsShown() then
+        b:Show()
+      end
+    end
+    b:SetAlpha(1)
   elseif not self:IsActionEmpty() then
     b:GetNormalTexture():SetAlpha(1.0)
-    b:SetAlpha(1)
-  elseif self.showTmp_ and self.showTmp_ > 0 or self.config.showGrid then
-    b:GetNormalTexture():SetAlpha(0.5)
-    self.frames.cooldown:Hide()
-    b:SetAlpha(1)
+    b:SetAlpha(self.currentOpacity or (self.config.opacity and self.config.opacity.usable) or 1)
   else
-    b:SetAlpha(0)
+    if self.config.hideEmptySlots then
+      if not InCombatLockdown() then
+        b:Hide()
+      end
+    else
+      b:SetAlpha(self.config.opacity and self.config.opacity.empty or 0)
+    end
   end
 end
 
--- a/classes/ReAction_ActionType.lua	Tue Mar 20 21:25:29 2007 +0000
+++ b/classes/ReAction_ActionType.lua	Tue Mar 20 21:33:59 2007 +0000
@@ -129,9 +129,8 @@
     -- UseAction() appears to swap the cursor action for the current action if
     -- an action is on the cursor.
     PlaceAction(self:GetID())
+    -- the ACTIONBAR_SLOT_CHANGED event will handle the update
   end
-  self:UpdateActionEvents()
-  self:UpdateIcon()
 end
 
 function RAAT:IsActionEmpty()
--- a/classes/ReAction_PetActionDisplay.lua	Tue Mar 20 21:25:29 2007 +0000
+++ b/classes/ReAction_PetActionDisplay.lua	Tue Mar 20 21:33:59 2007 +0000
@@ -134,7 +134,7 @@
   self:DisplayVisibility()
   -- refresh the action ID display
   if ReAction.showIDs_ then
-    self:DisplayID(self:GetID())
+    self:DisplayID(true)
   end
 end
 
@@ -152,9 +152,9 @@
   return 30
 end
 
-function RAPAD:DisplayID( id )
+function RAPAD:DisplayID( show )
   local f = self.frames.actionID
-  if id then
+  if show then
     if not f then
       -- create the actionID label
       f = self.frames.button:CreateFontString(nil,"ARTWORK","NumberFontNormalSmall")
@@ -162,7 +162,7 @@
       f:SetTextColor( tcolor(actionIDColor) )
       self.frames.actionID = f
     end
-    f:SetText(tostring(id))
+    f:SetText(tostring(self:GetID()))
     f:Show()
   elseif f then
     f:Hide()
--- a/classes/ReBar.lua	Tue Mar 20 21:25:29 2007 +0000
+++ b/classes/ReBar.lua	Tue Mar 20 21:33:59 2007 +0000
@@ -149,13 +149,19 @@
    
 
   -- create the bar and control widgets
-  self.barFrame     = CreateFrame("Frame", "ReBar"..id, config.parent and getglobal(config.parent) or UIParent, "ReBarTemplate")
+  local name = "ReBar"..id
+  self.barFrame     = CreateFrame("Frame", name, config.parent and getglobal(config.parent) or UIParent, "ReBarTemplate")
   self.controlFrame = getglobal(self.barFrame:GetName().."Controls")
   self.controlFrame.reBar = self
   self.barFrame:SetClampedToScreen(true)
 
+  -- get references to sub-frames
+  self.labelString = getglobal(name.."ControlsLabelString")
+  self.upArrow     = getglobal(name.."PageUp")
+  self.downArrow   = getglobal(name.."PageDown")
+  self.pageNum     = getglobal(name.."PageNumber")
+
   -- set the text label on the control widget
-  self.labelString = getglobal(self.controlFrame:GetName().."LabelString")
   self.labelString:SetText(id)
 
   -- initial stateheader state
@@ -178,8 +184,8 @@
 
   -- register page up/down buttons with ReBound for keybinding
   if ReBound then
-    ReBound:AddKeybindTarget(getglobal(self.barFrame:GetName().."PageUp"))
-    ReBound:AddKeybindTarget(getglobal(self.barFrame:GetName().."PageDown"))
+    ReBound:AddKeybindTarget(self.upArrow)
+    ReBound:AddKeybindTarget(self.downArrow)
   end
 
   -- add bar to anchorTargets list
@@ -281,19 +287,6 @@
   self:ApplyVisibility()
 end
 
-function ReBar.prototype:GetOpacity()
-  return tonumber(self.config.opacity) or 100
-end
-
-function ReBar.prototype:SetOpacity( o )
-  o = tonumber(o)
-  if o then
-    self.config.opacity = o
-    self:ApplyVisibility()
-    return self.config.opacity
-  end
-end
-
 function ReBar.prototype:GetButtonList()
  return self.buttons
 end
@@ -378,20 +371,19 @@
 
 function ReBar.prototype:ApplyAutoStanceSwitch()
   local switch = self:GetAutoStanceSwitch()
-  local _, class = UnitClass("player")
   if switch then
     -- check that the number of pages available is sufficient
-    local totalPages = nStancePages[class] + (self:GetAutoStealthSwitch() and 1 or 0)
+    local totalPages = nStancePages[playerClass] + (self:GetAutoStealthSwitch() and 1 or 0)
     if self:GetPages() < totalPages then
       self:SetPages(totalPages)
     end
-    for form, spec in pairs(stanceMaps[class]) do
+    for form, spec in pairs(stanceMaps[playerClass]) do
       self.barFrame:SetAttribute("statemap-stance-"..form,spec)
     end
     -- set initial value
     self.barFrame:SetAttribute("state-stance",GetShapeshiftForm(true))
   else
-    for form, _ in pairs(stanceMaps[class]) do
+    for form, _ in pairs(stanceMaps[playerClass]) do
       self.barFrame:SetAttribute("statemap-stance-"..form, ATTRIBUTE_NOOP)
     end
   end
@@ -415,21 +407,20 @@
 
 function ReBar.prototype:ApplyAutoStealthSwitch()
   local switch = self:GetAutoStealthSwitch()
-  local _, class = UnitClass("player")
   if switch then
     -- check that the number of pages available is sufficient
-    local totalPages = (self:GetAutoStanceSwitch() and nStancePages[class] > 0 and nStancePages[class] or 1) + 1
+    local totalPages = (self:GetAutoStanceSwitch() and nStancePages[playerClass] > 0 and nStancePages[playerClass] or 1) + 1
     if self:GetPages() < totalPages then
       self:SetPages(totalPages)
     end
     local s, s2
-    if class == "DRUID" and not self:GetAutoStanceSwitch() then
+    if playerClass == "DRUID" and not self:GetAutoStanceSwitch() then
       -- change mapping for cat->prowl and prowl->cat to 1:2 and 2:1 since no stance mapping
       s = "1:2"
       s2 = "2:1"
     end
-    self.barFrame:SetAttribute("statemap-stealth-1",s or stealthMaps[class])
-    self.barFrame:SetAttribute("statemap-stealth-0",s2 or unstealthMaps[class])
+    self.barFrame:SetAttribute("statemap-stealth-1",s or stealthMaps[playerClass])
+    self.barFrame:SetAttribute("statemap-stealth-0",s2 or unstealthMaps[playerClass])
     -- set initial value
     self.barFrame:SetAttribute("state-stealth",IsStealthed() or 0)
   else
@@ -462,13 +453,16 @@
 
 function ReBar.prototype:RefreshPageControls()
   local b = self.barFrame;
-  local upArrow   = getglobal(b:GetName().."PageUp")
-  local downArrow = getglobal(b:GetName().."PageDown")
-  local pageNum   = getglobal(b:GetName().."PageNumber")
+  local upArrow   = self.upArrow
+  local downArrow = self.downArrow
+  local pageNum   = self.pageNum
 
   if self:GetPages() > 1 and self.config.pages.showControls then
     local loc = self.config.pages.controlsLoc
 
+    upArrow:SetAttribute("hidestates",nil)
+    downArrow:SetAttribute("hidestates",nil)
+
     pageNum:ClearAllPoints()
     upArrow:ClearAllPoints()
     downArrow:ClearAllPoints()
@@ -519,6 +513,9 @@
     downArrow:Show()
     pageNum:Show()
   else
+    upArrow:SetAttribute("hidestates","1-"..self:GetPages())
+    downArrow:SetAttribute("hidestates","1-"..self:GetPages())
+
     upArrow:Hide()
     downArrow:Hide()
     pageNum:Hide()
@@ -566,10 +563,6 @@
 function ReBar.prototype:ApplyVisibility()
   local v = self.config.visible or not self.locked
   
-  if tonumber(self.config.opacity) then
-    self.barFrame:SetAlpha(self.config.opacity / 100)
-  end
-
   if v then
     self.barFrame:Show()
   else
@@ -831,3 +824,4 @@
   GameTooltip:AddLine("Drag to add/remove buttons")
   GameTooltip:Show()
 end
+
--- a/classes/ReBar.xml	Tue Mar 20 21:25:29 2007 +0000
+++ b/classes/ReBar.xml	Tue Mar 20 21:33:59 2007 +0000
@@ -83,14 +83,14 @@
   <!-- A ReBar is a container for buttons. The bar container itself is invisible and non-responsive to
        mouse input, but when unlocked a normally invisible child control frame becomes visible and
        consumes mouse events to move, resize, and set bar options. -->
-  <Frame name="ReBarTemplate" inherits="SecureStateDriverTemplate" frameStrata="MEDIUM" virtual="true" toplevel="true" movable="true" resizable="true">
+  <Frame name="ReBarTemplate" inherits="SecureStateDriverTemplate" frameStrata="MEDIUM" virtual="true" movable="true" resizable="true">
     <Frames>
       <Frame name="$parentControl" setAllPoints="true">
         <!-- this nesting is to ensure the control frame is on top of the buttons, which will 
              live at this level -->
         <Frames>
           <!-- name: e.g. $parentControls (with an s) - yes I know, goofy naming structure -->
-          <Button name="$parents" hidden="true" enableMouse="true" setAllPoints="true">
+          <Button name="$parents" hidden="true" enableMouse="true" toplevel="true" setAllPoints="true">
             <Anchors>
               <Anchor point="TOPLEFT">
                 <Offset>
--- a/libs/AceComm-2.0/AceComm-2.0.lua	Tue Mar 20 21:25:29 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2623 +0,0 @@
---[[
-Name: AceComm-2.0
-Revision: $Rev: 18708 $
-Developed by: The Ace Development Team (http://www.wowace.com/index.php/The_Ace_Development_Team)
-Inspired By: Ace 1.x by Turan (turan@gryphon.com)
-Website: http://www.wowace.com/
-Documentation: http://www.wowace.com/index.php/AceComm-2.0
-SVN: http://svn.wowace.com/wowace/trunk/Ace2/AceComm-2.0
-Description: Mixin to allow for inter-player addon communications.
-Dependencies: AceLibrary, AceOO-2.0, AceEvent-2.0,
-              ChatThrottleLib by Mikk (included)
-]]
-
-local MAJOR_VERSION = "AceComm-2.0"
-local MINOR_VERSION = "$Revision: 18708 $"
-
-if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary") end
-if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end
-
-if not AceLibrary:HasInstance("AceOO-2.0") then error(MAJOR_VERSION .. " requires AceOO-2.0") end
-
-local _G = getfenv(0)
-
-local AceOO = AceLibrary("AceOO-2.0")
-local Mixin = AceOO.Mixin
-local AceComm = Mixin {
-						"SendCommMessage",
-						"SendPrioritizedCommMessage",
-						"RegisterComm",
-						"UnregisterComm",
-						"UnregisterAllComms",
-						"IsCommRegistered",
-						"SetDefaultCommPriority",
-						"SetCommPrefix",
-						"RegisterMemoizations",
-						"IsUserInChannel",
-					  }
-AceComm.hooks = {}
-
-local AceEvent = AceLibrary:HasInstance("AceEvent-2.0") and AceLibrary("AceEvent-2.0")
-
-local string_byte = string.byte
-
-local byte_a = string_byte('a')
-local byte_z = string_byte('z')
-local byte_A = string_byte('A')
-local byte_Z = string_byte('Z')
-local byte_fake_s = string_byte('\015')
-local byte_fake_S = string_byte('\020')
-local byte_deg = string_byte('°')
-local byte_percent = string_byte('%') -- 37
-
-local byte_b = string_byte('b')
-local byte_B = string_byte('B')
-local byte_nil = string_byte('/')
-local byte_plus = string_byte('+')
-local byte_minus = string_byte('-')
-local byte_d = string_byte('d')
-local byte_D = string_byte('D')
-local byte_e = string_byte('e')
-local byte_E = string_byte('E')
-local byte_m = string_byte('m')
-local byte_s = string_byte('s')
-local byte_S = string_byte('S')
-local byte_o = string_byte('o')
-local byte_O = string_byte('O')
-local byte_t = string_byte('t')
-local byte_T = string_byte('T')
-local byte_u = string_byte('u')
-local byte_U = string_byte('U')
-local byte_i = string_byte('i')
-local byte_inf = string_byte('@')
-local byte_ninf = string_byte('$')
-local byte_nan = string_byte('!')
-
-local inf = 1/0
-local nan = 0/0
-
-local math_floor = math.floor
-local math_mod = math.fmod
-local math_floormod = function(value, m)
-	return math_mod(math_floor(value), m)
-end
-local string_gmatch = string.gmatch
-local string_char = string.char
-local string_len = string.len
-local string_format = string.format
-local string_gsub = string.gsub
-local string_find = string.find
-local table_insert = table.insert
-local string_sub = string.sub
-local table_concat = table.concat
-local table_remove = table.remove
-
-local type = type
-local unpack = unpack
-local pairs = pairs
-local next = next
-
-local player = UnitName("player")
-
-local NumericCheckSum, HexCheckSum, BinaryCheckSum
-local TailoredNumericCheckSum, TailoredHexCheckSum, TailoredBinaryCheckSum
-do
-	local SOME_PRIME = 16777213
-	function NumericCheckSum(text)
-		local counter = 1
-		local len = string_len(text)
-		for i = 1, len, 3 do
-			counter = math_mod(counter*8257, 16777259) +
-				(string_byte(text,i)) +
-				((string_byte(text,i+1) or 1)*127) +
-				((string_byte(text,i+2) or 2)*16383)
-		end
-		return math_mod(counter, 16777213)
-	end
-	
-	function HexCheckSum(text)
-		return string_format("%06x", NumericCheckSum(text))
-	end
-	
-	function BinaryCheckSum(text)
-		local num = NumericCheckSum(text)
-		return string_char(math_floor(num / 65536), math_floormod(num / 256, 256), math_mod(num, 256))
-	end
-	
-	function TailoredNumericCheckSum(text)
-		local hash = NumericCheckSum(text)
-		local a = math_floor(hash / 65536)
-		local b = math_floormod(hash / 256, 256)
-		local c = math_mod(hash, 256)
-		-- \000, \n, |, °, s, S, \015, \020
-		if a == 0 or a == 10 or a == 124 or a == 176 or a == 115 or a == 83 or a == 15 or a == 20 or a == 37 then
-			a = a + 1
-		-- \t, \255
-		elseif a == 9 or a == 255 then
-			a = a - 1
-		end
-		if b == 0 or b == 10 or b == 124 or b == 176 or b == 115 or b == 83 or b == 15 or b == 20 or b == 37 then
-			b = b + 1
-		elseif b == 9 or b == 255 then
-			b = b - 1
-		end
-		if c == 0 or c == 10 or c == 124 or c == 176 or c == 115 or c == 83 or c == 15 or c == 20 or c == 37 then
-			c = c + 1
-		elseif c == 9 or c == 255 then
-			c = c - 1
-		end
-		return a * 65536 + b * 256 + c
-	end
-	
-	function TailoredHexCheckSum(text)
-		return string_format("%06x", TailoredNumericCheckSum(text))
-	end
-	
-	function TailoredBinaryCheckSum(text)
-		local num = TailoredNumericCheckSum(text)
-		return string_char(math_floor(num / 65536), math_floormod(num / 256, 256), math_mod(num, 256))
-	end
-end
-
-local function GetLatency()
-	local _,_,lag = GetNetStats()
-	return lag / 1000
-end
-
-local function IsInChannel(chan)
-	return GetChannelName(chan) ~= 0
-end
-
--- Package a message for transmission
-local function Encode(text, drunk)
-	text = string_gsub(text, "°", "°±")
-	if drunk then
-		text = string_gsub(text, "\020", "°\021")
-		text = string_gsub(text, "\015", "°\016")
-		text = string_gsub(text, "S", "\020")
-		text = string_gsub(text, "s", "\015")
-		-- change S and s to a different set of character bytes.
-	end
-	text = string_gsub(text, "\255", "°\254") -- \255 (this is here because \000 is more common)
-	text = string_gsub(text, "%z", "\255") -- \000
-	text = string_gsub(text, "\010", "°\011") -- \n
-	text = string_gsub(text, "\124", "°\125") -- |
-	text = string_gsub(text, "%%", "°\038") -- %
-	-- encode assorted prohibited characters
-	return text
-end
-
-local func
--- Clean a received message
-local function Decode(text, drunk)
-	if drunk then
-		text = string_gsub(text, "^(.*)°.-$", "%1")
-		-- get rid of " ...hic!"
-	end
-	if not func then
-		func = function(text)
-			if text == "\016" then
-				return "\015"
-			elseif text == "\021" then
-				return "\020"
-			elseif text == "±" then
-				return "°"
-			elseif text == "\254" then
-				return "\255"
-			elseif text == "\011" then
-				return "\010"
-			elseif text == "\125" then
-				return "\124"
-			elseif text == "\038" then
-				return "\037"
-			end
-		end
-	end
-	text = string_gsub(text, "\255", "\000")
-	if drunk then
-		text = string_gsub(text, "\020", "S")
-		text = string_gsub(text, "\015", "s")
-	end
-	text = string_gsub(text, drunk and "°([\016\021±\254\011\125\038])" or "°([±\254\011\125\038])", func)
-	-- remove the hidden character and refix the prohibited characters.
-	return text
-end
-
-local lastChannelJoined
-
-function AceComm.hooks:JoinChannelByName(orig, channel, a,b,c,d,e,f,g,h,i)
-	lastChannelJoined = channel
-	return orig(channel, a,b,c,d,e,f,g,h,i)
-end
-
-local function JoinChannel(channel)
-	if not IsInChannel(channel) then
-		LeaveChannelByName(channel)
-		AceComm:ScheduleEvent(JoinChannelByName, 0, channel)
-	end
-end
-
-local function LeaveChannel(channel)
-	if IsInChannel(channel) then
-		LeaveChannelByName(channel)
-	end
-end
-
-local switches = {}
-
-local function SwitchChannel(former, latter)
-	if IsInChannel(former) then
-		LeaveChannelByName(former)
-		switches[{
-			former = former,
-			latter = latter
-		}] = true
-		return
-	end
-	if not IsInChannel(latter) then
-		JoinChannelByName(latter)
-	end
-end
-
-local shutdown = false
-
-local zoneCache
-local function GetCurrentZoneChannel()
-	if not zoneCache then
-		zoneCache = "AceCommZone" .. HexCheckSum(GetRealZoneText())
-	end
-	return zoneCache
-end
-
-local AceComm_registry
-
-local function SupposedToBeInChannel(chan)
-	if not string_find(chan, "^AceComm") then
-		return true
-	elseif shutdown or not AceEvent:IsFullyInitialized() then
-		return false
-	end
-	
-	if chan == "AceComm" then
-		return AceComm_registry.GLOBAL and next(AceComm_registry.GLOBAL) and true or false
-	elseif string_find(chan, "^AceCommZone%x%x%x%x%x%x$") then
-		if chan == GetCurrentZoneChannel() then
-			return AceComm_registry.ZONE and next(AceComm_registry.ZONE) and true or false
-		else
-			return false
-		end
-	else
-		return AceComm_registry.CUSTOM and AceComm_registry.CUSTOM[chan] and next(AceComm_registry.CUSTOM[chan]) and true or false
-	end
-end
-
-local tmp = {}
-local function LeaveAceCommChannels(all)
-	if all then
-		shutdown = true
-	end
-	local _,a,_,b,_,c,_,d,_,e,_,f,_,g,_,h,_,i,_,j = GetChannelList()
-	tmp[1] = a
-	tmp[2] = b
-	tmp[3] = c
-	tmp[4] = d
-	tmp[5] = e
-	tmp[6] = f
-	tmp[7] = g
-	tmp[8] = h
-	tmp[9] = i
-	tmp[10] = j
-	for _,v in ipairs(tmp) do
-		if v and string_find(v, "^AceComm") then
-			if not SupposedToBeInChannel(v) then
-				LeaveChannelByName(v)
-			end
-		end
-	end
-	for i = 1, 10 do
-		tmp[i] = nil
-	end
-end
-
-local lastRefix = 0
-local function RefixAceCommChannelsAndEvents()
-	if GetTime() - lastRefix <= 5 then
-		AceComm:ScheduleEvent(RefixAceCommChannelsAndEvents, 1)
-		return
-	end
-	lastRefix = GetTime()
-	LeaveAceCommChannels(false)
-	
-	local channel = false
-	local whisper = false
-	local addon = false
-	if SupposedToBeInChannel("AceComm") then
-		JoinChannel("AceComm")
-		channel = true
-	end
-	if SupposedToBeInChannel(GetCurrentZoneChannel()) then
-		JoinChannel(GetCurrentZoneChannel())
-		channel = true
-	end
-	if AceComm_registry.CUSTOM then
-		for k,v in pairs(AceComm_registry.CUSTOM) do
-			if next(v) and SupposedToBeInChannel(k) then
-				JoinChannel(k)
-				channel = true
-			end
-		end
-	end
-	if AceComm_registry.WHISPER then
-		whisper = true
-	end
-	if AceComm_registry.GROUP or AceComm_registry.PARTY or AceComm_registry.RAID or AceComm_registry.BATTLEGROUND or AceComm_registry.GUILD then
-		addon = true
-	end
-	
-	if channel then
-		if not AceComm:IsEventRegistered("CHAT_MSG_CHANNEL") then
-			AceComm:RegisterEvent("CHAT_MSG_CHANNEL")
-		end
-		if not AceComm:IsEventRegistered("CHAT_MSG_CHANNEL_LIST") then
-			AceComm:RegisterEvent("CHAT_MSG_CHANNEL_LIST")
-		end
-		if not AceComm:IsEventRegistered("CHAT_MSG_CHANNEL_JOIN") then
-			AceComm:RegisterEvent("CHAT_MSG_CHANNEL_JOIN")
-		end
-		if not AceComm:IsEventRegistered("CHAT_MSG_CHANNEL_LEAVE") then
-			AceComm:RegisterEvent("CHAT_MSG_CHANNEL_LEAVE")
-		end
-	else
-		if AceComm:IsEventRegistered("CHAT_MSG_CHANNEL") then
-			AceComm:UnregisterEvent("CHAT_MSG_CHANNEL")
-		end
-		if AceComm:IsEventRegistered("CHAT_MSG_CHANNEL_LIST") then
-			AceComm:UnregisterEvent("CHAT_MSG_CHANNEL_LIST")
-		end
-		if AceComm:IsEventRegistered("CHAT_MSG_CHANNEL_JOIN") then
-			AceComm:UnregisterEvent("CHAT_MSG_CHANNEL_JOIN")
-		end
-		if AceComm:IsEventRegistered("CHAT_MSG_CHANNEL_LEAVE") then
-			AceComm:UnregisterEvent("CHAT_MSG_CHANNEL_LEAVE")
-		end
-	end
-	
-	if whisper then
-		if not AceComm:IsEventRegistered("CHAT_MSG_WHISPER") then
-			AceComm:RegisterEvent("CHAT_MSG_WHISPER")
-		end
-	else
-		if AceComm:IsEventRegistered("CHAT_MSG_WHISPER") then
-			AceComm:UnregisterEvent("CHAT_MSG_WHISPER")
-		end
-	end
-	
-	if addon then
-		if not AceComm:IsEventRegistered("CHAT_MSG_ADDON") then
-			AceComm:RegisterEvent("CHAT_MSG_ADDON")
-		end
-	else
-		if AceComm:IsEventRegistered("CHAT_MSG_ADDON") then
-			AceComm:UnregisterEvent("CHAT_MSG_ADDON")
-		end
-	end
-end
-
-
-do
-	local myFunc = function(k)
-		if not IsInChannel(k.latter) then
-			JoinChannelByName(k.latter)
-		end
-		switches[k] = nil
-	end
-	
-	function AceComm:CHAT_MSG_CHANNEL_NOTICE(kind, _, _, deadName, _, _, _, num, channel)
-		if kind == "YOU_LEFT" then
-			if not string_find(channel, "^AceComm") then
-				return
-			end
-			for k in pairs(switches) do
-				if k.former == channel then
-					self:ScheduleEvent(myFunc, 0, k)
-				end
-			end
-			if channel == GetCurrentZoneChannel() then
-				self:TriggerEvent("AceComm_LeftChannel", "ZONE")
-			elseif channel == "AceComm" then
-				self:TriggerEvent("AceComm_LeftChannel", "GLOBAL")
-			else
-				self:TriggerEvent("AceComm_LeftChannel", "CUSTOM", string_sub(channel, 8))
-			end
-			if string_find(channel, "^AceComm") and SupposedToBeInChannel(channel) then
-				self:ScheduleEvent(JoinChannel, 0, channel)
-			end
-			if AceComm.userRegistry[channel] then
-				AceComm.userRegistry[channel] = nil
-			end
-		elseif kind == "YOU_JOINED" then
-			if not string_find(num == 0 and deadName or channel, "^AceComm") then
-				return
-			end
-			if num == 0 then
-				self:ScheduleEvent(LeaveChannelByName, 0, deadName)
-				switches[{
-					former = deadName,
-					latter = deadName,
-				}] = true
-			elseif channel == GetCurrentZoneChannel() then
-				self:TriggerEvent("AceComm_JoinedChannel", "ZONE")
-			elseif channel == "AceComm" then
-				self:TriggerEvent("AceComm_JoinedChannel", "GLOBAL")
-			else
-				self:TriggerEvent("AceComm_JoinedChannel", "CUSTOM", string_sub(channel, 8))
-			end
-			if num ~= 0 then
-				if not SupposedToBeInChannel(channel) then
-					LeaveChannel(channel)
-				else
-					ListChannelByName(channel)
-				end
-			end
-		end
-	end
-end
-
-local Serialize
-do
-	local recurse
-	local function _Serialize(v, textToHash)
-		local kind = type(v)
-		if kind == "boolean" then
-			if v then
-				return "B" -- true
-			else
-				return "b" -- false
-			end
-		elseif not v then
-			return "/"
-		elseif kind == "number" then
-			if v == math_floor(v) then
-				if v <= 127 and v >= -128 then
-					if v < 0 then
-						v = v + 256
-					end
-					return string_char(byte_d, v)
-				elseif v <= 32767 and v >= -32768 then
-					if v < 0 then
-						v = v + 65536
-					end
-					return string_char(byte_D, math_floor(v / 256), math_mod(v, 256))
-				elseif v <= 2147483647 and v >= -2147483648 then
-					if v < 0 then
-						v = v + 4294967296
-					end
-					return string_char(byte_e, math_floor(v / 16777216), math_floormod(v / 65536, 256), math_floormod(v / 256, 256), math_mod(v, 256))
-				elseif v <= 9223372036854775807 and v >= -9223372036854775808 then
-					if v < 0 then
-						v = v + 18446744073709551616
-					end
-					return string_char(byte_E, math_floor(v / 72057594037927936), math_floormod(v / 281474976710656, 256), math_floormod(v / 1099511627776, 256), math_floormod(v / 4294967296, 256), math_floormod(v / 16777216, 256), math_floormod(v / 65536, 256), math_floormod(v / 256, 256), math_mod(v, 256))
-				end
-			elseif v == inf then
-				return string_char(64 --[[byte_inf]])
-			elseif v == -inf then
-				return string_char(36 --[[byte_ninf]])
-			elseif v ~= v then
-				return string_char(33 --[[byte_nan]])
-			end
---			do
---				local s = tostring(v)
---				local len = string_len(s)
---				return string_char(byte_plus, len) .. s
---			end
-			local sign = v < 0 or v == 0 and tostring(v) == "-0"
-			if sign then
-				v = -v
-			end
-			local m, exp = math.frexp(v)
-			m = m * 9007199254740992
-			local x = exp + 1023
-			local b = math_mod(m, 256)
-			local c = math_floormod(m / 256, 256)
-			m = math_floor(m / 65536)
-			m = m + x * 137438953472
-			return string_char(sign and byte_minus or byte_plus, math_floormod(m / 1099511627776, 256), math_floormod(m / 4294967296, 256), math_floormod(m / 16777216, 256), math_floormod(m / 65536, 256), math_floormod(m / 256, 256), math_mod(m, 256), c, b)
-		elseif kind == "string" then
-			local hash = textToHash and textToHash[v]
-			if hash then
-				return string_char(byte_m, math_floor(hash / 65536), math_floormod(hash / 256, 256), math_mod(hash, 256))
-			end
-			local _,_,A,B,C,D,E,F,G,H = string_find(v, "^|cff%x%x%x%x%x%x|Hitem:(%d+):(%d+):(%d+):(%d+):(%d+):(%d+):(%-?%d+):(%d+)|h%[.+%]|h|r$")
-			if A then
-				-- item link
-				
-				A = A+0 -- convert to number
-				B = B+0
-				C = C+0
-				D = D+0
-				E = E+0
-				F = F+0
-				G = G+0
-				H = H+0
-				
-				-- (1-35000):(1-3093):(1-3093):(1-3093):(1-3093):(?):(-57 to 2164):(0-4294967295)
-				
-				F = nil -- don't care
-				if G < 0 then
-					G = G + 65536 -- handle negatives
-				end
-				
-				H = math_mod(H, 65536) -- only lower 16 bits matter
-				
-				return string_char(byte_i, math_floormod(A / 256, 256), math_mod(A, 256), math_floormod(B / 256, 256), math_mod(B, 256), math_floormod(C / 256, 256), math_mod(C, 256), math_floormod(D / 256, 256), math_mod(D, 256), math_floormod(E / 256, 256), math_mod(E, 256), math_floormod(G / 256, 256), math_mod(G, 256), math_floormod(H / 256, 256), math_mod(H, 256))
-			else
-				-- normal string
-				local len = string_len(v)
-				if len <= 255 then
-					return string_char(byte_s, len) .. v
-				else
-					return string_char(byte_S, math_floor(len / 256), math_mod(len, 256)) .. v
-				end
-			end
-		elseif kind == "function" then
-			AceComm:error("Cannot serialize a function")
-		elseif kind == "table" then
-			if recurse[v] then
-				for k in pairs(recurse) do
-					recurse[k] = nil
-				end
-				AceComm:error("Cannot serialize a recursive table")
-				return
-			end
-			recurse[v] = true
-			if AceOO.inherits(v, AceOO.Class) then
-				if not v.class then
-					AceComm:error("Cannot serialize an AceOO class, can only serialize objects")
-				elseif type(v.Serialize) ~= "function" then
-					AceComm:error("Cannot serialize an AceOO object without the `Serialize' method.")
-				elseif type(v.class.Deserialize) ~= "function" then
-					AceComm:error("Cannot serialize an AceOO object without the `Deserialize' static method.")
-				elseif type(v.class.GetLibraryVersion) ~= "function" or not AceLibrary:HasInstance(v.class:GetLibraryVersion()) then
-					AceComm:error("Cannot serialize an AceOO object if the class is not registered with AceLibrary.")
-				end
-				local classHash = TailoredBinaryCheckSum(v.class:GetLibraryVersion())
-				local t = { classHash, v:Serialize() }
-				for i = 2, #t do
-					t[i] = _Serialize(t[i], textToHash)
-				end
-				if not notFirst then
-					for k in pairs(recurse) do
-						recurse[k] = nil
-					end
-				end
-				local s = table.concat(t)
-				t = nil
-				local len = string_len(s)
-				if len <= 255 then
-					return string_char(byte_o, len) .. s
-				else
-					return string_char(byte_O, math_floor(len / 256), math_mod(len, 256)) .. s
-				end
-			end
-			local t = {}
-			local islist = false
-			local n = #v
-			if n >= 1 then
-				islist = true
-				for k,u in pairs(v) do
-					if type(k) ~= "number" or k < 1 then
-						islist = false
-						break
-					end
-				end
-			end
-			if islist then
-				n = n * 4
-				while v[n] == nil do
-					n = n - 1
-				end
-				for i = 1, n do
-					t[i] = _Serialize(v[i], textToHash)
-				end
-			else
-				local i = 1
-				for k,u in pairs(v) do
-					t[i] = _Serialize(k, textToHash)
-					t[i+1] = _Serialize(u, textToHash)
-					i = i + 2
-				end
-			end
-			if not notFirst then
-				for k in pairs(recurse) do
-					recurse[k] = nil
-				end
-			end
-			local s = table.concat(t)
-			t = nil
-			local len = string_len(s)
-			if islist then
-				if len <= 255 then
-					return string_char(byte_u, len) .. s
-				else
-					return "U" .. string_char(math_floor(len / 256), math_mod(len, 256)) .. s
-				end
-			else
-				if len <= 255 then
-					return "t" .. string_char(len) .. s
-				else
-					return "T" .. string_char(math_floor(len / 256), math_mod(len, 256)) .. s
-				end
-			end
-		end
-	end
-	
-	function Serialize(value, textToHash)
-		if not recurse then
-			recurse = {}
-		end
-		local chunk = _Serialize(value, textToHash)
-		for k in pairs(recurse) do
-			recurse[k] = nil
-		end
-		return chunk
-	end
-end
-
-local Deserialize
-do
-	local tmp = {}
-	local function _Deserialize(value, position, hashToText)
-		if not position then
-			position = 1
-		end
-		local x = string_byte(value, position)
-		if x == byte_b then
-			-- false
-			return false, position
-		elseif x == byte_B then
-			-- true
-			return true, position
-		elseif x == byte_nil then
-			-- nil
-			return nil, position
-		elseif x == byte_i then
-			-- 14-byte item link
-			local a1 = string_byte(value, position + 1)
-			local a2 = string_byte(value, position + 2)
-			local b1 = string_byte(value, position + 3)
-			local b2 = string_byte(value, position + 4)
-			local c1 = string_byte(value, position + 5)
-			local c2 = string_byte(value, position + 6)
-			local d1 = string_byte(value, position + 7)
-			local d2 = string_byte(value, position + 8)
-			local e1 = string_byte(value, position + 9)
-			local e2 = string_byte(value, position + 10)
-			local g1 = string_byte(value, position + 11)
-			local g2 = string_byte(value, position + 12)
-			local h1 = string_byte(value, position + 13)
-			local h2 = string_byte(value, position + 14)
-			local A = a1 * 256 + a2
-			local B = b1 * 256 + b2
-			local C = c1 * 256 + c2
-			local D = d1 * 256 + d2
-			local E = e1 * 256 + e2
-			local G = g1 * 256 + g2
-			local H = h1 * 256 + h2
-			if G >= 32768 then
-				G = G - 65536
-			end
-			local s = string.format("item:%d:%d:%d:%d:%d:%d:%d:%d", A, B, C, D, E, 0, G, H)
-			local _, link = GetItemInfo(s)
-			return link, position + 14
-		elseif x == byte_m then
-			local hash = string_byte(value, position + 1) * 65536 + string_byte(value, position + 2) * 256 + string_byte(value, position + 3)
-			return hashToText[hash], position + 3
-		elseif x == byte_s then
-			-- 0-255-byte string
-			local len = string_byte(value, position + 1)
-			return string.sub(value, position + 2, position + 1 + len), position + 1 + len
-		elseif x == byte_S then
-			-- 256-65535-byte string
-			local len = string_byte(value, position + 1) * 256 + string_byte(value, position + 2)
-			return string.sub(value, position + 3, position + 2 + len), position + 2 + len
-		elseif x == 64 --[[byte_inf]] then
-			return inf, position
-		elseif x == 36 --[[byte_ninf]] then
-			return -inf, position
-		elseif x == 33 --[[byte_nan]] then
-			return nan, position
-		elseif x == byte_d then
-			-- 1-byte integer
-			local a = string_byte(value, position + 1)
-			if a >= 128 then
-				a = a - 256
-			end
-			return a, position + 1
-		elseif x == byte_D then
-			-- 2-byte integer
-			local a = string_byte(value, position + 1)
-			local b = string_byte(value, position + 2)
-			local N = a * 256 + b
-			if N >= 32768 then
-				N = N - 65536
-			end
-			return N, position + 2
-		elseif x == byte_e then
-			-- 4-byte integer
-			local a = string_byte(value, position + 1)
-			local b = string_byte(value, position + 2)
-			local c = string_byte(value, position + 3)
-			local d = string_byte(value, position + 4)
-			local N = a * 16777216 + b * 65536 + c * 256 + d
-			if N >= 2147483648 then
-				N = N - 4294967296
-			end
-			return N, position + 4
-		elseif x == byte_E then
-			-- 8-byte integer
-			local a = string_byte(value, position + 1)
-			local b = string_byte(value, position + 2)
-			local c = string_byte(value, position + 3)
-			local d = string_byte(value, position + 4)
-			local e = string_byte(value, position + 5)
-			local f = string_byte(value, position + 6)
-			local g = string_byte(value, position + 7)
-			local h = string_byte(value, position + 8)
-			local N = a * 72057594037927936 + b * 281474976710656 + c * 1099511627776 + d * 4294967296 + e * 16777216 + f * 65536 + g * 256 + h
-			if N >= 9223372036854775808 then
-				N = N - 18446744073709551616
-			end
-			return N, position + 8
-		elseif x == byte_plus or x == byte_minus then
-			local a = string_byte(value, position + 1)
-			local b = string_byte(value, position + 2)
-			local c = string_byte(value, position + 3)
-			local d = string_byte(value, position + 4)
-			local e = string_byte(value, position + 5)
-			local f = string_byte(value, position + 6)
-			local g = string_byte(value, position + 7)
-			local h = string_byte(value, position + 8)
-			local N = a * 1099511627776 + b * 4294967296 + c * 16777216 + d * 65536 + e * 256 + f
-			local sign = x
-			local x = math.floor(N / 137438953472)
-			local m = math_mod(N, 137438953472) * 65536 + g * 256 + h
-			local mantissa = m / 9007199254740992
-			local exp = x - 1023
-			local val = math.ldexp(mantissa, exp)
-			if sign == byte_minus then
-				return -val, position + 8
-			end
-			return val, position + 8
-		elseif x == byte_u or x == byte_U then
-			-- numerically-indexed table
-			local finish
-			local start
-			if x == byte_u then
-				local len = string_byte(value, position + 1)
-				finish = position + 1 + len
-				start = position + 2
-			else
-				local len = string_byte(value, position + 1) * 256 + string_byte(value, position + 2)
-				finish = position + 2 + len
-				start = position + 3
-			end
-			local t = {}
-			local n = 0
-			local curr = start - 1
-			while curr < finish do
-				local v
-				v, curr = _Deserialize(value, curr + 1, hashToText)
-				n = n + 1
-				t[n] = v
-			end
-			return t, finish
-		elseif x == byte_o or x == byte_O then
-			-- numerically-indexed table
-			local finish
-			local start
-			if x == byte_o then
-				local len = string_byte(value, position + 1)
-				finish = position + 1 + len
-				start = position + 2
-			else
-				local len = string_byte(value, position + 1) * 256 + string_byte(value, position + 2)
-				finish = position + 2 + len
-				start = position + 3
-			end
-			local hash = string_byte(value, start) * 65536 + string_byte(value, start + 1) * 256 + string_byte(value, start + 2)
-			local curr = start + 2
-			if not AceComm.classes[hash] then
-				return nil, finish
-			end
-			local class = AceComm.classes[hash]
-			if type(class.Deserialize) ~= "function" or type(class.prototype.Serialize) ~= "function" then
-				return nil, finish
-			end
-			local n = 0
-			while curr < finish do
-				local v
-				v, curr = _Deserialize(value, curr + 1, hashToText)
-				n = n + 1
-				tmp[n] = v
-			end
-			local object = class:Deserialize(unpack(tmp))
-			for i = 1, n do
-				tmp[i] = nil
-			end
-			return object, finish
-		elseif x == byte_t or x == byte_T then
-			-- table
-			local finish
-			local start
-			if x == byte_t then
-				local len = string_byte(value, position + 1)
-				finish = position + 1 + len
-				start = position + 2
-			else
-				local len = string_byte(value, position + 1) * 256 + string_byte(value, position + 2)
-				finish = position + 2 + len
-				start = position + 3
-			end
-			local t = {}
-			local curr = start - 1
-			while curr < finish do
-				local key, l = _Deserialize(value, curr + 1, hashToText)
-				local value, m = _Deserialize(value, l + 1, hashToText)
-				curr = m
-				t[key] = value
-			end
-			if type(t.n) ~= "number" then
-				local i = 1
-				while t[i] ~= nil do
-					i = i + 1
-				end
-			end
-			return t, finish
-		else
-			error("Improper serialized value provided")
-		end
-	end
-	
-	function Deserialize(value, hashToText)
-		local ret,msg = pcall(_Deserialize, value, nil, hashToText)
-		if ret then
-			return msg
-		end
-	end
-end
-
-local function GetCurrentGroupDistribution()
-	if MiniMapBattlefieldFrame.status == "active" then
-		return "BATTLEGROUND"
-	elseif UnitInRaid("player") then
-		return "RAID"
-	elseif UnitInParty("player") then
-		return "PARTY"
-	else
-		return nil
-	end
-end
-
-local function IsInDistribution(dist, customChannel)
-	if dist == "GROUP" then
-		return GetCurrentGroupDistribution() and true or false
-	elseif dist == "BATTLEGROUND" then
-		return MiniMapBattlefieldFrame.status == "active"
-	elseif dist == "RAID" then
-		return UnitInRaid("player") == 1
-	elseif dist == "PARTY" then
-		return UnitInParty("player") == 1
-	elseif dist == "GUILD" then
-		return IsInGuild() == 1
-	elseif dist == "GLOBAL" then
-		return IsInChannel("AceComm")
-	elseif dist == "ZONE" then
-		return IsInChannel(GetCurrentZoneChannel())
-	elseif dist == "WHISPER" then
-		return true
-	elseif dist == "CUSTOM" then
-		return IsInChannel(customChannel)
-	end
-	error("unknown distribution: " .. dist, 2)
-end
-
-function AceComm:RegisterComm(prefix, distribution, method, a4)
-	AceComm:argCheck(prefix, 2, "string")
-	AceComm:argCheck(distribution, 3, "string")
-	if distribution ~= "GLOBAL" and distribution ~= "WHISPER" and distribution ~= "PARTY" and distribution ~= "RAID" and distribution ~= "GUILD" and distribution ~= "BATTLEGROUND" and distribution ~= "GROUP" and distribution ~= "ZONE" and distribution ~= "CUSTOM" then
-		AceComm:error('Argument #3 to `RegisterComm\' must be either "GLOBAL", "ZONE", "WHISPER", "PARTY", "RAID", "GUILD", "BATTLEGROUND", "GROUP", or "CUSTOM". %q is not appropriate', distribution)
-	end
-	local customChannel
-	if distribution == "CUSTOM" then
-		customChannel, method = method, a4
-		AceComm:argCheck(customChannel, 4, "string")
-		if string_len(customChannel) == 0 then
-			AceComm:error('Argument #4 to `RegisterComm\' must be a non-zero-length string.')
-		elseif string_find(customChannel, "%s") then
-			AceComm:error('Argument #4 to `RegisterComm\' must not have spaces.')
-		end
-	end
-	if self == AceComm then
-		AceComm:argCheck(method, customChannel and 5 or 4, "function", "table")
-		self = method
-	else
-		AceComm:argCheck(method, customChannel and 5 or 4, "string", "function", "table", "nil")
-	end
-	if not method then
-		method = "OnCommReceive"
-	end
-	if type(method) == "string" and type(self[method]) ~= "function" and type(self[method]) ~= "table" then
-		AceEvent:error("Cannot register comm %q to method %q, it does not exist", prefix, method)
-	end
-	
-	local registry = AceComm_registry
-	if not registry[distribution] then
-		registry[distribution] = {}
-	end
-	if customChannel then
-		customChannel = "AceComm" .. customChannel
-		if not registry[distribution][customChannel] then
-			registry[distribution][customChannel] = {}
-		end
-		if not registry[distribution][customChannel][prefix] then
-			registry[distribution][customChannel][prefix] = {}
-		end
-		registry[distribution][customChannel][prefix][self] = method
-	else
-		if not registry[distribution][prefix] then
-			registry[distribution][prefix] = {}
-		end
-		registry[distribution][prefix][self] = method
-	end
-	
-	RefixAceCommChannelsAndEvents()
-end
-
-function AceComm:UnregisterComm(prefix, distribution, customChannel)
-	AceComm:argCheck(prefix, 2, "string")
-	AceComm:argCheck(distribution, 3, "string", "nil")
-	if distribution and distribution ~= "GLOBAL" and distribution ~= "WHISPER" and distribution ~= "PARTY" and distribution ~= "RAID" and distribution ~= "GUILD" and distribution ~= "BATTLEGROUND" and distribution ~= "GROUP" and distribution ~= "CUSTOM" then
-		AceComm:error('Argument #3 to `UnregisterComm\' must be either nil, "GLOBAL", "WHISPER", "PARTY", "RAID", "GUILD", "BATTLEGROUND", "GROUP", or "CUSTOM". %q is not appropriate', distribution)
-	end
-	if distribution == "CUSTOM" then
-		AceComm:argCheck(customChannel, 3, "string")
-		if string_len(customChannel) == 0 then
-			AceComm:error('Argument #3 to `UnregisterComm\' must be a non-zero-length string.')
-		end
-	else
-		AceComm:argCheck(customChannel, 3, "nil")
-	end
-	
-	local registry = AceComm_registry
-	if not distribution then
-		for k,v in pairs(registry) do
-			if k == "CUSTOM" then
-				for l,u in pairs(v) do
-					if u[prefix] and u[prefix][self] then
-						AceComm.UnregisterComm(self, prefix, k, string.sub(l, 8))
-						if not registry[k] then
-							break
-						end
-					end
-				end
-			else
-				if v[prefix] and v[prefix][self] then
-					AceComm.UnregisterComm(self, prefix, k)
-				end
-			end
-		end
-		return
-	end
-	if self == AceComm then
-		if distribution == "CUSTOM" then
-			error(string_format("Cannot unregister comm %q::%q. Improperly unregistering from AceComm-2.0.", distribution, customChannel), 2)
-		else
-			error(string_format("Cannot unregister comm %q. Improperly unregistering from AceComm-2.0.", distribution), 2)
-		end
-	end
-	if distribution == "CUSTOM" then
-		customChannel = "AceComm" .. customChannel
-		if not registry[distribution] or not registry[distribution][customChannel] or not registry[distribution][customChannel][prefix] or not registry[distribution][customChannel][prefix][self] then
-			AceComm:error("Cannot unregister comm %q. %q is not registered with it.", distribution, self)
-		end
-		registry[distribution][customChannel][prefix][self] = nil
-		
-		if not next(registry[distribution][customChannel][prefix]) then
-			registry[distribution][customChannel][prefix] = nil
-		end
-		
-		if not next(registry[distribution][customChannel]) then
-			registry[distribution][customChannel] = nil
-		end
-	else
-		if not registry[distribution] or not registry[distribution][prefix] or not registry[distribution][prefix][self] then
-			AceComm:error("Cannot unregister comm %q. %q is not registered with it.", distribution, self)
-		end
-		registry[distribution][prefix][self] = nil
-		
-		if not next(registry[distribution][prefix]) then
-			registry[distribution][prefix] = nil
-		end
-	end
-	
-	if not next(registry[distribution]) then
-		registry[distribution] = nil
-	end
-	
-	RefixAceCommChannelsAndEvents()
-end
-
-function AceComm:UnregisterAllComms()
-	local registry = AceComm_registry
-	for k, distribution in pairs(registry) do
-		if k == "CUSTOM" then
-			for l, channel in pairs(distribution) do
-				local j = next(channel)
-				while j ~= nil do
-					local prefix = channel[j]
-					if prefix[self] then
-						AceComm.UnregisterComm(self, j)
-						if distribution[l] and registry[k] then
-							j = next(channel)
-						else
-							l = nil
-							k = nil
-							break
-						end
-					else
-						j = next(channel, j)
-					end
-				end
-				if k == nil then
-					break
-				end
-			end
-		else
-			local j = next(distribution)
-			while j ~= nil do
-				local prefix = distribution[j]
-				if prefix[self] then
-					AceComm.UnregisterComm(self, j)
-					if registry[k] then
-						j = next(distribution)
-					else
-						k = nil
-						break
-					end
-				else
-					j = next(distribution, j)
-				end
-			end
-		end
-	end
-end
-
-function AceComm:IsCommRegistered(prefix, distribution, customChannel)
-	AceComm:argCheck(prefix, 2, "string")
-	AceComm:argCheck(distribution, 3, "string", "nil")
-	if distribution and distribution ~= "GLOBAL" and distribution ~= "WHISPER" and distribution ~= "PARTY" and distribution ~= "RAID" and distribution ~= "GUILD" and distribution ~= "BATTLEGROUND" and distribution ~= "GROUP" and distribution ~= "ZONE" and distribution ~= "CUSTOM" then
-		AceComm:error('Argument #3 to `IsCommRegistered\' must be either "GLOBAL", "WHISPER", "PARTY", "RAID", "GUILD", "BATTLEGROUND", "GROUP", "ZONE", or "CUSTOM". %q is not appropriate', distribution)
-	end
-	if distribution == "CUSTOM" then
-		AceComm:argCheck(customChannel, 4, "nil", "string")
-		if customChannel == "" then
-			AceComm:error('Argument #4 to `IsCommRegistered\' must be a non-zero-length string or nil.')
-		end
-	else
-		AceComm:argCheck(customChannel, 4, "nil")
-	end
-	local registry = AceComm_registry
-	if not distribution then
-		for k,v in pairs(registry) do
-			if k == "CUSTOM" then
-				for l,u in pairs(v) do
-					if u[prefix] and u[prefix][self] then
-						return true
-					end
-				end
-			else
-				if v[prefix] and v[prefix][self] then
-					return true
-				end
-			end
-		end
-		return false
-	elseif distribution == "CUSTOM" and not customChannel then
-		if not registry[distribution] then
-			return false
-		end
-		for l,u in pairs(registry[distribution]) do
-			if u[prefix] and u[prefix][self] then
-				return true
-			end
-		end
-		return false
-	elseif distribution == "CUSTOM" then
-		customChannel = "AceComm" .. customChannel
-		return registry[distribution] and registry[distribution][customChannel] and registry[distribution][customChannel][prefix] and registry[distribution][customChannel][prefix][self] and true or false
-	end
-	return registry[distribution] and registry[distribution][prefix] and registry[distribution][prefix][self] and true or false
-end
-
-function AceComm:OnEmbedDisable(target)
-	self.UnregisterAllComms(target)
-end
-
-local id = byte_Z
-
-local function encodedChar(x)
-	if x == 10 then
-		return "°\011"
-	elseif x == 0 then
-		return "\255"
-	elseif x == 255 then
-		return "°\254"
-	elseif x == 124 then
-		return "°\125"
-	elseif x == byte_s then
-		return "\015"
-	elseif x == byte_S then
-		return "\020"
-	elseif x == 15 then
-		return "°\016"
-	elseif x == 20 then
-		return "°\021"
-	elseif x == byte_deg then
-		return "°±"
-	elseif x == 37 then
-		return "°\038"
-	end
-	return string_char(x)
-end
-
-local function soberEncodedChar(x)
-	if x == 10 then
-		return "°\011"
-	elseif x == 0 then
-		return "\255"
-	elseif x == 255 then
-		return "°\254"
-	elseif x == 124 then
-		return "°\125"
-	elseif x == byte_deg then
-		return "°±"
-	elseif x == 37 then
-		return "°\038"
-	end
-	return string_char(x)
-end
-
-local function SendMessage(prefix, priority, distribution, person, message, textToHash)
-	if distribution == "CUSTOM" then
-		person = "AceComm" .. person
-	end
-	if not IsInDistribution(distribution, person) then
-		return false
-	end
-	if distribution == "GROUP" then
-		distribution = GetCurrentGroupDistribution()
-		if not distribution then
-			return false
-		end
-	end
-	if id == byte_Z then
-		id = byte_a
-	elseif id == byte_z then
-		id = byte_A
-	else
-		id = id + 1
-	end
-	if id == byte_s or id == byte_S then
-		id = id + 1
-	end
-	local id = string_char(id)
-	local drunk = distribution == "GLOBAL" or distribution == "WHISPER" or distribution == "ZONE" or distribution == "CUSTOM"
-	prefix = Encode(prefix, drunk)
-	message = Serialize(message, textToHash)
-	message = Encode(message, drunk)
-	local headerLen = string_len(prefix) + 6
-	local messageLen = string_len(message)
-	if distribution == "WHISPER" then
-		AceComm.recentWhispers[string.lower(person)] = GetTime()
-	end
-	local max = math_floor(messageLen / (250 - headerLen) + 1)
-	if max > 1 then
-		local segment = math_floor(messageLen / max + 0.5)
-		local last = 0
-		local good = true
-		for i = 1, max do
-			local bit
-			if i == max then
-				bit = string_sub(message, last + 1)
-			else
-				local next = segment * i
-				if string_byte(message, next) == byte_deg then
-					next = next + 1
-				end
-				bit = string_sub(message, last + 1, next)
-				last = next
-			end
-			if distribution == "WHISPER" then
-				bit = "/" .. prefix .. "\t" .. id .. encodedChar(i) .. encodedChar(max) .. "\t" .. bit .. "°"
-				ChatThrottleLib:SendChatMessage(priority, prefix, bit, "WHISPER", nil, person)
-			elseif distribution == "GLOBAL" or distribution == "ZONE" or distribution == "CUSTOM" then
-				bit = prefix .. "\t" .. id .. encodedChar(i) .. encodedChar(max) .. "\t" .. bit .. "°"
-				local channel
-				if distribution == "GLOBAL" then
-					channel = "AceComm"
-				elseif distribution == "ZONE" then
-					channel = GetCurrentZoneChannel()
-				elseif distribution == "CUSTOM" then
-					channel = person
-				end
-				local index = GetChannelName(channel)
-				if index and index > 0 then
-					ChatThrottleLib:SendChatMessage(priority, prefix, bit, "CHANNEL", nil, index)
-				else
-					good = false
-				end
-			else
-				bit = id .. soberEncodedChar(i) .. soberEncodedChar(max) .. "\t" .. bit
-				ChatThrottleLib:SendAddonMessage(priority, prefix, bit, distribution)
-			end
-		end
-		return good
-	else
-		if distribution == "WHISPER" then
-			message = "/" .. prefix .. "\t" .. id .. string_char(1) .. string_char(1) .. "\t" .. message .. "°"
-			ChatThrottleLib:SendChatMessage(priority, prefix, message, "WHISPER", nil, person)
-			return true
-		elseif distribution == "GLOBAL" or distribution == "ZONE" or distribution == "CUSTOM" then
-			message = prefix .. "\t" .. id .. string_char(1) .. string_char(1) .. "\t" .. message .. "°"
-			local channel
-			if distribution == "GLOBAL" then
-				channel = "AceComm"
-			elseif distribution == "ZONE" then
-				channel = GetCurrentZoneChannel()
-			elseif distribution == "CUSTOM" then
-				channel = person
-			end
-			local index = GetChannelName(channel)
-			if index and index > 0 then
-				ChatThrottleLib:SendChatMessage(priority, prefix, message, "CHANNEL", nil, index)
-				return true
-			end
-		else
-			message = id .. string_char(1) .. string_char(1) .. "\t" .. message
-			ChatThrottleLib:SendAddonMessage(priority, prefix, message, distribution)
-			return true
-		end
-	end
-	return false
-end
-
-local tmp = {}
-function AceComm:SendPrioritizedCommMessage(priority, distribution, person, ...)
-	AceComm:argCheck(priority, 2, "string")
-	if priority ~= "NORMAL" and priority ~= "BULK" and priority ~= "ALERT" then
-		AceComm:error('Argument #2 to `SendPrioritizedCommMessage\' must be either "NORMAL", "BULK", or "ALERT"')
-	end
-	AceComm:argCheck(distribution, 3, "string")
-	local includePerson = true
-	if distribution == "WHISPER" or distribution == "CUSTOM" then
-		includePerson = false
-		AceComm:argCheck(person, 4, "string")
-		if string_len(person) == 0 then
-			AceComm:error("Argument #4 to `SendPrioritizedCommMessage' must be a non-zero-length string")
-		end
-	end
-	if self == AceComm then
-		AceComm:error("Cannot send a comm message from AceComm directly.")
-	end
-	if distribution and distribution ~= "GLOBAL" and distribution ~= "WHISPER" and distribution ~= "PARTY" and distribution ~= "RAID" and distribution ~= "GUILD" and distribution ~= "BATTLEGROUND" and distribution ~= "GROUP" and distribution ~= "ZONE" and distribution ~= "CUSTOM" then
-		AceComm:error('Argument #4 to `SendPrioritizedCommMessage\' must be either nil, "GLOBAL", "ZONE", "WHISPER", "PARTY", "RAID", "GUILD", "BATTLEGROUND", "GROUP", or "CUSTOM". %q is not appropriate', distribution)
-	end
-	
-	local prefix = self.commPrefix
-	if type(prefix) ~= "string" then
-		AceComm:error("`SetCommPrefix' must be called before sending a message.")
-	end
-	
-	local message
-	
-	if includePerson and select('#', ...) == 0 and type(person) ~= "table" then
-		message = person
-	elseif not includePerson and select('#', ...) == 1 and type((...)) ~= "table" then
-		message = ...
-	else
-		message = tmp
-		local n = 1
-		if includePerson then
-			tmp[1] = person
-			n = 2
-		end
-		for i = 1, select('#', ...) do
-			tmp[n] = select(i, ...)
-			n = n + 1
-		end
-	end
-	
-	local ret = SendMessage(AceComm.prefixTextToHash[prefix], priority, distribution, person, message, self.commMemoTextToHash)
-	
-	if message == tmp then
-		local n = #tmp
-		for i = 1, n do
-			tmp[i] = nil
-		end
-	end
-	
-	return ret
-end
-
-function AceComm:SendCommMessage(distribution, person, ...)
-	AceComm:argCheck(distribution, 2, "string")
-	local includePerson = true
-	if distribution == "WHISPER" or distribution == "CUSTOM" then
-		includePerson = false
-		AceComm:argCheck(person, 3, "string")
-		if string_len(person) == 0 then
-			AceComm:error("Argument #3 to `SendCommMessage' must be a non-zero-length string")
-		end
-	end
-	if self == AceComm then
-		AceComm:error("Cannot send a comm message from AceComm directly.")
-	end
-	if distribution and distribution ~= "GLOBAL" and distribution ~= "WHISPER" and distribution ~= "PARTY" and distribution ~= "RAID" and distribution ~= "GUILD" and distribution ~= "BATTLEGROUND" and distribution ~= "GROUP" and distribution ~= "ZONE" and distribution ~= "CUSTOM" then
-		AceComm:error('Argument #2 to `SendCommMessage\' must be either nil, "GLOBAL", "ZONE", "WHISPER", "PARTY", "RAID", "GUILD", "BATTLEGROUND", "GROUP", or "CUSTOM". %q is not appropriate', distribution)
-	end
-	
-	local prefix = self.commPrefix
-	if type(prefix) ~= "string" then
-		AceComm:error("`SetCommPrefix' must be called before sending a message.")
-	end
-	
-	if includePerson and select('#', ...) == 0 and type(person) ~= "table" then
-		message = person
-	elseif not includePerson and select('#', ...) == 1 and type((...)) ~= "table" then
-		message = ...
-	else
-		message = tmp
-		local n = 1
-		if includePerson then
-			tmp[1] = person
-			n = 2
-		end
-		for i = 1, select('#', ...) do
-			tmp[n] = select(i, ...)
-			n = n + 1
-		end
-	end
-	
-	local priority = self.commPriority or "NORMAL"
-	
-	local ret = SendMessage(AceComm.prefixTextToHash[prefix], priority, distribution, person, message, self.commMemoTextToHash)
-	
-	if message == tmp then
-		local n = #tmp
-		for i = 1, n do
-			tmp[i] = nil
-		end
-	end
-	
-	return ret
-end
-
-function AceComm:SetDefaultCommPriority(priority)
-	AceComm:argCheck(priority, 2, "string")
-	if priority ~= "NORMAL" and priority ~= "BULK" and priority ~= "ALERT" then
-		AceComm:error('Argument #2 must be either "NORMAL", "BULK", or "ALERT"')
-	end
-	
-	if self.commPriority then
-		AceComm:error("Cannot call `SetDefaultCommPriority' more than once")
-	end
-	
-	self.commPriority = priority
-end
-
-function AceComm:SetCommPrefix(prefix)
-	AceComm:argCheck(prefix, 2, "string")
-	
-	if self.commPrefix then
-		AceComm:error("Cannot call `SetCommPrefix' more than once.")
-	end
-	
-	if AceComm.prefixes[prefix] then
-		AceComm:error("Cannot set prefix to %q, it is already in use.", prefix)
-	end
-	
-	local hash = TailoredBinaryCheckSum(prefix)
-	if AceComm.prefixHashToText[hash] then
-		AceComm:error("Cannot set prefix to %q, its hash is used by another prefix: %q", prefix, AceComm.prefixHashToText[hash])
-	end
-	
-	AceComm.prefixes[prefix] = true
-	self.commPrefix = prefix
-	AceComm.prefixHashToText[hash] = prefix
-	AceComm.prefixTextToHash[prefix] = hash
-end
-
-function AceComm:RegisterMemoizations(values)
-	AceComm:argCheck(values, 2, "table")
-	for k,v in pairs(values) do
-		if type(k) ~= "number" then
-			AceComm:error("Bad argument #2 to `RegisterMemoizations'. All keys must be numbers")
-		elseif type(v) ~= "string" then
-			AceComm:error("Bad argument #2 to `RegisterMemoizations'. All values must be strings")
-		end
-	end
-	if self.commMemoHashToText or self.commMemoTextToHash then
-		AceComm:error("You can only call `RegisterMemoizations' once.")
-	elseif not self.commPrefix then
-		AceComm:error("You can only call `RegisterCommPrefix' before calling `RegisterMemoizations'.")
-	elseif AceComm.prefixMemoizations[self.commPrefix] then
-		AceComm:error("Another addon with prefix %q has already registered memoizations.", self.commPrefix)
-	end
-	local hashToText = {}
-	local textToHash = {}
-	for _,text in ipairs(values) do
-		local hash = TailoredNumericCheckSum(text)
-		if hashToText[hash] then
-			AceComm:error("%q and %q have the same checksum. You must remove one of them for memoization to work properly", hashToText[hash], text)
-		else
-			textToHash[text] = hash
-			hashToText[hash] = text
-		end
-	end
-	values = nil
-	self.commMemoHashToText = hashToText
-	self.commMemoTextToHash = textToHash
-	AceComm.prefixMemoizations[self.commPrefix] = hashToText
-end
-
-local lastCheck = GetTime()
-local function CheckRefix()
-	if GetTime() - lastCheck >= 120 then
-		lastCheck = GetTime()
-		RefixAceCommChannelsAndEvents()
-	end
-end
-
-local stack = setmetatable({}, {__mode='k'})
-local function HandleMessage(prefix, message, distribution, sender, customChannel)
-	local isGroup = GetCurrentGroupDistribution() == distribution
-	local isCustom = distribution == "CUSTOM"
-	if (not AceComm_registry[distribution] and (not isGroup or not AceComm_registry.GROUP)) or (isCustom and not AceComm_registry.CUSTOM[customChannel]) then
-		return CheckRefix()
-	end
-	local _, id, current, max
-	if not message then
-		if distribution == "WHISPER" then
-			_,_, prefix, id, current, max, message = string_find(prefix, "^/(...)\t(.)(.)(.)\t(.*)$")
-		else
-			_,_, prefix, id, current, max, message = string_find(prefix, "^(...)\t(.)(.)(.)\t(.*)$")
-		end
-		prefix = AceComm.prefixHashToText[prefix]
-		if not prefix then
-			return CheckRefix()
-		end
-		if isCustom then
-			if not AceComm_registry.CUSTOM[customChannel][prefix] then
-				return CheckRefix()
-			end
-		else
-			if (not AceComm_registry[distribution] or not AceComm_registry[distribution][prefix]) and (not isGroup or not AceComm_registry.GROUP or not AceComm_registry.GROUP[prefix]) then
-				return CheckRefix()
-			end
-		end
-	else
-		_,_, id, current, max, message = string_find(message, "^(.)(.)(.)\t(.*)$")
-	end
-	if not message then
-		return
-	end
-	local smallCustomChannel = customChannel and string_sub(customChannel, 8)
-	current = string_byte(current)
-	max = string_byte(max)
-	if max > 1 then
-		local queue = AceComm.recvQueue
-		local x
-		if distribution == "CUSTOM" then
-			x = prefix .. ":" .. sender .. distribution .. customChannel .. id
-		else
-			x = prefix .. ":" .. sender .. distribution .. id
-		end
-		if not queue[x] then
-			if current ~= 1 then
-				return
-			end
-			local t = next(stack) or {}
-			stack[t] = nil
-			queue[x] = t
-		end
-		local chunk = queue[x]
-		chunk.time = GetTime()
-		chunk[current] = message
-		if current == max then
-			message = table_concat(chunk)
-			local t = queue[x]
-			queue[x] = nil
-			for k in pairs(t) do
-				t[k] = nil
-			end
-			stack[t] = true
-		else
-			return
-		end
-	end
-	message = Deserialize(message, AceComm.prefixMemoizations[prefix])
-	local isTable = type(message) == "table"
-	local n
-	if isTable then
-		n = #message * 4
-		if n < 40 then
-			n = 40
-		end
-		while message[n] == nil do
-			n = n - 1
-		end
-	end
-	if AceComm_registry[distribution] then
-		if isTable then
-			if isCustom then
-				if AceComm_registry.CUSTOM[customChannel][prefix] then
-					for k,v in pairs(AceComm_registry.CUSTOM[customChannel][prefix]) do
-						local type_v = type(v)
-						if type_v == "string" then
-							local f = k[v]
-							if type(f) == "table" then
-								local i = 1
-								local g = f[message[i]]
-								while g do
-									if type(g) ~= "table" then -- function
-										g(k, prefix, sender, distribution, smallCustomChannel, unpack(message, i+1, n))
-										break
-									else
-										i = i + 1
-										g = g[message[i]]
-									end
-								end
-							else -- function
-								f(k, prefix, sender, distribution, smallCustomChannel, unpack(message, 1, n))
-							end
-						elseif type_v == "table" then
-							local i = 1
-							local g = v[message[i]]
-							while g do
-								if type(g) ~= "table" then -- function
-									g(prefix, sender, distribution, smallCustomChannel, unpack(message, i+1, n))
-									break
-								else
-									i = i + 1
-									g = g[message[i]]
-								end
-							end
-						else -- function
-							v(prefix, sender, distribution, smallCustomChannel, unpack(message, 1, n))
-						end
-					end
-				end
-			else
-				if AceComm_registry[distribution][prefix] then
-					for k,v in pairs(AceComm_registry[distribution][prefix]) do
-						local type_v = type(v)
-						if type_v == "string" then
-							local f = k[v]
-							if type(f) == "table" then
-								local i = 1
-								local g = f[message[i]]
-								while g do
-									if type(g) ~= "table" then -- function
-										g(k, prefix, sender, distribution, unpack(message, i+1, n))
-										break
-									else
-										i = i + 1
-										g = g[message[i]]
-									end
-								end
-							else -- function
-								f(k, prefix, sender, distribution, unpack(message, 1, n))
-							end
-						elseif type_v == "table" then
-							local i = 1
-							local g = v[message[i]]
-							while g do
-								if type(g) ~= "table" then -- function
-									g(prefix, sender, distribution, unpack(message, i+1, n))
-									break
-								else
-									i = i + 1
-									g = g[message[i]]
-								end
-							end
-						else -- function
-							v(prefix, sender, distribution, unpack(message, 1, n))
-						end
-					end
-				end
-			end
-		else
-			if isCustom then
-				if AceComm_registry.CUSTOM[customChannel][prefix] then
-					for k,v in pairs(AceComm_registry.CUSTOM[customChannel][prefix]) do
-						local type_v = type(v)
-						if type_v == "string" then
-							local f = k[v]
-							if type(f) == "table" then
-								local g = f[message]
-								if g and type(g) == "function" then
-									g(k, prefix, sender, distribution, smallCustomChannel)
-								end
-							else -- function
-								f(k, prefix, sender, distribution, smallCustomChannel, message)
-							end
-						elseif type_v == "table" then
-							local g = v[message]
-							if g and type(g) == "function" then
-								g(k, prefix, sender, distribution, smallCustomChannel)
-							end
-						else -- function
-							v(prefix, sender, distribution, smallCustomChannel, message)
-						end
-					end
-				end
-			else
-				if AceComm_registry[distribution][prefix] then
-					for k,v in pairs(AceComm_registry[distribution][prefix]) do
-						local type_v = type(v)
-						if type_v == "string" then
-							local f = k[v]
-							if type(f) == "table" then
-								local g = f[message]
-								if g and type(g) == "function" then
-									g(k, prefix, sender, distribution)
-								end
-							else -- function
-								f(k, prefix, sender, distribution, message)
-							end
-						elseif type_v == "table" then
-							local g = v[message]
-							if g and type(g) == "function" then
-								g(k, prefix, sender, distribution)
-							end
-						else -- function
-							v(prefix, sender, distribution, message)
-						end
-					end
-				end
-			end
-		end
-	end
-	if isGroup and AceComm_registry.GROUP and AceComm_registry.GROUP[prefix] then
-		if isTable then
-			for k,v in pairs(AceComm_registry.GROUP[prefix]) do
-				local type_v = type(v)
-				if type_v == "string" then
-					local f = k[v]
-					if type(f) == "table" then
-						local i = 1
-						local g = f[message[i]]
-						while g do
-							if type(g) ~= "table" then -- function
-								g(k, prefix, sender, "GROUP", unpack(message, i+1, n))
-								break
-							else
-								i = i + 1
-								g = g[message[i]]
-							end
-						end
-					else -- function
-						f(k, prefix, sender, "GROUP", unpack(message, 1, n))
-					end
-				elseif type_v == "table" then
-					local i = 1
-					local g = v[message[i]]
-					while g do
-						if type(g) ~= "table" then -- function
-							g(prefix, sender, "GROUP", unpack(message, i+1, n))
-							break
-						else
-							i = i + 1
-							g = g[message[i]]
-						end
-					end
-				else -- function
-					v(prefix, sender, "GROUP", unpack(message, 1, n))
-				end
-			end
-		else
-			for k,v in pairs(AceComm_registry.GROUP[prefix]) do
-				local type_v = type(v)
-				if type_v == "string" then
-					local f = k[v]
-					if type(f) == "table" then
-						local g = f[message]
-						if g and type(g) == "function" then
-							g(k, prefix, sender, "GROUP")
-						end
-					else -- function
-						f(k, prefix, sender, "GROUP", message)
-					end
-				elseif type_v == "table" then
-					local g = v[message]
-					if g and type(g) == "function" then
-						g(k, prefix, sender, "GROUP")
-					end
-				else -- function
-					v(prefix, sender, "GROUP", message)
-				end
-			end
-		end
-	end
-end
-
-function AceComm:CHAT_MSG_ADDON(prefix, message, distribution, sender)
-	if sender == player then
-		return
-	end
-	prefix = self.prefixHashToText[prefix]
-	if not prefix then
-		return CheckRefix()
-	end
-	local isGroup = GetCurrentGroupDistribution() == distribution
-	if not AceComm_registry[distribution] and (not isGroup or not AceComm_registry.GROUP) then
-		return CheckRefix()
-	end
-	prefix = Decode(prefix)
-	if (not AceComm_registry[distribution] or not AceComm_registry[distribution][prefix]) and (not isGroup or not AceComm_registry.GROUP or not AceComm_registry.GROUP[prefix]) then
-		return CheckRefix()
-	end
-	message = Decode(message)
-	return HandleMessage(prefix, message, distribution, sender)
-end
-
-function AceComm:CHAT_MSG_WHISPER(text, sender)
-	if not string_find(text, "^/") then
-		return
-	end
-	text = Decode(text, true)
-	return HandleMessage(text, nil, "WHISPER", sender)
-end
-
-function AceComm:CHAT_MSG_CHANNEL(text, sender, _, _, _, _, _, _, channel)
-	if sender == player or not string_find(channel, "^AceComm") then
-		return
-	end
-	text = Decode(text, true)
-	local distribution
-	local customChannel
-	if channel == "AceComm" then
-		distribution = "GLOBAL"
-	elseif channel == GetCurrentZoneChannel() then
-		distribution = "ZONE"
-	else
-		distribution = "CUSTOM"
-		customChannel = channel
-	end
-	return HandleMessage(text, nil, distribution, sender, customChannel)
-end
-
-function AceComm:IsUserInChannel(userName, distribution, customChannel)
-	AceComm:argCheck(userName, 2, "string", "nil")
-	if not userName then
-		userName = player
-	end
-	AceComm:argCheck(distribution, 3, "string")
-	local channel
-	if distribution == "GLOBAL" then
-		channel = "AceComm"
-	elseif distribution == "ZONE" then
-		channel = GetCurrentZoneChannel()
-	elseif distribution == "CUSTOM" then
-		AceComm:argCheck(customChannel, 4, "string")
-		channel = "AceComm" .. customChannel
-	else
-		AceComm:error('Argument #3 to `IsUserInChannel\' must be "GLOBAL", "CUSTOM", or "ZONE"')
-	end
-	
-	return AceComm.userRegistry[channel] and AceComm.userRegistry[channel][userName] or false
-end
-
-function AceComm:CHAT_MSG_CHANNEL_LIST(text, _, _, _, _, _, _, _, channel)
-	if not string_find(channel, "^AceComm") then
-		return
-	end
-	
-	if not AceComm.userRegistry[channel] then
-		AceComm.userRegistry[channel] = {}
-	end
-	local t = AceComm.userRegistry[channel]
-	for k in string_gmatch(text, "[^, @%*#]+") do
-		t[k] = true
-	end
-end
-
-function AceComm:CHAT_MSG_CHANNEL_JOIN(_, user, _, _, _, _, _, _, channel)
-	if not string_find(channel, "^AceComm") then
-		return
-	end
-	
-	if not AceComm.userRegistry[channel] then
-		AceComm.userRegistry[channel] = {}
-	end
-	local t = AceComm.userRegistry[channel]
-	t[user] = true
-end
-
-function AceComm:CHAT_MSG_CHANNEL_LEAVE(_, user, _, _, _, _, _, _, channel)
-	if not string_find(channel, "^AceComm") then
-		return
-	end
-	
-	if not AceComm.userRegistry[channel] then
-		AceComm.userRegistry[channel] = {}
-	end
-	local t = AceComm.userRegistry[channel]
-	if t[user] then
-		t[user] = nil
-	end
-end
-
-function AceComm:AceEvent_FullyInitialized()
-	RefixAceCommChannelsAndEvents()
-end
-
-function AceComm:PLAYER_LOGOUT()
-	LeaveAceCommChannels(true)
-end
-
-function AceComm:ZONE_CHANGED_NEW_AREA()
-	local lastZone = zoneCache
-	zoneCache = nil
-	local newZone = GetCurrentZoneChannel()
-	if self.registry.ZONE and next(self.registry.ZONE) then
-		if lastZone then
-			SwitchChannel(lastZone, newZone)
-		else
-			JoinChannel(newZone)
-		end
-	end
-end
-
-function AceComm:embed(target)
-	self.super.embed(self, target)
-	if not AceEvent then
-		AceComm:error(MAJOR_VERSION .. " requires AceEvent-2.0")
-	end
-end
-
-local recentNotSeen = {}
-local notSeenString = '^' .. string_gsub(string_gsub(ERR_CHAT_PLAYER_NOT_FOUND_S, "%%s", "(.-)"), "%%1%$s", "(.-)") .. '$'
-local ambiguousString = '^' .. string_gsub(string_gsub(ERR_CHAT_PLAYER_AMBIGUOUS_S, "%%s", "(.-)"), "%%1%$s", "(.-)") .. '$'
-function AceComm.hooks:ChatFrame_MessageEventHandler(orig, event)
-	if event == "CHAT_MSG_WHISPER" or event == "CHAT_MSG_WHISPER_INFORM" then
-		if string_find(arg1, "^/") then
-			return
-		end
-	elseif event == "CHAT_MSG_AFK" or event == "CHAT_MSG_DND" then
-		local t = self.recentWhispers[string.lower(arg2)]
-		if t and GetTime() - t <= 15 then
-			return
-		end
-	elseif event == "CHAT_MSG_CHANNEL" or event == "CHAT_MSG_CHANNEL_LIST" then
-		if string_find(arg9, "^AceComm") then
-			return
-		end
-	elseif event == "CHAT_MSG_SYSTEM" then
-		local _,_,player = string_find(arg1, notSeenString)
-		if not player then
-			_,_,player = string_find(arg1, ambiguousString)
-		end
-		if player then
-			local t = GetTime()
-			if recentNotSeen[player] and recentNotSeen[player] > t then
-				recentNotSeen[player] = t + 10
-				return
-			else
-				recentNotSeen[player] = t + 10
-			end
-		end
-	end
-	return orig(event)
-end
-
-local id, loggingOut
-function AceComm.hooks:Logout(orig)
-	if IsResting() then
-		LeaveAceCommChannels(true)
-	else
-		id = self:ScheduleEvent(LeaveAceCommChannels, 15, true)
-	end
-	loggingOut = true
-	return orig()
-end
-
-function AceComm.hooks:CancelLogout(orig)
-	shutdown = false
-	if id then
-		self:CancelScheduledEvent(id)
-		id = nil
-	end
-	RefixAceCommChannelsAndEvents()
-	loggingOut = false
-	return orig()
-end
-
-function AceComm.hooks:Quit(orig)
-	if IsResting() then
-		LeaveAceCommChannels(true)
-	else
-		id = self:ScheduleEvent(LeaveAceCommChannels, 15, true)
-	end
-	loggingOut = true
-	return orig()
-end
-
-function AceComm.hooks:FCFDropDown_LoadChannels(orig, ...)
-	local arg = { ... }
-	for i = 1, #arg, 2 do
-		if not arg[i] then
-			break
-		end
-		if type(arg[i + 1]) == "string" and string_find(arg[i + 1], "^AceComm") then
-			table.remove(arg, i + 1)
-			table.remove(arg, i)
-			i = i - 2
-		end
-	end
-	return orig(unpack(arg))
-end
-
-function AceComm:CHAT_MSG_SYSTEM(text)
-	if text ~= ERR_TOO_MANY_CHAT_CHANNELS then
-		return
-	end
-	
-	local chan = lastChannelJoined
-	if not chan then
-		return
-	end
-	if not string_find(lastChannelJoined, "^AceComm") then
-		return
-	end
-	
-	local text
-	if chan == "AceComm" then
-		local addon = self.registry.GLOBAL and next(AceComm_registry.GLOBAL)
-		if not addon then
-			return
-		end
-		addon = tostring(addon)
-		text = string_format("%s has tried to join the AceComm global channel, but there are not enough channels available. %s may not work because of this", addon, addon)
-	elseif chan == GetCurrentZoneChannel() then
-		local addon = AceComm_registry.ZONE and next(AceComm_registry.ZONE)
-		if not addon then
-			return
-		end
-		addon = tostring(addon)
-		text = string_format("%s has tried to join the AceComm zone channel, but there are not enough channels available. %s may not work because of this", addon, addon)
-	else
-		local addon = AceComm_registry.CUSTOM and AceComm_registry.CUSTOM[chan] and next(AceComm_registry.CUSTOM[chan])
-		if not addon then
-			return
-		end
-		addon = tostring(addon)
-		text = string_format("%s has tried to join the AceComm custom channel %s, but there are not enough channels available. %s may not work because of this", addon, chan, addon)
-	end
-	
-	StaticPopupDialogs["ACECOMM_TOO_MANY_CHANNELS"] = {
-		text = text,
-		button1 = CLOSE,
-		timeout = 0,
-		whileDead = 1,
-		hideOnEscape = 1,
-	}
-	StaticPopup_Show("ACECOMM_TOO_MANY_CHANNELS")
-end
-
-local function activate(self, oldLib, oldDeactivate)
-	AceComm = self
-	
-	if oldLib then
-		self.frame = oldLib.frame
-		self.frame:UnregisterAllEvents()
-		self.recvQueue = oldLib.recvQueue
-		self.registry = oldLib.registry
-		self.channels = oldLib.channels
-		self.prefixes = oldLib.prefixes
-		self.classes = oldLib.classes
-		self.prefixMemoizations = oldLib.prefixMemoizations
-		self.prefixHashToText = oldLib.prefixHashToText
-		self.prefixTextToHash = oldLib.prefixTextToHash
-		self.recentWhispers = oldLib.recentWhispers
-		self.userRegistry = oldLib.userRegistry
-	else
-		local old_ChatFrame_MessageEventHandler = ChatFrame_MessageEventHandler
-		function ChatFrame_MessageEventHandler(event)
-			if self.hooks.ChatFrame_MessageEventHandler then
-				return self.hooks.ChatFrame_MessageEventHandler(self, old_ChatFrame_MessageEventHandler, event)
-			else
-				return old_ChatFrame_MessageEventHandler(event)
-			end
-		end
-		local id
-		local loggingOut = false
-		local old_Logout = Logout
-		function Logout()
-			if self.hooks.Logout then
-				return self.hooks.Logout(self, old_Logout)
-			else
-				return old_Logout()
-			end
-		end
-		local old_CancelLogout = CancelLogout
-		function CancelLogout()
-			if self.hooks.CancelLogout then
-				return self.hooks.CancelLogout(self, old_CancelLogout)
-			else
-				return old_CancelLogout()
-			end
-		end
-		local old_Quit = Quit
-		function Quit()
-			if self.hooks.Quit then
-				return self.hooks.Quit(self, old_Quit)
-			else
-				return old_Quit()
-			end
-		end
-		local old_FCFDropDown_LoadChannels = FCFDropDown_LoadChannels
-		function FCFDropDown_LoadChannels(...)
-			if self.hooks.FCFDropDown_LoadChannels then
-				return self.hooks.FCFDropDown_LoadChannels(self, old_FCFDropDown_LoadChannels, ...)
-			else
-				return old_FCFDropDown_LoadChannels(...)
-			end
-		end
-		local old_JoinChannelByName = JoinChannelByName
-		function JoinChannelByName(a,b,c,d,e,f,g,h,i,j)
-			if self.hooks.JoinChannelByName then
-				return self.hooks.JoinChannelByName(self, old_JoinChannelByName, a,b,c,d,e,f,g,h,i,j)
-			else
-				return old_JoinChannelByName(a,b,c,d,e,f,g,h,i,j)
-			end
-		end
-	end
-	
-	if not self.recvQueue then
-		self.recvQueue = {}
-	end
-	if not self.registry then
-		self.registry = {}
-	end
-	AceComm_registry = self.registry
-	if not self.prefixes then
-		self.prefixes = {}
-	end
-	if not self.classes then
-		self.classes = {}
-	else
-		for k in pairs(self.classes) do
-			self.classes[k] = nil
-		end
-	end
-	if not self.prefixMemoizations then
-		self.prefixMemoizations = {}
-	end
-	if not self.prefixHashToText then
-		self.prefixHashToText = {}
-	end
-	if not self.prefixTextToHash then
-		self.prefixTextToHash = {}
-	end
-	if not self.recentWhispers then
-		self.recentWhispers = {}
-	end
-	if not self.userRegistry then
-		self.userRegistry = {}
-	end
-	
-	SetCVar("spamFilter", 0)
-	
-	self:activate(oldLib, oldDeactivate)
-	
-	if oldDeactivate then
-		oldDeactivate(oldLib)
-	end
-end
-
-local function external(self, major, instance)
-	if major == "AceEvent-2.0" then
-		AceEvent = instance
-		
-		AceEvent:embed(AceComm)
-		
-		self:UnregisterAllEvents()
-		self:CancelAllScheduledEvents()
-		
-		if AceEvent:IsFullyInitialized() then
-			self:AceEvent_FullyInitialized()
-		else
-			self:RegisterEvent("AceEvent_FullyInitialized", "AceEvent_FullyInitialized", true)
-		end
-		
-		self:RegisterEvent("PLAYER_LOGOUT")
-		self:RegisterEvent("ZONE_CHANGED_NEW_AREA")
-		self:RegisterEvent("CHAT_MSG_CHANNEL_NOTICE")
-		self:RegisterEvent("CHAT_MSG_SYSTEM")
-	else
-		if AceOO.inherits(instance, AceOO.Class) and not instance.class then
-			self.classes[TailoredNumericCheckSum(major)] = instance
-		end
-	end
-end
-
-AceLibrary:Register(AceComm, MAJOR_VERSION, MINOR_VERSION, activate, nil, external)
-
-
-
-
-
---
--- ChatThrottleLib by Mikk
---
--- Manages AddOn chat output to keep player from getting kicked off.
---
--- ChatThrottleLib.SendChatMessage/.SendAddonMessage functions that accept 
--- a Priority ("BULK", "NORMAL", "ALERT") as well as prefix for SendChatMessage.
---
--- Priorities get an equal share of available bandwidth when fully loaded.
--- Communication channels are separated on extension+chattype+destination and
--- get round-robinned. (Destination only matters for whispers and channels,
--- obviously)
---
--- Will install hooks for SendChatMessage and SendAdd[Oo]nMessage to measure
--- bandwidth bypassing the library and use less bandwidth itself.
---
---
--- Fully embeddable library. Just copy this file into your addon directory,
--- add it to the .toc, and it's done.
---
--- Can run as a standalone addon also, but, really, just embed it! :-)
---
-
-local CTL_VERSION = 13
-
-local MAX_CPS = 800			  -- 2000 seems to be safe if NOTHING ELSE is happening. let's call it 800.
-local MSG_OVERHEAD = 40		-- Guesstimate overhead for sending a message; source+dest+chattype+protocolstuff
-
-local BURST = 4000				-- WoW's server buffer seems to be about 32KB. 8KB should be safe, but seen disconnects on _some_ servers. Using 4KB now.
-
-local MIN_FPS = 20				-- Reduce output CPS to half (and don't burst) if FPS drops below this value
-
-if(ChatThrottleLib and ChatThrottleLib.version>=CTL_VERSION) then
-	-- There's already a newer (or same) version loaded. Buh-bye.
-	return;
-end
-
-
-
-if(not ChatThrottleLib) then
-	ChatThrottleLib = {}
-end
-
-local ChatThrottleLib = ChatThrottleLib
-local strlen = strlen
-local setmetatable = setmetatable
-local getn = getn
-local tremove = tremove
-local tinsert = tinsert
-local tostring = tostring
-local GetTime = GetTime
-local format = format
-
-ChatThrottleLib.version=CTL_VERSION;
-
-
------------------------------------------------------------------------
--- Double-linked ring implementation
-
-local Ring = {}
-local RingMeta = { __index=Ring }
-
-function Ring:New()
-	local ret = {}
-	setmetatable(ret, RingMeta)
-	return ret;
-end
-
-function Ring:Add(obj)	-- Append at the "far end" of the ring (aka just before the current position)
-	if(self.pos) then
-		obj.prev = self.pos.prev;
-		obj.prev.next = obj;
-		obj.next = self.pos;
-		obj.next.prev = obj;
-	else
-		obj.next = obj;
-		obj.prev = obj;
-		self.pos = obj;
-	end
-end
-
-function Ring:Remove(obj)
-	obj.next.prev = obj.prev;
-	obj.prev.next = obj.next;
-	if(self.pos == obj) then
-		self.pos = obj.next;
-		if(self.pos == obj) then
-			self.pos = nil;
-		end
-	end
-end
-
-
-
------------------------------------------------------------------------
--- Recycling bin for pipes (kept in a linked list because that's 
--- how they're worked with in the rotating rings; just reusing members)
-
-ChatThrottleLib.PipeBin = { count=0 }
-
-function ChatThrottleLib.PipeBin:Put(pipe)
-	for i=getn(pipe),1,-1 do
-		tremove(pipe, i);
-	end
-	pipe.prev = nil;
-	pipe.next = self.list;
-	self.list = pipe;
-	self.count = self.count+1;
-end
-
-function ChatThrottleLib.PipeBin:Get()
-	if(self.list) then
-		local ret = self.list;
-		self.list = ret.next;
-		ret.next=nil;
-		self.count = self.count - 1;
-		return ret;
-	end
-	return {};
-end
-
-function ChatThrottleLib.PipeBin:Tidy()
-	if(self.count < 25) then
-		return;
-	end
-		
-	if(self.count > 100) then
-		n=self.count-90;
-	else
-		n=10;
-	end
-	for i=2,n do
-		self.list = self.list.next;
-	end
-	local delme = self.list;
-	self.list = self.list.next;
-	delme.next = nil;
-end
-
-
-
-
------------------------------------------------------------------------
--- Recycling bin for messages
-
-ChatThrottleLib.MsgBin = {}
-
-function ChatThrottleLib.MsgBin:Put(msg)
-	msg.text = nil;
-	tinsert(self, msg);
-end
-
-function ChatThrottleLib.MsgBin:Get()
-	local ret = tremove(self, getn(self));
-	if(ret) then return ret; end
-	return {};
-end
-
-function ChatThrottleLib.MsgBin:Tidy()
-	if(getn(self)<50) then
-		return;
-	end
-	if(getn(self)>150) then	 -- "can't happen" but ...
-		for n=getn(self),120,-1 do
-			tremove(self,n);
-		end
-	else
-		for n=getn(self),getn(self)-20,-1 do
-			tremove(self,n);
-		end
-	end
-end
-
-
------------------------------------------------------------------------
--- ChatThrottleLib:Init
--- Initialize queues, set up frame for OnUpdate, etc
-
-
-function ChatThrottleLib:Init()	
-	
-	-- Set up queues
-	if(not self.Prio) then
-		self.Prio = {}
-		self.Prio["ALERT"] = { ByName={}, Ring = Ring:New(), avail=0 };
-		self.Prio["NORMAL"] = { ByName={}, Ring = Ring:New(), avail=0 };
-		self.Prio["BULK"] = { ByName={}, Ring = Ring:New(), avail=0 };
-	end
-	
-	-- v4: total send counters per priority
-	for _,Prio in pairs(self.Prio) do
-		Prio.nTotalSent = Prio.nTotalSent or 0;
-	end
-	
-	self.avail = self.avail or 0;							-- v5
-	self.nTotalSent = self.nTotalSent or 0;		-- v5
-
-	
-	-- Set up a frame to get OnUpdate events
-	if(not self.Frame) then
-		self.Frame = CreateFrame("Frame");
-		self.Frame:Hide();
-	end
-	self.Frame.Show = self.Frame.Show; -- cache for speed
-	self.Frame.Hide = self.Frame.Hide; -- cache for speed
-	self.Frame:SetScript("OnUpdate", self.OnUpdate);
-	self.Frame:SetScript("OnEvent", self.OnEvent);	-- v11: Monitor P_E_W so we can throttle hard for a few seconds
-	self.Frame:RegisterEvent("PLAYER_ENTERING_WORLD");
-	self.OnUpdateDelay=0;
-	self.LastAvailUpdate=GetTime();
-	self.HardThrottlingBeginTime=GetTime();	-- v11: Throttle hard for a few seconds after startup
-	
-	-- Hook SendChatMessage and SendAddonMessage so we can measure unpiped traffic and avoid overloads (v7)
-	if(not self.ORIG_SendChatMessage) then
-		--SendChatMessage
-		self.ORIG_SendChatMessage = SendChatMessage;
-		SendChatMessage = function(a1,a2,a3,a4) return ChatThrottleLib.Hook_SendChatMessage(a1,a2,a3,a4); end
-		--SendAdd[Oo]nMessage
-		if(SendAddonMessage or SendAddOnMessage) then -- v10: don't pretend like it doesn't exist if it doesn't!
-			self.ORIG_SendAddonMessage = SendAddonMessage or SendAddOnMessage;
-			SendAddonMessage = function(a1,a2,a3) return ChatThrottleLib.Hook_SendAddonMessage(a1,a2,a3); end
-			if(SendAddOnMessage) then		-- in case Slouken changes his mind...
-				SendAddOnMessage = SendAddonMessage;
-			end
-		end
-	end
-	self.nBypass = 0;
-end
-
-
------------------------------------------------------------------------
--- ChatThrottleLib.Hook_SendChatMessage / .Hook_SendAddonMessage
-function ChatThrottleLib.Hook_SendChatMessage(text, chattype, language, destination)
-	local self = ChatThrottleLib;
-	local size = strlen(tostring(text or "")) + strlen(tostring(chattype or "")) + strlen(tostring(destination or "")) + 40;
-	self.avail = self.avail - size;
-	self.nBypass = self.nBypass + size;
-	return self.ORIG_SendChatMessage(text, chattype, language, destination);
-end
-function ChatThrottleLib.Hook_SendAddonMessage(prefix, text, chattype)
-	local self = ChatThrottleLib;
-	local size = strlen(tostring(text or "")) + strlen(tostring(chattype or "")) + strlen(tostring(prefix or "")) + 40;
-	self.avail = self.avail - size;
-	self.nBypass = self.nBypass + size;
-	return self.ORIG_SendAddonMessage(prefix, text, chattype);
-end
-
-
-
------------------------------------------------------------------------
--- ChatThrottleLib:UpdateAvail
--- Update self.avail with how much bandwidth is currently available
-
-function ChatThrottleLib:UpdateAvail()
-	local now = GetTime();
-	local newavail = MAX_CPS * (now-self.LastAvailUpdate);
-
-	if(now - self.HardThrottlingBeginTime < 5) then
-		-- First 5 seconds after startup/zoning: VERY hard clamping to avoid irritating the server rate limiter, it seems very cranky then
-		self.avail = min(self.avail + (newavail*0.1), MAX_CPS*0.5);
-	elseif(GetFramerate()<MIN_FPS) then		-- GetFrameRate call takes ~0.002 secs
-		newavail = newavail * 0.5;
-		self.avail = min(MAX_CPS, self.avail + newavail);
-		self.bChoking = true;		-- just for stats
-	else
-		self.avail = min(BURST, self.avail + newavail);
-		self.bChoking = false;
-	end
-	
-	self.avail = max(self.avail, 0-(MAX_CPS*2));	-- Can go negative when someone is eating bandwidth past the lib. but we refuse to stay silent for more than 2 seconds; if they can do it, we can.
-	self.LastAvailUpdate = now;
-	
-	return self.avail;
-end
-
-
------------------------------------------------------------------------
--- Despooling logic
-
-function ChatThrottleLib:Despool(Prio)
-	local ring = Prio.Ring;
-	while(ring.pos and Prio.avail>ring.pos[1].nSize) do
-		local msg = tremove(Prio.Ring.pos, 1);
-		if(not Prio.Ring.pos[1]) then
-			local pipe = Prio.Ring.pos;
-			Prio.Ring:Remove(pipe);
-			Prio.ByName[pipe.name] = nil;
-			self.PipeBin:Put(pipe);
-		else
-			Prio.Ring.pos = Prio.Ring.pos.next;
-		end
-		Prio.avail = Prio.avail - msg.nSize;
-		msg.f(msg[1], msg[2], msg[3], msg[4]);
-		Prio.nTotalSent = Prio.nTotalSent + msg.nSize;
-		self.MsgBin:Put(msg);
-	end
-end
-
-
-function ChatThrottleLib.OnEvent()
-	-- v11: We know that the rate limiter is touchy after login. Assume that it's touch after zoning, too.
-	self = ChatThrottleLib;
-	if(event == "PLAYER_ENTERING_WORLD") then
-		self.HardThrottlingBeginTime=GetTime();	-- Throttle hard for a few seconds after zoning
-		self.avail = 0;
-	end
-end
-
-
-function ChatThrottleLib.OnUpdate()
-	self = ChatThrottleLib;
-	
-	self.OnUpdateDelay = self.OnUpdateDelay + arg1;
-	if(self.OnUpdateDelay < 0.08) then
-		return;
-	end
-	self.OnUpdateDelay = 0;
-	
-	self:UpdateAvail();
-	
-	if(self.avail<0) then
-		return; -- argh. some bastard is spewing stuff past the lib. just bail early to save cpu.
-	end
-
-	-- See how many of or priorities have queued messages
-	local n=0;
-	for prioname,Prio in pairs(self.Prio) do
-		if(Prio.Ring.pos or Prio.avail<0) then 
-			n=n+1; 
-		end
-	end
-	
-	-- Anything queued still?
-	if(n<1) then
-		-- Nope. Move spillover bandwidth to global availability gauge and clear self.bQueueing
-		for prioname,Prio in pairs(self.Prio) do
-			self.avail = self.avail + Prio.avail;
-			Prio.avail = 0;
-		end
-		self.bQueueing = false;
-		self.Frame:Hide();
-		return;
-	end
-	
-	-- There's stuff queued. Hand out available bandwidth to priorities as needed and despool their queues
-	local avail= self.avail/n;
-	self.avail = 0;
-	
-	for prioname,Prio in pairs(self.Prio) do
-		if(Prio.Ring.pos or Prio.avail<0) then
-			Prio.avail = Prio.avail + avail;
-			if(Prio.Ring.pos and Prio.avail>Prio.Ring.pos[1].nSize) then
-				self:Despool(Prio);
-			end
-		end
-	end
-
-	-- Expire recycled tables if needed	
-	self.MsgBin:Tidy();
-	self.PipeBin:Tidy();
-end
-
-
-
-
------------------------------------------------------------------------
--- Spooling logic
-
-
-function ChatThrottleLib:Enqueue(prioname, pipename, msg)
-	local Prio = self.Prio[prioname];
-	local pipe = Prio.ByName[pipename];
-	if(not pipe) then
-		self.Frame:Show();
-		pipe = self.PipeBin:Get();
-		pipe.name = pipename;
-		Prio.ByName[pipename] = pipe;
-		Prio.Ring:Add(pipe);
-	end
-	
-	tinsert(pipe, msg);
-	
-	self.bQueueing = true;
-end
-
-
-
-function ChatThrottleLib:SendChatMessage(prio, prefix,   text, chattype, language, destination)
-	if(not (self and prio and text and self.Prio[prio] ) ) then
-		error('Usage: ChatThrottleLib:SendChatMessage("{BULK||NORMAL||ALERT}", "prefix" or nil, "text"[, "chattype"[, "language"[, "destination"]]]', 2);
-	end
-	
-	prefix = prefix or tostring(this);		-- each frame gets its own queue if prefix is not given
-	
-	local nSize = strlen(text) + MSG_OVERHEAD;
-	
-	-- Check if there's room in the global available bandwidth gauge to send directly
-	if(not self.bQueueing and nSize < self:UpdateAvail()) then
-		self.avail = self.avail - nSize;
-		self.ORIG_SendChatMessage(text, chattype, language, destination);
-		self.Prio[prio].nTotalSent = self.Prio[prio].nTotalSent + nSize;
-		return;
-	end
-	
-	-- Message needs to be queued
-	msg=self.MsgBin:Get();
-	msg.f=self.ORIG_SendChatMessage
-	msg[1]=text;
-	msg[2]=chattype or "SAY";
-	msg[3]=language;
-	msg[4]=destination;
-	msg.n = 4
-	msg.nSize = nSize;
-
-	self:Enqueue(prio, format("%s/%s/%s", prefix, chattype, destination or ""), msg);
-end
-
-
-function ChatThrottleLib:SendAddonMessage(prio, prefix, text, chattype)
-	if(not (self and prio and prefix and text and chattype and self.Prio[prio] ) ) then
-		error('Usage: ChatThrottleLib:SendAddonMessage("{BULK||NORMAL||ALERT}", "prefix", "text", "chattype")', 0);
-	end
-	
-	local nSize = strlen(prefix) + 1 + strlen(text) + MSG_OVERHEAD;
-	
-	-- Check if there's room in the global available bandwidth gauge to send directly
-	if(not self.bQueueing and nSize < self:UpdateAvail()) then
-		self.avail = self.avail - nSize;
-		self.ORIG_SendAddonMessage(prefix, text, chattype);
-		self.Prio[prio].nTotalSent = self.Prio[prio].nTotalSent + nSize;
-		return;
-	end
-	
-	-- Message needs to be queued
-	msg=self.MsgBin:Get();
-	msg.f=self.ORIG_SendAddonMessage;
-	msg[1]=prefix;
-	msg[2]=text;
-	msg[3]=chattype;
-	msg.n = 3
-	msg.nSize = nSize;
-	
-	self:Enqueue(prio, format("%s/%s", prefix, chattype), msg);
-end
-
-
-
-
------------------------------------------------------------------------
--- Get the ball rolling!
-
-ChatThrottleLib:Init();
-
---[[ WoWBench debugging snippet
-if(WOWB_VER) then
-	local function SayTimer()
-		print("SAY: "..GetTime().." "..arg1);
-	end
-	ChatThrottleLib.Frame:SetScript("OnEvent", SayTimer);
-	ChatThrottleLib.Frame:RegisterEvent("CHAT_MSG_SAY");
-end
-]]
--- a/libs/AceDebug-2.0/AceDebug-2.0.lua	Tue Mar 20 21:25:29 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,184 +0,0 @@
---[[
-Name: AceDebug-2.0
-Revision: $Rev: 18708 $
-Developed by: The Ace Development Team (http://www.wowace.com/index.php/The_Ace_Development_Team)
-Inspired By: Ace 1.x by Turan (turan@gryphon.com)
-Website: http://www.wowace.com/
-Documentation: http://www.wowace.com/index.php/AceDebug-2.0
-SVN: http://svn.wowace.com/root/trunk/Ace2/AceDebug-2.0
-Description: Mixin to allow for simple debugging capabilities.
-Dependencies: AceLibrary, AceOO-2.0
-]]
-
-local MAJOR_VERSION = "AceDebug-2.0"
-local MINOR_VERSION = "$Revision: 18708 $"
-
-if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary") end
-if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end
-
-if not AceLibrary:HasInstance("AceOO-2.0") then error(MAJOR_VERSION .. " requires AceOO-2.0") end 
-
-if GetLocale() == "frFR" then
-	DEBUGGING = "D\195\169boguage"
-	TOGGLE_DEBUGGING = "Activer/d\195\169sactiver le d\195\169boguage"
-elseif GetLocale() == "deDE" then
-	DEBUGGING = "Debuggen"
-	TOGGLE_DEBUGGING = "Aktiviert/Deaktiviert Debugging"
-elseif GetLocale() == "koKR" then
-	DEBUGGING = "디버깅"
-	TOGGLE_DEBUGGING = "디버깅 기능 사용함/사용안함"
-elseif GetLocale() == "zhTW" then
-	DEBUGGING = "除錯"
-	TOGGLE_DEBUGGING = "啟用/åœç”¨é™¤éŒ¯åŠŸèƒ½"
-elseif GetLocale() == "zhCN" then
-	DEBUGGING = "\232\176\131\232\175\149"
-	TOGGLE_DEBUGGING = "\229\144\175\231\148\168/\231\166\129\231\148\168 \232\176\131\232\175\149"
-else -- enUS
-	DEBUGGING = "Debugging"
-	TOGGLE_DEBUGGING = "Enable/disable debugging"
-end
-
-local AceOO = AceLibrary:GetInstance("AceOO-2.0")
-local AceDebug = AceOO.Mixin {"Debug", "CustomDebug", "IsDebugging", "SetDebugging", "SetDebugLevel", "LevelDebug", "CustomLevelDebug", "GetDebugLevel"}
-
-local function print(text, r, g, b, frame, delay)
-	(frame or DEFAULT_CHAT_FRAME):AddMessage(text, r, g, b, 1, delay or 5)
-end
-
-local tmp = {}
-
-function AceDebug:CustomDebug(r, g, b, frame, delay, a1, ...)
-	if not self.debugging then
-		return
-	end
-
-	local output = string.format("|cff7fff7f(DEBUG) %s:[%s.%3d]|r",  tostring(self), date("%H:%M:%S"), math.fmod(GetTime(), 1) * 1000)
-	
-	a1 = tostring(a1)
-	if string.find(a1, "%%") and select('#', ...) >= 1 then
-		for i = 1, select('#', ...) do
-			tmp[i] = tostring((select(i, ...)))
-		end
-		output = output .. " " .. string.format(a1, unpack(tmp))
-		for i = 1, select('#', ...) do
-			tmp[i] = nil
-		end
-	else
-		-- This block dynamically rebuilds the tmp array stopping on the first nil.
-		tmp[1] = output
-		tmp[2] = a1
-		for i = 1, select('#', ...) do
-			tmp[i+2] = tostring((select(i, ...)))
-		end
-		
-		output = table.concat(tmp, " ")
-		
-		for i = 1, select('#', ...) + 2 do
-			tmp[i] = nil
-		end
-	end
-
-	print(output, r, g, b, frame or self.debugFrame, delay)
-end
-
-function AceDebug:Debug(...)
-	AceDebug.CustomDebug(self, nil, nil, nil, nil, nil, ...)
-end
-
-function AceDebug:IsDebugging() 
-	return self.debugging
-end
-
-function AceDebug:SetDebugging(debugging)
-	self.debugging = debugging
-end
-
--- Takes a number 1-3
--- Level 1: Critical messages that every user should receive
--- Level 2: Should be used for local debugging (function calls, etc)
--- Level 3: Very verbose debugging, will dump everything and anything
--- If set to nil, you will receive no debug information
-function AceDebug:SetDebugLevel(level)
-    AceDebug:argCheck(level, 1, "number", "nil")
-    if not level then
-        self.debuglevel = nil
-        return
-    end
-    if level < 1 or level > 3 then
-        AceDebug:error("Bad argument #1 to `SetDebugLevel`, must be a number 1-3")
-    end
-    self.debuglevel = level
-end
-
-function AceDebug:GetDebugLevel()
-    return self.debuglevel
-end
-
-function AceDebug:CustomLevelDebug(level, r, g, b, frame, delay, ...)
-	if not self.debugging or not self.debuglevel then return end
-    AceDebug:argCheck(level, 1, "number")
-    if level < 1 or level > 3 then
-        AceDebug:error("Bad argument #1 to `LevelDebug`, must be a number 1-3")
-    end
-    if level > self.debuglevel then return end
-
-	local output = string.format("|cff7fff7f(DEBUG) %s:[%s.%3d]|r",  tostring(self), date("%H:%M:%S"), math.fmod(GetTime(), 1) * 1000)
-    
-	a1 = tostring(a1)
-	if string.find(a1, "%%") and select('#', ...) >= 2 then
-		for i = 1, select('#', ...) do
-			tmp[i] = tostring((select(i, ...)))
-		end
-		output = output .. " " .. string.format(a1, unpack(tmp))
-		for i = 1, select('#', ...) do
-			tmp[i] = nil
-		end
-	else
-		-- This block dynamically rebuilds the tmp array stopping on the first nil.
-		tmp[1] = output
-		tmp[2] = a1
-		for i = 1, select('#', ...) do
-			tmp[i+2] = tostring((select(i, ...)))
-		end
-		
-		output = table.concat(tmp, " ")
-		
-		for i = 1, select('#', ...) + 2 do
-			tmp[i] = nil
-		end
-	end
-
-	print(output, r, g, b, frame or self.debugFrame, delay)
-end
-
-function AceDebug:LevelDebug(level, ...)
-	if not self.debugging or not self.debuglevel then return end
-    AceDebug:argCheck(level, 1, "number")
-    if level < 1 or level > 3 then
-        AceDebug:error("Bad argument #1 to `LevelDebug`, must be a number 1-3")
-    end
-    if level > self.debuglevel then return end
-
-	AceDebug.CustomLevelDebug(self, level, nil, nil, nil, nil, nil, ...)
-end
-
-
-local options
-function AceDebug:GetAceOptionsDataTable(target)
-	if not options then
-		options = {
-			debug = {
-				name = DEBUGGING,
-				desc = TOGGLE_DEBUGGING,
-				type = "toggle",
-				get = "IsDebugging",
-				set = "SetDebugging",
-				order = -2,
-			}
-		}
-	end
-	return options
-end
-
-AceLibrary:Register(AceDebug, MAJOR_VERSION, MINOR_VERSION, AceDebug.activate)
-AceDebug = AceLibrary(MAJOR_VERSION)
--- a/libs/AceHook-2.0/AceHook-2.0.lua	Tue Mar 20 21:25:29 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,554 +0,0 @@
---[[
-Name: AceHook-2.0
-Revision: $Rev: 18708 $
-Developed by: The Ace Development Team (http://www.wowace.com/index.php/The_Ace_Development_Team)
-Inspired By: Ace 1.x by Turan (turan@gryphon.com)
-Website: http://www.wowace.com/
-Documentation: http://www.wowace.com/index.php/AceHook-2.0
-SVN: http://svn.wowace.com/root/trunk/Ace2/AceHook-2.0
-Description: Mixin to allow for safe hooking of functions, methods, and scripts.
-Dependencies: AceLibrary, AceOO-2.0
-]]
-
-local MAJOR_VERSION = "AceHook-2.0"
-local MINOR_VERSION = "$Revision: 18708 $"
-
--- This ensures the code is only executed if the libary doesn't already exist, or is a newer version
-if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary.") end
-if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end
-
-local lua51 = loadstring("return function(...) return ... end") and true or false
-
-if not AceLibrary:HasInstance("AceOO-2.0") then error(MAJOR_VERSION .. " requires AceOO-2.0") end
-
---[[---------------------------------------------------------------------------------
-  Create the library object
-----------------------------------------------------------------------------------]]
-
-local AceOO = AceLibrary:GetInstance("AceOO-2.0")
-local AceHook = AceOO.Mixin {
-								"Hook",
-								"Unhook",
-								"UnhookAll",
-								"HookReport",
-								"IsHooked",
-								"HookScript",
-							}
-
-local table_setn = lua51 and function() end or table.setn
-
-if lua51 then
-	AceHook.__deprecated = MAJOR_VERSION .. " is deprecated in WoW 2.0"
-end
-
---[[---------------------------------------------------------------------------------
-  Library Definitions
-----------------------------------------------------------------------------------]]
-
-local protFuncs = {
-	CameraOrSelectOrMoveStart = true, 	CameraOrSelectOrMoveStop = true,
-	TurnOrActionStart = true,			TurnOrActionStop = true,
-	PitchUpStart = true,				PitchUpStop = true,
-	PitchDownStart = true,				PitchDownStop = true,
-	MoveBackwardStart = true,			MoveBackwardStop = true,
-	MoveForwardStart = true,			MoveForwardStop = true,
-	Jump = true,						StrafeLeftStart = true,
-	StrafeLeftStop = true,				StrafeRightStart = true,
-	StrafeRightStop = true,				ToggleMouseMove = true,
-	ToggleRun = true,					TurnLeftStart = true,
-	TurnLeftStop = true,				TurnRightStart = true,
-	TurnRightStop = true,
-}
-
-local _G = getfenv(0)
-
-local handlers, funcs, scripts, actives
-
---[[---------------------------------------------------------------------------------
-  Private definitions (Not exposed)
-----------------------------------------------------------------------------------]]
-
---[[----------------------------------------------------------------------
-	_debug - Internal Method
--------------------------------------------------------------------------]]		
-local function print(text)
-	DEFAULT_CHAT_FRAME:AddMessage(text)
-end
-
-local function _debug(self, msg)
-	local name = self.hooks.name
-	if name then
-		print(string.format("[%s]: %s", name, msg))
-	else
-		print(msg)
-	end		
-end
-
-local new, del
-do
-	local list = setmetatable({}, {__mode = "k"})
-	function new()
-		local t = next(list)
-		if not t then
-			return {}
-		end
-		list[t] = nil
-		return t
-	end
-	
-	function del(t)
-		setmetatable(t, nil)
-		table_setn(t, 0)
-		for k in pairs(t) do
-			t[k] = nil
-		end
-		list[t] = true
-	end
-end
-
-local origMetatable = {
-	__call = function(self, ...)
-		return self.orig(...)
-	end
-}
-
---[[----------------------------------------------------------------------
-	AceHook:_getFunctionHook- internal method
--------------------------------------------------------------------------]]		
-
-local function _getFunctionHook(self, func, handler, orig)
-	if type(handler) == "string" then
-		-- The handler is a method, need to self it
-		return function(...)
-			if actives[orig] then
-				return self[handler](self, ...)
-			else
-				return orig(...)
-			end
-		end
-	else
-		-- The handler is a function, just call it
-		return function(...)
-			if actives[orig] then
-				return handler(...)
-			else
-				return orig(...)
-			end
-		end
-	end
-end
-
---[[----------------------------------------------------------------------
-	AceHook:_getMethodHook - Internal Method
--------------------------------------------------------------------------]]		
-local function _getMethodHook(self, object, method, handler, orig, script)
-	if type(handler) == "string" then
-		-- The handler is a method, need to self it
-		if script then
-			return function()
-				if actives[orig] then
-					return self[handler](self, object)
-				else
-					return orig()
-				end
-			end
-		else
-			return function(obj,...)
-				if actives[orig] then
-					return self[handler](self, obj, ...)
-				else
-					return orig(obj, ...)
-				end
-			end
-		end
-	else
-		-- The handler is a function, just call it
-		if script then
-			return function()
-				if actives[orig] then
-					return handler(object)
-				else
-					return orig()
-				end
-			end
-		else
-			return function(obj, ...)
-				if actives[orig] then
-					return handler(obj, ...)
-				else
-					return orig(obj, ...)
-				end
-			end	
-		end
-	end
-end
-
---[[----------------------------------------------------------------------
-	AceHook:HookFunc - internal method.
-	o You can only hook each function once from each source.
-	o If there is an inactive hook for this func/handler pair, we reactivate it
-	o If there is an inactive hook for another handler, we error out.
-	o Looks for handler as a method of the calling class, error if not available
-	o If handler is a function, it just uses it directly through the wrapper
--------------------------------------------------------------------------]]		
-local function _hookFunc(self, func, handler)						
-	local orig = _G[func]
-	
-	if not orig or type(orig) ~= "function" then
-		_debug(self, string.format("Attempt to hook a non-existant function %q", func),3)
-		return
-	end
-	
-	if not handler then handler = func end
-
-	if self.hooks[func] then
-		local orig = self.hooks[func].orig
-		-- We have an active hook from this source.  Don't multi-hook
-		if actives[orig] then
-			_debug(self, string.format("%q already has an active hook from this source.", func))
-			return
-		end
-		-- The hook is inactive, so reactivate it
-		if handlers[orig] == handler then
-			actives[orig] = true
-			return
-		else
-			AceHook:error("There is a stale hook for %q can't hook or reactivate.", func)
-		end
-	end	
-	
-	if type(handler) == "string" then
-		if type(self[handler]) ~= "function" then
-			AceHook:error("Could not find the the handler %q when hooking function %q", handler, func)
-		end
-	elseif type(handler) ~= "function" then
-		AceHook:error("Could not find the handler you supplied when hooking %q", func)
-	end
-	
-	local t = setmetatable(new(), origMetatable)
-	self.hooks[func] = t
-	t.orig = orig
-	
-	actives[orig] = true
-	handlers[orig] = handler
-	local newFunc = _getFunctionHook(self, func, handler, orig)
-	funcs[orig] = newFunc
-	
-	_G[func] = newFunc
-end
-
---[[----------------------------------------------------------------------
-	AceHook:UnhookFunc - internal method
-	o If you attempt to unhook a function that has never been hooked, or to unhook in a
-	  system that has never had a hook before, the system will error with a stack trace
-	o If we own the global function, then put the original back in its place and remove
-	  all references to the Hooks[func] structure.
-	o If we don't own the global function (we've been hooked) we deactivate the hook,
-	  forcing the handler to passthrough.
--------------------------------------------------------------------------]]		
-local function _unhookFunc(self, func)
-	if not self.hooks[func] or not funcs[self.hooks[func].orig] then
-		_debug(self, string.format("Tried to unhook %q which is not currently hooked.", func))
-		return
-	end
-	
-	local orig = self.hooks[func].orig
-	
-	if actives[orig] then
-		-- See if we own the global function
-		if _G[func] == funcs[orig] then
-			_G[func] = orig
-			self.hooks[func] = del(self.hooks[func])
-			handlers[orig] = nil
-			funcs[orig] = nil
-			scripts[orig] = nil
-			actives[orig] = nil
-			-- Magically all-done
-		else
-			actives[orig] = nil
-		end
-	end
-end
-
---[[----------------------------------------------------------------------
-	AceHook:HookMeth - Takes an optional fourth argument
-	o script - Signifies whether this is a script hook or not
--------------------------------------------------------------------------]]		
-
-local function _hookMeth(self, obj, method, handler, script)
-	if not handler then handler = method end
-	if (not obj or type(obj) ~= "table") then
-		AceHook:error("The object you supplied could not be found, or isn't a table.")
-	end
-	
-	if self.hooks[obj] and self.hooks[obj][method] then
-		local orig = self.hooks[obj][method].orig
-		-- We have an active hook from this source.  Don't multi-hook
-		if actives[orig] then
-			_debug(self, string.format("%q already has an active hook from this source.", method))
-			return
-		end
-		-- The hook is inactive, so reactivate it.
-		if handlers[orig] == handler then
-			actives[orig] = true
-			return
-		else
-			AceHook:error("There is a stale hook for %q can't hook or reactivate.", method)
-		end
-	end
-	-- We're clear to try the hook, let's make some checks first
-	if type(handler) == "string" then
-		if type(self[handler]) ~= "function" then
-			AceHook:error("Could not find the handler %q you supplied when hooking method %q", handler, method)
-		end
-	elseif type(handler) ~= "function" then
-		AceHook:error("Could not find the handler you supplied when hooking method %q", method)
-	end
-	-- Handler has been found, so now try to find the method we're trying to hook	
-	local orig
-	-- Script
-	if script then
-		if not obj.GetScript then
-			AceHook:error("The object you supplied does not have a GetScript method.")
-		end
-		if not obj:HasScript(method) then
-			AceHook:error("The object you supplied doesn't allow the %q method.", method)
-		end
-		-- Sometimes there is not a original function for a script.
-		orig = obj:GetScript(method)
-		if not orig then
-			orig = function() end
-		end
-	-- Method
-	else
-		orig = obj[method]
-	end
-	if not orig then
-		AceHook:error("Could not find the method or script %q you are trying to hook.", method)
-	end
-	if not self.hooks[obj] then
-		self.hooks[obj] = new()
-	end
-	local t = setmetatable(new(), origMetatable)
-	self.hooks[obj][method] = t
-	t.orig = orig
-	
-	actives[orig] = true
-	handlers[orig] = handler
-	scripts[orig] = script and true or nil
-	local newFunc = _getMethodHook(self, obj, method, handler, orig, script)
-	funcs[orig] = newFunc
-	
-	if script then
-		obj:SetScript(method, newFunc)
-	else
-		obj[method] = newFunc
-	end
-end	
-
---[[----------------------------------------------------------------------
-	AceHook:UnhookMeth - Internal method
-	o If you attempt to unhook a method that has never been hooked, or to unhook in a
-	  system that has never had a hook before, the system will error with a stack trace
-	o If we own the global method, then put the original back in its place and remove
-	  all references to the Hooks[obj][method] structure.
-	o If we don't own the global method (we've been hooked) we deactivate the hook,
-	  forcing the handler to passthrough.
--------------------------------------------------------------------------]]		
-local function _unhookMeth(self, obj, method)
-	if not self.hooks[obj] or not self.hooks[obj][method] or not funcs[self.hooks[obj][method].orig] then
-		_debug(self, string.format("Attempt to unhook a method %q that is not currently hooked.", method))
-		return
-	end
-	
-	local orig = self.hooks[obj][method].orig
-	
-	if actives[orig] then
-		-- If this is a script
-		if scripts[orig] then
-			if obj:GetScript(method) == funcs[orig] then
-				-- We own the script.  Kill it.
-				obj:SetScript(method, orig)
-				self.hooks[obj][method] = del(self.hooks[obj][method])
-				handlers[orig] = nil
-				funcs[orig] = nil
-				scripts[orig] = nil
-				actives[orig] = nil
-			else
-				actives[orig] = nil
-			end
-		else
-			if obj[method] == funcs[orig] then
-				-- We own the method.  Kill it.
-				obj[method] = orig
-				self.hooks[obj][method] = del(self.hooks[obj][method])
-				handlers[orig] = nil
-				funcs[orig] = nil
-				scripts[orig] = nil
-				actives[orig] = nil
-			else
-				actives[orig] = nil
-			end
-		end
-	end
-	if not next(self.hooks[obj]) then
-		-- Spank the table
-		self.hooks[obj] = del(self.hooks[obj])
-	end
-end
-
-function AceHook:OnInstanceInit(object)
-	if not object.hooks then
-		object.hooks = new()
-	end
-	
-	local name
-	
-	if type(rawget(object, 'GetLibraryVersion')) == "function" then
-		name = object:GetLibraryVersion()
-	end
-	if not name and type(object.GetName) == "function" then
-		name = object:GetName()
-	end
-	if not name and type(object.name) == "string" then
-		name = object.name
-	end
-	if not name then
-		for k,v in pairs(_G) do
-			if v == object then
-				name = tostring(k)
-				break
-			end
-		end
-	end
-	
-	object.hooks.name = name
-end
-
-AceHook.OnManualEmbed = AceHook.OnInstanceInit
-
---[[----------------------------------------------------------------------
-	AceHook:Hook
-		self:Hook("functionName", ["handlerName" | handler])
-		self:Hook(ObjectName, "Method", ["Handler" | handler])
--------------------------------------------------------------------------]]		
-function AceHook:Hook(arg1, arg2, arg3)
-	if type(arg1)== "string" then
-		if protFuncs[arg1] then
- 			if self.hooks.name then
-				AceHook:error("%s tried to hook %q, which is a Blizzard protected function.", self.hooks.name, arg1)
-			else
-				_debug(self, string.format("An Addon tried to hook %q, which is a Blizzard protected function.", arg1))
-			end
-		else
-			_hookFunc(self, arg1, arg2)
-		end
-	else
-		_hookMeth(self, arg1, arg2, arg3)
-	end
-end
-
-function AceHook:HookScript(arg1, arg2, arg3)
-	_hookMeth(self, arg1, arg2, arg3, true)
-end
-
---[[----------------------------------------------------------------------
-	AceHook:IsHooked()
-		self:Hook("functionName")
-		self:Hook(ObjectName, "Method")
-		
-		Returns whether or not the given function is hooked in the current	
-		namespace.  A hooked, but inactive function is considered NOT
-		hooked in this context.
--------------------------------------------------------------------------]]		
-function AceHook:IsHooked(obj, method)
-	if method and obj then
-		if self.hooks and self.hooks[obj] and self.hooks[obj][method] and actives[self.hooks[obj][method].orig] then
-			return true, handlers[self.hooks[obj][method].orig]
-		end
-	else
-		if self.hooks and self.hooks[obj] and actives[self.hooks[obj].orig] then
-			return true, handlers[self.hooks[obj].orig]
-		end
-	end
-	
-	return false, nil
-end
-
---[[----------------------------------------------------------------------
-	AceHook:Unhook
-		self:Unhook("functionName")
-		self:Unhook(ObjectName, "Method")
--------------------------------------------------------------------------]]		
-function AceHook:Unhook(arg1, arg2)
-	if type(arg1) == "string" then
-		_unhookFunc(self, arg1)
-	else
-		_unhookMeth(self, arg1, arg2)
-	end
-end			
-
---[[----------------------------------------------------------------------
-	AceHook:UnhookAll - Unhooks all active hooks from the calling source
--------------------------------------------------------------------------]]		
-function AceHook:UnhookAll()
-	for key, value in pairs(self.hooks) do
-		if type(key) == "table" then
-			for method in pairs(value) do
-				self:Unhook(key, method)
-			end
-		else
-			self:Unhook(key)
-		end
-	end
-end
-
-
-function AceHook:OnEmbedDisable(target)
-	self.UnhookAll(target)
-end
-	
---[[----------------------------------------------------------------------
-	AceHook:HookReport - Lists registered hooks from this source
--------------------------------------------------------------------------]]		
-
-function AceHook:HookReport()
-	_debug(self, "This is a list of all active hooks for this object:")
-	if not self.hooks then _debug(self, "No registered hooks.") return end
-
-	for key, value in pairs(self.hooks) do
-		if type(value) == "table" then
-			for method in pairs(value) do
-				_debug(self, string.format("key: %s method: %q |cff%s|r", tostring(key), method, self.hooks[key][method].active and "00ff00Active" or "ffff00Inactive"))
-			end
-		else
-			_debug(self, string.format("key: %s value: %q |cff%s|r", tostring(key), tostring(value), self.hooks[key].active and "00ff00Active" or "ffff00Inactive"))
-		end
-	end
-end
-
---[[---------------------------------------------------------------------------------
-  Stub and Library registration
-----------------------------------------------------------------------------------]]
-
-local function activate(self, oldLib, oldDeactivate)
-	AceHook = self
-	
-	self.handlers = oldLib and oldLib.handlers or {}
-	self.funcs = oldLib and oldLib.funcs or {}
-	self.scripts = oldLib and oldLib.scripts or {}
-	self.actives = oldLib and oldLib.actives or {}
-	
-	handlers = self.handlers
-	funcs = self.funcs
-	scripts = self.scripts
-	actives = self.actives
-	
-	self:activate(oldLib, oldDeactivate)
-	
-	if oldDeactivate then
-		oldDeactivate(oldLib)
-	end
-end
-
-AceLibrary:Register(AceHook, MAJOR_VERSION, MINOR_VERSION, activate)
--- a/libs/AceHook-2.1/AceHook-2.1.lua	Tue Mar 20 21:25:29 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,523 +0,0 @@
---[[
-Name: AceHook-2.1
-Revision: $Rev: 19980 $
-Developed by: The Ace Development Team (http://www.wowace.com/index.php/The_Ace_Development_Team)
-Inspired By: Ace 1.x by Turan (turan@gryphon.com)
-Website: http://www.wowace.com/
-Documentation: http://www.wowace.com/index.php/AceHook-2.1
-SVN: http://svn.wowace.com/root/trunk/Ace2/AceHook-2.1
-Description: Mixin to allow for safe hooking of functions, methods, and scripts.
-Dependencies: AceLibrary, AceOO-2.0
-]]
-
-local MAJOR_VERSION = "AceHook-2.1"
-local MINOR_VERSION = "$Revision: 19980 $"
-
--- This ensures the code is only executed if the libary doesn't already exist, or is a newer version
-if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary.") end
-if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end
-
-if not AceLibrary:HasInstance("AceOO-2.0") then error(MAJOR_VERSION .. " requires AceOO-2.0") end
-
---[[---------------------------------------------------------------------------------
-  Create the library object
-----------------------------------------------------------------------------------]]
-
-local AceOO = AceLibrary:GetInstance("AceOO-2.0")
-local AceHook = AceOO.Mixin {
-								"Hook",
-								"HookScript",
-								"SecureHook",
-								"Unhook",
-								"UnhookAll",
-								"HookReport",
-								"IsHooked",
-							}
-
---[[---------------------------------------------------------------------------------
-  Library Definitions
-----------------------------------------------------------------------------------]]
-
-local protectedScripts = {
-	OnClick = true,
-}
-
-local _G = getfenv(0)
-
-local handlers, scripts, actives, registry, onceSecure
-
---[[---------------------------------------------------------------------------------
-  Private definitions (Not exposed)
-----------------------------------------------------------------------------------]]
-
-local new, del
-do
-	local list = setmetatable({}, {__mode = "k"})
-	function new()
-		local t = next(list)
-		if not t then
-			return {}
-		end
-		list[t] = nil
-		return t
-	end
-	
-	function del(t)
-		setmetatable(t, nil)
-		for k in pairs(t) do
-			t[k] = nil
-		end
-		list[t] = true
-	end
-end
-
-local function createFunctionHook(self, func, handler, orig, secure)
-	if not secure then
-		if type(handler) == "string" then
-			-- The handler is a method, need to self it
-			local uid
-			uid = function(...)
-				if actives[uid] then
-					return self[handler](self, ...)
-				else
-					return orig(...)
-				end
-			end
-			return uid
-		else
-			-- The handler is a function, just call it
-			local uid
-			uid = function(...)
-				if actives[uid] then
-					return handler(...)
-				else
-					return orig(...)
-				end
-			end
-			return uid
-		end
-	else
-		-- secure hooks don't call the original method
-		if type(handler) == "string" then
-			-- The handler is a method, need to self it
-			local uid
-			uid = function(...)
-				if actives[uid] then
-					return self[handler](self, ...)
-				end
-			end
-			return uid
-		else
-			-- The handler is a function, just call it
-			local uid
-			uid = function(...)
-				if actives[uid] then
-					return handler(...)
-				end
-			end
-			return uid
-		end
-	end
-end
-
-local function createMethodHook(self, object, method, handler, orig, secure)
-	if not secure then
-		if type(handler) == "string" then
-			local uid
-			uid = function(...)
-				if actives[uid] then
-					return self[handler](self, ...)
-				else
-					return orig(...)
-				end
-			end
-			return uid
-		else
-			-- The handler is a function, just call it
-			local uid
-			uid = function(...)
-				if actives[uid] then
-					return handler(...)
-				else
-					return orig(...)
-				end
-			end
-			return uid
-		end
-	else
-		-- secure hooks don't call the original method
-		if type(handler) == "string" then
-			local uid
-			uid = function(...)
-				if actives[uid] then
-					return self[handler](self, ...)
-				end
-			end
-			return uid
-		else
-			-- The handler is a function, just call it
-			local uid
-			uid = function(...)
-				if actives[uid] then
-					return handler(...)
-				end
-			end
-			return uid
-		end
-	end
-end
-
-local function hookFunction(self, func, handler, secure)
-	local orig = _G[func]
-	
-	if not orig or type(orig) ~= "function" then
-		AceHook:error("Attempt to hook a non-existant function %q", func)
-	end
-	
-	if not handler then
-		handler = func
-	end
-
-	local uid = registry[self][func]
-	if uid then
-		if actives[uid] then
-			-- We have an active hook from this source.  Don't multi-hook
-			AceHook:error("%q already has an active hook from this source.", func)
-		end
-		
-		if handlers[uid] == handler then
-			-- The hook is inactive, so reactivate it
-			actives[uid] = true
-			return
-		else
-			self.hooks[func] = nil
-			registry[self][func] = nil
-			handlers[uid] = nil
-			uid = nil
-		end
-	end
-	
-	if type(handler) == "string" then
-		if type(self[handler]) ~= "function" then
-			AceHook:error("Could not find the the handler %q when hooking function %q", handler, func)
-		end
-	elseif type(handler) ~= "function" then
-		AceHook:error("Could not find the handler you supplied when hooking %q", func)
-	end
-	
-	uid = createFunctionHook(self, func, handler, orig, secure)
-	registry[self][func] = uid
-	actives[uid] = true
-	handlers[uid] = handler
-	
-	if not secure then
-		_G[func] = uid
-		self.hooks[func] = orig
-	else
-		hooksecurefunc(func, uid)
-	end
-end
-
-local function unhookFunction(self, func)
-	if not registry[self][func] then
-		AceHook:error("Tried to unhook %q which is not currently hooked.", func)
-	end
-	
-	local uid = registry[self][func]
-	
-	if actives[uid] then
-		-- See if we own the global function
-		if self.hooks[func] and _G[func] == uid then
-			_G[func] = self.hooks[func]
-			self.hooks[func] = nil
-			registry[self][func] = nil
-			handlers[uid] = nil
-			actives[uid] = nil
-			-- Magically all-done
-		else
-			actives[uid] = nil
-		end
-	end
-end
-
-local function hookMethod(self, obj, method, handler, script, secure)
-	if not handler then
-		handler = method
-	end
-	
-	if not obj or type(obj) ~= "table" then
-		AceHook:error("The object you supplied could not be found, or isn't a table.")
-	end
-	
-	local uid = registry[self][obj] and registry[self][obj][method]
-	if uid then
-		if actives[uid] then
-			-- We have an active hook from this source.  Don't multi-hook
-			AceHook:error("%q already has an active hook from this source.", method)
-		end
-		
-		if handlers[uid] == handler then
-			-- The hook is inactive, reactivate it.
-			actives[uid] = true
-			return
-		else
-			if self.hooks[obj] then
-				self.hooks[obj][method] = nil
-			end
-			registry[self][obj][method] = nil
-			handlers[uid] = nil
-			actives[uid] = nil
-			scripts[uid] = nil
-			uid = nil
-		end
-	end
-	
-	if type(handler) == "string" then
-		if type(self[handler]) ~= "function" then
-			AceHook:error("Could not find the handler %q you supplied when hooking method %q", handler, method)
-		end
-	elseif type(handler) ~= "function" then
-		AceHook:error("Could not find the handler you supplied when hooking method %q", method)
-	end
-	
-	local orig
-	if script then
-		if not obj.GetScript then
-			AceHook:error("The object you supplied does not have a GetScript method.")
-		end
-		if not obj:HasScript(method) then
-			AceHook:error("The object you supplied doesn't allow the %q method.", method)
-		end
-		
-		orig = obj:GetScript(method)
-		if type(orig) ~= "function" then
-			-- Sometimes there is not a original function for a script.
-			orig = function() end
-		end
-	else
-		orig = obj[method]
-	end
-	if not orig then
-		AceHook:error("Could not find the method or script %q you are trying to hook.", method)
-	end
-	
-	if not self.hooks[obj] then
-		self.hooks[obj] = new()
-	end
-	if not registry[self][obj] then
-		registry[self][obj] = new()
-	end
-	
-	local uid = createMethodHook(self, obj, method, handler, orig, secure)
-	registry[self][obj][method] = uid
-	actives[uid] = true
-	handlers[uid] = handler
-	scripts[uid] = script and true or nil
-	
-	if script then
-		obj:SetScript(method, uid)
-		self.hooks[obj][method] = orig
-	elseif not secure then
-		obj[method] = uid
-		self.hooks[obj][method] = orig
-	else
-		hooksecurefunc(obj, method, uid)
-	end
-end
-
-local function unhookMethod(self, obj, method)
-	if not registry[self][obj] or not registry[self][obj][method] then
-		AceHook:error("Attempt to unhook a method %q that is not currently hooked.", method)
-		return
-	end
-	
-	local uid = registry[self][obj][method]
-	
-	if actives[uid] then
-		if scripts[uid] then -- If this is a script
-			if obj:GetScript(method) == uid then
-				-- We own the script.  Revert to normal.
-				obj:SetScript(method, self.hooks[obj][method])
-				self.hooks[obj][method] = nil
-				registry[self][obj][method] = nil
-				handlers[uid] = nil
-				scripts[uid] = nil
-				actives[uid] = nil
-			else
-				actives[uid] = nil
-			end
-		else
-			if self.hooks[obj] and self.hooks[obj][method] and obj[method] == uid then
-				-- We own the method.  Revert to normal.
-				obj[method] = self.hooks[obj][method]
-				self.hooks[obj][method] = nil
-				registry[self][obj][method] = nil
-				handlers[uid] = nil
-				actives[uid] = nil
-			else
-				actives[uid] = nil
-			end
-		end
-	end
-	if self.hooks[obj] and not next(self.hooks[obj]) then
-		self.hooks[obj] = del(self.hooks[obj])
-	end
-	if not next(registry[self][obj]) then
-		registry[self][obj] = del(registry[self][obj])
-	end
-end
-
--- ("function" [, handler] [, hookSecure]) or (object, "method" [, handler] [, hookSecure])
-function AceHook:Hook(object, method, handler, hookSecure)
-	if type(object) == "string" then
-		method, handler, hookSecure = object, method, handler
-		if handler == true then
-			handler, hookSecure = nil, true
-		end
-		AceHook:argCheck(handler, 3, "function", "string", "nil")
-		AceHook:argCheck(hookSecure, 4, "boolean", "nil")
-		if issecurevariable(method) or onceSecure[method] then
-			if hookSecure then
-				onceSecure[method] = true
-			else
-				AceHook:error("Attempt to hook secure function %q. Use `SecureHook' or add `true' to the argument list to override.", method)
-			end
-		end
-		hookFunction(self, method, handler, false)
-	else
-		if handler == true then
-			handler, hookSecure = nil, true
-		end
-		AceHook:argCheck(object, 2, "table")
-		AceHook:argCheck(method, 3, "string")
-		AceHook:argCheck(handler, 4, "function", "string", "nil")
-		AceHook:argCheck(hookSecure, 5, "boolean", "nil")
-		if not hookSecure and issecurevariable(object, method) then
-			AceHook:error("Attempt to hook secure method %q. Use `SecureHook' or add `true' to the argument list to override.", method)
-		end
-		hookMethod(self, object, method, handler, false, false)
-	end
-end
-
--- ("function", handler) or (object, "method", handler)
-function AceHook:SecureHook(object, method, handler)
-	if type(object) == "string" then
-		method, handler = object, method
-		AceHook:argCheck(handler, 3, "function", "string", "nil")
-		hookFunction(self, method, handler, true)
-	else
-		AceHook:argCheck(object, 2, "table")
-		AceHook:argCheck(method, 3, "string")
-		AceHook:argCheck(handler, 4, "function", "string", "nil")
-		hookMethod(self, object, method, handler, false, true)
-	end
-end
-
-function AceHook:HookScript(frame, script, handler)
-	AceHook:argCheck(frame, 2, "table")
-	if not frame[0] or type(frame.IsProtected) ~= "function" then
-		AceHook:error("Bad argument #2 to `HookScript'. Expected frame.")
-	end
-	AceHook:argCheck(script, 3, "string")
-	AceHook:argCheck(handler, 4, "function", "string", "nil")
-	if frame:IsProtected() and protectedScripts[script] then
-		AceHook:error("Cannot hook secure script %q.", script)
-	end
-	hookMethod(self, frame, script, handler, true, false)
-end
-
--- ("function") or (object, "method")
-function AceHook:IsHooked(obj, method)
-	if type(obj) == "string" then
-		if registry[self][obj] and actives[registry[self][obj]] then
-			return true, handlers[registry[self][obj]]
-		end
-	else
-		AceHook:argCheck(obj, 2, "string", "table")
-		AceHook:argCheck(method, 3, "string")
-		if registry[self][obj] and registry[self][obj][method] and actives[registry[self][obj][method]] then
-			return true, handlers[registry[self][obj][method]]
-		end
-	end
-	
-	return false, nil
-end
-
--- ("function") or (object, "method")
-function AceHook:Unhook(obj, method)
-	if type(obj) == "string" then
-		unhookFunction(self, obj)
-	else
-		AceHook:argCheck(obj, 2, "string", "table")
-		AceHook:argCheck(method, 3, "string")
-		unhookMethod(self, obj, method)
-	end
-end
-
-function AceHook:UnhookAll()
-	for key, value in pairs(registry[self]) do
-		if type(key) == "table" then
-			for method in pairs(value) do
-				self:Unhook(key, method)
-			end
-		else
-			self:Unhook(key)
-		end
-	end
-end
-
-function AceHook:HookReport()
-	DEFAULT_CHAT_FRAME:AddMessage("This is a list of all active hooks for this object:")
-	if not next(registry[self]) then
-		DEFAULT_CHAT_FRAME:AddMessage("No hooks")
-	end
-	
-	for key, value in pairs(registry[self]) do
-		if type(value) == "table" then
-			for method, uid in pairs(value) do
-				DEFAULT_CHAT_FRAME:AddMessage(string.format("object: %s method: %q |cff%s|r%s", tostring(key), method, actives[uid] and "00ff00Active" or "ffff00Inactive", not self.hooks[key][method] and " |cff7f7fff-Secure-|r" or ""))
-			end
-		else
-			DEFAULT_CHAT_FRAME:AddMessage(string.format("function: %q |cff%s|r%s", tostring(key), actives[value] and "00ff00Active" or "ffff00Inactive", not self.hooks[key] and " |cff7f7fff-Secure-|r" or ""))
-		end
-	end
-end
-
-function AceHook:OnInstanceInit(object)
-	if not object.hooks then
-		object.hooks = new()
-	end
-	if not registry[object] then
-		registry[object] = new()
-	end
-end
-
-AceHook.OnManualEmbed = AceHook.OnInstanceInit
-
-function AceHook:OnEmbedDisable(target)
-	self.UnhookAll(target)
-end
-
-local function activate(self, oldLib, oldDeactivate)
-	AceHook = self
-	
-	self.handlers = oldLib and oldLib.handlers or {}
-	self.registry = oldLib and oldLib.registry or {}
-	self.scripts = oldLib and oldLib.scripts or {}
-	self.actives = oldLib and oldLib.actives or {}
-	self.onceSecure = oldLib and oldLib.onceSecure or {}
-	
-	handlers = self.handlers
-	registry = self.registry
-	scripts = self.scripts
-	actives = self.actives
-	onceSecure = self.onceSecure
-	
-	self:activate(oldLib, oldDeactivate)
-	
-	if oldDeactivate then
-		oldDeactivate(oldLib)
-	end
-end
-
-AceLibrary:Register(AceHook, MAJOR_VERSION, MINOR_VERSION, activate)
--- a/libs/AceLocale-2.0/AceLocale-2.0.lua	Tue Mar 20 21:25:29 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,506 +0,0 @@
---[[
-Name: AceLocale-2.0
-Revision: $Rev: 18753 $
-Developed by: The Ace Development Team (http://www.wowace.com/index.php/The_Ace_Development_Team)
-Inspired By: Ace 1.x by Turan (turan@gryphon.com)
-Website: http://www.wowace.com/
-Documentation: http://www.wowace.com/index.php/AceLocale-2.0
-SVN: http://svn.wowace.com/root/trunk/Ace2/AceLocale-2.0
-Description: Localization library for addons to use to handle proper
-             localization and internationalization.
-Dependencies: AceLibrary
-]]
-
-local MAJOR_VERSION = "AceLocale-2.0"
-local MINOR_VERSION = "$Revision: 18753 $"
-
-if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary.") end
-if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end
-
-local AceLocale = {}
-
-local DEFAULT_LOCALE = "enUS"
-local _G = getfenv(0)
-
-local __baseTranslations__, __debugging__, __translations__, __baseLocale__, __translationTables__, __reverseTranslations__, __strictness__
-
-local __call = function(self, key1, key2)
-	if key2 then
-		return self[key1][key2]
-	else
-		return self[key1]
-	end
-end
-
-local rawget = rawget
-local rawset = rawset
-local type = type
-
-local lastSelf
-
-local __index = function(self, key)
-	lastSelf = self
-	local value = (rawget(self, __translations__) or AceLocale.prototype)[key]
-	rawset(self, key, value)
-	return value
-end
-
-local __newindex = function(self, k, v)
-	if type(v) ~= "function" and type(k) ~= "table" then
-		AceLocale.error(self, "Cannot change the values of an AceLocale instance.")
-	end
-	rawset(self, k, v)
-end
-
-local __tostring = function(self)
-	if type(rawget(self, 'GetLibraryVersion')) == "function" then
-		return self:GetLibraryVersion()
-	else
-		return "AceLocale(" .. self[__name__] .. ")"
-	end
-end
-
-local refixInstance = function(instance)
-	if getmetatable(instance) then
-		setmetatable(instance, nil)
-	end
-	local translations = instance[__translations__]
-	if translations then
-		if getmetatable(translations) then
-			setmetatable(translations, nil)
-		end
-		local baseTranslations = instance[__baseTranslations__]
-		if getmetatable(baseTranslations) then
-			setmetatable(baseTranslations, nil)
-		end
-		if translations == baseTranslations or instance[__strictness__] then
-			setmetatable(instance, {
-				__index = __index,
-				__newindex = __newindex,
-				__call = __call,
-				__tostring = __tostring
-			})
-			
-			setmetatable(translations, {
-				__index = AceLocale.prototype
-			})
-		else
-			setmetatable(instance, {
-				__index = __index,
-				__newindex = __newindex,
-				__call = __call,
-				__tostring = __tostring
-			})
-			
-			setmetatable(translations, {
-				__index = baseTranslations,
-			})
-			
-			setmetatable(baseTranslations, {
-				__index = AceLocale.prototype,
-			})
-		end
-	else
-		setmetatable(instance, {
-			__index = __index,
-			__newindex = __newindex,
-			__call = __call,
-			__tostring = __tostring,
-		})
-	end
-end
-
-function AceLocale:new(name)
-	error(MAJOR_VERSION .. " is not supported in WoW 2.0", 2)
-	self:argCheck(name, 2, "string")
-	
-	if self.registry[name] and type(rawget(self.registry[name], 'GetLibraryVersion')) ~= "function" then
-		return self.registry[name]
-	end
-	
-	local self = {
-		[__strictness__] = false,
-		[__name__] = name,
-	}
-	refixInstance(self)
-	
-	AceLocale.registry[name] = self
-	return self
-end
-
-setmetatable(AceLocale, { __call = AceLocale.new })
-
-AceLocale.prototype = {}
-AceLocale.prototype.class = AceLocale
-
-function AceLocale.prototype:EnableDebugging()
-	if rawget(self, __baseTranslations__) then
-		AceLocale:error("Cannot enable debugging after a translation has been registered.")
-	end
-	rawset(self, __debugging__, true)
-end
-
-function AceLocale.prototype:RegisterTranslations(locale, func)
-	AceLocale.argCheck(self, locale, 2, "string")
-	AceLocale.argCheck(self, func, 3, "function")
-	
-	if locale == rawget(self, __baseLocale__) then
-		AceLocale.error(self, "Cannot provide the same locale more than once. %q provided twice.", locale)
-	end
-	
-	if rawget(self, __baseTranslations__) and GetLocale() ~= locale then
-		if rawget(self, __debugging__) then
-			local t = func()
-			func = nil
-			if type(t) ~= "table" then
-				AceLocale.error(self, "Bad argument #3 to `RegisterTranslations'. function did not return a table. (expected table, got %s)", type(t))
-			end
-			self[__translationTables__][locale] = t
-			t = nil
-		end
-		func = nil
-		return
-	end
-	local t = func()
-	func = nil
-	if type(t) ~= "table" then
-		AceLocale.error(self, "Bad argument #3 to `RegisterTranslations'. function did not return a table. (expected table, got %s)", type(t))
-	end
-	
-	rawset(self, __translations__, t)
-	if not rawget(self, __baseTranslations__) then
-		rawset(self, __baseTranslations__, t)
-		rawset(self, __baseLocale__, locale)
-		for key,value in pairs(t) do
-			if value == true then
-				t[key] = key
-			end
-		end
-	else
-		for key, value in pairs(self[__translations__]) do
-			if not rawget(self[__baseTranslations__], key) then
-				AceLocale.error(self, "Improper translation exists. %q is likely misspelled for locale %s.", key, locale)
-			end
-			if value == true then
-				AceLocale.error(self, "Can only accept true as a value on the base locale. %q is the base locale, %q is not.", rawget(self, __baseLocale__), locale)
-			end
-		end
-	end
-	refixInstance(self)
-	if rawget(self, __debugging__) then
-		if not rawget(self, __translationTables__) then
-			rawset(self, __translationTables__, {})
-		end
-		self[__translationTables__][locale] = t
-	end
-	t = nil
-end
-
-function AceLocale.prototype:SetStrictness(strict)
-	AceLocale.argCheck(self, strict, 2, "boolean")
-	local mt = getmetatable(self)
-	if not mt then
-		AceLocale.error(self, "Cannot call `SetStrictness' without a metatable.")
-	end
-	if not rawget(self, __translations__) then
-		AceLocale.error(self, "No translations registered.")
-	end
-	rawset(self, __strictness__, strict)
-	refixInstance(self)
-end
-
-function AceLocale.prototype:GetTranslationStrict(text, sublevel)
-	AceLocale.argCheck(self, text, 1, "string")
-	local translations = rawget(self, __translations__)
-	if not translations then
-		AceLocale.error(self, "No translations registered")
-	end
-	if sublevel then
-		local t = rawget(translations, text)
-		if type(t) ~= "table" then
-			AceLocale.error(self, "Strict translation %q::%q does not exist", text, sublevel)
-		end
-		local value = t[sublevel]
-		if not value then
-			AceLocale.error(self, "Strict translation %q::%q does not exist", text, sublevel)
-		end
-		return value
-	else
-		local value = rawget(translations, text)
-		if not value then
-			AceLocale.error(self, "Strict translation %q does not exist", text)
-		end
-		return value
-	end
-end
-
-function AceLocale.prototype:GetTranslation(text, sublevel)
-	AceLocale.argCheck(self, text, 1, "string")
-	local translations = rawget(self, __translations__)
-	if not translations then
-		AceLocale.error(self, "No translations registered")
-	end
-	if sublevel then
-		local base = self[__baseTranslations__]
-		local standard = rawget(translations, text)
-		local current
-		local baseStandard
-		if not standard then
-			baseStandard = rawget(base, text)
-			current = baseStandard
-		end
-		if not type(current) ~= "table" then
-			AceLocale.error(self, "Loose translation %q::%q does not exist", text, sublevel)
-		end
-		local value = current[sublevel]
-		if not value then
-			if current == baseStandard or type(baseStandard) ~= "table" then
-				AceLocale.error(self, "Loose translation %q::%q does not exist", text, sublevel)
-			end
-			value = baseStandard[sublevel]
-			if not value then
-				AceLocale.error(self, "Loose translation %q::%q does not exist", text, sublevel)
-			end
-		end
-		return value
-	else
-		local value = rawget(translations, text)
-		if not value then
-			AceLocale.error(self, "Loose translation %q does not exist", text)
-		end
-		return value
-	end
-end
-
-local function initReverse(self)
-	rawset(self, __reverseTranslations__, {})
-	local alpha = self[__translations__]
-	local bravo = self[__reverseTranslations__]
-	for base, localized in pairs(alpha) do
-		bravo[localized] = base
-	end
-end
-
-function AceLocale.prototype:GetReverseTranslation(text)
-	local x = rawget(self, __reverseTranslations__)
-	if not x then
-		if not rawget(self, __translations__) then
-			AceLocale.error(self, "No translations registered")
-		end
-		initReverse(self)
-		x = self[__reverseTranslations__]
-	end
-	local translation = x[text]
-	if not translation then
-		AceLocale.error(self, "Reverse translation for %q does not exist", text)
-	end
-	return translation
-end
-
-function AceLocale.prototype:GetIterator()
-	local x = rawget(self, __translations__)
-	if not x then
-		AceLocale.error(self, "No translations registered")
-	end
-	return next, x, nil
-end
-
-function AceLocale.prototype:GetReverseIterator()
-	local x = rawget(self, __reverseTranslations__)
-	if not x then
-		if not rawget(self, __translations__) then
-			AceLocale.error(self, "No translations registered")
-		end
-		initReverse(self)
-		x = self[__reverseTranslations__]
-	end
-	return next, x, nil
-end
-
-function AceLocale.prototype:HasTranslation(text, sublevel)
-	AceLocale.argCheck(self, text, 1, "string")
-	local x = rawget(self, __translations__)
-	if not x then
-		AceLocale.error(self, "No translations registered")
-	end
-	if sublevel then
-		AceLocale.argCheck(self, sublevel, 2, "string", "nil")
-		return type(rawget(x, text)) == "table" and x[text][sublevel] and true
-	end
-	return rawget(x, text) and true
-end
-
-function AceLocale.prototype:HasReverseTranslation(text)
-	local x = rawget(self, __reverseTranslations__)
-	if not x then
-		if not rawget(self, __translations__) then
-			AceLocale.error(self, "No translations registered")
-		end
-		initReverse(self)
-		x = self[__reverseTranslations__]
-	end
-	return x[text] and true
-end
-
-AceLocale.prototype.GetTableStrict = AceLocale.prototype.GetTranslationStrict
-AceLocale.prototype.GetTable = AceLocale.prototype.GetTranslation
-
-function AceLocale.prototype:Debug()
-	if not rawget(self, __debugging__) then
-		return
-	end
-	local words = {}
-	local locales = {"enUS", "deDE", "frFR", "koKR", "zhCN", "zhTW"}
-	local localizations = {}
-	DEFAULT_CHAT_FRAME:AddMessage("--- AceLocale Debug ---")
-	for _,locale in ipairs(locales) do
-		if not self[__translationTables__][locale] then
-			DEFAULT_CHAT_FRAME:AddMessage(string.format("Locale %q not found", locale))
-		else
-			localizations[locale] = self[__translationTables__][locale]
-		end
-	end
-	local localeDebug = {}
-	for locale, localization in pairs(localizations) do
-		localeDebug[locale] = {}
-		for word in pairs(localization) do
-			if type(localization[word]) == "table" then
-				if type(words[word]) ~= "table" then
-					words[word] = {}
-				end
-				for bit in pairs(localization[word]) do
-					if type(localization[word][bit]) == "string" then
-						words[word][bit] = true
-					end
-				end
-			elseif type(localization[word]) == "string" then
-				words[word] = true
-			end
-		end
-	end
-	for word in pairs(words) do
-		if type(words[word]) == "table" then
-			for bit in pairs(words[word]) do
-				for locale, localization in pairs(localizations) do
-					if not rawget(localization, word) or not localization[word][bit] then
-						localeDebug[locale][word .. "::" .. bit] = true
-					end
-				end
-			end
-		else
-			for locale, localization in pairs(localizations) do
-				if not rawget(localization, word) then
-					localeDebug[locale][word] = true
-				end
-			end
-		end
-	end
-	for locale, t in pairs(localeDebug) do
-		if not next(t) then
-			DEFAULT_CHAT_FRAME:AddMessage(string.format("Locale %q complete", locale))
-		else
-			DEFAULT_CHAT_FRAME:AddMessage(string.format("Locale %q missing:", locale))
-			for word in pairs(t) do
-				DEFAULT_CHAT_FRAME:AddMessage(string.format("    %q", word))
-			end
-		end
-	end
-	DEFAULT_CHAT_FRAME:AddMessage("--- End AceLocale Debug ---")
-end
-
-setmetatable(AceLocale.prototype, {
-	__index = function(self, k)
-		if type(k) ~= "table" and k ~= 0 and k ~= "GetLibraryVersion"  and k ~= "error" and k ~= "assert" and k ~= "argCheck" and k ~= "pcall" then -- HACK: remove "GetLibraryVersion" and such later.
-			AceLocale.error(lastSelf or self, "Translation %q does not exist.", k)
-		end
-		return nil
-	end
-})
-
-local function activate(self, oldLib, oldDeactivate)
-	AceLocale = self
-	
-	if oldLib then
-		self.registry = oldLib.registry
-		self.__baseTranslations__ = oldLib.__baseTranslations__
-		self.__debugging__ = oldLib.__debugging__
-		self.__translations__ = oldLib.__translations__
-		self.__baseLocale__ = oldLib.__baseLocale__
-		self.__translationTables__ = oldLib.__translationTables__
-		self.__reverseTranslations__ = oldLib.__reverseTranslations__
-		self.__strictness__ = oldLib.__strictness__
-		self.__name__ = oldLib.__name__
-	end
-	if not self.__baseTranslations__ then
-		self.__baseTranslations__ = {}
-	end
-	if not self.__debugging__ then
-		self.__debugging__ = {}
-	end
-	if not self.__translations__ then
-		self.__translations__ = {}
-	end
-	if not self.__baseLocale__ then
-		self.__baseLocale__ = {}
-	end
-	if not self.__translationTables__ then
-		self.__translationTables__ = {}
-	end
-	if not self.__reverseTranslations__ then
-		self.__reverseTranslations__ = {}
-	end
-	if not self.__strictness__ then
-		self.__strictness__ = {}
-	end
-	if not self.__name__ then
-		self.__name__ = {}
-	end
-	
-	__baseTranslations__ = self.__baseTranslations__
-	__debugging__ = self.__debugging__
-	__translations__ = self.__translations__
-	__baseLocale__ = self.__baseLocale__
-	__translationTables__ = self.__translationTables__
-	__reverseTranslations__ = self.__reverseTranslations__
-	__strictness__ = self.__strictness__
-	__name__ = self.__name__
-	
-	if not self.registry then
-		self.registry = {}
-	else
-		for name, instance in pairs(self.registry) do
-			local name = name
-			local mt = getmetatable(instance)
-			setmetatable(instance, nil)
-			instance[__name__] = name
-			local strict
-			if instance.translations then
-				instance[__translations__], instance.translations = instance.translations
-				instance[__baseLocale__], instance.baseLocale = instance.baseLocale
-				instance[__baseTranslations__], instance.baseTranslations = instance.baseTranslations
-				instance[__debugging__], instance.debugging = instance.debugging
-				instance.reverseTranslations = nil
-				instance[__translationTables__], instance.translationTables = instance.translationTables
-				if mt and mt.__call == oldLib.prototype.GetTranslationStrict then
-					strict = true
-				end
-			else
-				if instance[__strictness__] ~= nil then
-					strict = instance[__strictness__]
-				elseif instance[__translations__] ~= instance[__baseTranslations__] then
-					if getmetatable(instance[__translations__]).__index == oldLib.prototype then
-						strict = true
-					end
-				end
-			end
-			instance[__strictness__] = strict and true or false
-			refixInstance(instance)
-		end
-	end
-	
-	if oldDeactivate then
-		oldDeactivate(oldLib)
-	end
-end
-
-AceLibrary:Register(AceLocale, MAJOR_VERSION, MINOR_VERSION, activate)
--- a/libs/AceLocale-2.1/AceLocale-2.1.lua	Tue Mar 20 21:25:29 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,290 +0,0 @@
---[[
-Name: AceLocale-2.1
-Revision: $Rev: 18753 $
-Developed by: The Ace Development Team (http://www.wowace.com/index.php/The_Ace_Development_Team)
-Inspired By: Ace 1.x by Turan (turan@gryphon.com)
-Website: http://www.wowace.com/
-Documentation: http://www.wowace.com/index.php/AceLocale-2.1
-SVN: http://svn.wowace.com/root/trunk/Ace2/AceLocale-2.1
-Description: Localization library for addons to use to handle proper
-             localization and internationalization.
-Dependencies: AceLibrary
-]]
-
-local MAJOR_VERSION = "AceLocale-2.1"
-local MINOR_VERSION = "$Revision: 18753 $"
-
-if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary.") end
-if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end
-
-local curTranslation, baseTranslation, translations, baseLocale, curLocale, strictTranslations, dynamic, reverseTranslation
-local AceLocale = {}
-local backbone = {}
-backbone.class, backbone.super = false, false
-
-local function initReverse(self)
-   self[reverseTranslation] = {}
-
-   for k, v in pairs(self[curTranslation]) do self[reverseTranslation][v] = k end
-
-   setmetatable(self[reverseTranslation], {
-      __index = function(tbl, key)  
-         AceLocale:error("Reverse translation for %s not found", key)
-      end
-   })
-end
-
-local function __call(obj, text, flag)
-   if flag == nil then return obj[text] end
-   
-   if flag == true then
-      if rawget(obj[curTranslation], text) then AceLocale:error("Strict translation for %s not found", text) end
-      return rawget(obj[curTranslation], text)
-   elseif flag == false then
-      return rawget(obj[curTranslation], arg2) or obj[baseTranslation][arg2]
-   elseif flag == "reverse" then
-      if not rawget(obj, reverseTranslation) then initReverse(obj) end
-      return obj[reverseTranslation][text]	
-   else
-      AceLocale:error("Invalid flag given to __call.  Should be true/false/\"reverse\" but %s was given", flag)
-   end
-end
-
-local function NewInstance(self, uid)
-   if self.registry[uid] then return self.registry[uid] end
-
-   self.registry[uid] = {}
-   self.registry[uid][translations] = {}
-   
-   setmetatable(self.registry[uid], {
-     __tostring = function()
-        return "AceLocale(" .. uid .. ")"
-     end,
-     __call = __call,
-     __index = backbone
-   })
-   
-   return self.registry[uid]
-end
-
-function AceLocale:RegisterTranslation(uid, locale, func)
-	error(MAJOR_VERSION .. " is not supported in WoW 2.0", 2)
-   self:argCheck(uid, 1, "string")
-   self:argCheck(locale, 2, "string")
-   self:argCheck(func, 3, "function")
-	
-   local instance = self.registry[uid] or NewInstance(self, uid)
-   
-   if instance[translations][locale] then
-      self:error("Cannot provide the same locale more than once. %q provided twice for %s.", locale, uid)
-   end
-	
-    if rawget(instance, baseLocale) then 
-        for k, v in pairs(func()) do
-			if not rawget(instance[baseTranslation], k) then
-				self:error("Improper translation exists. %q is likely misspelled for locale %s.", k, locale)
-			elseif value == true then
-				self:error( "Can only accept true as a value on the base locale. %q is the base locale, %q is not.", instance[baseLocale], locale)
-			end
-		end
-    else
-        instance[baseTranslation] = func() 
-        instance[baseLocale] = locale
-        
-        for k, v in pairs(instance[baseTranslation]) do
-            if type(v) ~= "string" and type(v) ~= "table" then
-                if type(v) == "boolean" then 
-                    instance[baseTranslation][k] = k 
-                else
-                    self:error("Translation for %s is invalid.  Must be either string or boolean", k)
-                end
-            end
-        end
-        
-        setmetatable(instance[baseTranslation], {__index = backbone})
-    end
-    
-    instance[translations][locale] = func
-end
-
-function AceLocale:GetInstance(uid, locale)
-   self:argCheck(uid, 1, "string")
-   
-   local instance = self.registry[uid]
-   
-   if not instance then self:error("At least one translation must be registered before you can GetInstance().") end
-    
-   instance:SetLocale(locale)
-   
-   return instance
-end
-
-function AceLocale:HasInstance(uid)
-    self:argCheck(uid, 1, "string")
-    return self.registry[uid] and true or false
-end
-
-setmetatable(backbone, {__index = 
-    function(tbl, key)  
-        AceLocale:error("Translation for %s not found", key)
-    end})
-
-function backbone:SetLocale(locale)
-    local loose = false
-    if locale == nil then return end
-   
-    if locale == true then 
-        locale = GetLocale() 
-        if rawget(self, curLocale) and self[curLocale] == locale then return end
-        if not self[translations][locale] then locale = self[baseLocale] end
-    end
-    
-    if rawget(self, curLocale) and self[curLocale] == locale then return end
-    
-    if not self[translations][locale] then
-            AceLocale:error("Cannot SetLocale to %s for %s,  It has not been registered.", locale, tostring(self))
-    end
-    
-    if self[translations][locale] and self[baseLocale] == locale then
-        self[curLocale] = self[baseLocale]
-        self[curTranslation] = {}
-        getmetatable(self).__index = self[baseTranslation]
-    else
-        self[curLocale] = locale
-        self[curTranslation] = self[translations][locale]()
-        getmetatable(self).__index = self[curTranslation]
-    end    
-
-    if rawget(self, strictTranslations) then
-        setmetatable(self[curTranslation], {
-            __index = function(tbl, key)  
-                AceLocale:error("Translation for %s not found", key)
-            end
-        })
-    else
-        setmetatable(self[curTranslation], {
-            __index = self[baseTranslation]
-        })
-    end
-
-    if not rawget(self, dynamic) then
-        self[translations] = {}
-    end
-
-    if rawget(self, reverseTranslation) then
-        self[reverseTranslation] = nil
-    end
-end
-
-function backbone:ClearLocales()
-    self[translations] = {}
-    self[curLocale] = nil
-    self[baseLocale] = nil
-end
-
-function backbone:SetDynamicLocales(flag)
-    AceLocale:argCheck(flag, 1, "boolean")
-    self[dynamic] = flag
-end
-
-function backbone:SetStrictness(flag)
-    AceLocale:argCheck(flag, 1, "boolean")
-    local mt
-    
-    if rawget(self, curTranslation) then
-        mt = getmetatable(self[curTranslation])
-    end
-    
-    if strict and mt then
-        mt.__index = function(tbl, key)  
-            AceLocale:error("Translation for %s not found", key)
-        end
-    elseif mt then
-        mt.__index = self[baseTranslation]
-    end
-
-    self[strictTranslations] = strict
-end
-
-function backbone:HasTranslation(text)
-   AceLocale:argCheck(text, 1, "string")
-   
-   if not rawget(self, curTranslation) then AceLocale:error("A locale must be chosen before you can call HasTranslation().") end
-   
-   return rawget(self[curTranslation], text) and true or false
-end
-
-function backbone:HasReverseTranslation(text)
-   AceLocale:argCheck(text, 1, "string")
-    
-    if not rawget(self, curTranslation) then AceLocale:error("A locale must be chosen before you can call HasReverseTranslation().") end
-    
-    if not rawget(self, reverseTranslation) then
-		initReverse(self)
-	end
-    
-    return rawget(self[reverseTranslation], text) and true or false
-end
-
-function backbone:GetIterator()
-   if not rawget(self, curTranslation) then AceLocale:error("A locale must be chosen before you can call GetIterator().") end
-   return pairs(self[curTranslation])
-end
-
-function backbone:GetReverseIterator()
-    if not rawget(self, curTranslation) then AceLocale:error("A locale must be chosen before you can call HasReverseTranslation().") end
-    
-    if not rawget(self, reverseTranslation) then
-		initReverse(self)
-	end
-    
-    return pairs(self[reverseTranslation])
-end
-
-function backbone:GetLocaleList()
-    local results = {}
-    for k, v in pairs(self[translations]) do tinsert(results, k) end
-    return results
-end
-
-local function activate(self, oldLib, oldDeactivate)
-   AceLocale = self
-	
-   if oldLib then
-      self.registry = oldLib.registry
-      self.curTranslation = oldLib.curTranslation
-      self.baseTranslation = oldLib.baseTranslation
-      self.translations = oldLib.translations
-      self.baseLocale = oldLib.baseLocale
-      self.curLocale = oldLib.curLocale
-      self.strictTranslations = oldLib.strictTranslations
-      self.dynamic = oldLib.dynamic
-      self.reverseTranslation = oldLib.reverseTranslation
-   end
-	
-   if not self.registry then self.registry = {} end
-   if not self.curTranslation then	self.curTranslation = {} end
-   if not self.baseTranslation then self.baseTranslation = {} end
-   if not self.translations then self.translations = {} end
-   if not self.baseLocale then self.baseLocale = {} end
-   if not self.curLocale then self.curLocale = {} end
-   if not self.strictTranslations then	self.strictTranslations = {} end
-   if not self.dynamic then self.dynamic = {} end
-   if not self.reverseTranslation then	self.reverseTranslation = {} end
-	
-   if oldDeactivate then
-      oldDeactivate(oldLib)
-   end
-	
-   curTranslation = self.curTranslation
-   baseTranslation = self.baseTranslation
-   translations = self.translations
-   baseLocale = self.baseLocale
-   curLocale = self.curLocale
-   strictTranslations = self.strictTranslations
-   dynamic = self.dynamic
-   reverseTranslation = self.reverseTranslation
-end
-
-AceLibrary:Register(AceLocale, MAJOR_VERSION, MINOR_VERSION, activate)
-AceLocale = AceLibrary(MAJOR_VERSION)
\ No newline at end of file
--- a/libs/AceModuleCore-2.0/AceModuleCore-2.0.lua	Tue Mar 20 21:25:29 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,377 +0,0 @@
---[[
-Name: AceModuleCore-2.0
-Revision: $Rev: 18708 $
-Developed by: The Ace Development Team (http://www.wowace.com/index.php/The_Ace_Development_Team)
-Inspired By: Ace 1.x by Turan (turan@gryphon.com)
-Website: http://www.wowace.com/
-Documentation: http://www.wowace.com/index.php/AceModuleCore-2.0
-SVN: http://svn.wowace.com/root/trunk/Ace2/AceModuleCore-2.0
-Description: Mixin to provide a module system so that modules or plugins can
-             use an addon as its core.
-Dependencies: AceLibrary, AceOO-2.0, AceAddon-2.0, AceEvent-2.0 (optional)
-]]
-
-local MAJOR_VERSION = "AceModuleCore-2.0"
-local MINOR_VERSION = "$Revision: 18708 $"
-
-if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary") end
-if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end
-
-if not AceLibrary:HasInstance("AceOO-2.0") then error(MAJOR_VERSION .. " requires AceOO-2.0") end
-
-local function safecall(func, ...)
-	local success, err = pcall(func, ...)
-	if not success then geterrorhandler()(err) end
-end
-
-local AceEvent
-local AceOO = AceLibrary:GetInstance("AceOO-2.0")
-local AceModuleCore = AceOO.Mixin {
-									"NewModule",
-									"HasModule",
-									"GetModule",
-									"IsModule",
-									"IterateModules",
-									"SetModuleMixins", 
-									"SetModuleClass",
-									"IsModuleActive",
-									"ToggleModuleActive"
-								  }
-
-local function getlibrary(lib)
-	if type(lib) == "string" then
-		return AceLibrary(lib)
-	else
-		return lib
-	end
-end
-
-local tmp = {}
-function AceModuleCore:NewModule(name, ...)
-	if not self.modules then
-		AceModuleCore:error("CreatePrototype() must be called before attempting to create a new module.", 2)
-	end
-	AceModuleCore:argCheck(name, 2, "string")
-	if string.len(name) == 0 then
-		AceModuleCore:error("Bad argument #2 to `NewModule`, string must not be empty")
-	end
-	if self.modules[name] then
-		AceModuleCore:error("The module %q has already been registered", name)
-	end
-	
-	for i = 1, select('#', ...) do
-		tmp[i] = getlibrary((select(i, ...)))
-	end
-	
-	if self.moduleMixins then
-		for _,mixin in ipairs(self.moduleMixins) do
-			local exists = false
-			for _,v in ipairs(tmp) do
-				if mixin == v then
-					exists = true
-					break
-				end
-			end
-			if not exists then
-				table.insert(tmp, mixin)
-			end
-		end
-	end
-
-	local module = AceOO.Classpool(self.moduleClass, unpack(tmp)):new(name)
-	self.modules[name] = module
-	module.name = name
-	module.title = name
-
-	AceModuleCore.totalModules[module] = self
-	
-	if AceEvent then
-		AceEvent:TriggerEvent("Ace2_ModuleCreated", module)
-	end
-
-	local num = #tmp
-	for i = 1, num do
-		tmp[i] = nil
-	end
-	return module
-end
-
-function AceModuleCore:HasModule(...)
-	for i = 1, select('#', ...) do
-		if not self.modules[select(i, ...)] then
-			return false
-		end
-	end
-	
-	return true
-end
-
-function AceModuleCore:GetModule(name)
-	if not self.modules then
-		AceModuleCore:error("Error initializing class.  Please report error.")
-	end
-	if not self.modules[name] then
-		AceModuleCore:error("Cannot find module %q.", name)
-	end
-	return self.modules[name]
-end
-
-function AceModuleCore:IsModule(module)
-	if self == AceModuleCore then
-		return AceModuleCore.totalModules[module]
-	else
-		for k,v in pairs(self.modules) do
-			if v == module then
-				return true
-			end
-		end
-		return false
-	end
-end
-
-function AceModuleCore:IterateModules()
-	local t = {}
-	for k in pairs(self.modules) do
-		table.insert(t, k)
-	end
-	table.sort(t)
-	local i = 0
-	return function()
-		i = i + 1
-		local x = t[i]
-		if x then
-			return x, self.modules[x]
-		else
-			t = nil
-			return nil
-		end
-	end, nil, nil
-end
-
-function AceModuleCore:SetModuleMixins(...)
-	if self.moduleMixins then
-		AceModuleCore:error('Cannot call "SetModuleMixins" twice')
-	elseif not self.modules then
-		AceModuleCore:error("Error initializing class.  Please report error.")
-	elseif next(self.modules) then
-		AceModuleCore:error('Cannot call "SetModuleMixins" after "NewModule" has been called.')
-	end
-
-	self.moduleMixins =  { ... }
-	for i,v in ipairs(self.moduleMixins) do
-		self.moduleMixins[i] = getlibrary(v)
-	end
-end
-
-function AceModuleCore:SetModuleClass(class)
-	class = getlibrary(class)
-	AceModuleCore:assert(AceOO.inherits(class, AceOO.Class), "Bad argument #2 to `SetModuleClass' (Class expected)")
-	if not self.modules then
-		AceModuleCore:error("Error initializing class.  Please report error.")
-	end
-	if self.customModuleClass then
-		AceModuleCore:error("Cannot call `SetModuleClass' twice.")
-	end
-	self.customModuleClass = true
-	self.moduleClass = class
-	self.modulePrototype = class.prototype
-end
-
-function AceModuleCore:ToggleModuleActive(module, state)
-	AceModuleCore:argCheck(module, 2, "table", "string")
-	AceModuleCore:argCheck(state, 3, "nil", "boolean")
-	
-	if type(module) == "string" then
-		if not self:HasModule(module) then
-			AceModuleCore:error("Cannot find module %q", module)
-		end
-		module = self:GetModule(module)
-	else
-		if not self:IsModule(module) then
-			AceModuleCore:error("%q is not a module", module)
-		end
-	end
-
-	local disable
-	if state == nil then
-		disable = self:IsModuleActive(module)
-	else
-		disable = not state
-		if disable ~= self:IsModuleActive(module) then
-			return
-		end
-	end
-
-	if type(module.ToggleActive) == "function" then
-		return module:ToggleActive(not disable)
-	elseif AceOO.inherits(self, "AceDB-2.0") then
-		if not self.db or not self.db.raw then
-			AceModuleCore:error("Cannot toggle a module until `RegisterDB' has been called and `ADDON_LOADED' has been fired.")
-		end
-		if type(self.db.raw.disabledModules) ~= "table" then
-			self.db.raw.disabledModules = {}
-		end
-		local _,profile = self:GetProfile()
-		if type(self.db.raw.disabledModules[profile]) ~= "table" then
-			self.db.raw.disabledModules[profile] = {}
-		end
-		if type(self.db.raw.disabledModules[profile][module.name]) ~= "table" then
-			self.db.raw.disabledModules[profile][module.name] = disable or nil
-		end
-		if not disable then
-			if not next(self.db.raw.disabledModules[profile]) then
-				self.db.raw.disabledModules[profile] = nil
-			end
-			if not next(self.db.raw.disabledModules) then
-				self.db.raw.disabledModules = nil
-			end
-		end
-	else
-		if type(self.disabledModules) ~= "table" then
-			self.disabledModules = {}
-		end
-		self.disabledModules[module.name] = disable or nil
-	end
-	if AceOO.inherits(module, "AceAddon-2.0") then
-		local AceAddon = AceLibrary("AceAddon-2.0")
-		if not AceAddon.addonsStarted[module] then
-			return
-		end
-	end
-	if not disable then
-		local current = module.class
-		while true do
-			if current == AceOO.Class then
-				break
-			end
-			if current.mixins then
-				for mixin in pairs(current.mixins) do
-					if type(mixin.OnEmbedEnable) == "function" then
-						safecall(mixin.OnEmbedEnable, mixin, module)
-					end
-				end
-			end
-			current = current.super
-		end
-		if type(module.OnEnable) == "function" then
-			safecall(module.OnEnable, module)
-		end
-		if AceEvent then
-			AceEvent:TriggerEvent("Ace2_AddonEnabled", module)
-		end
-	else
-		local current = module.class
-		while true do
-			if current == AceOO.Class then
-				break
-			end
-			if current.mixins then
-				for mixin in pairs(current.mixins) do
-					if type(mixin.OnEmbedDisable) == "function" then
-						safecall(mixin.OnEmbedDisable, mixin, module)
-					end
-				end
-			end
-			current = current.super
-		end
-		if type(module.OnDisable) == "function" then
-			safecall(module.OnDisable, module)
-		end
-		if AceEvent then
-			AceEvent:TriggerEvent("Ace2_AddonDisabled", module)
-		end
-	end
-	return not disable
-end
-
-function AceModuleCore:IsModuleActive(module)
-	AceModuleCore:argCheck(module, 2, "table", "string")
-	
-	if AceModuleCore == self then
-		self:argCheck(module, 2, "table")
-		
-		local core = AceModuleCore.totalModules[module]
-		if not core then
-			self:error("Bad argument #2 to `IsModuleActive'. Not a module")
-		end
-		return core:IsModuleActive(module)
-	end
-	
-	if type(module) == "string" then
-		if not self:HasModule(module) then
-			AceModuleCore:error("Cannot find module %q", module)
-		end
-		module = self:GetModule(module)
-	else
-		if not self:IsModule(module) then
-			AceModuleCore:error("%q is not a module", module)
-		end
-	end
-	
-	if type(module.IsActive) == "function" then
-		return module:IsActive()
-	elseif AceOO.inherits(self, "AceDB-2.0") then
-		local _,profile = self:GetProfile()
-		return not self.db or not self.db.raw or not self.db.raw.disabledModules or not self.db.raw.disabledModules[profile] or not self.db.raw.disabledModules[profile][module.name]
-	else
-		return not self.disabledModules or not self.disabledModules[module.name]
-	end
-end
-
-function AceModuleCore:OnInstanceInit(target)
-	if target.modules then
-		AceModuleCore:error("OnInstanceInit cannot be called twice")
-	end
-	target.modules = {}
-
-	target.moduleClass = AceOO.Class("AceAddon-2.0")
-	target.modulePrototype = target.moduleClass.prototype
-end
-
-AceModuleCore.OnManualEmbed = AceModuleCore.OnInstanceInit
-
-function AceModuleCore.OnEmbedProfileDisable(AceModuleCore, self, newProfile)
-	if not AceOO.inherits(self, "AceDB-2.0") then
-		return
-	end
-	local _,currentProfile = self:GetProfile()
-	for k, module in pairs(self.modules) do
-		if type(module.IsActive) == "function" or type(module.ToggleActive) == "function" then
-			-- continue
-		else
-			local currentActive =  not self.db or not self.db.raw or not self.db.raw.disabledModules or not self.db.raw.disabledModules[currentProfile] or not self.db.raw.disabledModules[currentProfile][module.name]
-			local newActive =  not self.db or not self.db.raw or not self.db.raw.disabledModules or not self.db.raw.disabledModules[newProfile] or not self.db.raw.disabledModules[newProfile][module.name]
-			if currentActive ~= newActive then
-				self:ToggleModuleActive(module)
-				if not self.db.raw.disabledModules then
-					self.db.raw.disabledModules = {}
-				end
-				if not self.db.raw.disabledModules[currentProfile] then
-					self.db.raw.disabledModules[currentProfile] = {}
-				end
-				self.db.raw.disabledModules[currentProfile][module.name] = not currentActive or nil
-			end
-		end
-	end
-end
-
-local function activate(self, oldLib, oldDeactivate)
-	AceModuleCore = self
-
-	self.totalModules = oldLib and oldLib.totalModules or {}
-	
-	self:activate(oldLib, oldDeactivate)
-	
-	if oldDeactivate then
-		oldDeactivate(oldLib)
-	end
-end
-
-local function external(self, major, instance)  
-	if major == "AceEvent-2.0" then  
-		AceEvent = instance  
-	end  
-end 
-
-AceLibrary:Register(AceModuleCore, MAJOR_VERSION, MINOR_VERSION, activate, nil, external)
-AceModuleCore = AceLibrary(MAJOR_VERSION)
--- a/libs/AceTab-2.0/AceTab-2.0.lua	Tue Mar 20 21:25:29 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,327 +0,0 @@
---[[
-Name: AceTab-2.0
-Revision: $Rev: 18708 $
-Developed by: The Ace Development Team (http://www.wowace.com/index.php/The_Ace_Development_Team)
-Website: http://www.wowace.com/
-Documentation: http://www..wowace.com/index.php/AceTab-2.0
-SVN: http://svn.wowace.com/root/trunk/Ace2/AceTab-2.0
-Description: A tab-completion library
-Dependencies: AceLibrary, AceEvent-2.0
-]]
-
-local MAJOR_VERSION = "AceTab-2.0"
-local MINOR_VERSION = "$Revision: 18708 $"
-
-if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary.") end
-if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end
-
-local AceEvent
-local AceTab = {}
-local _G = getfenv()
-
-local hookedFrames = {}
-local framesHooked = {}
-
-function AceTab:RegisterTabCompletion(descriptor, regex, wlfunc, usage, editframes)
-	self:argCheck(descriptor, 2, "string")
-	self:argCheck(regex, 3, "string", "table")
-	self:argCheck(wlfunc, 4, "string", "function", "nil")
-	self:argCheck(usage, 5, "string", "function", "boolean", "nil")
-	self:argCheck(editframe, 6, "string", "table", "nil")
-
-	if type(regex) == "string" then regex = {regex} end
-
-	if type(wlfunc) == "string" and type(self[wlfunc]) ~= "function" then
-		self:error("Cannot register function %q; it does not exist", wlfunc)
-	end
-
-	if type(usage) == "string" and type(self[usage]) ~= "function" then
-		self:error("Cannot register usage function %q; it does not exist", usage)
-	end
-
-	if not editframes then editframes = {"ChatFrameEditBox"} end
-
-	if type(editframes) == "table" and editframes.Show then editframes = {editframes:GetName()} end
-	
-	for _, frame in pairs(editframes) do
-		local Gframe
-		if type(frame) == "table" then
-			Gframe = frame
-			frame  = frame:GetName()
-		else
-			Gframe = _G[frame]
-		end
-
-		if type(Gframe) ~= "table" or not Gframe.Show then
-			self:error("Cannot register frame %q; it does not exist", frame)
-			frame = nil
-		end
-		
-		if frame then
-			if Gframe:GetFrameType() ~= "EditBox" then
-				self:error("Cannot register frame %q; it is not an EditBox", frame)
-				frame = nil
-			else
-				if AceEvent and AceEvent:IsFullyInitialized() then
-					if not framesHooked[Gframe] then
-						framesHooked[Gframe] = true
-						local orig = Gframe:GetScript("OnTabPressed")
-						if type(orig) ~= "function" then
-							orig = function() end
-						end
-						Gframe:SetScript("OnTabPressed", function()
-							if self:OnTabPressed(Gframe) then
-								return orig()
-							end
-						end)
-						Gframe.curMatch = 0
-						Gframe.matches = {}
-						Gframe.pMatchLen = 0
-					end
-				else
-					hookedFrames[frame] = true
-				end
-			end
-		end
-	end
-	
-	if not self.registry[descriptor] then
-		self.registry[descriptor] = {}
-	end
-	
-	if not self.registry[descriptor][self] then
-		self.registry[descriptor][self] = {}
-	end
-	self.registry[descriptor][self] = {patterns = regex, wlfunc = wlfunc,  usage = usage, frames = editframes}
-	
-	
-	if not AceEvent and AceLibrary:HasInstance("AceEvent-2.0") then
-		external(AceTab, "AceEvent-2.0", AceLibrary("AceEvent-2.0"))
-	end
-	if AceEvent then
-		if not self:IsEventRegistered("AceEvent_FullyInitialized") then
-			self:RegisterEvent("AceEvent_FullyInitialized", "AceEvent_FullyInitialized", true)
-		end
-	end
-end
-
-function AceTab:IsTabCompletionRegistered(descriptor)
-	self:argCheck(descriptor, 2, "string")
-	return self.registry[descriptor] and self.registry[descriptor][self]
-end
-
-function AceTab:UnregisterTabCompletion(descriptor)
-	self:argCheck(descriptor, 2, "string")
-	if self.registry[descriptor] and self.registry[descriptor][self] then
-		self.registry[descriptor][self] = nil
-	else
-		self:error("Cannot unregister a tab completion (%s) that you have not registered.", descriptor)
-	end
-end
-
-local GCS
-GCS = function(s1, s2)
-	if not s1 and not s2 then return end
-	if not s1 then s1 = s2 end
-	if not s2 then s2 = s1 end
-	local s1len, s2len = string.len(s1), string.len(s2)
-	if s2len < s1len then
-		s1, s2 = s2, s1
-	end
-	if string.find(string.lower(s2), string.lower(s1)) then
-		return s1
-	else
-		return GCS(string.sub(s1, 1, -2), s2)
-	end
-end
-local pos
-local function CycleTab()
-	this.pMatchLen = string.len(this.lMatch)
-	local cMatch = 0
-	local matched = false
-	for desc, mList in pairs(this.matches) do
-		if not matched then
-			for _, m in ipairs(mList) do
-				cMatch = cMatch + 1
-				if cMatch == this.curMatch then
-					this.lMatch = m
-					this.curMatch = this.curMatch + 1
-					matched = true
-					break
-				end
-			end
-		end
-	end
-	if not matched then
-		this.curMatch = 1
-		this.lMatch = this.origWord
-	end
-	this:HighlightText(pos - this.pMatchLen, pos)
-	this:Insert(this.lMatch)
-end
-
-function AceTab:OnTabPressed()
-	local ost = this:GetScript("OnTextSet")
-	if type(ost) ~= "function" then
-		ost = nil
-	end
-	if ost then this:SetScript("OnTextSet", nil) end
-	if this:GetText() == "" then return true end
-	this:Insert("\255")
-	pos = string.find(this:GetText(), "\255", 1) - 1
-	this:HighlightText(pos, pos+1)
-	this:Insert("\0")
-	if ost then this:SetScript("OnTextSet", ost) end
-	local fulltext = this:GetText()
-	local text = string.sub(fulltext, 0, pos) or ""
-
-	local left = string.find(string.sub(text, 1, pos), "%w+$")
-	left = left and left-1 or pos
-	if not left or left == 1 and string.sub(text, 1, 1) == "/" then return true end
-
-	local _, _, word = string.find(string.sub(text, left, pos), "(%w+)")
-	word = word or ""
-	this.lMatch = this.curMatch > 0 and (this.lMatch or this.origWord)
-
-	if this.lMatch and this.lMatch ~= "" and string.find(string.sub(text, 1, pos), this.lMatch.."$") then
-		return CycleTab()
-	else
-		this.matches = {}
-		this.curMatch = 0
-		this.lMatch = nil
-	end
-
-	local completions = {}
-	local numMatches = 0
-	local firstMatch, hasNonFallback
-	
-	for desc, entry in pairs(AceTab.registry) do
-		for _, s in pairs(entry) do
-			for _, f in pairs(s.frames) do
-				if _G[f] == this then
-					for _, regex in ipairs(s.patterns) do
-						local cands = {}
-						if string.find(string.sub(text, 1, left), regex.."$") then
-							local c = s.wlfunc(cands, fulltext, left)
-							if c ~= false then
-								local mtemp = {}
-								this.matches[desc] = this.matches[desc] or {}
-								for _, cand in ipairs(cands) do
-									if string.find(string.lower(cand), string.lower(word), 1, 1) == 1 then
-										mtemp[cand] = true
-										numMatches = numMatches + 1
-										if numMatches == 1 then firstMatch = cand end
-									end
-								end
-								for i in pairs(mtemp) do
-									table.insert(this.matches[desc], i)
-								end
-								this.matches[desc].usage = s.usage
-								if regex ~= "" and this.matches[desc][1] then
-									hasNonFallback = true
-									this.matches[desc].notFallback = true
-								end
-							end
-						end
-					end
-				end
-			end
-		end
-	end
-
-	local _, set = next(this.matches)
-	if not set or numMatches == 0 and not hasNonFallback then return true end
-	
-	this:HighlightText(left, left + string.len(word))
-	if numMatches == 1 then
-		this:Insert(firstMatch)
-		this:Insert(" ")
-	else
-		if this.curMatch == 0 then
-			this.curMatch = 1
-			this.origWord = word
-			this.lMatch = word
-			CycleTab()
-		end
-		local gcs
-		for h, c in pairs(this.matches) do
-			if hasNonFallback and not c.notFallback then break end
-			local u = c.usage
-			c.usage = nil
-			local candUsage = u and {}
-			local gcs2
-			if next(c) then
-				if not u then DEFAULT_CHAT_FRAME:AddMessage(h..":") end
-				for _, m in ipairs(c) do
-					if not u then DEFAULT_CHAT_FRAME:AddMessage(m) end
-					gcs2 = GCS(gcs2, m)
-				end
-			end
-			gcs = GCS(gcs, gcs2)
-			if u then
-				if type(u) == "function" then
-					local us = u(candUsage, c, gcs2, string.sub(text, 1, left))
-					if candUsage and next(candUsage) then us = candUsage end
-					if type(us) == "string" then
-						DEFAULT_CHAT_FRAME:AddMessage(us)
-					elseif type(us) == "table" and numMatches > 0 then
-						for _, v in ipairs(c) do
-							if us[v] then DEFAULT_CHAT_FRAME:AddMessage(string.format("%s - %s", v, us[v])) end
-						end
-					end
-				end
-			end
-		end
-		if curMatch == 0 then
-			this:Insert(gcs or word)
-		end
-	end
-end
-
-function AceTab:AceEvent_FullyInitialized()
-	for frame in pairs(hookedFrames) do
-		local Gframe = _G[frame]
-		if not framesHooked[Gframe] then
-			framesHooked[Gframe] = true
-			local orig = Gframe:GetScript("OnTabPressed")
-			if type(orig) ~= "function" then
-				orig = function() end
-			end
-			Gframe:SetScript("OnTabPressed", function()
-				if self:OnTabPressed(Gframe) then
-					return orig()
-				end
-			end)
-			Gframe.curMatch = 0
-			Gframe.matches = {}
-			Gframe.pMatchLen = 0
-		end
-	end
-end
-
-local function external(self, major, instance)
-	if major == "AceEvent-2.0" then
-		if not AceEvent then
-			AceEvent = instance
-			
-			AceEvent:embed(self)
-		end
-	end
-end
-
-local function activate(self, oldLib, oldDeactivate)
-	if oldLib then
-		self.registry = oldLib.registry
-	end
-
-	if not self.registry then
-		self.registry = {}
-	end
-
-	if oldDeactivate then
-		oldDeactivate(oldLib)
-	end
-end
-
-AceLibrary:Register(AceTab, MAJOR_VERSION, MINOR_VERSION, activate, nil, external)
-AceTab = AceLibrary(MAJOR_VERSION)
--- a/main.lua	Tue Mar 20 21:25:29 2007 +0000
+++ b/main.lua	Tue Mar 20 21:33:59 2007 +0000
@@ -102,7 +102,9 @@
 function main:EVENT_REBOUND_KEYBINDING_MODE(enabled)
   for _, bar in pairs(self.bars) do
     for __, button in pairs(bar.buttons) do
-      button:TempShow(enabled)
+      if button and button ~= EMPTY_BAR_SLOT then
+        button:TempShow(enabled)
+      end
     end
   end
 end