Added:
tags/OptionHouse-r669/OptionHouse/
tags/OptionHouse-r669/OptionHouse/GnomePortrait.tga (contents,
props changed)
tags/OptionHouse-r669/OptionHouse/LibStub.lua
tags/OptionHouse-r669/OptionHouse/OH_AddOns.lua
tags/OptionHouse-r669/OptionHouse/OH_Configuration.lua
tags/OptionHouse-r669/OptionHouse/OH_PerfMon.lua
tags/OptionHouse-r669/OptionHouse/OptionHouse.lua
tags/OptionHouse-r669/OptionHouse/OptionHouse.toc
tags/OptionHouse-r669/OptionHouse/changelog.txt
Log:
* Importing OptionHouse-r669 addon
Added: tags/OptionHouse-r669/OptionHouse/GnomePortrait.tga
==============================================================================
Binary file. No diff available.
Added: tags/OptionHouse-r669/OptionHouse/LibStub.lua
==============================================================================
--- (empty file)
+++ tags/OptionHouse-r669/OptionHouse/LibStub.lua Thu Apr 24 22:00:45 2008
@@ -0,0 +1,51 @@
+-- $Id: LibStub.lua 48018 2007-09-03 01:50:17Z mikk $
+-- LibStub is a simple versioning stub meant for use in Libraries.
http://www.wowace.com/wiki/LibStub for more info
+-- LibStub is hereby placed in the Public Domain
+-- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
+local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS
AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
+local LibStub = _G[LIBSTUB_MAJOR]
+
+-- Check to see is this version of the stub is obsolete
+if not LibStub or LibStub.minor < LIBSTUB_MINOR then
+ LibStub = LibStub or {libs = {}, minors = {} }
+ _G[LIBSTUB_MAJOR] = LibStub
+ LibStub.minor = LIBSTUB_MINOR
+
+ -- LibStub:NewLibrary(major, minor)
+ -- major (string) - the major version of the library
+ -- minor (string or number ) - the minor version of the library
+ --
+ -- returns nil if a newer or same version of the lib is already present
+ -- returns empty library object or old library object if upgrade is needed
+ function LibStub:NewLibrary(major, minor)
+ assert(type(major) == "string", "Bad argument #2 to `NewLibrary'
(string expected)")
+ minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must
either be a number or contain a number.")
+
+ local oldminor = self.minors[major]
+ if oldminor and oldminor >= minor then return nil end
+ self.minors[major], self.libs[major] = minor, self.libs[major] or {}
+ return self.libs[major], oldminor
+ end
+
+ -- LibStub:GetLibrary(major, [silent])
+ -- major (string) - the major version of the library
+ -- silent (boolean) - if true, library is optional, silently return
nil if its not found
+ --
+ -- throws an error if the library can not be found (except silent is set)
+ -- returns the library object if found
+ function LibStub:GetLibrary(major, silent)
+ if not self.libs[major] and not silent then
+ error(("Cannot find a library instance
of %q."):format(tostring(major)), 2)
+ end
+ return self.libs[major], self.minors[major]
+ end
+
+ -- LibStub:IterateLibraries()
+ --
+ -- Returns an iterator for the currently registered libraries
+ function LibStub:IterateLibraries()
+ return pairs(self.libs)
+ end
+
+ setmetatable(LibStub, { __call = LibStub.GetLibrary })
+end
Added: tags/OptionHouse-r669/OptionHouse/OH_AddOns.lua
==============================================================================
--- (empty file)
+++ tags/OptionHouse-r669/OptionHouse/OH_AddOns.lua Thu Apr 24 22:00:45 2008
@@ -0,0 +1,744 @@
+local frame
+local OptionHouse
+local TOTAL_ROWS = 14
+local CREATED_ROWS = 0
+
+OHManage = {}
+
+local STATUS_COLORS = {
+ ["DISABLED"] = "|cff9d9d9d",
+ ["NOT_DEMAND_LOADED"] = "|cffff8000",
+ ["DEP_NOT_DEMAND_LOADED"] = "|cffff8000",
+ ["LOAD_ON_DEMAND"] = "|cff1eff00",
+ ["DISABLED_AT_RELOAD"] = "|cffa335ee",
+ ["INCOMPATIBLE"] = "|cffff2020",
+}
+
+local L = {
+ ["LOAD"] = "Load",
+ ["RELOAD_UI"] = "Reload UI",
+ ["ENABLE_ALL"] = "Enable All",
+ ["DISABLE_ALL"] = "Disable All",
+ ["AUTHOR"] = "Author: %s",
+ ["VERSION"] = "Version: %s",
+ ["DISABLED_AT_RELOAD"] = "Disabled on UI Reload",
+ ["LOD_LOADED"] = "Is Loadable on Demand but already loaded",
+ ["LOAD_ON_DEMAND"] = "Loadable on Demand",
+ ["ADDON_MANAGEMENT"] = "Management",
+ ["NAME"] = "Name",
+ ["STATUS"] = "Status",
+ ["NOTES"] = "Notes: %s",
+ ["VIEW_ALL"] = "Show all addons",
+ ["VIEW"] = "[View]",
+ ["DEPENDS"] = "Dependencies",
+ ["ENABLE_DEPS"] = "Would you like to enable the %d dependencies for %s?",
+ ["ENABLE_DEP"] = "Would you like to enable the %d dependency for %s?",
+ ["ENABLE_CHILDREN"] = "Would you like to enable the %s children addon for %s?",
+ ["ENABLE_CHILD"] = "Would you like to enable the %s child addon for %s?",
+}
+
+local function sortManagementAddons(a, b)
+ if( not b ) then
+ return false
+ end
+
+ if( frame.sortOrder ) then
+ if( frame.sortType == "name" ) then
+ return ( string.lower(a.title) < string.lower(b.title) )
+ --elseif( frame.sortType == "parent" ) then
+ -- return ( a.parent < b.parent )
+ elseif( frame.sortType == "status" ) then
+ return ( a.reason < b.reason )
+ end
+
+ return ( string.lower(a.title) < string.lower(b.title) )
+
+ else
+ if( frame.sortType == "name" ) then
+ return ( string.lower(a.title) > string.lower(b.title) )
+ --elseif( frame.sortType == "parent" ) then
+ -- return ( a.parent > b.parent )
+ elseif( frame.sortType == "status" ) then
+ return ( a.reason > b.reason )
+ end
+
+ return ( string.lower(a.title) > string.lower(b.title) )
+ end
+end
+
+-- Turns a vararg into a table
+local function createDependencies(...)
+ if( select("#", ...) == 0 ) then
+ return nil
+ end
+
+ local deps = {}
+ for i=1, select("#", ...) do
+ deps[select(i, ...)] = true
+ end
+
+ return deps
+end
+
+-- Searchs the passed dependencies to see if parent is mentioned
+local function isAddonChildOf(parent, ...)
+ if( select("#", ...) == 0 ) then
+ return nil
+ end
+
+ if( type(parent) == "number" ) then
+ parent = string.lower((GetAddOnInfo(parent)))
+ end
+
+ for i=1, select("#", ...) do
+ if( string.lower(select(i, ...)) == parent ) then
+ return true
+ end
+ end
+
+ return nil
+end
+
+local updateManageList;
+local function filterParent(self)
+ if( frame.parentFilter and frame.parentFilter == self.parentAddon ) then
+ frame.parentFilter = nil
+ else
+ frame.parentFilter = self.parentAddon
+ end
+
+ frame.resortList = true
+ updateManageList()
+end
+
+-- Displays everything
+updateManageList = function(skipShown)
+ if( ( not skipShown and not frame:IsShown() ) or not frame.scroll ) then
+ return
+ end
+
+ -- This way we don't have to recreate the entire list on search
+ local searchBy = string.trim(string.lower(frame.search:GetText()))
+ if( searchBy == "" or frame.search.searchText ) then
+ searchBy = nil
+ end
+
+ -- We could reduce all of this into one or two if statements, but
this way is saner
+ -- and far easier for people to debug
+ for id, addon in pairs(frame.addons) do
+ if( searchBy and not string.find(string.lower(addon.title),
searchBy) ) then
+ frame.addons[id].hide = true
+ elseif( not frame.parentFilter ) then
+ frame.addons[id].hide = nil
+ elseif( frame.parentFilter == addon.name or (
frame.dependencies[addon.name] and
frame.dependencies[addon.name][frame.parentFilter] ) ) then
+ frame.addons[id].hide = nil
+ else
+ frame.addons[id].hide = true
+ end
+ end
+
+ if( frame.resortList ) then
+ table.sort(frame.addons, sortManagementAddons)
+ frame.resortList = nil
+ end
+
+ local usedRows = 0
+ local totalAddons = 0
+ for id, addon in pairs(frame.addons) do
+ if( not addon.hide ) then
+ totalAddons = totalAddons + 1
+ if( totalAddons > frame.scroll.offset and usedRows < TOTAL_ROWS ) then
+ usedRows = usedRows + 1
+ local row = frame.rows[usedRows]
+ if( addon.color ) then
+ row.title:SetText(addon.color .. addon.title .. "|r")
+ row.reason:SetText(addon.color .. addon.reason .. "|r")
+ else
+ row.title:SetText(addon.title)
+ row.reason:SetText(addon.reason)
+ end
+
+
+ row.enabled.text = addon.tooltip
+ row.enabled.addon = addon.name
+ row.enabled:SetChecked(addon.isEnabled)
+
+ row.enabled:Show()
+ row.title:Show()
+ row.reason:Show()
+
+ if( frame.dependencies[addon.name] ) then
+ for _, parent in pairs(row.parents) do
+ parent:Hide()
+ end
+
+ local id = 0
+ for dep in pairs(frame.dependencies[addon.name]) do
+ id = id + 1
+
+ local parent
+ if( row.parents[id] ) then
+ parent = row.parents[id]
+ else
+ local path, _, border = GameFontHighlightSmall:GetFont()
+
+ parent = CreateFrame("Button", nil, frame)
+ parent:SetFont(path, OptionHouseDB.manageFontSize, border)
+ parent:SetHeight(18)
+ parent:SetScript("OnClick", filterParent)
+
+ if( id > 1 ) then
+ parent:SetPoint("LEFT", row.parents[id - 1], "TOPRIGHT", 5, -10)
+ else
+ parent:SetPoint("TOPRIGHT", row.parents[id - 1], "TOPRIGHT",
45, 0)
+ end
+ row.parents[id] = parent
+ end
+
+ if( frame.addonStatus[dep] ) then
+ parent:SetText(frame.addonStatus[dep] )
+ else
+ parent:SetText(STATUS_COLORS["INCOMPATIBLE"] .. dep .. "|r" )
+ end
+
+ parent.parentAddon = dep
+ parent:SetWidth(parent:GetFontString():GetStringWidth() + 3)
+ parent:Show()
+ end
+ else
+ for _, parent in pairs(row.parents) do
+ parent:Hide()
+ end
+ end
+
+ -- Shift the reason to the right if no button so we don't have
ugly blank space
+ if( not addon.isLoD ) then
+ row.reason:SetPoint("RIGHT", row.button, "RIGHT", -5, 0)
+ row.button:Hide()
+ else
+ row.reason:SetPoint("RIGHT", row.button, "LEFT", -5, 0)
+ row.button.addon = addon.name
+ row.button:Show()
+ end
+ end
+ end
+ end
+
+ for i=usedRows+1, CREATED_ROWS do
+ frame.rows[i].title:Hide()
+ frame.rows[i].enabled:Hide()
+ frame.rows[i].button:Hide()
+ frame.rows[i].reason:Hide()
+
+ for _, parent in pairs(frame.rows[i].parents) do
+ parent:Hide()
+ end
+ end
+
+ OptionHouse:UpdateScroll(frame.scroll, totalAddons)
+end
+
+local function sortManageClick(self)
+ if( self.sortType ) then
+ if( self.sortType ~= frame.sortType ) then
+ frame.sortOrder = false
+ frame.sortType = self.sortType
+ else
+ frame.sortOrder = not frame.sortOrder
+ end
+
+ frame.resortList = true
+ updateManageList()
+ end
+end
+
+
+local function saveAddonData(id, skipCheck)
+ local name, title, notes, enabled, loadable, reason, security = GetAddOnInfo(id)
+ local isLoaded = IsAddOnLoaded(id)
+ local isLoD = IsAddOnLoadOnDemand(id)
+ local author = GetAddOnMetadata(id, "Author")
+ local version = GetAddOnMetadata(id, "Version")
+ local dataTitle, dataAuthor, dataVersion = OptionHouse:GetAddOnData(name)
+ local color
+
+ if( not frame.dependencies[name] ) then
+ frame.dependencies[name] = createDependencies(GetAddOnDependencies(id))
+ end
+
+ if( title ) then
+ title = string.gsub(title, "%|cff7fff7f %-(.+)%-%|r", "")
+ end
+
+ title = dataTitle or title
+
+ -- Use registered version if avaliable, meta if not
+ if( dataVersion ) then
+ version = dataVersion
+ elseif( type(version) == "string" ) then
+ -- Strip out some of the common strings from version meta data
+ version = string.gsub(version, "%$Revision: (%d+) %$", "%1")
+ version = string.gsub(version, "%$Rev: (%d+) %$", "%1")
+ version = string.gsub(version, "%$LastChangedRevision: (%d+) %$", "%1")
+ version = string.trim(version)
+ else
+ version = nil
+ end
+
+ -- Use registered author if available, meta if not
+ if( dataAuthor ) then
+ author = dataAuthor
+ elseif( type(author) ~= "string" ) then
+ author = nil
+ end
+
+ if( isLoaded or reason == "INCOMPATIBLE" or reason
== "DEP_NOT_DEMAND_LOADED" or reason == "DISABLED" ) then
+ isLoD = nil
+ end
+
+ if( reason ) then
+ color = STATUS_COLORS[reason]
+ reason = TEXT(getglobal("ADDON_" .. reason))
+
+ -- Load on Demand
+ elseif( loadable and isLoD and not isLoaded and enabled ) then
+ reason = L["LOAD_ON_DEMAND"]
+ color = STATUS_COLORS["LOAD_ON_DEMAND"]
+
+ -- Currently loaded, but will be disabled at reload
+ elseif( isLoaded and not enabled ) then
+ reason = L["DISABLED_AT_RELOAD"]
+ color = STATUS_COLORS["DISABLED_AT_RELOAD"]
+
+ -- Addon is LoD, but it was already loaded/enabled so dont show the button
+ elseif( isLoD and isLoaded and enabled ) then
+ reason = L["LOD_LOADED"]
+ end
+
+ local tooltip = "|cffffffff" .. title .. "|r"
+ if( author ) then
+ tooltip = tooltip .. "\n" .. string.format(L["AUTHOR"], author)
+ end
+
+ if( version ) then
+ tooltip = tooltip .. "\n" .. string.format(L["VERSION"], version)
+ end
+
+ if( notes ) then
+ tooltip = tooltip .. "\n" .. string.format(L["NOTES"], notes)
+ end
+
+ if( color ) then
+ frame.addonStatus[name] = color .. title .. "|r"
+ else
+ frame.addonStatus[name] = title
+ end
+
+ local tbl = {name = name, id = id, color = color, title = title,
author = author, version = version, tooltip = tooltip, reason = reason
or "", isEnabled = enabled, isLoD = isLoD}
+ if( not skipCheck ) then
+ for i, addon in pairs(frame.addons) do
+ if( addon.name == name ) then
+ frame.addons[i] = tbl
+ return
+ end
+ end
+ end
+
+ frame.resortList = true
+ table.insert(frame.addons, tbl)
+end
+
+local function createManageList()
+ frame.dependencies = {}
+ frame.addons = {}
+ frame.addonStatus = {}
+
+ for i=1, GetNumAddOns() do
+ saveAddonData(i, true)
+ end
+end
+
+-- ADDDON ENABLING/LOADING
+local function loadAddon(self)
+ LoadAddOn(self.addon)
+
+ saveAddonData(self.addon)
+ updateManageList()
+end
+
+local function enableChildren(self, children)
+ for _, child in pairs(children) do
+ EnableAddOn(child)
+ saveAddonData(child)
+ end
+
+ updateManageList()
+end
+
+local function enableAddon(self, addon, useDeps)
+ EnableAddOn(addon)
+ saveAddonData(addon)
+
+ if( useDeps and frame.dependencies[self.addon] ) then
+ for dep, _ in pairs(frame.dependencies[self.addon]) do
+ if( not select(4, GetAddOnInfo(dep)) ) then
+ EnableAddOn(dep)
+ saveAddonData(dep)
+ end
+ end
+ end
+
+ updateManageList()
+end
+
+-- Toggle addon on
+local function toggleAddOnStatus(self)
+ -- Addons disabled
+ if( select(4, GetAddOnInfo(self.addon)) ) then
+ PlaySound("igMainMenuOptionCheckBoxOff")
+ DisableAddOn(self.addon)
+
+ saveAddonData(self.addon)
+ updateManageList()
+ return
+ end
+
+ PlaySound("igMainMenuOptionCheckBoxOn")
+
+ local addonEnabled
+
+ -- ENABLING THE DEPENDENCIES OF AN ADDON
+ if( OptionHouseDB.dependMode ~= "no" and
frame.dependencies[self.addon] ) then
+ -- Ask before enabling children
+ if( OptionHouseDB.dependMode == "ask" ) then
+ if( not StaticPopupDialogs["ENABLE_ADDON_DEPS"] ) then
+ OHManage.EnableAddon = enableAddon
+
+ StaticPopupDialogs["ENABLE_ADDON_DEPS"] = {
+ button1 = YES,
+ button2 = NO,
+ OnAccept = function(id)
+ OHManage:EnableAddon(id, true)
+ end,
+ OnCancel = function(id)
+ OHManage:EnableAddon(id)
+ end,
+ timeout = 0,
+ whileDead = 1,
+ hideOnEscape = 1,
+ multiple = 1,
+ }
+ end
+
+ local totalDeps = 0
+ for dep, _ in pairs(frame.dependencies[self.addon]) do
+ if( not select(4, GetAddOnInfo(dep)) ) then
+ totalDeps = totalDeps + 1
+ end
+ end
+
+ if( totalDeps > 0 ) then
+ if( totalDeps > 1 ) then
+ StaticPopupDialogs["ENABLE_ADDON_DEPS"].text = L["ENABLE_DEPS"]
+ else
+ StaticPopupDialogs["ENABLE_ADDON_DEPS"].text = L["ENABLE_DEP"]
+ end
+
+
+ -- damn you slouken =(
+ local dialog = StaticPopup_Show("ENABLE_ADDON_DEPS", totalDeps, self.addon)
+ if( dialog ) then
+ dialog.data = self.addon
+ end
+ addonEnabled = true
+ end
+ else
+ enableAddon(self, self.addon, true)
+ addonEnabled = true
+ end
+ end
+
+ -- Don't enable it already through the dep mode
+ if( not addonEnabled ) then
+ enableAddon(self, self.addon)
+ end
+
+ -- ENABLING THE CHILDREN OF AN ADDON
+ -- BigWigs, LightHeaded (damn clad), ect
+ if( OptionHouseDB.childMode ~= "no" ) then
+ -- Find all of the addons with us as a dependency
+ local children = {}
+ for i=1, GetNumAddOns() do
+ if( not select(4, GetAddOnInfo(i) ) and isAddonChildOf(self.addon,
GetAddOnDependencies(i)) ) then
+ table.insert(children, i)
+ end
+ end
+
+ if( #(children) > 0 ) then
+ -- Ask for enabling
+ if( OptionHouseDB.childMode == "ask" ) then
+ if( not StaticPopupDialogs["ENABLE_ADDON_CHILDREN"] ) then
+ OHManage.EnableChildren = enableChildren
+
+ StaticPopupDialogs["ENABLE_ADDON_CHILDREN"] = {
+ button1 = YES,
+ button2 = NO,
+ OnAccept = function(children)
+ OHManage:EnableChildren(children)
+ end,
+ timeout = 0,
+ whileDead = 1,
+ hideOnEscape = 1,
+ multiple = 1,
+ }
+ end
+
+ if( #(children) > 0 ) then
+ if( #(children) > 1 ) then
+ StaticPopupDialogs["ENABLE_ADDON_CHILDREN"].text = L["ENABLE_CHILDREN"]
+ else
+ StaticPopupDialogs["ENABLE_ADDON_CHILDREN"].text = L["ENABLE_CHILD"]
+ end
+
+
+ -- damn you slouken =(
+ local dialog = StaticPopup_Show("ENABLE_ADDON_CHILDREN",
#(children), self.addon)
+ if( dialog ) then
+ dialog.data = children
+ end
+ end
+
+ -- Always enable children
+ elseif( OptionHouseDB.childMode == "yes" ) then
+ enableChildren(self, children)
+ end
+ end
+ end
+end
+
+local function showTooltip(self)
+ if( self.text ) then
+ GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
+ GameTooltip:SetText(self.text, nil, nil, nil, nil, 1)
+ end
+end
+
+local function hideTooltip()
+ GameTooltip:Hide()
+end
+
+local function createRows()
+ local path, size, border = GameFontHighlightSmall:GetFont()
+ size = OptionHouseDB.manageFontSize
+
+ -- We need a fake FS so we can calculate total height
+ if( not frame.testFS ) then
+ frame.testFS = frame:CreateFontString()
+ end
+
+ frame.testFS:SetFont(path, size, border)
+ frame.testFS:SetText("*")
+
+ local spacing = -12 - frame.testFS:GetHeight()
+
+ TOTAL_ROWS = ceil(305 / abs(spacing))
+
+ if( not frame.rows ) then
+ frame.rows = {}
+ end
+
+ for i=1, TOTAL_ROWS do
+ local row
+ if( not frame.rows[i] ) then
+ CREATED_ROWS = CREATED_ROWS + 1
+
+ row = { parents = {} }
+ frame.rows[i] = row
+
+ row.enabled = CreateFrame("CheckButton", nil, frame, "OptionsCheckButtonTemplate")
+ row.reason = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
+ row.title = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
+ row.button = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate")
+ row.parents[1] = CreateFrame("Button", nil, frame)
+ else
+ row = frame.rows[i]
+ end
+
+ -- Enable checkbox
+ row.enabled:SetWidth(22)
+ row.enabled:SetHeight(22)
+ row.enabled:SetScript("OnClick", toggleAddOnStatus)
+ row.enabled:SetScript("OnEnter", showTooltip)
+ row.enabled:SetScript("OnLeave", hideTooltip)
+
+ -- Load a LoD addon
+ row.button:SetWidth(50)
+ row.button:SetHeight(18)
+ row.button:SetText(L["LOAD"])
+ row.button:SetScript("OnClick", loadAddon)
+
+ -- Reason (Disabled/Not LoD/LoD/Dependency Missing/ect)
+ row.reason:SetFont(path, size, border)
+
+ -- Addon parent (LightHeaded, BigWigs, and so on)
+ row.parents[1]:SetFont(path, size, border)
+ row.parents[1]:SetHeight(18)
+ row.parents[1]:SetScript("OnClick", filterParent)
+
+ -- Addon title
+ row.title:SetFont(path, size, border)
+ row.title:SetHeight(22)
+ row.title:SetJustifyH("LEFT")
+ row.title:SetNonSpaceWrap(false)
+
+ if( i > 1 ) then
+ row.enabled:SetPoint("TOPLEFT", frame.rows[i-1].enabled, "TOPLEFT",
0, spacing)
+ row.button:SetPoint("TOPRIGHT", frame.rows[i-1].button, "TOPRIGHT",
0, spacing)
+ row.title:SetPoint("TOPLEFT", frame.rows[i-1].title, "TOPLEFT", 0, spacing)
+ row.parents[1]:SetPoint("TOPLEFT", frame.sortButtons[2], "TOPLEFT",
0, spacing * i)
+ else
+ row.enabled:SetPoint("TOPLEFT", frame.sortButtons[1], "TOPLEFT", 0, -22)
+ row.parents[1]:SetPoint("TOPLEFT", frame.sortButtons[2], "TOPLEFT",
0, -22)
+ row.button:SetPoint("TOPRIGHT", frame.sortButtons[3], "TOPRIGHT",
4, -22)
+ row.title:SetPoint("LEFT", row.enabled, "RIGHT", 5, 0)
+ end
+ end
+end
+
+local function createManageFrame(hide)
+ frame = OptionHouse:GetFrame("manage")
+
+ if( frame and hide ) then
+ frame:Hide()
+ return
+ elseif( hide ) then
+ return
+ elseif( not frame ) then
+ frame = CreateFrame("Frame", nil, OptionHouse:GetFrame("main"))
+ frame.sortOrder = true
+ frame.sortType = "name"
+ frame.sortButtons = {}
+ frame:SetFrameStrata("DIALOG")
+ frame:SetAllPoints(OptionHouse:GetFrame("main"))
+ frame:RegisterEvent("ADDON_LOADED")
+ frame:SetScript("OnEvent", function(self, event, name)
+ if( frame.addons ) then
+ saveAddonData(name)
+ updateManageList()
+ end
+ end)
+
+
+ OptionHouse:CreateSearchInput(frame, updateManageList)
+
+ local disableAll = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate")
+ disableAll:SetWidth(80)
+ disableAll:SetHeight(22)
+ disableAll:SetPoint("BOTTOMRIGHT",
OptionHouse:GetFrame("main"), "BOTTOMRIGHT", -8, 14)
+ disableAll:SetText(L["DISABLE_ALL"])
+ disableAll:SetScript("OnClick", function()
+ DisableAllAddOns()
+ EnableAddOn("OptionHouse")
+
+ createManageList()
+ updateManageList()
+ end)
+
+ local enableAll = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate")
+ enableAll:SetWidth(80)
+ enableAll:SetHeight(22)
+ enableAll:SetPoint("RIGHT", disableAll, "LEFT")
+ enableAll:SetText(L["ENABLE_ALL"])
+ enableAll:SetScript("OnClick", function()
+ EnableAllAddOns()
+
+ createManageList()
+ updateManageList()
+ end)
+
+ local reloadUI = CreateFrame("Button", nil, frame, "UIPanelButtonGrayTemplate")
+ reloadUI:SetWidth(80)
+ reloadUI:SetHeight(22)
+ reloadUI:SetPoint("RIGHT", enableAll, "LEFT")
+ reloadUI:SetText(L["RELOAD_UI"])
+ reloadUI:SetScript("OnClick", ReloadUI)
+
+ local button = CreateFrame("Button", nil, frame)
+ button:SetScript("OnClick", sortManageClick)
+ button:SetHeight(20)
+ button:SetWidth(75)
+ button:SetTextFontObject(GameFontNormal)
+ button.sortType = "name"
+ button:SetText(L["NAME"])
+ button:SetWidth(button:GetFontString():GetStringWidth() + 3)
+ button:SetPoint("TOPLEFT", frame, "TOPLEFT", 25, -73)
+ button:Show()
+
+ frame.sortButtons[1] = button
+
+ button = CreateFrame("Button", nil, frame)
+ --button:SetScript("OnClick", sortManageClick)
+ button:SetHeight(20)
+ button:SetWidth(75)
+ button:SetTextFontObject(GameFontNormal)
+ button.sortType = "parent"
+ button:SetText(L["DEPENDS"])
+ button:SetWidth(button:GetFontString():GetStringWidth() + 3)
+ button:SetPoint("TOPLEFT", frame, "TOPLEFT", 260, -73)
+ button:Show()
+
+ frame.sortButtons[2] = button
+
+ button = CreateFrame("Button", nil, frame)
+ button:SetScript("OnClick", sortManageClick)
+ button:SetHeight(20)
+ button:SetWidth(75)
+ button:SetTextFontObject(GameFontNormal)
+ button.sortType = "status"
+ button:SetText(L["STATUS"])
+ button:SetWidth(button:GetFontString():GetStringWidth() + 3)
+ button:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -50, -73)
+ button:Show()
+
+ frame.sortButtons[3] = button
+
+ -- Create all of the rows for display
+ createRows()
+
+ OptionHouse:CreateScrollFrame(frame, TOTAL_ROWS, updateManageList)
+ OptionHouse:RegisterFrame("manage", frame)
+
+ frame.scroll:SetPoint("TOPLEFT", frame, "TOPLEFT", 25, -76)
+ frame.scroll:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -35, 72)
+ end
+
+ createManageList()
+ updateManageList(true)
+
+ frame:Show()
+end
+
+function OHManage:Register()
+ if( not OptionHouse ) then
+ OptionHouse = LibStub:GetLibrary("OptionHouse-1.1")
+ end
+
+ OptionHouse:RegisterTab(L["ADDON_MANAGEMENT"], createManageFrame, "bid")
+end
+
+function OHManage:Reload()
+ if( frame ) then
+ createRows()
+
+ frame.scroll.displayNum = TOTAL_ROWS
+ frame.scroll.bar:SetValueStep(TOTAL_ROWS)
+
+ updateManageList()
+ end
+end
+
+function OHManage:Unregister()
+ if( OptionHouse ) then
+ OptionHouse:UnregisterTab(L["ADDON_MANAGEMENT"])
+ end
+end
Added: tags/OptionHouse-r669/OptionHouse/OH_Configuration.lua
==============================================================================
--- (empty file)
+++ tags/OptionHouse-r669/OptionHouse/OH_Configuration.lua Thu Apr 24
22:00:45 2008
@@ -0,0 +1,221 @@
+local OHConfig = {}
+local OptionHouse
+local L = {
+ ["ENABLE_PERFORMANCE"] = "Enable performance tab",
+ ["ENABLE_MANAGEMENT"] = "Enable master control panel tab",
+ ["PERFORMANCE_SIZE"] = "Performance font size",
+ ["MANAGEMENT_SIZE"] = "Management font size",
+ ["ASK_ALWAYS"] = "Ask every time",
+ ["NO_ALWAYS"] = "Never enable",
+ ["YES_ALWAYS"] = "Always enable",
+ ["DEP_ENABLE"] = "Dependency enabling from the management panel",
+ ["CHILDREN_ENABLE"] = "Enable children addons from management panel",
+ ["GENERAL"] = "General",
+ ["LOCK"] = "Lock OptionHouse frame",
+ ["HIDE_COMBAT"] = "Hide OptionHouse when entering combat",
+}
+
+function OHConfig:Enable()
+ OptionHouse = LibStub:GetLibrary("OptionHouse-1.1")
+ local OHObj = OptionHouse:RegisterAddOn("OptionHouse", nil,
nil, "r" .. (tonumber(string.match("$Revision: 669 $", "(%d+)")) or 1))
+
+ OHObj:RegisterCategory(L["GENERAL"], self, "CreateUI")
+
+ if( not OptionHouseDB ) then
+ OptionHouseDB = {}
+ end
+
+ self.defaults = {
+ enablePerf = true,
+ enableManage = true,
+ dependMode = "yes",
+ childMode = "ask",
+ perfFontSize = 10,
+ manageFontSize = 10,
+ locked = true,
+ combatHide = false,
+ }
+
+ self.db = setmetatable(OptionHouseDB, {
+ __index = function(t, k)
+ return self.defaults[k]
+ end
+ })
+
+ if( self.db.enableManage ) then
+ OHManage:Register()
+ end
+
+ if( self.db.enablePerf ) then
+ OHPerformance:Register()
+ --OHPerfGraph:Register()
+ end
+end
+
+function OHConfig:CreateUI()
+ local frame = CreateFrame("Frame", nil, OptionHouse:GetFrame("addon"))
+ frame:SetScript("OnShow", function()
+ OHConfig.lockOH:SetChecked(OHConfig.db.locked)
+ OHConfig.perfCheck:SetChecked(OHConfig.db.enablePerf)
+ OHConfig.manageCheck:SetChecked(OHConfig.db.enableManage)
+ OHConfig.perfSize:SetText(OHConfig.db.perfFontSize)
+ OHConfig.manageSize:SetText(OHConfig.db.manageFontSize)
+ end )
+ frame:Hide()
+
+ -- FRAME LOCK
+ self.lockOH = CreateFrame("CheckButton", "OHConfigUILock", frame, "OptionsCheckButtonTemplate")
+ self.lockOH:SetWidth(32)
+ self.lockOH:SetHeight(32)
+ self.lockOH:SetPoint("TOPLEFT", 5, -5)
+ OHConfigUILockText:SetText(L["LOCK"])
+ self.lockOH:SetScript("OnClick", function(self)
+ if( self:GetChecked() ) then
+ OHConfig.db.locked = true
+ else
+ OHConfig.db.locked = false
+ end
+
+ local frame = OptionHouse:GetFrame("main")
+ if( frame ) then
+ frame:SetMovable(not OHConfig.db.locked)
+ end
+ end )
+
+ -- COMBAT HIDING
+ self.hideOH = CreateFrame("CheckButton", "OHConfigUIHide", frame, "OptionsCheckButtonTemplate")
+ self.hideOH:SetWidth(32)
+ self.hideOH:SetHeight(32)
+ self.hideOH:SetPoint("TOPLEFT", 5, -35)
+ OHConfigUIHideText:SetText(L["HIDE_COMBAT"])
+ self.hideOH:SetScript("OnClick", function(self)
+ if( self:GetChecked() ) then
+ OHConfig.db.combatHide = true
+ else
+ OHConfig.db.combatHide = false
+ end
+ end )
+
+
+ -- ENABLE PERFORMANCE TAB
+ self.perfCheck = CreateFrame("CheckButton", "OHConfigUIPerformance", frame, "OptionsCheckButtonTemplate")
+ self.perfCheck:SetWidth(32)
+ self.perfCheck:SetHeight(32)
+ self.perfCheck:SetPoint("TOPLEFT", 5, -65)
+ OHConfigUIPerformanceText:SetText(L["ENABLE_PERFORMANCE"])
+ self.perfCheck:SetScript("OnClick", function(self)
+ if( self:GetChecked() ) then
+ OHConfig.db.enablePerf = true
+ OHPerformance:Register()
+ OHPerfGraph:Register()
+ else
+ OHConfig.db.enablePerf = false
+ OHPerformance:Unregister()
+ OHPerfGraph:Unregister()
+ end
+ end )
+
+ -- FONT SIZE FOR PERFORMANCE
+ self.perfSize = CreateFrame("EditBox", "OHConfigUIPerfSize", frame, "InputBoxTemplate")
+ self.perfSize:SetAutoFocus(false)
+ self.perfSize:SetHeight(20)
+ self.perfSize:SetWidth(75)
+ self.perfSize:SetNumeric(true)
+ self.perfSize:SetPoint("TOPLEFT", 15, -96)
+ self.perfSize:SetScript("OnTextChanged", function(self)
+ OHConfig.db.perfFontSize = self:GetNumber()
+ OHPerformance:Reload()
+ end)
+
+ local text = frame:CreateFontString("OHConfigUIPerfSizeText", self.perfSize, "GameFontNormalSmall")
+ text:SetPoint("LEFT", self.perfSize, "RIGHT", 5, 0)
+ text:SetText(L["PERFORMANCE_SIZE"])
+
+ -- ENABLE MANAGEMENT TAB
+ self.manageCheck = CreateFrame("CheckButton", "OHConfigUIManage", frame, "OptionsCheckButtonTemplate")
+ self.manageCheck:SetWidth(32)
+ self.manageCheck:SetHeight(32)
+ self.manageCheck:SetPoint("TOPLEFT", 5, -125)
+ OHConfigUIManageText:SetText( L["ENABLE_MANAGEMENT"])
+ self.manageCheck:SetScript("OnClick", function(self)
+ if( self:GetChecked() ) then
+ OHConfig.db.enableManage = true
+ OHManage:Register()
+ else
+ OHConfig.db.enableManage = false
+ OHManage:Unregister()
+ end
+ end)
+
+ -- FONT SIZE FOR MANAGEMENT
+ self.manageSize = CreateFrame("EditBox", "OHConfigUIManageSize", frame, "InputBoxTemplate")
+ self.manageSize:SetAutoFocus(false)
+ self.manageSize:SetHeight(20)
+ self.manageSize:SetWidth(75)
+ self.manageSize:SetNumeric(true)
+ self.manageSize:SetPoint("TOPLEFT", 15, -155)
+ self.manageSize:SetScript("OnTextChanged", function(self)
+ OHConfig.db.manageFontSize = self:GetNumber()
+ OHManage:Reload()
+ end)
+
+ local text = frame:CreateFontString("OHConfigUIManageSizeText", self.manageSize, "GameFontNormalSmall")
+ text:SetPoint("LEFT", self.manageSize, "RIGHT", 5, 0)
+ text:SetText(L["MANAGEMENT_SIZE"])
+
+ -- DROPDOWN FOR DEPENDENCY
+ self.dependMode = CreateFrame("Frame", "OHConfigUIDepMode", frame, "UIDropDownMenuTemplate")
+ self.dependMode:SetPoint("TOPLEFT", -10, -190)
+ self.dependMode:SetScript("OnShow", function(self)
+ UIDropDownMenu_Initialize(self, OHConfig.InitDepDropdown)
+ UIDropDownMenu_SetSelectedValue(OHConfigUIDepMode, OHConfig.db.dependMode)
+ end)
+
+ local text =
self.dependMode:CreateFontString("OHConfigUIDepModeText", frame, "GameFontNormalSmall")
+ text:SetPoint("LEFT", self.dependMode, "RIGHT", 120, 3)
+ text:SetText(L["DEP_ENABLE"])
+
+ -- DROPDOWN FOR CHILDREN
+ self.childMode = CreateFrame("Frame", "OHConfigUIChildMode", frame, "UIDropDownMenuTemplate")
+ self.childMode:SetPoint("TOPLEFT", -10, -220)
+ self.childMode:SetScript("OnShow", function(self)
+ UIDropDownMenu_Initialize(self, OHConfig.InitChildDropdown)
+ UIDropDownMenu_SetSelectedValue(OHConfigUIChildMode, OHConfig.db.childMode)
+ end)
+
+ local text =
self.childMode:CreateFontString("OHConfigUIChildModeText", frame, "GameFontNormalSmall")
+ text:SetPoint("LEFT", self.childMode, "RIGHT", 120, 3)
+ text:SetText(L["CHILDREN_ENABLE"])
+
+ return frame
+end
+
+function OHConfig:InitDepDropdown()
+ UIDropDownMenu_AddButton({ value = "ask", text = L["ASK_ALWAYS"],
arg1 = "dep", func = OHConfig.DropdownClicked })
+ UIDropDownMenu_AddButton({ value = "yes", text = L["YES_ALWAYS"],
arg1 = "dep", func = OHConfig.DropdownClicked })
+ UIDropDownMenu_AddButton({ value = "no", text = L["NO_ALWAYS"], arg1
= "dep", func = OHConfig.DropdownClicked })
+end
+
+function OHConfig:InitChildDropdown()
+ UIDropDownMenu_AddButton({ value = "ask", text = L["ASK_ALWAYS"],
arg1 = "child", func = OHConfig.DropdownClicked })
+ UIDropDownMenu_AddButton({ value = "yes", text = L["YES_ALWAYS"],
arg1 = "child", func = OHConfig.DropdownClicked })
+ UIDropDownMenu_AddButton({ value = "no", text = L["NO_ALWAYS"], arg1
= "child", func = OHConfig.DropdownClicked })
+end
+
+function OHConfig:DropdownClicked()
+ if( this.arg1 == "dep" ) then
+ UIDropDownMenu_SetSelectedValue(OHConfigUIDepMode, this.value)
+ OHConfig.db.dependMode = this.value
+ elseif( this.arg1 == "child" ) then
+ UIDropDownMenu_SetSelectedValue(OHConfigUIChildMode, this.value)
+ OHConfig.db.childMode = this.value
+ end
+end
+
+local frame = CreateFrame("Frame")
+frame:RegisterEvent("ADDON_LOADED")
+frame:SetScript("OnEvent", function(self, event, addon)
+ if( event == "ADDON_LOADED" and addon == "OptionHouse" ) then
+ OHConfig.Enable(OHConfig)
+ end
+end)
Added: tags/OptionHouse-r669/OptionHouse/OH_PerfMon.lua
==============================================================================
--- (empty file)
+++ tags/OptionHouse-r669/OptionHouse/OH_PerfMon.lua Thu Apr 24
22:00:45 2008
@@ -0,0 +1,434 @@
+local frame
+local scriptProfiling
+local OptionHouse
+local TOTAL_ROWS = 15
+local CREATED_ROWS = 0
+
+local L = {
+ ["MEMORY"] = "Memory",
+ ["MEMSEC"] = "Mem/Sec",
+ ["CPU"] = "CPU",
+ ["CPUSEC"] = "CPU/Sec",
+ ["ENABLE_CPU"] = "Enable CPU",
+ ["DISABLE_CPU"] = "Disable CPU",
+ ["RELOAD_UI"] = "Reload UI",
+ ["ADDON_PERFORMANCE"] = "Performance",
+ ["NAME"] = "Name",
+}
+
+local function sortPerformanceList(a, b)
+ if( not b ) then
+ return false
+ end
+
+ if( frame.sortOrder ) then
+ if( frame.sortType == "name" ) then
+ return ( string.lower(a.title) < string.lower(b.title) )
+ elseif( frame.sortType == "memory" ) then
+ return ( a.memory < b.memory )
+ elseif( frame.sortType == "cpu" ) then
+ return ( a.cpu < b.cpu )
+ elseif( frame.sortType == "mir" ) then
+ -- If mir is 0 for both, sort by name
+ -- this prevents everything from moving around randomly
+ -- and generally just looking ugly
+ if( a.mir == 0 and b.mir == 0 ) then
+ return ( string.lower(a.title) < string.lower(b.title) )
+ end
+
+ return ( a.mir < b.mir )
+
+ elseif( frame.sortType == "cir" ) then
+ if( a.cir == 0 and b.cir == 0 ) then
+ return ( string.lower(a.title) < string.lower(b.title) )
+ end
+
+ return ( a.cir < b.cir )
+ end
+
+ return ( a.memory < b.memory )
+
+ else
+ if( frame.sortType == "name" ) then
+ return ( string.lower(a.title) > string.lower(b.title) )
+ elseif( frame.sortType == "memory" ) then
+ return ( a.memory > b.memory )
+ elseif( frame.sortType == "cpu" ) then
+ return ( a.cpu > b.cpu )
+ elseif( frame.sortType == "mir" ) then
+ if( a.mir == 0 and b.mir == 0 ) then
+ return ( string.lower(a.title) > string.lower(b.title) )
+ end
+
+ return ( a.mir > b.mir )
+
+ elseif( frame.sortType == "cir" ) then
+ if( a.cir == 0 and b.cir == 0 ) then
+ return ( string.lower(a.title) > string.lower(b.title) )
+ end
+
+ return ( a.cir > b.cir )
+ end
+
+ return ( a.memory > b.memory )
+ end
+end
+
+local function updateAddonPerformance()
+ UpdateAddOnMemoryUsage()
+ UpdateAddOnCPUUsage()
+
+ local totalMemory = 0
+ local totalCPU = 0
+ local totalMIR = 0
+ local totalCIR = 0
+
+ for id, addon in pairs(frame.addons) do
+ memory = GetAddOnMemoryUsage(addon.name)
+ cpu = GetAddOnCPUUsage(addon.name)
+
+ frame.addons[id].mir = memory - addon.memory
+ frame.addons[id].cir = cpu - addon.cpu
+ frame.addons[id].memory = memory
+ frame.addons[id].cpu = cpu
+
+ totalMemory = totalMemory + memory
+ totalCPU = totalCPU + cpu
+ totalMIR = totalMIR + frame.addons[id].mir
+ totalCIR = totalCIR + frame.addons[id].cir
+ end
+
+ for id, addon in pairs(frame.addons) do
+ frame.addons[id].cpuPerct = frame.addons[id].cpu / totalCPU * 100
+ frame.addons[id].memPerct = frame.addons[id].memory / totalMemory * 100
+ end
+
+ frame.totalMemory = totalMemory
+ frame.totalCPU = totalCPU
+ frame.totalMIR = totalMIR
+ frame.totalCIR = totalCIR
+end
+
+local function updatePerformanceList(skipShown)
+ if( not skipShown and not frame:IsShown() ) then
+ return
+ end
+
+ if( frame.totalMemory > 1024 ) then
+ frame.sortButtons[2]:SetFormattedText("%s (%.1f %s)", L["MEMORY"],
frame.totalMemory / 1024, "MiB")
+ else
+ frame.sortButtons[2]:SetFormattedText("%s (%.1f %s)", L["MEMORY"], frame.totalMemory, "KiB")
+ end
+
+ if( frame.totalMIR > 1024 ) then
+ frame.sortButtons[3]:SetFormattedText("%s (%.2f %s)", L["MEMSEC"],
frame.totalMIR / 1024, "MiB/s")
+ else
+ frame.sortButtons[3]:SetFormattedText("%s (%.2f %s)", L["MEMSEC"], frame.totalMIR, "KiB/s")
+ end
+
+ if( scriptProfiling ) then
+ frame.sortButtons[4]:SetFormattedText("%s (%.2f)", L["CPU"], frame.totalCPU)
+
frame.sortButtons[4]:SetWidth(frame.sortButtons[4]:GetFontString():GetStringWidth()
+ 3)
+
+ frame.sortButtons[5]:SetFormattedText("%s (%.2f)", L["CPUSEC"], frame.totalCIR)
+
frame.sortButtons[5]:SetWidth(frame.sortButtons[5]:GetFontString():GetStringWidth()
+ 3)
+ end
+
+
frame.sortButtons[2]:SetWidth(frame.sortButtons[2]:GetFontString():GetStringWidth()
+ 3)
+
frame.sortButtons[3]:SetWidth(frame.sortButtons[3]:GetFontString():GetStringWidth()
+ 3)
+
+ table.sort(frame.addons, sortPerformanceList)
+ OptionHouse:UpdateScroll(frame.scroll, #(frame.addons))
+
+ for i=1, TOTAL_ROWS do
+ local addon = frame.addons[frame.scroll.offset + i]
+ local row = frame.rows[i]
+
+ if( addon ) then
+ row[1]:SetText(addon.title)
+
+ if( addon.memory > 1024 ) then
+ row[2]:SetFormattedText("%.3f MiB (%.2f%%)", addon.memory / 1024, addon.memPerct)
+ else
+ row[2]:SetFormattedText("%.3f KiB (%.2f%%)", addon.memory, addon.memPerct)
+ end
+
+ if( addon.mir > 1024 ) then
+ row[3]:SetFormattedText("%.3f MiB/s", addon.mir / 1024)
+ else
+ row[3]:SetFormattedText("%.3f KiB/s", addon.mir)
+ end
+
+ if( scriptProfiling ) then
+ row[4]:SetFormattedText("%.3f (%.2f%%)", addon.cpu, addon.cpuPerct)
+ row[5]:SetFormattedText("%.3f", addon.cir)
+ else
+ row[4]:SetText("----")
+ row[5]:SetText("----")
+ end
+
+ row[1]:Show()
+ row[2]:Show()
+ row[3]:Show()
+ row[4]:Show()
+ row[5]:Show()
+ else
+ row[1]:Hide()
+ row[2]:Hide()
+ row[3]:Hide()
+ row[4]:Hide()
+ row[5]:Hide()
+ end
+ end
+end
+
+local elapsed = 0
+local function performanceOnUpdate(self, time)
+ elapsed = elapsed + time
+
+ if( elapsed >= 0.5 ) then
+ elapsed = 0
+
+ updateAddonPerformance()
+ updatePerformanceList()
+ end
+end
+
+local function sortPerfClick(self)
+ if( self.sortType ) then
+ if( self.sortType ~= frame.sortType ) then
+ frame.sortOrder = false
+ frame.sortType = self.sortType
+ else
+ frame.sortOrder = not frame.sortOrder
+ end
+
+ updatePerformanceList()
+ end
+end
+
+-- Create a list now so we aren't creating a new table/list every OnUpdate
+local function updateAddonPerfList()
+ UpdateAddOnMemoryUsage()
+ UpdateAddOnCPUUsage()
+
+ local searchBy = string.trim(string.lower(frame.search:GetText()))
+ if( searchBy == "" or frame.search.searchText ) then
+ searchBy = nil
+ end
+
+ frame.addons = {}
+ for i=1, GetNumAddOns() do
+ local name, title = GetAddOnInfo(i)
+ if( IsAddOnLoaded(i) and ((searchBy and
string.find(string.lower(name), searchBy)) or not searchBy ) ) then
+ table.insert(frame.addons, {name = name, title =
string.gsub(title, "%|cff7fff7f %-(.+)%-%|r", ""), mir = 0, cir = 0,
cpu = GetAddOnCPUUsage(i), memory = GetAddOnMemoryUsage(i)})
+ end
+ end
+end
+
+
+local function createRows()
+ local path, size, border = GameFontNormalSmall:GetFont()
+ size = OptionHouseDB.perfFontSize
+
+ if( not frame.testFS ) then
+ frame.testFS = frame:CreateFontString()
+ end
+
+ frame.testFS:SetFont(path, size, border)
+ frame.testFS:SetText("*")
+
+ local spacing = -10 - frame.testFS:GetHeight()
+ TOTAL_ROWS = floor(305 / abs(spacing))
+
+ if( not frame.rows ) then
+ frame.rows = {}
+ end
+
+ for i=1, TOTAL_ROWS do
+ if( not frame.rows[i] ) then
+ frame.rows[i] = {}
+ CREATED_ROWS = CREATED_ROWS + 1
+ end
+
+ for j=1, 5 do
+ if( not frame.rows[i][j] ) then
+ text = frame:CreateFontString(nil, frame)
+ else
+ text = frame.rows[i][j]
+ end
+
+ text:SetFont(path, size, border)
+ text:SetTextColor(1, 1, 1)
+ text:Hide()
+ frame.rows[i][j] = text
+
+ if( i > 1 ) then
+ text:SetPoint("TOPLEFT", frame.rows[i-1][j], "TOPLEFT", 0, spacing)
+ else
+ text:SetPoint("TOPLEFT", frame.sortButtons[j], "TOPLEFT", 2, -28)
+ end
+ end
+ end
+end
+
+local function createPerfFrame(hide)
+ frame = OptionHouse:GetFrame("perf")
+
+ if( frame and hide ) then
+ frame:Hide()
+ return
+ elseif( hide ) then
+ return
+ elseif( not frame ) then
+ frame = CreateFrame("Frame", nil, OptionHouse:GetFrame("main"))
+ frame:SetFrameStrata("DIALOG")
+ frame:SetAllPoints(OptionHouse:GetFrame("main"))
+ frame.sortOrder = nil
+ frame.sortType = "name"
+ frame.sortButtons = {}
+
+ local toggleCPU = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate")
+ toggleCPU:SetWidth(80)
+ toggleCPU:SetHeight(22)
+ toggleCPU:SetPoint("BOTTOMRIGHT",
OptionHouse:GetFrame("main"), "BOTTOMRIGHT", -8, 14)
+ toggleCPU:SetScript("OnClick", function(self)
+ if( GetCVar("scriptProfile") == "1" ) then
+ self:SetText(L["ENABLE_CPU"])
+ SetCVar("scriptProfile", "0", 1)
+ else
+ self:SetText(L["DISABLE_CPU"])
+ SetCVar("scriptProfile", "1", 1)
+ end
+ end)
+
+ -- UI Reload required for CPU profiling to be usable, so check on load
+ if( GetCVar("scriptProfile") == "1" ) then
+ scriptProfiling = true
+ toggleCPU:SetText(L["DISABLE_CPU"])
+ else
+ toggleCPU:SetText(L["ENABLE_CPU"])
+ end
+
+ local reloadUI = CreateFrame("Button", nil, frame, "UIPanelButtonGrayTemplate")
+ reloadUI:SetWidth(80)
+ reloadUI:SetHeight(22)
+ reloadUI:SetPoint("RIGHT", toggleCPU, "LEFT")
+ reloadUI:SetText(L["RELOAD_UI"])
+ reloadUI:SetScript("OnClick", ReloadUI)
+
+ local button = CreateFrame("Button", nil, frame)
+ button.sortType = "name"
+ button:SetScript("OnClick", sortPerfClick)
+ button:SetTextFontObject(GameFontNormal)
+ button:SetText(L["NAME"])
+ button:SetHeight(18)
+ button:SetWidth(button:GetFontString():GetStringWidth() + 3)
+ button:SetPoint("TOPLEFT", frame, "TOPLEFT", 25, -75)
+ button:Show()
+
+ frame.sortButtons[1] = button
+
+ local button = CreateFrame("Button", nil, frame)
+ button.sortType = "memory"
+ button:SetScript("OnClick", sortPerfClick)
+ button:SetTextFontObject(GameFontNormal)
+ button:SetText(L["MEMORY"])
+ button:SetHeight(18)
+ button:SetWidth(button:GetFontString():GetStringWidth() + 3)
+ button:SetPoint("TOPLEFT", frame.sortButtons[1], "TOPLEFT", 180, 0)
+ button:Show()
+
+ frame.sortButtons[2] = button
+
+ local button = CreateFrame("Button", nil, frame)
+ button.sortType = "mir"
+ button:SetScript("OnClick", sortPerfClick)
+ button:SetTextFontObject(GameFontNormal)
+ button:SetText(L["MEMSEC"])
+ button:SetHeight(18)
+ button:SetWidth(button:GetFontString():GetStringWidth() + 3)
+ button:SetPoint("TOPLEFT", frame.sortButtons[2], "TOPLEFT", 180, 0)
+ button:Show()
+
+ frame.sortButtons[3] = button
+
+ local button = CreateFrame("Button", nil, frame)
+ button.sortType = "cpu"
+ button:SetScript("OnClick", sortPerfClick)
+ button:SetTextFontObject(GameFontNormal)
+ button:SetText(L["CPU"])
+ button:SetHeight(18)
+ button:SetWidth(button:GetFontString():GetStringWidth() + 3)
+ button:SetPoint("TOPLEFT", frame.sortButtons[3], "TOPLEFT", 170, 0)
+ button:Show()
+
+ frame.sortButtons[4] = button
+
+ local button = CreateFrame("Button", nil, frame)
+ button.sortType = "cir"
+ button:SetScript("OnClick", sortPerfClick)
+ button:SetTextFontObject(GameFontNormal)
+ button:SetText(L["CPUSEC"])
+ button:SetHeight(18)
+ button:SetWidth(button:GetFontString():GetStringWidth() + 3)
+ button:SetPoint("TOPLEFT", frame.sortButtons[4], "TOPLEFT", 130, 0)
+ button:Show()
+
+ frame.sortButtons[5] = button
+
+ -- Create all of the rows for display
+ createRows()
+
+ OptionHouse:CreateScrollFrame(frame, TOTAL_ROWS, updatePerformanceList)
+
+ frame.scroll:SetPoint("TOPLEFT", frame, "TOPLEFT", 25, -76)
+ frame.scroll:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -35, 72)
+
+ frame:SetScript("OnUpdate", performanceOnUpdate)
+ frame:SetScript("OnEvent", updatePerformanceList)
+ frame:RegisterEvent("ADDON_LOADED")
+
+ OptionHouse:CreateSearchInput(frame, function()
+ updateAddonPerfList()
+ updateAddonPerformance()
+ updatePerformanceList()
+ end)
+
+ OptionHouse:RegisterFrame("perf", frame)
+ end
+
+ updateAddonPerfList()
+ updateAddonPerformance()
+ updatePerformanceList(true)
+
+ frame:Show()
+end
+
+-- For configuraiton
+OHPerformance = {}
+
+function OHPerformance:Register()
+ if( not OptionHouse ) then
+ OptionHouse = LibStub:GetLibrary("OptionHouse-1.1")
+ end
+
+ OptionHouse:RegisterTab(L["ADDON_PERFORMANCE"], createPerfFrame, "bid")
+end
+
+function OHPerformance:Reload()
+ if( frame ) then
+ createRows()
+
+ frame.scroll.displayNum = TOTAL_ROWS
+ frame.scroll.bar:SetValueStep(TOTAL_ROWS)
+
+ updatePerformanceList()
+ end
+end
+
+function OHPerformance:Unregister()
+ if( OptionHouse ) then
+ OptionHouse:UnregisterTab(L["ADDON_PERFORMANCE"])
+ end
+end
Added: tags/OptionHouse-r669/OptionHouse/OptionHouse.lua
==============================================================================
--- (empty file)
+++ tags/OptionHouse-r669/OptionHouse/OptionHouse.lua Thu Apr 24
22:00:45 2008
@@ -0,0 +1,1377 @@
+local major = "OptionHouse-1.1"
+local minor = tonumber(string.match("$Revision: 669 $", "(%d+)") or 1)
+
+assert(LibStub, string.format("%s requires LibStub.", major))
+
+local OHInstance, oldRevision = LibStub:NewLibrary(major, minor)
+if( not OHInstance ) then return end
+
+local L = {
+ ["ERROR_NO_FRAME"] = "No frame returned for the addon \"%s\",
category \"%s\", sub category \"%s\".",
+ ["NO_FUNC_PASSED"] = "You must associate a function with a category.",
+ ["BAD_ARGUMENT"] = "bad argument #%d to '%s' (%s expected, got %s)",
+ ["MUST_CALL"] = "You must call '%s' from an OptionHouse addon object.",
+ ["ADDON_ALREADYREG"] = "The addon '%s' is already registered with OptionHouse.",
+ ["UNKNOWN_TAB"] = "Cannot open tab #%d, only %d tabs are registered.",
+ ["CATEGORY_ALREADYREG"] = "The category '%s' already exists in '%s'",
+ ["NO_CATEGORYEXISTS"] = "No category named '%s' in '%s' exists.",
+ ["NO_SUBCATEXISTS"] = "No sub-category '%s' exists in '%s' for the addon '%s'.",
+ ["NO_PARENTCAT"] = "No parent category named '%s' exists in %s'",
+ ["SUBCATEGORY_ALREADYREG"] = "The sub-category named '%s' already
exists in the category '%s' for '%s'",
+ ["UNKNOWN_FRAMETYPE"] = "Unknown frame type given '%s',
only 'main', 'perf', 'addon', 'config', 'graph' are supported.",
+ ["OPTION_HOUSE"] = "OptionHouse",
+ ["ENTERED_COMBAT"] = "|cFF33FF99OptionHouse|r: Configuration window
closed due to entering combat.",
+ ["IN_COMBAT"] = "|cFF33FF99OptionHouse|r: Configuration window cannot
be opened while in combat.",
+ ["SEARCH"] = "Search...",
+ ["ADDON_OPTIONS"] = "Addons",
+ ["VERSION"] = "Version: %s",
+ ["AUTHOR"] = "Author: %s",
+ ["TOTAL_SUBCATEGORIES"] = "Sub Categories: %d",
+ ["TAB_MANAGEMENT"] = "Management",
+ ["TAB_PERFORMANCE"] = "Performance",
+ ["TAB_GRAPH"] = "Performance Graph",
+ ["SECURE_FRAME"] = "OptionHouse is currently a secure frame and
cannot be opened in combat.",
+ ["INSECURE_FRAME"] = "OptionHouse is not a secure frame, and can be
opened while in combat.",
+}
+
+local function assert(level,condition,message)
+ if( not condition ) then
+ error(message,level)
+ end
+end
+
+local function argcheck(value, num, ...)
+ if( type(num) ~= "number" ) then
+ error(L["BAD_ARGUMENT"]:format(2, "argcheck", "number", type(num)), 1)
+ end
+
+ for i=1,select("#", ...) do
+ if( type(value) == select(i, ...) ) then return end
+ end
+
+ local types = string.join(", ", ...)
+ local name = string.match(debugstack(2,2,0), ": in function [`<](.-)['>]")
+ error(L["BAD_ARGUMENT"]:format(num, name, types, type(value)), 3)
+end
+
+-- OptionHouse
+local OptionHouse = {}
+local tabfunctions = {}
+local methods = {"RegisterCategory", "RegisterSubCategory", "RemoveCategory", "RemoveSubCategory"}
+local addons = {}
+local regFrames = {}
+local openedByMenu
+local evtFrame
+local frame
+
+-- TABS
+local function resizeTab(tab)
+ local textWidth = tab:GetFontString():GetWidth()
+
+ tab.middleActive:SetWidth(textWidth)
+ tab.middleInactive:SetWidth(textWidth)
+
+ tab:SetWidth((2 * tab.leftActive:GetWidth()) + textWidth)
+ tab.highlightTexture:SetWidth(textWidth + 20)
+end
+
+local function tabSelected(tab)
+ tab:SetTextColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b)
+ tab.highlightTexture:Hide()
+
+ tab.leftActive:Show()
+ tab.middleActive:Show()
+ tab.rightActive:Show()
+
+ tab.leftInactive:Hide()
+ tab.middleInactive:Hide()
+ tab.rightInactive:Hide()
+end
+
+local function tabDeselected(tab)
+ tab:SetTextColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b)
+ tab.highlightTexture:Show()
+
+ tab.leftInactive:Show()
+ tab.middleInactive:Show()
+ tab.rightInactive:Show()
+
+ tab.leftActive:Hide()
+ tab.middleActive:Hide()
+ tab.rightActive:Hide()
+end
+
+local function setTab(id)
+ if( frame.selectedTab ) then
+ tabDeselected(frame.tabs[frame.selectedTab])
+ end
+
+ frame.selectedTab = id
+ tabSelected(frame.tabs[id])
+end
+
+local function tabOnClick(self)
+ local id
+ if( type(self) ~= "number" ) then
+ id = self:GetID()
+ else
+ id = self
+ end
+
+ setTab(id)
+
+ for tabID, tab in pairs(tabfunctions) do
+ if( tabID == id ) then
+ if( type(tab.func) == "function" ) then
+ tab.func()
+ else
+ tab.handler[tab.func](tab.handler)
+ end
+
+ if( tab.type == "browse" ) then
+ frame.topLeft:SetTexture("Interface\\AuctionFrame\\UI-AuctionFrame-Browse-TopLeft")
+ frame.top:SetTexture("Interface\\AuctionFrame\\UI-AuctionFrame-Browse-Top")
+ frame.topRight:SetTexture("Interface\\AuctionFrame\\UI-AuctionFrame-Browse-TopRight")
+ frame.bottomLeft:SetTexture("Interface\\AuctionFrame\\UI-AuctionFrame-Browse-BotLeft")
+ frame.bottom:SetTexture("Interface\\AuctionFrame\\UI-AuctionFrame-Browse-Bot")
+ frame.bottomRight:SetTexture("Interface\\AuctionFrame\\UI-AuctionFrame-Browse-BotRight")
+ elseif( tab.type == "bid" ) then
+ frame.topLeft:SetTexture("Interface\\AuctionFrame\\UI-AuctionFrame-Bid-TopLeft")
+ frame.top:SetTexture("Interface\\AuctionFrame\\UI-AuctionFrame-Bid-Top")
+ frame.topRight:SetTexture("Interface\\AuctionFrame\\UI-AuctionFrame-Bid-TopRight")
+ frame.bottomLeft:SetTexture("Interface\\AuctionFrame\\UI-AuctionFrame-Bid-BotLeft")
+ frame.bottom:SetTexture("Interface\\AuctionFrame\\UI-AuctionFrame-Bid-Bot")
+ frame.bottomRight:SetTexture("Interface\\AuctionFrame\\UI-AuctionFrame-Bid-BotRight")
+ end
+
+ elseif( type(tab.func) == "function" ) then
+ tab.func(true)
+ else
+ tab.handler[tab.func](tab.handler, true)
+ end
+ end
+end
+
+local function createTab(text, id)
+ local tab = frame.tabs[id]
+ if( not tab ) then
+ tab = CreateFrame("Button", nil, frame)
+ tab:SetHighlightFontObject(GameFontHighlightSmall)
+ tab:SetTextFontObject(GameFontNormalSmall)
+ tab:SetHighlightTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight")
+ tab:SetText(text)
+ tab:SetWidth(115)
+ tab:SetHeight(32)
+ tab:SetID(id)
+ tab:SetScript("OnClick", tabOnClick)
+ tab:GetFontString():SetPoint("CENTER", 0, 2)
+
+ tab.highlightTexture = tab:GetHighlightTexture()
+ tab.highlightTexture:ClearAllPoints()
+ tab.highlightTexture:SetPoint("CENTER", tab:GetFontString(), 0, 0)
+ tab.highlightTexture:SetBlendMode("ADD")
+
+ -- TAB SELECTED TEXTURES
+ tab.leftActive = tab:CreateTexture(nil, "ARTWORK")
+ tab.leftActive:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-ActiveTab")
+ tab.leftActive:SetHeight(32)
+ tab.leftActive:SetWidth(20)
+ tab.leftActive:SetPoint("TOPLEFT", tab, "TOPLEFT")
+ tab.leftActive:SetTexCoord(0, 0.15625, 0, 1.0)
+
+ tab.middleActive = tab:CreateTexture(nil, "ARTWORK")
+ tab.middleActive:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-ActiveTab")
+ tab.middleActive:SetHeight(32)
+ tab.middleActive:SetWidth(20)
+ tab.middleActive:SetPoint("LEFT", tab.leftActive, "RIGHT")
+ tab.middleActive:SetTexCoord(0.15625, 0.84375, 0, 1.0)
+
+ tab.rightActive = tab:CreateTexture(nil, "ARTWORK")
+ tab.rightActive:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-ActiveTab")
+ tab.rightActive:SetHeight(32)
+ tab.rightActive:SetWidth(20)
+ tab.rightActive:SetPoint("LEFT", tab.middleActive, "RIGHT")
+ tab.rightActive:SetTexCoord(0.84375, 1.0, 0, 1.0)
+
+ -- TAB DESELECTED TEXTURES
+ tab.leftInactive = tab:CreateTexture(nil, "ARTWORK")
+ tab.leftInactive:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-InActiveTab")
+ tab.leftInactive:SetHeight(32)
+ tab.leftInactive:SetWidth(20)
+ tab.leftInactive:SetPoint("TOPLEFT", tab, "TOPLEFT")
+ tab.leftInactive:SetTexCoord(0, 0.15625, 0, 1.0)
+
+ tab.middleInactive = tab:CreateTexture(nil, "ARTWORK")
+ tab.middleInactive:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-InActiveTab")
+ tab.middleInactive:SetHeight(32)
+ tab.middleInactive:SetWidth(20)
+ tab.middleInactive:SetPoint("LEFT", tab.leftInactive, "RIGHT")
+ tab.middleInactive:SetTexCoord(0.15625, 0.84375, 0, 1.0)
+
+ tab.rightInactive = tab:CreateTexture(nil, "ARTWORK")
+ tab.rightInactive:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-InActiveTab")
+ tab.rightInactive:SetHeight(32)
+ tab.rightInactive:SetWidth(20)
+ tab.rightInactive:SetPoint("LEFT", tab.middleInactive, "RIGHT")
+ tab.rightInactive:SetTexCoord(0.84375, 1.0, 0, 1.0)
+
+ frame.totalTabs = frame.totalTabs + 1
+ frame.tabs[id] = tab
+ end
+
+ tab:SetText(text)
+ tab:Show()
+
+ tabDeselected(tab)
+ resizeTab(tab)
+
+ if( id == 1 ) then
+ tab:SetPoint("TOPLEFT", frame, "BOTTOMLEFT", 15, 11)
+ else
+ tab:SetPoint("TOPLEFT", frame.tabs[id - 1], "TOPRIGHT", -8, 0)
+ end
+end
+
+-- SCROLL FRAME
+local function onVerticalScroll(self, offset)
+ offset = ceil(offset)
+
+ self.bar:SetValue(offset)
+ self.offset = ceil(offset / self.displayNum)
+
+ if( self.offset < 0 ) then
+ self.offset = 0
+ end
+
+ local min, max = self.bar:GetMinMaxValues()
+
+ if( min == offset ) then
+ self.up:Disable()
+ else
+ self.up:Enable()
+ end
+
+ if( max == offset ) then
+ self.down:Disable()
+ else
+ self.down:Enable()
+ end
+
+ self.updateFunc(self.updateHandler)
+end
+
+local function onMouseWheel(self, offset)
+ if( self.scroll ) then self = self.scroll end
+ if( offset > 0 ) then
+ self.bar:SetValue(self.bar:GetValue() - (self.bar:GetHeight() / 2))
+ else
+ self.bar:SetValue(self.bar:GetValue() + (self.bar:GetHeight() / 2))
+ end
+end
+
+local function onParentMouseWheel(self, offset)
+ onMouseWheel(self.scroll, offset)
+end
+
+local function updateScroll(scroll, totalRows)
+ local max = (totalRows - scroll.displayNum) * scroll.displayNum
+
+ -- Macs are unhappy if max is less then the min
+ if( max < 0 ) then
+ max = 0
+ end
+
+ scroll.bar:SetMinMaxValues(0, max)
+
+ if( totalRows > scroll.displayNum ) then
+ scroll:Show()
+ scroll.bar:Show()
+ scroll.up:Show()
+ scroll.down:Show()
+ scroll.bar:GetThumbTexture():Show()
+ else
+ scroll:Hide()
+ scroll.bar:Hide()
+ scroll.up:Hide()
+ scroll.down:Hide()
+ scroll.bar:GetThumbTexture():Hide()
+ end
+end
+
+local function onValueChanged(self, offset)
+ self:GetParent():SetVerticalScroll(offset)
+end
+
+local function scrollButtonUp(self)
+ local parent = self:GetParent()
+ parent:SetValue(parent:GetValue() - (parent:GetHeight() / 2))
+ PlaySound("UChatScrollButton")
+end
+
+local function scrollButtonDown(self)
+ local parent = self:GetParent()
+ parent:SetValue(parent:GetValue() + (parent:GetHeight() / 2))
+ PlaySound("UChatScrollButton")
+end
+
+local function createScrollFrame(frame, displayNum, onScroll)
+ frame:EnableMouseWheel(true)
+ frame:SetScript("OnMouseWheel", onParentMouseWheel)
+
+ frame.scroll = CreateFrame("ScrollFrame", nil, frame)
+ frame.scroll:EnableMouseWheel(true)
+ frame.scroll:SetWidth(16)
+ frame.scroll:SetHeight(270)
+ frame.scroll:SetScript("OnVerticalScroll", onVerticalScroll)
+ frame.scroll:SetScript("OnMouseWheel", onMouseWheel)
+
+ frame.scroll.offset = 0
+ frame.scroll.displayNum = displayNum
+ frame.scroll.updateHandler = frame
+ frame.scroll.updateFunc = onScroll
+
+ -- Actual bar for scrolling
+ frame.scroll.bar = CreateFrame("Slider", nil, frame.scroll)
+ frame.scroll.bar:SetValueStep(frame.scroll.displayNum)
+ frame.scroll.bar:SetMinMaxValues(0, 0)
+ frame.scroll.bar:SetValue(0)
+ frame.scroll.bar:SetWidth(16)
+ frame.scroll.bar:SetScript("OnValueChanged", onValueChanged)
+ frame.scroll.bar:SetPoint("TOPLEFT", frame.scroll, "TOPRIGHT", 6, -16)
+ frame.scroll.bar:SetPoint("BOTTOMLEFT", frame.scroll, "BOTTOMRIGHT",
6, -16)
+
+ -- Up/Down buttons
+ frame.scroll.up = CreateFrame("Button", nil, frame.scroll.bar, "UIPanelScrollUpButtonTemplate")
+ frame.scroll.up:ClearAllPoints()
+ frame.scroll.up:SetPoint( "BOTTOM", frame.scroll.bar, "TOP" )
+ frame.scroll.up:SetScript("OnClick", scrollButtonUp)
+
+ frame.scroll.down = CreateFrame("Button", nil, frame.scroll.bar, "UIPanelScrollDownButtonTemplate")
+ frame.scroll.down:ClearAllPoints()
+ frame.scroll.down:SetPoint( "TOP", frame.scroll.bar, "BOTTOM" )
+ frame.scroll.down:SetScript("OnClick", scrollButtonDown)
+
+ -- That square thingy that shows where the bar is
+ frame.scroll.bar:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob")
+ local thumb = frame.scroll.bar:GetThumbTexture()
+
+ thumb:SetHeight(16)
+ thumb:SetWidth(16)
+ thumb:SetTexCoord(0.25, 0.75, 0.25, 0.75)
+
+ -- Border graphic
+ frame.scroll.barUpTexture = frame.scroll:CreateTexture(nil, "BACKGROUND")
+ frame.scroll.barUpTexture:SetWidth(31)
+ frame.scroll.barUpTexture:SetHeight(256)
+ frame.scroll.barUpTexture:SetPoint("TOPLEFT",
frame.scroll.up, "TOPLEFT", -7, 5)
+ frame.scroll.barUpTexture:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-ScrollBar")
+ frame.scroll.barUpTexture:SetTexCoord(0, 0.484375, 0, 1.0)
+
+ frame.scroll.barDownTexture = frame.scroll:CreateTexture(nil, "BACKGROUND")
+ frame.scroll.barDownTexture:SetWidth(31)
+ frame.scroll.barDownTexture:SetHeight(106)
+ frame.scroll.barDownTexture:SetPoint("BOTTOMLEFT",
frame.scroll.down, "BOTTOMLEFT", -7, -3)
+ frame.scroll.barDownTexture:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-ScrollBar")
+ frame.scroll.barDownTexture:SetTexCoord(0.515625, 1.0, 0, 0.4140625)
+end
+
+-- SEARCH INPUT
+local function focusGained(self)
+ if( self.searchText ) then
+ self.searchText = nil
+ self:SetText("")
+ self:SetTextColor(1, 1, 1, 1)
+ end
+end
+
+local function focusLost(self)
+ if( not self.searchText and string.trim(self:GetText()) == "" ) then
+ self.searchText = true
+ self:SetText(L["SEARCH"])
+ self:SetTextColor(0.90, 0.90, 0.90, 0.80)
+ end
+end
+
+local function createSearchInput(frame, onChange)
+ frame.search = CreateFrame("EditBox", nil, frame, "InputBoxTemplate")
+ frame.search:SetHeight(19)
+ frame.search:SetWidth(150)
+ frame.search:SetAutoFocus(false)
+ frame.search:ClearAllPoints()
+ frame.search:SetPoint("CENTER", frame, "BOTTOMLEFT", 100, 25)
+
+ frame.search.searchText = true
+ frame.search:SetText(L["SEARCH"])
+ frame.search:SetTextColor(0.90, 0.90, 0.90, 0.80)
+ frame.search:SetScript("OnTextChanged", onChange)
+ frame.search:SetScript("OnEditFocusGained", focusGained)
+ frame.search:SetScript("OnEditFocusLost", focusLost)
+end
+
+-- ADDON CONFIGURATION
+local function showTooltip(self)
+ if( self.tooltip ) then
+ GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
+ GameTooltip:SetText(self.tooltip, nil, nil, nil, nil, 1)
+ end
+end
+
+local function hideTooltip()
+ GameTooltip:Hide()
+end
+
+local function sortCategories(a, b)
+ if( not b ) then
+ return false
+ elseif( not a ) then
+ return true
+ end
+
+ local aType = type(a.sortID)
+ local bType = type(b.sortID)
+
+ -- Sort categories/sub categories
+ -- We're comparing two categories/sub categories
+ if( aType == "number" and bType == "number" ) then
+ -- Same ID, so sort by alpha
+ if( a.sortID == b.sortID ) then
+ return ( a.name < b.name )
+ end
+
+ return ( a.sortID < b.sortID )
+
+ -- Comparing mixed types, category + addon
+ elseif( aType == "number" and bType ~= "number" ) then
+ return true
+
+
+ -- Comparing mixed types, category + addon
+ elseif( bType == "number" and aType ~= "number" ) then
+ return false
+ end
+
+ -- Comparing two addons
+ return ( a.name < b.name )
+end
+
+-- Adds the actual row, will attempt to reuse the current row if able to
+local function addCategoryRow(type, name, tooltip, data, parent, addon)
+ local sortID
+ if( type == "addon" ) then
+ sortID = name
+ elseif( not data.sortID ) then
+ sortID = 9999999
+ else
+ sortID = data.sortID
+ end
+
+ local frame = regFrames.addon
+ for i=1, #(frame.categories) do
+ -- Match type/name first
+ if( frame.categories[i].type == type and frame.categories[i].name ==
name ) then
+ -- Then make sure it's correct addons parent, if it's a category
+ if( (parent and frame.categories[i].parent and
frame.categories[i].parent == parent) or (not parent and not
frame.categories[i].parent) ) then
+ -- Now make sure it's the correct addon if it's a sub category
+ if( (addon and frame.categories[i].addon and
frame.categories[i].addon == addon) or (not addon and not
frame.categories[i].addon) ) then
+ frame.categories[i].tooltip = tooltip
+ frame.categories[i].data = data
+ frame.categories[i].sortID = sortID
+ return
+ end
+ end
+ end
+ end
+
+ table.insert(frame.categories, {name = name, type = type, tooltip =
tooltip, sortID = sortID, data = data, parent = parent, addon = addon} )
+ frame.resortList = true
+end
+
+-- This removes the entire addon, we don't use this unless
+-- we're removing the last category
+local function removeAddonListing(addon)
+ local frame = regFrames.addon
+ for i=#(frame.categories), 1, -1 do
+ if( frame.categories[i].addon == addon ) then
+ table.remove(frame.categories, i)
+ end
+ end
+end
+
+-- Remove a specific category and/or sub category listing
+-- without needing to recreate the entire list
+local function removeCategoryListing(addon, name)
+ local frame = regFrames.addon
+ for i=#(frame.categories), 1, -1 do
+ -- Remove the category requested
+ if( frame.categories[i].type == "category" and
frame.categories[i].name == name and frame.categories[i].addon == addon
) then
+ table.remove(frame.categories, i)
+
+ -- Remove all of it's sub categories
+ elseif( frame.categories[i].type == "subcat" and
frame.categories[i].parent == name and frame.categories[i].addon ==
addon ) then
+ table.remove(frame.categories, i)
+ end
+ end
+end
+
+local function removeSubCategoryListing(addon, parentCat, name)
+ local frame = regFrames.addon
+ for i=#(frame.categories), 1, -1 do
+ -- Remove the specific sub category
+ if( frame.categories[i].type == "subcat" and
frame.categories[i].name == name and frame.categories[i].parent ==
parentCat and frame.categories[i].addon == addon ) then
+ table.remove(frame.categories, i)
+ end
+ end
+end
+
+-- We have a seperate function for adding addons
+-- so we can update a single addon out of the entire list
+-- if it's categories/sub categories get changed, or a new ones added
+local function addCategoryListing(name, addon)
+ local tooltip = "|cffffffff" .. (addon.title or name) .. "|r"
+ local data
+
+ if( addon.version ) then
+ tooltip = tooltip .. "\n" .. string.format(L["VERSION"], addon.version)
+ end
+
+ if( addon.author ) then
+ tooltip = tooltip .. "\n" .. string.format(L["AUTHOR"], addon.author)
+ end
+
+ -- One category, make clicking the addon open that category
+ if( addon.totalCats == 1 and addon.totalSubs == 0 ) then
+ for catName, cat in pairs(addon.categories) do
+ data = cat
+ data.parentCat = catName
+ break
+ end
+
+ -- Multiple categories, or sub categories
+ else
+ for catName, cat in pairs(addon.categories) do
+ cat.parentCat = catName
+ addCategoryRow("category", catName, cat.totalSubs > 0 and
string.format(L["TOTAL_SUBCATEGORIES"], cat.totalSubs), cat, name, name)
+
+ for subCatName, subCat in pairs(cat.sub) do
+ subCat.parentCat = catName
+ addCategoryRow("subcat", subCatName, nil, subCat, catName, name)
+ end
+ end
+ end
+
+ addCategoryRow("addon", name, (addon.version or addon.author) and
tooltip, data, nil, name)
+end
+
+-- Recreates the entire listing
+local function createCategoryListing()
+ regFrames.addon.categories = {}
+
+ for name, addon in pairs(addons) do
+ addCategoryListing(name, addon)
+ end
+end
+
+local function openConfigFrame(data)
+ local frame = regFrames.addon
+
+ -- Clicking on an addon with multiple categories or sub categories
will cause no data
+ if( not data ) then
+ -- Make sure the frames hidden when only the addon button is selected
+ if( frame.shownFrame ) then
+ frame.shownFrame:Hide()
+ end
+ return
+ end
+
+ if( data.handler or data.func ) then
+ data.frame = nil
+
+ if( type(data.func) == "string" ) then
+ data.frame = data.handler[data.func](data.handler, data.parentCat
or frame.selectedCategory, frame.selectedSubCat)
+ elseif( type(data.handler) == "function" ) then
+ data.frame = data.handler(data.parentCat or frame.selectedCategory, frame.selectedSubCat)
+ end
+
+ -- Mostly this is for authors, but it lets us clean up the logic a bit
+ if( not data.frame ) then
+ error(string.format(L["ERROR_NO_FRAME"], frame.selectedAddon,
data.parentCat or frame.selectedCategory, frame.selectedSubCat), 3)
+ end
+
+ -- Validate location/width/height and force parent
+ if( not data.frame:GetPoint() ) then
+ data.frame:SetPoint("TOPLEFT", frame, "TOPLEFT", 190, -103)
+ end
+
+ if( data.frame:GetWidth() > 630 or data.frame:GetWidth() == 0 ) then
+ data.frame:SetWidth(630)
+ end
+
+ if( data.frame:GetHeight() > 305 or data.frame:GetHeight() == 0 ) then
+ data.frame:SetHeight(305)
+ end
+
+ data.frame:SetParent(frame)
+ data.frame:SetFrameStrata("DIALOG")
+
+ if( not data.noCache ) then
+ local category
+
+ -- Figure out which category we're modifying
+ if( frame.selectedSubCat ~= "" ) then
+ category = addons[frame.selectedAddon].categories[frame.selectedCategory].sub[frame.selectedSubCat]
+ elseif( frame.selectedCategory ~= "" ) then
+ category = addons[frame.selectedAddon].categories[frame.selectedCategory]
+ elseif( frame.selectedAddon ~= "" ) then
+ for catName, _ in pairs(addons[frame.selectedAddon].categories) do
+ category = addons[frame.selectedAddon].categories[catName]
+ end
+ end
+
+ -- Remove the handler/func and save the frame for next time
+ if( category ) then
+ category.handler = nil
+ category.func = nil
+ category.frame = data.frame
+ end
+ end
+ end
+
+ if( frame.shownFrame ) then
+ frame.shownFrame:Hide()
+ end
+
+ -- Now show the current one
+ if( data.frame and frame.selectedAddon ~= "" ) then
+ data.frame:Show()
+ frame.shownFrame = data.frame
+ end
+end
+
+-- Displays the actual button
+local function displayCategoryRow(type, text, data, tooltip, highlighted)
+ local frame = regFrames.addon
+
+ -- We have to let this run completely
+ -- so we know how many rows we have total
+ frame.totalRows = frame.totalRows + 1
+ if( frame.totalRows <= frame.scroll.offset or frame.rowID >= 15 ) then
+ return
+ end
+
+ frame.rowID = frame.rowID + 1
+
+ local button = frame.buttons[frame.rowID]
+ local line = frame.lines[frame.rowID]
+
+ if( highlighted ) then
+ button:LockHighlight()
+ else
+ button:UnlockHighlight()
+ end
+
+ if( type == "addon" ) then
+ button:SetText(text)
+ button:GetFontString():SetPoint("LEFT", button, "LEFT", 4, 0)
+ button:GetNormalTexture():SetAlpha(1.0)
+ line:Hide()
+
+ elseif( type == "category" ) then
+ button:SetText(HIGHLIGHT_FONT_COLOR_CODE..text..FONT_COLOR_CODE_CLOSE)
+ button:GetFontString():SetPoint("LEFT", button, "LEFT", 12, 0)
+ button:GetNormalTexture():SetAlpha(0.4)
+ line:Hide()
+
+ elseif( type == "subcat" ) then
+ button:SetText(HIGHLIGHT_FONT_COLOR_CODE..text..FONT_COLOR_CODE_CLOSE)
+ button:GetFontString():SetPoint("LEFT", button, "LEFT", 20, 0)
+ button:GetNormalTexture():SetAlpha(0.0)
+ line:SetTexCoord(0, 0.4375, 0, 0.625)
+ line:Show()
+ end
+
+ button.fs = button:GetFontString()
+ button.tooltip = tooltip
+ button.data = data
+ button.type = type
+ button.catText = text
+ button:Show()
+end
+
+local function updateConfigList(openAlso)
+ local frame = regFrames.addon
+ frame.rowID = 0
+ frame.totalRows = 0
+
+ local lastID
+ local searchBy = string.trim(string.lower(frame.search:GetText()))
+ if( searchBy == "" or frame.search.searchText ) then
+ searchBy = nil
+ end
+
+ -- Make sure stuff matches our search results
+ for id, row in pairs(frame.categories) do
+ if( searchBy and not string.match(string.lower(row.name), searchBy)
) then
+ frame.categories[id].hide = true
+ else
+ frame.categories[id].hide = nil
+ end
+ end
+
+ -- Resort list if needed
+ if( frame.resortList ) then
+ table.sort(frame.categories, sortCategories)
+ frame.resortList = nil
+ end
+
+ -- Now display
+ local opened
+ for _, addon in pairs(frame.categories) do
+ if( not addon.hide and addon.type == "addon" ) then
+ -- Total addons
+ if( addon.name == frame.selectedAddon ) then
+ displayCategoryRow(addon.type, addon.name, addon.data,
addon.tooltip, true)
+
+ for _, cat in pairs(frame.categories) do
+ -- Show all the categories with the addon as the parent
+ if( not cat.hide and cat.parent == addon.name and cat.type
== "category" ) then
+ -- Total categories of the selected addon
+ if( cat.name == frame.selectedCategory ) then
+ displayCategoryRow(cat.type, cat.name, cat.data, cat.tooltip, true)
+
+ for _, subCat in pairs(frame.categories) do
+ -- We don't have to check type, because it's the only one that
has .addon set
+ if( not subCat.hide and subCat.parent == cat.name and
subCat.addon == addon.name ) then
+ -- Total sub categories of the selected addons selected category
+ displayCategoryRow(subCat.type, subCat.name, subCat.data,
subCat.tooltip, subCat.name == frame.selectedSubCat)
+
+ lastID = frame.rowID
+ if( openAlso ) then
+ opened = subCat.data
+ end
+ end
+ end
+
+ if( lastID ) then
+ frame.lines[lastID]:SetTexCoord(0.4375, 0.875, 0, 0.625)
+ end
+
+ -- Okay open the category then
+ if( not opened and openAlso ) then
+ opened = cat.data
+ end
+ else
+ displayCategoryRow(cat.type, cat.name, cat.data, cat.tooltip)
+ end
+ end
+ end
+
+ if( not opened and openAlso ) then
+ opened = addon.data
+ end
+ else
+ displayCategoryRow(addon.type, addon.name, addon.data, addon.tooltip)
+ end
+ end
+ end
+
+ if( opened and type(openAlso) == "boolean" ) then
+ openConfigFrame(opened)
+ end
+
+ updateScroll(frame.scroll, frame.totalRows)
+
+ local wrapSize = 145
+ if( frame.totalRows > 15 ) then
+ wrapSize = 135
+ end
+
+ for i=1, 15 do
+ local button = frame.buttons[i]
+ if( frame.totalRows > 15 ) then
+ button:SetWidth(140)
+ else
+ button:SetWidth(156)
+ end
+
+ if( button.fs ) then
+ local wrapAt = wrapSize
+ if( button.type == "category" ) then
+ wrapAt = wrapAt - 5
+ elseif( frame.buttons[i].type == "subcat" ) then
+ wrapAt = wrapAt - 10
+ end
+
+ if( button.fs:GetStringWidth() > wrapAt ) then
+ button.fs:SetWidth(wrapAt)
+ else
+ button.fs:SetWidth(button.fs:GetStringWidth())
+ end
+ end
+
+ -- We have less then 15 rows used
+ -- and our index is equal or past our current
+ if( frame.rowID < 15 and i > frame.rowID ) then
+ button:Hide()
+ end
+ end
+end
+
+local function expandConfigList(self)
+ local frame = regFrames.addon
+
+ if( self.type == "addon" ) then
+ if( frame.selectedAddon == self.catText ) then
+ frame.selectedAddon = ""
+ else
+ frame.selectedAddon = self.catText
+ end
+
+ frame.selectedCategory = ""
+ frame.selectedSubCat = ""
+
+ elseif( self.type == "category" ) then
+ if( frame.selectedCategory == self.catText and frame.selectedSubCat
== "" ) then
+ frame.selectedCategory = ""
+ self.data = nil
+ else
+ frame.selectedCategory = self.catText
+ end
+
+ frame.selectedSubCat = ""
+
+ elseif( self.type == "subcat" ) then
+ if( frame.selectedSubCat == self.catText ) then
+ frame.selectedSubCat = ""
+
+ -- Make sure the frame gets hidden when deselecting
+ self.data = addons[frame.selectedAddon].categories[frame.selectedCategory]
+ else
+ frame.selectedSubCat = self.catText
+ end
+ end
+
+ openConfigFrame(self.data)
+ updateConfigList()
+end
+
+
+local function createAddonFrame(hide)
+ local frame = regFrames.addon
+
+ if( frame and hide ) then
+ frame:Hide()
+ return
+ elseif( hide ) then
+ return
+ elseif( not frame ) then
+ frame = CreateFrame("Frame", nil, regFrames.main)
+ frame:SetFrameStrata("DIALOG")
+ frame:SetAllPoints(regFrames.main)
+
+ regFrames.addon = frame
+
+ frame.buttons = {}
+ frame.lines = {}
+ for i=1, 15 do
+ local button = CreateFrame("Button", nil, frame)
+ frame.buttons[i] = button
+
+ button:SetHighlightFontObject(GameFontHighlightSmall)
+ button:SetTextFontObject(GameFontNormalSmall)
+ button:SetScript("OnClick", expandConfigList)
+ button:SetScript("OnEnter", showTooltip)
+ button:SetScript("OnLeave", hideTooltip)
+ button:SetWidth(140)
+ button:SetHeight(20)
+
+ button:SetNormalTexture("Interface\\AuctionFrame\\UI-AuctionFrame-FilterBG")
+ button:GetNormalTexture():SetTexCoord(0, 0.53125, 0, 0.625)
+
+ button:SetHighlightTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight")
+ button:GetHighlightTexture():SetBlendMode("ADD")
+
+ -- For sub categories only
+ local line = button:CreateTexture(nil, "BACKGROUND")
+ frame.lines[i] = line
+
+ line:SetWidth(7)
+ line:SetHeight(20)
+ line:SetPoint("LEFT", 13, 0)
+ line:SetTexture("Interface\\AuctionFrame\\UI-AuctionFrame-FilterLines")
+ line:SetTexCoord(0, 0.4375, 0, 0.625)
+
+ if( i > 1 ) then
+ button:SetPoint("TOPLEFT", frame.buttons[i - 1], "BOTTOMLEFT", 0, 0)
+ else
+ button:SetPoint("TOPLEFT", 23, -105)
+ end
+ end
+
+ createScrollFrame(frame, 15, updateConfigList)
+ frame.scroll:SetPoint("TOPRIGHT", frame, "TOPLEFT", 158, -105)
+
+ createSearchInput(frame, updateConfigList)
+ createCategoryListing()
+ end
+
+ -- Reset selection
+ frame.selectedAddon = ""
+ frame.selectedCategory = ""
+ frame.selectedSubCat = ""
+
+ -- Hide the open config frame
+ if( frame.shownFrame ) then
+ frame.shownFrame:Hide()
+ end
+
+ updateConfigList()
+ ShowUIPanel(frame)
+end
+
+local function createOHFrame()
+ if( regFrames.main ) then
+ return
+ end
+
+ frame = CreateFrame("Frame", nil, UIParent)
+ frame:CreateTitleRegion()
+ frame:SetClampedToScreen(true)
+ frame:SetMovable(false)
+ frame:SetFrameStrata("DIALOG")
+ frame:SetWidth(832)
+ frame:SetHeight(447)
+ frame:SetPoint("TOPLEFT", 0, -104)
+ frame.totalTabs = 0
+ frame.tabs = {}
+
+ regFrames.main = frame
+
+ -- If we don't hide it ourself, the panel layout becomes messed up
+ -- because dynamically created frames are created shown
+ frame:Hide()
+
+ frame:SetScript("OnHide", function()
+ if( openedByMenu ) then
+ openedByMenu = nil
+
+ PlaySound("gsTitleOptionExit");
+ ShowUIPanel(GameMenuFrame)
+ end
+ end)
+ frame:SetScript("OnShow", function(self)
+ if( OptionHouseDB and OptionHouseDB.position ) then
+ local scale = self:GetEffectiveScale()
+
+ self:ClearAllPoints()
+ self:SetPoint("TOPLEFT", nil, "BOTTOMLEFT",
OptionHouseDB.position.x / scale, OptionHouseDB.position.y / scale)
+ end
+ end)
+
+
+ frame:SetAttribute("UIPanelLayout-defined", true)
+ frame:SetAttribute("UIPanelLayout-enabled", true)
+ frame:SetAttribute("UIPanelLayout-area", "doublewide")
+ frame:SetAttribute("UIPanelLayout-whileDead", true)
+ table.insert(UISpecialFrames, name)
+
+ local title = frame:GetTitleRegion()
+ title:SetWidth(757)
+ title:SetHeight(20)
+ title:SetPoint("TOPLEFT", 75, -15)
+
+ -- Embedded version wont include the icon cause authors are more
whiny then users
+ -- Also, we want to use different methods of frame dragging
+ if( not IsAddOnLoaded("OptionHouse") ) then
+ local texture = frame:CreateTexture(nil, "OVERLAY")
+ texture:SetWidth(57)
+ texture:SetHeight(57)
+ texture:SetPoint("TOPLEFT", 9, -7)
+ SetPortraitTexture(texture, "player")
+
+ frame:EnableMouse(true)
+ else
+ local texture = frame:CreateTexture(nil, "OVERLAY")
+ texture:SetWidth(128)
+ texture:SetHeight(128)
+ texture:SetPoint("TOPLEFT", 9, -2)
+ texture:SetTexture("Interface\\AddOns\\OptionHouse\\GnomePortrait")
+
+ frame:EnableMouse(false)
+ frame:SetMovable(not OptionHouseDB.locked)
+
+ -- This goes in the entire bar where "OptionHouse" title text is
+ local mover = CreateFrame("Button", nil, frame)
+ mover:SetPoint("TOP", 25, -15)
+ mover:SetHeight(19)
+ mover:SetWidth(730)
+
+ mover:SetScript("OnLeave", hideTooltip)
+ mover:SetScript("OnEnter", showTooltip)
+ mover:SetScript("OnMouseUp", function(self)
+ if( self.isMoving ) then
+ local parent = self:GetParent()
+ local scale = parent:GetEffectiveScale()
+
+ self.isMoving = nil
+ parent:StopMovingOrSizing()
+
+ OptionHouseDB.position = {x = parent:GetLeft() * scale, y =
parent:GetTop() * scale}
+ end
+ end)
+
+ mover:SetScript("OnMouseDown", function(self, mouse)
+ local parent = self:GetParent()
+
+ -- Start moving!
+ if( parent:IsMovable() and mouse == "LeftButton" ) then
+ self.isMoving = true
+ parent:StartMoving()
+
+ -- Reset position
+ elseif( mouse == "RightButton" ) then
+ parent:ClearAllPoints()
+ parent:SetPoint("TOPLEFT", 0, -104)
+
+ OptionHouseDB.position = nil
+ end
+ end)
+ end
+
+ local title = frame:CreateFontString(nil, "OVERLAY")
+ title:SetFontObject(GameFontNormal)
+ title:SetPoint("TOP", 0, -18)
+ title:SetText(L["OPTION_HOUSE"])
+
+ frame.topLeft = frame:CreateTexture(nil, "ARTWORK")
+ frame.topLeft:SetWidth(256)
+ frame.topLeft:SetHeight(256)
+ frame.topLeft:SetPoint("TOPLEFT", 0, 0)
+
+ frame.top = frame:CreateTexture(nil, "ARTWORK")
+ frame.top:SetWidth(320)
+ frame.top:SetHeight(256)
+ frame.top:SetPoint("TOPLEFT", 256, 0)
+
+ frame.topRight = frame:CreateTexture(nil, "ARTWORK")
+ frame.topRight:SetWidth(256)
+ frame.topRight:SetHeight(256)
+ frame.topRight:SetPoint("TOPLEFT", frame.top, "TOPRIGHT", 0, 0)
+
+ frame.bottomLeft = frame:CreateTexture(nil, "ARTWORK")
+ frame.bottomLeft:SetWidth(256)
+ frame.bottomLeft:SetHeight(256)
+ frame.bottomLeft:SetPoint("TOPLEFT", 0, -256)
+
+ frame.bottom = frame:CreateTexture(nil, "ARTWORK")
+ frame.bottom:SetWidth(320)
+ frame.bottom:SetHeight(256)
+ frame.bottom:SetPoint("TOPLEFT", 256, -256)
+
+ frame.bottomRight = frame:CreateTexture(nil, "ARTWORK")
+ frame.bottomRight:SetWidth(256)
+ frame.bottomRight:SetHeight(256)
+ frame.bottomRight:SetPoint("TOPLEFT", frame.bottom, "TOPRIGHT", 0, 0)
+
+ local button = CreateFrame("Button", nil, frame, "UIPanelCloseButton")
+ button:SetPoint("TOPRIGHT", 3, -8)
+ button:SetScript("OnClick", function()
+ HideUIPanel(frame)
+ end)
+
+ -- Make sure the configuration tab is first
+ local tabs = {{func = createAddonFrame, text = L["ADDON_OPTIONS"],
type = "browse"}}
+ createTab(L["ADDON_OPTIONS"], 1)
+
+ for id, tab in pairs(tabfunctions) do
+ table.insert(tabs, tab)
+ createTab(tab.text, id + 1)
+ end
+
+ tabfunctions = tabs
+end
+
+-- PRIVATE API's
+-- While these aren't locked down to prevent being used
+-- You ARE using them are your own risk for future compatability
+function OptionHouse:CreateSearchInput(frame, onChange)
+ createSearchInput(frame, onChange)
+end
+
+function OptionHouse:UpdateScroll(scroll, totalRows)
+ updateScroll(scroll, totalRows)
+end
+
+function OptionHouse:CreateScrollFrame(frame, displayNum, onScroll)
+ createScrollFrame(frame, displayNum, onScroll)
+end
+
+function OptionHouse.RegisterTab(self, text, func, type)
+ -- Simple, effective you can't register a tab unless we list it here
+ -- I highly doubt will ever need to add another one
+ if( text ~= L["TAB_MANAGEMENT"] and text ~= L["TAB_PERFORMANCE"] and
text ~= L["TAB_GRAPH"] ) then return end
+
+ table.insert(tabfunctions, {func = func, handler = self, text = text,
type = type})
+
+ -- Will create all of the tabs when the frame is created if needed
+ if( not frame ) then
+ return
+ end
+
+ createTab(text, #(tabfunctions))
+end
+
+function OptionHouse.UnregisterTab(self, text)
+ for i=#(tabfunctions), 1, -1 do
+ if( tabfunctions[i].text == text ) then
+ table.remove(tabfunctions, i)
+ end
+ end
+
+ for i=1, frame.totalTabs do
+ if( tabfunctions[i] ) then
+ createTab(tabfunctions[i].text, i)
+ else
+ frame.tabs[i]:Hide()
+ end
+ end
+end
+
+function OptionHouse.GetAddOnData(self, name)
+ if( not addons[name] ) then
+ return nil, nil, nil
+ end
+
+ return addons[name].title, addons[name].author, addons[name].version
+end
+
+function OptionHouse.RegisterFrame(self, type, frame)
+ if( type ~= "addon" and type ~= "manage" and type ~= "perf" and type
~= "main" and type ~= "graph" ) then
+ error(string.format(L["UNKNOWN_FRAMETYPE"], type), 3)
+ end
+
+ regFrames[type] = frame
+end
+
+-- PUBLIC API's
+function OptionHouse:GetFrame(type)
+ if( type ~= "addon" and type ~= "manage" and type ~= "perf" and type
~= "main" and type ~= "graph" ) then
+ error(string.format(L["UNKNOWN_FRAMETYPE"], type), 3)
+ end
+
+ return regFrames[type]
+end
+
+function OptionHouse:Open(addonName, parentCat, childCat)
+ argcheck(addonName, 1, "string", "nil")
+ argcheck(parentCat, 2, "string", "nil")
+ argcheck(childCat, 3, "string", "nil")
+
+ createOHFrame()
+ tabOnClick(1)
+
+ if( not addonName ) then
+ ShowUIPanel(frame)
+ return
+ end
+
+ regFrames.addon.selectedAddon = addonName or ""
+ regFrames.addon.selectedCategory = parentCat or ""
+ regFrames.addon.selectedSubCat = childCat or ""
+
+ updateConfigList(true)
+ ShowUIPanel(frame)
+end
+
+function OptionHouse:OpenTab(id)
+ argcheck(id, 1, "number")
+
+ createOHFrame()
+ if( #(tabfunctions) > id ) then
+ assert(string.format(L["UNKNOWN_TAB"], id, #(tabfunctions)), 3)
+ end
+
+ tabOnClick(id)
+ ShowUIPanel(frame)
+end
+
+function OptionHouse:RegisterAddOn(name, title, author, version)
+ argcheck(name, 1, "string")
+ argcheck(title, 2, "string", "nil")
+ argcheck(author, 3, "string", "nil")
+ argcheck(version, 4, "string", "number", "nil")
+ assert(3, not addons[name], string.format(L["ADDON_ALREADYREG"], name))
+
+ addons[name] = {title = title, author = author, version = version,
totalCats = 0, totalSubs = 0, categories = {}}
+ addons[name].obj = {name = name}
+
+ -- So we can upgrade the function pointer if a newer rev is found
+ for id, method in pairs(methods) do
+ addons[name].obj[method] = OptionHouse[method]
+ end
+
+ if( regFrames.addon ) then
+ addCategoryListing(name, addons[name])
+ updateConfigList()
+ end
+
+ return addons[name].obj
+end
+
+function OptionHouse.RegisterCategory(addon, name, handler, func,
noCache, sortID)
+ argcheck(name, 2, "string")
+ argcheck(handler, 3, "string", "function", "table")
+ argcheck(func, 4, "string", "function", "nil")
+ argcheck(noCache, 5, "boolean", "number", "nil")
+ argcheck(sortID, 6, "number", "string", "nil")
+ assert(3, handler or func, L["NO_FUNC_PASSED"])
+ assert(3, addons[addon.name], string.format(L["MUST_CALL"], "RegisterCategory"))
+ assert(3, addons[addon.name].categories,
string.format(L["CATEGORY_ALREADYREG"], name, addon.name))
+
+ -- Category numbers are required so we know when to skip it because
only one category/sub cat exists
+ addons[addon.name].totalCats = addons[addon.name].totalCats + 1
+ addons[addon.name].categories[name] = {func = func, handler =
handler, noCache = noCache, sub = {}, totalSubs = 0, sortID = sortID or 9999999}
+
+ if( regFrames.addon ) then
+ addCategoryListing(addon.name, addons[addon.name])
+ updateConfigList()
+ end
+end
+
+function OptionHouse.RegisterSubCategory(addon, parentCat, name,
handler, func, noCache, sortID)
+ argcheck(parentCat, 2, "string")
+ argcheck(name, 3, "string")
+ argcheck(handler, 4, "string", "function", "table")
+ argcheck(func, 5, "string", "function", "nil")
+ argcheck(noCache, 6, "boolean", "number", "nil")
+ argcheck(sortID, 7, "number", "string", "nil")
+ assert(3, handler or func, L["NO_FUNC_PASSED"])
+ assert(3, addons[addon.name], string.format(L["MUST_CALL"], "RegisterSubCategory"))
+ assert(3, addons[addon.name].categories[parentCat],
string.format(L["NO_PARENTCAT"], parentCat, addon.name))
+ assert(3, not addons[addon.name].categories[parentCat].sub[name],
string.format(L["SUBCATEGORY_ALREADYREG"], name, parentCat, addon.name))
+
+ addons[addon.name].totalSubs = addons[addon.name].totalSubs + 1
+ addons[addon.name].categories[parentCat].totalSubs =
addons[addon.name].categories[parentCat].totalSubs + 1
+ addons[addon.name].categories[parentCat].sub[name] = {handler =
handler, func = func, noCache = noCache, sortID = sortID or 9999999}
+
+ if( regFrames.addon ) then
+ addCategoryListing(addon.name, addons[addon.name])
+ updateConfigList()
+ end
+end
+
+function OptionHouse.RemoveCategory(addon, name)
+ argcheck(name, 2, "string")
+ assert(3, addons[addon.name], string.format(L["MUST_CALL"], "RemoveCategory"))
+ assert(3, addons[addon.name].categories[name],
string.format(L["NO_CATEGORYEXISTS"], name, addon.name))
+
+ addons[addon.name].totalCats = addons[addon.name].totalCats - 1
+ addons[addon.name].totalSubs = addons[addon.name].totalSubs - addons[addon.name].categories[name].totalSubs
+ addons[addon.name].categories[name] = nil
+
+ if( regFrames.addon ) then
+ if( addons[addon.name].totalCats == 0 ) then
+ removeAddonListing(addon.name)
+ else
+ removeCategoryListing(addon.name, name)
+ end
+
+ updateConfigList()
+ end
+end
+
+function OptionHouse.RemoveSubCategory(addon, parentCat, name)
+ argcheck(parentCat, 2, "string")
+ argcheck(name, 2, "string")
+ assert(3, addons[addon.name], string.format(L["MUST_CALL"], "RemoveSubCategory"))
+ assert(3, addons[addon.name].categories[parentCat],
string.format(L["NO_PARENTCAT"], name, addon.name))
+ assert(3, addons[addon.name].categories[parentCat].sub[name],
string.format(L["NO_SUBCATEXISTS"], name, parentCat, addon.name))
+
+ addons[addon.name].totalSubs = addons[addon.name].totalSubs - 1
+ addons[addon.name].categories[parentCat].totalSubs =
addons[addon.name].categories[parentCat].totalSubs - 1
+ addons[addon.name].categories[parentCat].sub[name] = nil
+
+ if( regFrames.addon ) then
+ -- If this means we only have no more sub categories
+ -- and only one category we need to change how it works
+ if( addons[addon.name].totalSubs == 0 and
addons[addon.name].totalCats == 1 ) then
+ removeAddonListing(addon.name)
+ addCategoryListing(addon.name, addons[addon.name])
+ else
+ removeSubCategoryListing(addon.name, parentCat, name)
+ end
+
+ updateConfigList()
+ end
+end
+
+function OptionHouse:GetVersion() return major, minor end
+
+local function instanceLoaded()
+ if( oldRevision ) then
+ addons = OHInstance.addons or addons
+ evtFrame = OHInstance.evtFrame or evtFrame
+ tabfunctions = OHInstance.tabfunctions or tabfunctions
+ else
+ -- Secure headers are supported so don't want the window stuck open
in combat
+ evtFrame = CreateFrame("Frame")
+ evtFrame:RegisterEvent("PLAYER_REGEN_DISABLED")
+ evtFrame:SetScript("OnEvent",function(self, event)
+ if( event == "PLAYER_REGEN_DISABLED" and frame and frame:IsShown()
) then
+ if( not OptionHouseDB or ( OptionHouseDB and
OptionHouseDB.combatHide ) ) then
+ HideUIPanel(frame)
+ DEFAULT_CHAT_FRAME:AddMessage(L["ENTERED_COMBAT"])
+ end
+ end
+ end)
+
+ -- Make sure it hasn't been created already.
+ -- don't have to upgrade the referance because it just uses the
slash command
+ -- which will upgrade below to use the current version anyway
+ if( not GameMenuButtonOptionHouse ) then
+ local menubutton =
CreateFrame("Button", "GameMenuButtonOptionHouse", GameMenuFrame, "GameMenuButtonTemplate")
+ menubutton:SetText(L["OPTION_HOUSE"])
+ menubutton:SetScript("OnClick", function()
+ openedByMenu = true
+
+ PlaySound("igMainMenuOption")
+ HideUIPanel(GameMenuFrame)
+ SlashCmdList["OPTHOUSE"]()
+ end)
+
+ -- Position below "Interface Options"
+ local a1, fr, a2, x, y = GameMenuButtonKeybindings:GetPoint()
+ menubutton:SetPoint(a1, fr, a2, x, y)
+
+ GameMenuButtonKeybindings:SetPoint(a1, menubutton, a2, x, y)
+ GameMenuFrame:SetHeight(GameMenuFrame:GetHeight() + 25)
+ end
+ end
+
+ OptionHouse.addons = addons
+ OptionHouse.evtFrame = evtFrame
+ OptionHouse.tabfunctions = tabfunctions
+
+ -- Upgrade functions to point towards the latest revision
+ for name, addon in pairs(addons) do
+ for _, method in pairs(methods) do
+ addon.obj[method] = OptionHouse[method]
+ end
+ end
+
+ SLASH_OPTHOUSE1 = "/opthouse"
+ SLASH_OPTHOUSE2 = "/oh"
+ SlashCmdList["OPTHOUSE"] = function(...)
+ if( select(1, ...) == "" ) then
+ OptionHouse:Open()
+ else
+ OptionHouse:Open(...)
+ end
+ end
+
+ -- Now make it active
+ for k, v in pairs(OptionHouse) do
+ OHInstance[k] = v
+ end
+end
+
+instanceLoaded()
Added: tags/OptionHouse-r669/OptionHouse/OptionHouse.toc
==============================================================================
--- (empty file)
+++ tags/OptionHouse-r669/OptionHouse/OptionHouse.toc Thu Apr 24
22:00:45 2008
@@ -0,0 +1,10 @@
+## Interface: 20300
+## Title: OptionHouse
+## Author: Dongle Dev Team
+## SavedVariables: OptionHouseDB
+
+OptionHouse.lua
+
+OH_Configuration.lua
+OH_AddOns.lua
+OH_PerfMon.lua
\ No newline at end of file
Added: tags/OptionHouse-r669/OptionHouse/changelog.txt
==============================================================================
--- (empty file)
+++ tags/OptionHouse-r669/OptionHouse/changelog.txt Thu Apr 24 22:00:45 2008
@@ -0,0 +1,985 @@
+------------------------------------------------------------------------
+r669 | shadowed.wow | 2008-04-24 21:56:21 -0700 (Thu, 24 Apr 2008) | 3 lines
+
+* You can now open OH through the API's while in combat
+* When using standalone, you can set the OH frame to hide in combat by
default it won't
+* Fixed positioning when using standalone, will account for scale
correctly now
+------------------------------------------------------------------------
+r668 | shadowed.wow | 2008-03-07 16:01:05 -0800 (Fri, 07 Mar 2008) | 2 lines
+
+* Fixed memory calculations, uses 1024 correctly now instead of 1000
+* Fixed a bug with dividing total memory by 1024 when the total memory
was only above 100 instead of when above 1024
+------------------------------------------------------------------------
+r661 | shadowed.wow | 2008-01-12 20:33:14 -0800 (Sat, 12 Jan 2008) | 5 lines
+
+* Changed expansion method, if you select a sub category then select
the category it'll switch to the categories panel instead of collapsing
the sub category
+* Fixed OptionHouse:OpenTab not letting you open the last tab
+* Fixed sortID not accepting strings or numbers, used to only accept numbers
+* Fixed a bug where when you scroll it attempts to reopen the
currently selected frame
+* Added graph checks to tabs so it'll support them
+------------------------------------------------------------------------
+r660 | shadowed.wow | 2007-12-09 11:46:46 -0800 (Sun, 09 Dec 2007) | 1 line
+
+* Fixed an addon missing from the management list but could still be
searched to bring it up
+------------------------------------------------------------------------
+r656 | shadowed.wow | 2007-11-28 13:53:56 -0800 (Wed, 28 Nov 2007) | 1 line
+
+* Fixed a sorting bug where the sortID wouldn't be set if you were
adding a new category with a new set of data that didn't include the
sortID. No longer creates a table just to store sortID as well.
+------------------------------------------------------------------------
+r655 | joshborke | 2007-11-28 12:31:33 -0800 (Wed, 28 Nov 2007) | 1 line
+
+OH: fix sorting bug
+------------------------------------------------------------------------
+r654 | jnwhiteh | 2007-11-28 11:57:05 -0800 (Wed, 28 Nov 2007) | 2 lines
+
+* Fixed two typos from previous commit
+
+------------------------------------------------------------------------
+r653 | jnwhiteh | 2007-11-28 11:55:58 -0800 (Wed, 28 Nov 2007) | 5 lines
+
+OptionHouse:
+* You know whats cool? When your perfmon addon wastes memory
+* L["FOO"] .. string.format() has to be the stupidest thing I've seen
today =(
+* Fixed OptionHouse to use SetFormattedText, and to not create two
garbage strings on every single update. Jeesh
+
+------------------------------------------------------------------------
+r652 | shadowed.wow | 2007-11-18 12:08:56 -0800 (Sun, 18 Nov 2007) | 1 line
+
+* Fixed "Status" under addon management tab not sorting
+------------------------------------------------------------------------
+r651 | jnwhiteh | 2007-11-15 05:40:51 -0800 (Thu, 15 Nov 2007) | 2 lines
+
+* .toc bump for 2.3
+
+------------------------------------------------------------------------
+r642 | shadowed.wow | 2007-11-10 13:25:42 -0800 (Sat, 10 Nov 2007) | 1 line
+
+* Fixed dependency display bug
+------------------------------------------------------------------------
+r638 | shadowed.wow | 2007-10-31 17:02:16 -0700 (Wed, 31 Oct 2007) | 1 line
+
+* Fixed a bug with OnShow not verifying that theres actually a OptionHouseDB
+------------------------------------------------------------------------
+r634 | shadowed.wow | 2007-10-26 12:08:26 -0700 (Fri, 26 Oct 2007) | 1 line
+
+* Okay, NOW it's backwards compatible, also includes a safe-fail
incase sortID manages to become nil when adding it to the categories list
+------------------------------------------------------------------------
+r633 | shadowed.wow | 2007-10-26 12:03:24 -0700 (Fri, 26 Oct 2007) | 5 lines
+
+* Fixed position not being saved correctly
+* Sorting is now supported. Addons are sorted by A-Z regardless of
order loaded, categories and sub categories are also sorted by A-Z,
unless a sort id is passed.
+* API CHANGE, OHObj:RegisterCategory(name, handler/func, func,
noCache, sortID), OHObj:RegisterSubCategory(parentCat, name,
handler/func, func, noCache, sortID)
+
+These are backwards compatabile so the major hasn't been bumped.
+------------------------------------------------------------------------
+r628 | shadowed.wow | 2007-10-15 22:06:43 -0700 (Mon, 15 Oct 2007) | 2 lines
+
+* We refer to OptionHouse as "OptionHouse" not "Option House"
basically every where except for the combat entered message
+* Enforced not being able to open OptionHouse in combat through
OH:Open and OH:OpenTab instead of only when you enter combat, may
revert this later.
+------------------------------------------------------------------------
+r627 | shadowed.wow | 2007-10-05 10:53:41 -0700 (Fri, 05 Oct 2007) | 1 line
+
+* Added moving back and the lock/unlock option
+------------------------------------------------------------------------
+r626 | shadowed.wow | 2007-09-30 13:43:42 -0700 (Sun, 30 Sep 2007) | 2 lines
+
+* Fixed OptionHouse:OpenTab(#) not letting you open the management or
performance tab until OptionHouse had been opened once
+* Fixed positioning of dependencies, if the addon has more then 3
dependencies they shouldn't start overlapping in the management tab
+------------------------------------------------------------------------
+r625 | shadowed.wow | 2007-09-25 19:31:32 -0700 (Tue, 25 Sep 2007) | 2 lines
+
+* It looks like Blizzard fixed doublewide UIPanelLayout-area being
broken so uncommented it
+* If OptionHouse is opened from the game menu, closing OptionHouse
will pull the game menu back up like it does for other game menu panels
+------------------------------------------------------------------------
+r624 | shadowed.wow | 2007-09-25 13:58:04 -0700 (Tue, 25 Sep 2007) | 1 line
+
+* Updated toc to 20200
+------------------------------------------------------------------------
+r623 | shadowed.wow | 2007-09-22 11:47:55 -0700 (Sat, 22 Sep 2007) | 1 line
+
+* Removing OptionHouseFrames as it causes conflict issues and due to
the frame level and such changes you need to be sure you're getting the
right frame
+------------------------------------------------------------------------
+r619 | shadowed.wow | 2007-09-21 01:18:03 -0700 (Fri, 21 Sep 2007) | 2 lines
+
+* Removed the temp DongleStub -> LibStub code, this will be the
version that goes out Tuesday with the World of Warcraft 2.2 patch
being released
+* MAKE SURE YOU UPDATE ALL OF YOUR ADDONS TO USE THIS VERSION, Any
non-LibStub version will not show up in the configuration list
+------------------------------------------------------------------------
+r615 | shadowed.wow | 2007-09-08 14:01:32 -0700 (Sat, 08 Sep 2007) | 1 line
+
+* Fixed an upgrade path issue
+------------------------------------------------------------------------
+r608 | shadowed.wow | 2007-09-05 01:00:03 -0700 (Wed, 05 Sep 2007) | 1 line
+
+* Updated build script to work with LibStub
+------------------------------------------------------------------------
+r604 | shadowed.wow | 2007-09-05 00:35:49 -0700 (Wed, 05 Sep 2007) | 1 line
+
+* Fixed categories not trimming strings to long for the buttons
+------------------------------------------------------------------------
+r603 | mikko.majuri | 2007-09-03 06:46:46 -0700 (Mon, 03 Sep 2007) | 1 line
+
+OH_PerfMon.lua and OH_AddOns.lua bumped to OptionHouse-1.1
+------------------------------------------------------------------------
+r602 | shadowed.wow | 2007-09-02 23:33:46 -0700 (Sun, 02 Sep 2007) | 3 lines
+
+* OptionHouse now uses LibStub, some temp code has been added to merge
any addons added into the OptionHouse-1.0
+* MAJOR HAS BEEN BUMPED, Any LibStub version will now be referred to
as OptionHouse-1.1.
+* Added LibStub as an optional dependency
+------------------------------------------------------------------------
+r601 | joshborke | 2007-09-01 05:26:03 -0700 (Sat, 01 Sep 2007) | 1 line
+
+OptionHouse: fixed typo
+------------------------------------------------------------------------
+r600 | shadowed.wow | 2007-08-31 14:23:22 -0700 (Fri, 31 Aug 2007) | 4 lines
+
+* Fixed some code comments
+* Removed an unneeded return
+* Removed orderID usage, not used anymore
+* Changed private API RegisterFrame to error if you pass an invalid type
+------------------------------------------------------------------------
+r599 | shadowed.wow | 2007-08-30 10:47:10 -0700 (Thu, 30 Aug 2007) | 3 lines
+
+* Fixed configuration not being parented to OH
+* Changed updateConfigList to also open the panel if you pass true as
the first argument
+* Changed OptionHouse:Open(addon, parentCat, subCat) to simply call
updateConfigList to open the frames, this should cause less issues and
work perfectly now
+------------------------------------------------------------------------
+r597 | shadowed.wow | 2007-08-29 15:27:47 -0700 (Wed, 29 Aug 2007) | 1 line
+
+* Removed reset filters button, it seems rather pointless and just
wastes space
+------------------------------------------------------------------------
+r593 | shadowed.wow | 2007-08-28 18:13:30 -0700 (Tue, 28 Aug 2007) | 1 line
+
+* Fixed OptionHouse:Open not opening categories with sub categories
+------------------------------------------------------------------------
+r592 | tekkub | 2007-08-28 16:58:54 -0700 (Tue, 28 Aug 2007) | 1 line
+
+OptionHouse - Shoving everything up to DIALOG strata
+------------------------------------------------------------------------
+r591 | shadowed.wow | 2007-08-24 21:22:20 -0700 (Fri, 24 Aug 2007) | 1 line
+
+* OptionHouse:Open() actually works now, promise
+------------------------------------------------------------------------
+r590 | shadowed.wow | 2007-08-24 14:16:08 -0700 (Fri, 24 Aug 2007) | 1 line
+
+* Trying out a fix for category text trimming so it doesn't overflow
+------------------------------------------------------------------------
+r589 | shadowed.wow | 2007-08-23 21:33:19 -0700 (Thu, 23 Aug 2007) | 2 lines
+
+* Fixed a few scroll functions not being actual functions and instead
anonymous ones
+* Added OptionHouseFrames[type] for usage when you can't/don't want to
create a new instance of OptionHouse just to call :GetFrame()
+------------------------------------------------------------------------
+r588 | shadowed.wow | 2007-08-22 16:04:56 -0700 (Wed, 22 Aug 2007) | 1 line
+
+* Formatting addon.name into the argcheck was kind of
pointless...because the argcheck is only called if addon.name is nil,
corrected to use the function name instead
+------------------------------------------------------------------------
+r587 | shadowed.wow | 2007-08-20 13:35:47 -0700 (Mon, 20 Aug 2007) | 1 line
+
+* Removed the code for loading LoD deps as the game does it by default
+------------------------------------------------------------------------
+r586 | shadowed.wow | 2007-08-20 13:29:32 -0700 (Mon, 20 Aug 2007) | 3 lines
+
+* Added a small flag so the performance/acp list is populated then the
frames shown, to make it easier to detect that the data is usable
+* Removed an old localization thats no longer in used
+* Clarified private api comment
+------------------------------------------------------------------------
+r582 | shadowed.wow | 2007-08-18 09:46:17 -0700 (Sat, 18 Aug 2007) | 1 line
+
+* Fixed an error if an addon has a dependency listed thats not included
+------------------------------------------------------------------------
+r581 | shadowed.wow | 2007-08-17 21:16:36 -0700 (Fri, 17 Aug 2007) | 5 lines
+
+* /oh <addon> will now work for opening the page with the passed addon
+* Fixed OptionHouse:Open and all of the OptionHouse:Register*
functions that were still using the old frame names
+* Dependency filtering works now, the dependencies are colored by
status (Green means LoD, Orange means not LoD and was disabled and so
on), works the same as modules. Click on a dependency to filter by it,
click on it again to reset
+* Fixed sub category count not being reduced correctly when removing a category
+* Fixed all the remaining bugs with OptionHouse:RemoveCategory and
OptionHouse:RemoveSubCategory, you can now remove everything cleanly
and it'll correctly duplicate the behaviors as if it was never
registered in the first place, if you remove all of the addons
categories/sub categories the addon wont be listed anymore until you
add another category
+------------------------------------------------------------------------
+r580 | shadowed.wow | 2007-08-17 16:05:05 -0700 (Fri, 17 Aug 2007) |
11 lines
+
+* Removed modules, didn't work so well
+* All addons dependencies are now listed, you can filter by them by
clicking same with the old modules to only show other addons that are
dependent on it
+* Cleaned up dependency checking code to use the new table we have
+* Removed dependencies from tooltip since it's listed on the main window
+* Removed addonName from rows, easier to use it as addon since we
don't require a numeric id
+* Added reset filter button, ReloadUI was shifted one spot to the left
+* Clarified UNKNOWN_TAB and CATEGORY_ALREADYREG error, removed TOTAL_CATEGORIES
+* Formatting change to some code for consistency
+* Moved SetID/SetScript to when the tab is created, no sense in
calling it all the time
+* Fixed removeCategoryListing so it'll actually work when removing
multiple rows
+* Changed removeSubCategoryListing to use the same table.remove method
as everything else
+------------------------------------------------------------------------
+r579 | shadowed.wow | 2007-08-17 01:07:48 -0700 (Fri, 17 Aug 2007) | 3 lines
+
+* Removed FRAME_DRAGGING localization text, unneeded
+* Removed data.frame.time = GetTime() code, should have been removed
in r460
+* Moved the slider "border" graphic to scroll.barUpTexture and
scroll.barDownTexture so we can customize positioning
+------------------------------------------------------------------------
+r578 | shadowed.wow | 2007-08-16 22:52:02 -0700 (Thu, 16 Aug 2007) | 4 lines
+
+* Changed title strip code slightly
+* Reverted module to using folder name not title
+* Fixed "Show all addons" not working
+* Modules -> Module
+------------------------------------------------------------------------
+r577 | shadowed.wow | 2007-08-16 14:56:47 -0700 (Thu, 16 Aug 2007) | 2 lines
+
+* Fixed a bug when enabling all children of an addon
+* Fixed a bug when asking for confirmation for the above
+------------------------------------------------------------------------
+r573 | shadowed.wow | 2007-08-15 20:11:44 -0700 (Wed, 15 Aug 2007) | 1 line
+
+* Oops, small bug that was causing the buttons for performance to not show
+------------------------------------------------------------------------
+r572 | shadowed.wow | 2007-08-15 20:08:29 -0700 (Wed, 15 Aug 2007) | 4 lines
+
+* Everything actually works now
+* Fixed performance alignment
+* Fixed cpu/memory per a second spiking for a second when the frames
first shown
+* Tweaked positioning of elements in the performance column
+------------------------------------------------------------------------
+r571 | shadowed.wow | 2007-08-15 16:21:56 -0700 (Wed, 15 Aug 2007) | 1 line
+
+* Oops, was formatting wrong variable in for MiR
+------------------------------------------------------------------------
+r570 | shadowed.wow | 2007-08-15 16:01:31 -0700 (Wed, 15 Aug 2007) | 2 lines
+
+* Fixed a bug that was causing Mac's to crash due to an invalid max value
+* Changed Memory/sec -> Mem/sec
+------------------------------------------------------------------------
+r569 | JoshBorke | 2007-08-15 15:47:57 -0700 (Wed, 15 Aug 2007) | 1 line
+
+OptionHouse/OH_PerfMon.lua: fixed typo
+------------------------------------------------------------------------
+r568 | shadowed.wow | 2007-08-15 14:58:50 -0700 (Wed, 15 Aug 2007) | 7 lines
+
+* Removed the frame name variables that didn't get cleaned up
+* Fixed a global variable in OH_PerfMon.lua
+* Fixed some bad variables names in OH_AddOns.lua and OH_PerfMon.lua
+* Improved addon table creation for OH_AddOns.lua the entire addons
table is only populated once and then individual addons are updated
when needed
+* Added status for Load on Demand addons that are already loaded
+* Added parent addon detection.
+For example LightHeaded, LightHeaded_A20_Data, LightHeaded_A40_Data.
A20_Data and A40_Data are children of LightHeaded you can only show
addons that are children of LightHeaded by clicking on
the "LightHeaded" text in the parent column, you can also sort by
parent just like name and status
+------------------------------------------------------------------------
+r567 | shadowed.wow | 2007-08-15 07:00:10 -0700 (Wed, 15 Aug 2007) | 1 line
+
+* Fixed results of a search being shown at the bottom
+------------------------------------------------------------------------
+r566 | JoshBorke | 2007-08-15 04:42:37 -0700 (Wed, 15 Aug 2007) | 1 line
+
+OptionHouse: fixed leaked global
+------------------------------------------------------------------------
+r565 | shadowed.wow | 2007-08-14 22:34:13 -0700 (Tue, 14 Aug 2007) | 1 line
+
+* Added in total memory and total CPU onto the sort bar things,
positioning is messed up, I'll pretend I don't know about it and hope
someone else (Josh) fixes it
+------------------------------------------------------------------------
+r564 | shadowed.wow | 2007-08-14 20:23:33 -0700 (Tue, 14 Aug 2007) | 1 line
+
+* Now I remember why we needed that "or 1" part
+------------------------------------------------------------------------
+r560 | shadowed.wow | 2007-08-14 17:34:58 -0700 (Tue, 14 Aug 2007) | 1 line
+
+* Fixed performance monitor
+------------------------------------------------------------------------
+r559 | shadowed.wow | 2007-08-14 11:02:30 -0700 (Tue, 14 Aug 2007) | 3 lines
+
+* All frames are now unnamed (yay!)
+* Moved all scroll frames to the new system
+* New private APIs, OptionHouse:CreateScroll(parentFrame,
displayedNum, updateFunc) and OptionHouse:UpdateScroll(scrollFrame, totalRows)
+------------------------------------------------------------------------
+r558 | shadowed.wow | 2007-08-13 23:37:41 -0700 (Mon, 13 Aug 2007) | 1 line
+
+* Would cry if I lost the SF at this point
+------------------------------------------------------------------------
+r557 | shadowed.wow | 2007-08-13 20:53:17 -0700 (Mon, 13 Aug 2007) | 1 line
+
+* Everything previous commit is actually true now
+------------------------------------------------------------------------
+r556 | shadowed.wow | 2007-08-13 16:37:30 -0700 (Mon, 13 Aug 2007) | 3 lines
+
+* Fixed most of the inconsistencies for code formatting
+* Added a new feature that will enable all the children of an addon,
for example if you enable BigWigs you'll be asked if you want to enable
all of the BigWigs_* modules, like dependencies you can set this to
always ask, always enable, never enable
+* In theory all this stuff works fine, in practice OH is now horribly broken
+------------------------------------------------------------------------
+r555 | shadowed.wow | 2007-08-13 14:36:32 -0700 (Mon, 13 Aug 2007) | 2 lines
+
+* Using "Disable All" will keep OptionHouse enabled, you can still
disable it manually through the addon control panel
+* If a load on demand addon has load on demand dependencies then the
dependencies are automatically loaded then the addon
+------------------------------------------------------------------------
+r554 | shadowed.wow | 2007-08-13 07:58:47 -0700 (Mon, 13 Aug 2007) | 3 lines
+
+* Fixed highlight texture not resizing width
+* Tabs wont show the highlight texture when selected now
+* Tabs font color is white when selected and goldish when unselected (HIGHLIGHT_FONT_COLOR/NORMAL_FONT_COLOR)
+------------------------------------------------------------------------
+r553 | shadowed.wow | 2007-08-12 23:35:44 -0700 (Sun, 12 Aug 2007) | 1 line
+
+* Tabs now use our own system and are have been moved to being unnamed
+------------------------------------------------------------------------
+r552 | shadowed.wow | 2007-08-12 22:23:34 -0700 (Sun, 12 Aug 2007) | 2 lines
+
+* All of the frames except for tabs, FSF and main OptionHouse are unnamed
+* New API OptionHouse:GetFrame() accepts main, addon, manage, perf
these should be used in place of directly referencing a frame
+------------------------------------------------------------------------
+r551 | tekkub | 2007-08-12 17:57:44 -0700 (Sun, 12 Aug 2007) | 1 line
+
+OptionHouse - Seems "doublewide" is bugged, workaround until slouken
implements a fix
+------------------------------------------------------------------------
+r550 | shadowed.wow | 2007-08-12 13:45:00 -0700 (Sun, 12 Aug 2007) | 3 lines
+
+* Fixed OptionHouse not working correctly as an UI frame meaning no
more overlapping errors
+* Because OptionHouse is now a UI frame the ability to move it has
been removed
+* If an addon has dependencies that aren't load on demand, the "Load"
button wont show up and the text will be in orange
+------------------------------------------------------------------------
+r546 | shadowed.wow | 2007-08-10 20:32:07 -0700 (Fri, 10 Aug 2007) | 1 line
+
+* Everything I said previous commit log is actually true now
+------------------------------------------------------------------------
+r545 | shadowed.wow | 2007-08-10 14:06:32 -0700 (Fri, 10 Aug 2007) | 4 lines
+
+* Changed createRows to only create the test font string when it
doesn't exist already
+* updateManageList is called in createManageList, it was pointless to
have to call them seperately
+* Removed all of the remaining globals, only ones remaining are the
main frames, scroll frames and tabs
+* Code cleanup
+------------------------------------------------------------------------
+r544 | shadowed.wow | 2007-08-09 23:32:38 -0700 (Thu, 09 Aug 2007) | 1 line
+
+Ninja fix, close button works, clad will never know
+------------------------------------------------------------------------
+r540 | shadowed.wow | 2007-08-09 23:01:42 -0700 (Thu, 09 Aug 2007) | 7 lines
+
+* Removed texture names for the frame textures
+* Removed filter button names for addon configuration
+* Removed SetTexture call when frames initialized
+* Enable dependencies window will only show if the dependencies aren't
already enabled
+* Added number of dependencies being enabled
+* Changed the tooltip for the configuration to show if author OR
version exists instead of both
+* Fixed the registered OptionHouse version not being converted
+------------------------------------------------------------------------
+r539 | shadowed.wow | 2007-08-09 12:20:17 -0700 (Thu, 09 Aug 2007) | 1 line
+
+* Fixed the resort flag not being nilled after the sort
+------------------------------------------------------------------------
+r538 | shadowed.wow | 2007-08-08 19:14:26 -0700 (Wed, 08 Aug 2007) | 3 lines
+
+* All the features actually work now
+* Notes will correctly show up
+* Mod name in the tooltip is colored white to stand out more and look better
+------------------------------------------------------------------------
+r537 | shadowed.wow | 2007-08-08 14:54:36 -0700 (Wed, 08 Aug 2007) | 3 lines
+
+* Rows are used as needed, meaning you can change the text size and
see the results without a UI reload
+* When enabling an addon, if it has any dependencies they'll be
enabled you can change this to always enable, never enable or ask
through configuration
+* Some small code tweaks
+------------------------------------------------------------------------
+r536 | tekkub | 2007-08-07 00:55:19 -0700 (Tue, 07 Aug 2007) | 1 line
+
+OptionHouse - Fixed panel options and sorting for reals, shadowed
can't do anything right
+------------------------------------------------------------------------
+r535 | shadowed.wow | 2007-08-06 15:07:25 -0700 (Mon, 06 Aug 2007) | 1 line
+
+* Fixed title sorting not calling string.lower
+------------------------------------------------------------------------
+r534 | shadowed.wow | 2007-08-06 15:03:17 -0700 (Mon, 06 Aug 2007) | 2 lines
+
+* Changed OH to use the same window mode as AuctionHouse frame meaning
it'll close other frames when opened
+* Added mod notes to ACP tooltip
+------------------------------------------------------------------------
+r530 | shadowed.wow | 2007-08-01 20:33:31 -0700 (Wed, 01 Aug 2007) | 1 line
+
+* Fixed a bug that was causing the addons saved and the actual frame
from being updated when called in response to a tab being clicked
+------------------------------------------------------------------------
+r526 | JoshBorke | 2007-07-18 19:49:19 -0700 (Wed, 18 Jul 2007) | 4 lines
+
+OptionHouse:
+- dtw
+- don't StartMoving if frame isn't movable
+- fix RemoveSubCategory
+------------------------------------------------------------------------
+r525 | shadowed.wow | 2007-07-18 17:33:25 -0700 (Wed, 18 Jul 2007) | 1 line
+
+* Fixed locking/unlocking the frame not actually doing anything
+------------------------------------------------------------------------
+r521 | shadowed.wow | 2007-07-10 17:40:27 -0700 (Tue, 10 Jul 2007) | 2 lines
+
+* Fixed Build.lua
+* Fixed sorting not doing a string.lower
+------------------------------------------------------------------------
+r520 | shadowed.wow | 2007-07-10 00:58:11 -0700 (Tue, 10 Jul 2007) | 2 lines
+
+* All font options will work now, the configuration should be fully usable
+* Moving works, if you have standalone it'll save the positioning you
can right click to reset it to the standard one, you can drag it using
the title bar where "Option House" text is located
+------------------------------------------------------------------------
+r519 | shadowed.wow | 2007-07-09 20:10:24 -0700 (Mon, 09 Jul 2007) | 3 lines
+
+* Fixed a couple of bugs in the configuration, they'll actually show
and position correctly now
+* Fixed tab registering/unregistering, so it actually works now
+* Fixed a couple of sorting bugs in filters, it'll only do addons
still due to other bugs that need to be worked out
+------------------------------------------------------------------------
+r518 | shadowed.wow | 2007-07-09 17:25:07 -0700 (Mon, 09 Jul 2007) | 5 lines
+
+* Code clean up, fixed some functions using func( foo, bar ) instead
of func(foo, bar)
+* Added removeCategoryListing and removeSubCategoryListing so we don't
have to re-create the entire list on a remove
+* Added sorting back in, addon listings will be sorted by a-z order,
categories and sub categories sorted in the order they were added
+* Changed the logic in openConfigFrame, no need to check data.frame
when it can be done once and throw an error if none is found
+* Fixed a couple of errors in configuration
+------------------------------------------------------------------------
+r517 | tekkub | 2007-07-09 17:14:11 -0700 (Mon, 09 Jul 2007) | 1 line
+
+OptionHouse - Why not sort the perf tab by title instead of name, for
consistency with the addon tab and the charselect addon panel
+------------------------------------------------------------------------
+r516 | shadowed.wow | 2007-07-09 16:46:31 -0700 (Mon, 09 Jul 2007) | 3 lines
+
+* Fixed the MiR and CiR values, will do new - old now instead of
abs(old - new) meaning you'll see negative values if memory or CPU
usage dropped
+* UI Should be fixed and will show up now, also fixed positioning
errors (hopefully)
+* Added an option to lock the OptionHouse window, haven't actually
implemented the code to do this just the configuration
+------------------------------------------------------------------------
+r515 | shadowed.wow | 2007-07-06 19:04:08 -0700 (Fri, 06 Jul 2007) | 3 lines
+
+Added some quick checks in so if you don't pass a handler or a
function it'll error on the RegisterCategory/Subcategory
+Changed tab order to Management -> Performance
+Fixed an error in OH_Configuration.lua, it still doesn't work the
frame isn't being shown, not really sure why right now
+------------------------------------------------------------------------
+r514 | shadowed.wow | 2007-07-06 12:16:18 -0700 (Fri, 06 Jul 2007) | 3 lines
+
+* Added OptionHouse:UnregisterTab(text) so we can remove the tabs when
people disable/enable them
+* Changed the "security" checking to only accept tabs with the text
Management or Performance, to make life easier
+* Added in all of the base code + configuration to OptionHouse, it
should unregister/register tabs just fine but the font size doesn't
work yet
+------------------------------------------------------------------------
+r513 | shadowed.wow | 2007-07-06 08:55:14 -0700 (Fri, 06 Jul 2007) | 1 line
+
+Adding base files for configs
+------------------------------------------------------------------------
+r512 | shadowed.wow | 2007-07-04 22:20:43 -0700 (Wed, 04 Jul 2007) | 1 line
+
+* Fixed a couple of bugs where OptionHouse wouldn't update the filter
listing if you loaded an addon with either OH hidden or you're using
management or performance tab instead
+------------------------------------------------------------------------
+r511 | shadowed.wow | 2007-07-04 14:33:45 -0700 (Wed, 04 Jul 2007) | 1 line
+
+* Improved the filter display code, will no longer create a table per
every row every time you expand/collapse or search on something
+------------------------------------------------------------------------
+r510 | jnwhiteh | 2007-07-04 10:47:01 -0700 (Wed, 04 Jul 2007) | 4 lines
+
+* Added preliminary win32 support. This affects:
+ - copy instead of cp
+ - using the win32 path separator instead of unix
+
+------------------------------------------------------------------------
+r506 | shadowed.wow | 2007-07-03 21:23:23 -0700 (Tue, 03 Jul 2007) | 1 line
+
+Moved to a more reliable method of preventing people from registering
tabs with OptionHouse.
+------------------------------------------------------------------------
+r502 | jnwhiteh | 2007-07-03 12:20:24 -0700 (Tue, 03 Jul 2007) | 2 lines
+
+* Ensure we do a file-level copy of the graphic
+
+------------------------------------------------------------------------
+r501 | shadowed.wow | 2007-07-03 12:20:17 -0700 (Tue, 03 Jul 2007) | 1 line
+
+Fixed KiB/s and MiB/s used for CPU, it shouldn't be anything since
it's seconds increased CPU time used.
+------------------------------------------------------------------------
+r500 | jnwhiteh | 2007-07-03 11:57:04 -0700 (Tue, 03 Jul 2007) | 2 lines
+
+* Verbiage fix for the library import
+
+------------------------------------------------------------------------
+r496 | jnwhiteh | 2007-07-03 11:55:27 -0700 (Tue, 03 Jul 2007) | 2 lines
+
+* Change the build process to include the full OptionHouse.lua file
+
+------------------------------------------------------------------------
+r495 | jnwhiteh | 2007-07-03 11:53:25 -0700 (Tue, 03 Jul 2007) | 2 lines
+
+* Fix an issue where the build script would not build the library properly
+
+------------------------------------------------------------------------
+r492 | jnwhiteh | 2007-07-03 11:47:13 -0700 (Tue, 03 Jul 2007) | 2 lines
+
+* Fix build script to generate proper import commands
+
+------------------------------------------------------------------------
+r486 | jnwhiteh | 2007-07-03 11:39:39 -0700 (Tue, 03 Jul 2007) | 3 lines
+
+* Adding a simple untested build script
+* Attempt to fix the issues with issecurevariable()
+
+------------------------------------------------------------------------
+r482 | jnwhiteh | 2007-07-03 06:27:28 -0700 (Tue, 03 Jul 2007) | 5 lines
+
+* Never, ever, ever just copy DongleStub into a file. We don't work
that way.
+* Added DongleStub.lua from branches/Dongle-1.1 to OptionHouse
+* Added DongleStub.lua to the .toc file
+* Version numbers should be meaningful, the revision number in
the .toc is useless.. use the major version number.
+
+------------------------------------------------------------------------
+r481 | shadowed.wow | 2007-07-02 20:31:11 -0700 (Mon, 02 Jul 2007) | 1 line
+
+Not including DongleStub was probably bad.
+------------------------------------------------------------------------
+r480 | shadowed.wow | 2007-07-02 19:56:46 -0700 (Mon, 02 Jul 2007) | 1 line
+
+Cleaned up TOC data
+------------------------------------------------------------------------
+r479 | shadowed.wow | 2007-07-02 19:47:56 -0700 (Mon, 02 Jul 2007) | 1 line
+
+Fixed OptionHouse:OpenTab(id) not working, FOR REAL this time, also
fixed a typo in the error message when you try to request an unknown tab
+------------------------------------------------------------------------
+r478 | shadowed.wow | 2007-07-02 17:24:31 -0700 (Mon, 02 Jul 2007) | 3 lines
+
+Removed usage of arg1 in OH_PerfMon.lua
+Fixed a bug in OptionHouse:OpenTab(id) that was calling tabOnClick(id)
THEN createOHFrame() instead of createOHFrame() first.
+Clarified some code comments
+------------------------------------------------------------------------
+r477 | shadowed.wow | 2007-07-02 14:59:08 -0700 (Mon, 02 Jul 2007) | 1 line
+
+Fixed a bug in enable/disable all that was preventing the check boxes
from checking or unchecking.
+------------------------------------------------------------------------
+r476 | shadowed.wow | 2007-07-01 12:13:51 -0700 (Sun, 01 Jul 2007) | 1 line
+
+Fixed OptionHouse not updating correctly when a new revision is found
+------------------------------------------------------------------------
+r475 | shadowed.wow | 2007-06-30 20:06:39 -0700 (Sat, 30 Jun 2007) | 1 line
+
+Fixed the couple of remaining cases where frames didn't get hidden in
the addons tab.
+------------------------------------------------------------------------
+r474 | shadowed.wow | 2007-06-30 16:09:50 -0700 (Sat, 30 Jun 2007) | 1 line
+
+Changed sub categories tooltip to only display it if the category
itself has any sub categories and not just the addon.
+------------------------------------------------------------------------
+r473 | shadowed.wow | 2007-06-27 14:04:11 -0700 (Wed, 27 Jun 2007) | 1 line
+
+Added some quick validation to OptionHouse:OpenTab() so you can't open
one that doesn't exist.
+------------------------------------------------------------------------
+r472 | shadowed.wow | 2007-06-26 20:35:01 -0700 (Tue, 26 Jun 2007) | 4 lines
+
+Fixed sorting in management frame to actually work, also fixed sorting
going by colors not the actual title itself.
+Fixed tooltips in management
+Fixed the addon panels not showing and throwing an error
+Added OptionHouse:GetAddOnData back
+------------------------------------------------------------------------
+r471 | JoshBorke | 2007-06-26 20:14:12 -0700 (Tue, 26 Jun 2007) | 2 lines
+
+OptionHouse:
+- attempted fix for tainting stuff
+------------------------------------------------------------------------
+r470 | JoshBorke | 2007-06-25 20:54:11 -0700 (Mon, 25 Jun 2007) | 6 lines
+
+OptionHouse:
+- fix bugs introduced by Shadowed's recent changes
+- issecurevariable checks RegisterTab instead of self now
+- revert new syntax for CreateTab until shadowed fixes it better
+- check for existence of addon in OH_AddOns
+- delete trailing white spaces
+------------------------------------------------------------------------
+r469 | shadowed.wow | 2007-06-25 15:40:50 -0700 (Mon, 25 Jun 2007) | 2 lines
+
+Cleaned up code in OptionHouse.lua
+Moved the addon list in management to when you search, new addon
loaded, enabled/disabled or loaded something instead of whenever you
resort, scroll and basically anything.
+------------------------------------------------------------------------
+r468 | shadowed.wow | 2007-06-24 19:39:06 -0700 (Sun, 24 Jun 2007) | 1 line
+
+Testing validation stuff
+------------------------------------------------------------------------
+r467 | shadowed.wow | 2007-06-24 19:30:14 -0700 (Sun, 24 Jun 2007) | 1 line
+
+Added issecurevariable checking so only OptionHouse modules can
register tabs, create search inputs or get addon data.
+------------------------------------------------------------------------
+r462 | JoshBorke | 2007-06-23 10:55:05 -0700 (Sat, 23 Jun 2007) | 2 lines
+
+OptionHouse:
+- sort addons ascending by name by default
+------------------------------------------------------------------------
+r461 | JoshBorke | 2007-06-21 15:05:20 -0700 (Thu, 21 Jun 2007) | 1 line
+
+OptionHouse: no longer have lines with extraneous whitespace
+------------------------------------------------------------------------
+r460 | shadowed.wow | 2007-06-21 14:44:09 -0700 (Thu, 21 Jun 2007) | 5 lines
+
+Josh is whiny, moved expanded categories too a separate function
called on expand/search
+Fixed a couple of callback issues due to code changes
+Added OptionHouse title too the top bar
+Frame level changed to MEDIUM for OH and HIGH for addon registered
pages, need to play around with it still
+Probably did some other things, but if I didn't remember them not
really important
+------------------------------------------------------------------------
+r459 | shadowed.wow | 2007-06-21 00:16:50 -0700 (Thu, 21 Jun 2007) | 5 lines
+
+Fixed addons tab, everything will work correctly now.
+Changed Joshs formatting, he sucks
+Changed the name for performance/management too title and not addon name
+Did some other stuff, probably not importent
+NTS: Add validation
+------------------------------------------------------------------------
+r458 | JoshBorke | 2007-06-20 19:00:37 -0700 (Wed, 20 Jun 2007) | 4 lines
+
+OptionHouse:
+- added Status to Addons
+- fixed the tabs to show properly
+- addon option handlers aren't being called
+------------------------------------------------------------------------
+r457 | shadowed.wow | 2007-06-20 17:54:06 -0700 (Wed, 20 Jun 2007) | 1 line
+
+Fixes before heading home
+------------------------------------------------------------------------
+r456 | shadowed.wow | 2007-06-20 16:27:38 -0700 (Wed, 20 Jun 2007) | 5 lines
+
+Fuck trying to manage what data I want using numbers, changed all of
the expandedCategories info to stored by keys for sanity.
+Changed the expanding code to store the data array instead of setting
4-5 variables to the button
+OptionHouse:Open("addon", "cat", "subCat") should be back and actually
working now
+Cleaned up the configuration showing code so it can be used in areas
besides when a button is clicked
+Added a tooltip to the buttons on configuration, will show
title/version/author on the configuration buttons, and will also show
sub categories count when mousing over a category.
+------------------------------------------------------------------------
+r455 | shadowed.wow | 2007-06-20 13:15:08 -0700 (Wed, 20 Jun 2007) | 1 line
+
+Renamed tabs, AddOn Configuration -> Addons, AddOn Management ->
Management, AddOn Performance -> Performance.
+------------------------------------------------------------------------
+r454 | shadowed.wow | 2007-06-20 12:12:14 -0700 (Wed, 20 Jun 2007) | 1 line
+
+Split OH off to modules, untested but it's the basic idea code-wise of
what they'll look like, making sure the APIs are actually private needs
to be done still (cause clad fails).
+------------------------------------------------------------------------
+r453 | shadowed.wow | 2007-06-19 17:44:49 -0700 (Tue, 19 Jun 2007) | 1 line
+
+Added argument passing to the registered functions, note that they
will pass "" instead of nil for sub categories if none is there for now
due to lazyness
+------------------------------------------------------------------------
+r452 | shadowed.wow | 2007-06-19 17:14:22 -0700 (Tue, 19 Jun 2007) | 1 line
+
+Added category/sub category passing to the registered functions,
probably broken but Josh is a whiner.
+------------------------------------------------------------------------
+r451 | shadowed.wow | 2007-06-18 22:09:31 -0700 (Mon, 18 Jun 2007) | 1 line
+
+Icon will be used if standalone is found, added new files for the
basic stuff, cladhaire fails at issecurevariable.
+------------------------------------------------------------------------
+r450 | shadowed.wow | 2007-06-18 11:12:17 -0700 (Mon, 18 Jun 2007) | 3 lines
+
+Stupid Mikma breaking stuff.
+
+Fixed #959 and #983 errors
+------------------------------------------------------------------------
+r449 | shadowed.wow | 2007-06-18 10:49:57 -0700 (Mon, 18 Jun 2007) | 1 line
+
+Changed to upvalue (Josh fails)
+------------------------------------------------------------------------
+r448 | shadowed.wow | 2007-06-18 10:41:05 -0700 (Mon, 18 Jun 2007) | 1 line
+
+expandedCategories changed too OptionHouseOptionsFrame.expanded,
re-used instead of re-created every time in updateConfigList().
+------------------------------------------------------------------------
+r447 | shadowed.wow | 2007-06-18 10:28:03 -0700 (Mon, 18 Jun 2007) | 1 line
+
+Cleaned up more of the code formatting, split off category sorting to
a separate function thats only ran when OptionHouseOptionFrame is
created, or when a new addon is registered.
+------------------------------------------------------------------------
+r446 | shadowed.wow | 2007-06-17 17:33:14 -0700 (Sun, 17 Jun 2007) | 1 line
+
+Title will use the one from GetAddOnInfo if nothing is registered with
OH when displaying tooltip info, also the tooltip will add the data as
it comes meaning it can show title/version even without author, or
title/author/dependencies with no version found.
+------------------------------------------------------------------------
+r445 | shadowed.wow | 2007-06-17 16:45:37 -0700 (Sun, 17 Jun 2007) | 3 lines
+
+Added OHObject:RemoveCategory( "name" ) and
OHObject:RemoveSubCategory( "parentCat", "name" ) for addons that use
profiles, eg ItemRack type of things.
+Fixed a couple of assert validation types of errors in the Register* functions.
+Fixed sorting on the category panel
+------------------------------------------------------------------------
+r444 | shadowed.wow | 2007-06-17 12:36:26 -0700 (Sun, 17 Jun 2007) | 2 lines
+
+Fixed numbers not being a valid type when passing version in RegisterAddOn
+OH was positioning frames incorrectly, they'll actually move when OH
is moved now.
+------------------------------------------------------------------------
+r443 | shadowed.wow | 2007-06-16 21:10:03 -0700 (Sat, 16 Jun 2007) | 5 lines
+
+Fixed performance sorting using mir instead of cir for cir sorting.
+Fixed a search being done on the category when only one category and
no sub categories exist
+Fixed dependencies not showing (you need to return apparently)
+Added : after Option House in ENTERED_COMBAT, forgot to.
+Cleaned up some of the loops for sorting creation
+------------------------------------------------------------------------
+r442 | jnwhiteh | 2007-06-16 20:30:34 -0700 (Sat, 16 Jun 2007) | 2 lines
+
+* Removing the local copy of DongleStub.lua
+
+------------------------------------------------------------------------
+r441 | shadowed.wow | 2007-06-16 19:15:36 -0700 (Sat, 16 Jun 2007) | 1 line
+
+Removed the portrait and replaced it with the characters since embeds
can't use TGAs because authors are more bitchy then users
+------------------------------------------------------------------------
+r440 | shadowed.wow | 2007-06-16 17:02:06 -0700 (Sat, 16 Jun 2007) | 3 lines
+
+Added sorting to the management frame, can sort by status or name,
fixed a couple of reasons not displaying, cleaned up the color code too.
+The reason text will move to the position "Load" is if it's not a LoD addon.
+Added dependencies to the tooltip on addon management
+------------------------------------------------------------------------
+r439 | tekkub | 2007-06-16 11:36:41 -0700 (Sat, 16 Jun 2007) | 1 line
+
+Moving OptionHouse to trunk
+------------------------------------------------------------------------
+r438 | shadowed.wow | 2007-06-15 23:00:20 -0700 (Fri, 15 Jun 2007) | 3 lines
+
+Fixed size validation, positioning will work now it was off by around
105 y, OH will now force the OptionHouseOptionsFrame to be the parent
of configuration frames
+Fixed OH not getting any data from addons that are registered with it
in the management page
+Management page is broken since it doesn't fully implement all the
reasons (Damn Tekkub)
+------------------------------------------------------------------------
+r437 | shadowed.wow | 2007-06-15 18:11:06 -0700 (Fri, 15 Jun 2007) | 1 line
+
+Fixed size tests, height was being changed if it was > 305 instead of
630, and width was being changed if it was > 630 instead of 305.
+------------------------------------------------------------------------
+r436 | shadowed.wow | 2007-06-15 16:22:33 -0700 (Fri, 15 Jun 2007) | 1 line
+
+Changed this -> self, anything thats broken is Tekkubs fault.
+------------------------------------------------------------------------
+r435 | shadowed.wow | 2007-06-15 16:10:53 -0700 (Fri, 15 Jun 2007) | 1 line
+
+Bumped major to OptionHouse-1.0, pray and hope we never need to change
the API.
+------------------------------------------------------------------------
+r434 | shadowed.wow | 2007-06-15 16:01:53 -0700 (Fri, 15 Jun 2007) | 1 line
+
+Fixed major number, OptionHouse-Alpha0.1 now
+------------------------------------------------------------------------
+r433 | shadowed.wow | 2007-06-15 15:56:27 -0700 (Fri, 15 Jun 2007) | 1 line
+
+Fixed the open configuration panel not hiding when switching tabs
+------------------------------------------------------------------------
+r432 | tekkub | 2007-06-15 15:52:45 -0700 (Fri, 15 Jun 2007) | 1 line
+
+OptionHouse - KB --> KiB, MB --> MiB
+------------------------------------------------------------------------
+r431 | shadowed.wow | 2007-06-15 15:23:49 -0700 (Fri, 15 Jun 2007) | 3 lines
+
+Added OptionHouse:OpenTab( 1-3 ) (1 config/2 manage/3 perf)
+/oh will accept arguments, meaning you can do /oh SSPVP to open the
SSPVP category, or /oh Panda to open the Panda category.
+Removed the tabOnClick calls in createOHFrame moved them to
OptionHouse:Open() and OptionHouse:OpenTab()
+------------------------------------------------------------------------
+r430 | shadowed.wow | 2007-06-15 15:06:09 -0700 (Fri, 15 Jun 2007) | 1 line
+
+In theory, you can now do OptionHouse:Open( [addon][, category][,
subcategory] ) to specify what configuration is shown at the start.
+------------------------------------------------------------------------
+r429 | shadowed.wow | 2007-06-15 14:42:29 -0700 (Fri, 15 Jun 2007) | 1 line
+
+Changed major to OptionHouse-Alpha0.1
+------------------------------------------------------------------------
+r428 | shadowed.wow | 2007-06-15 13:28:26 -0700 (Fri, 15 Jun 2007) | 1 line
+
+Not needed anymore
+------------------------------------------------------------------------
+r427 | shadowed.wow | 2007-06-15 13:28:07 -0700 (Fri, 15 Jun 2007) | 2 lines
+
+Fixed enable check box for ms.whiny mc whine pants
+Fixed a couple lines of code and changed the formatting used for some
of them.
+------------------------------------------------------------------------
+r426 | shadowed.wow | 2007-06-14 18:53:24 -0700 (Thu, 14 Jun 2007) | 1 line
+
+Auto-frame positioning will only happen if GetPoint() returns nil,
also changed the frame size setting too only happen if it's wider then
630 or higher then 305, or if the current width and/or height are 0.
+------------------------------------------------------------------------
+r425 | shadowed.wow | 2007-06-14 18:09:33 -0700 (Thu, 14 Jun 2007) | 3 lines
+
+Fixed the addon configuration page, made it sort the addons by alpha,
the category listing will reset when you change panels too.
+Added in default positioning (TOPLEFT, 190, -103) and height/width (630/305)
+Cleaned up the configuration code and fixed a few bugs in the search
+------------------------------------------------------------------------
+r424 | shadowed.wow | 2007-06-14 15:53:48 -0700 (Thu, 14 Jun 2007) | 2 lines
+
+Performance/management pages will work, management will register
ADDON_LOADED now too, you can mouseover addons in management to view
the full title/version/author, will make it support the OH title also
if it exists.
+Options broken, will deal with later
+------------------------------------------------------------------------
+r423 | shadowed.wow | 2007-06-14 01:14:12 -0700 (Thu, 14 Jun 2007) | 4 lines
+
+Renamed OptionHouse.lua-bk to lazy too right click and choose which
editor to open it in.
+
+Pulled OptionHouse.lua into an embed and also cleaned up all the
code/functions/naming, still a couple of things need to be done like
adding a tooltip for the management page, and actually test everything
but the actual code is all implemented, normalized and ready to go.
+Category will reset when you change tabs and is also sorted in alpha order
+------------------------------------------------------------------------
+r422 | shadowed.wow | 2007-06-13 19:44:25 -0700 (Wed, 13 Jun 2007) | 2 lines
+
+Moved the actual OH code to OptionHouse.lua-bk for grabbing code to
move to the "final" code base.
+Figuring out how I managed to fuck up $Revision$
+------------------------------------------------------------------------
+r421 | shadowed.wow | 2007-06-11 20:40:57 -0700 (Mon, 11 Jun 2007) | 2 lines
+
+Added searching, will filter by addon/category/subcategory on the
configuration panel and name on the management/performance page. Used
hack method for management page due to Tekkubs crazy-ass code.
+Fixed an error when a frame is added with OH being shown.
+------------------------------------------------------------------------
+r420 | shadowed.wow | 2007-06-08 21:03:16 -0700 (Fri, 08 Jun 2007) | 1 line
+
+Changed positioning of performance stuff slightly
+------------------------------------------------------------------------
+r419 | shadowed.wow | 2007-06-08 15:07:18 -0700 (Fri, 08 Jun 2007) | 3 lines
+
+Removed the usage of AddonPage.lua and DongleFrames.lua as they were
only used for examples (and lord cladhaire is whiny).
+Added CPU per second (position needs checking)
+Fixed unloaded addons showing
+------------------------------------------------------------------------
+r418 | tekkub | 2007-06-08 12:48:00 -0700 (Fri, 08 Jun 2007) | 1 line
+
+OptionHouse - Another round of getglobal/blah:GetName() removals...
next up: removing frame names that aren't needed (stop cluttering the
global namespace with frame names!)
+------------------------------------------------------------------------
+r417 | tekkub | 2007-06-07 13:32:41 -0700 (Thu, 07 Jun 2007) | 3 lines
+
+OptionHouse
+- Fixed tab selection (again :P)
+- Removed some unneeded calls to getglobal and frame:GetName()
+------------------------------------------------------------------------
+r416 | tekkub | 2007-06-07 13:18:41 -0700 (Thu, 07 Jun 2007) | 1 line
+
+OptionHouse - Fixed parenting of the sample config frames so they hide
on tab changes
+------------------------------------------------------------------------
+r415 | shadowed.wow | 2007-06-07 12:29:21 -0700 (Thu, 07 Jun 2007) | 2 lines
+
+Added memory per second to the performance tab, also made it update
once a second while the frame is open for CPU/Memory/MiR updating.
+You can now sort all of the columns due to lord cladhaires request.
+------------------------------------------------------------------------
+r414 | shadowed.wow | 2007-06-07 01:06:58 -0700 (Thu, 07 Jun 2007) | 3 lines
+
+Category selection will work completely now including when an addon
only has one category and no subcategories registered
+Added in the performance page, will sort by highest memory when CPU
profiling is disabled, and highest memory + CPU when it's on
+Changed the metadata grabbing for management and performance to also
check the list of registered addons for getting author and version data
+------------------------------------------------------------------------
+r413 | shadowed.wow | 2007-06-06 23:27:05 -0700 (Wed, 06 Jun 2007) | 3 lines
+
+Switched category selection back too text detection not ids since it's
easier to detect whats open/closed
+Improved the Filter_UpdateList code, it'll actually work now with
setting a function and/or handler
+Added noCache argument to RegisterSubCategory and RegisterCategory for
lord Thrae, when you pass the noCache flag it wont save the frame and
will call the function and/or handler everytime.
+------------------------------------------------------------------------
+r412 | tekkub | 2007-06-06 17:57:41 -0700 (Wed, 06 Jun 2007) | 1 line
+
+OptionHouse - Nudging scroll bar a tad to close gaps
+------------------------------------------------------------------------
+r411 | tekkub | 2007-06-06 17:43:19 -0700 (Wed, 06 Jun 2007) | 1 line
+
+OptionHouse - Oh look, I found the background texture for scroll
bars... why doesn't FSF use this?
+------------------------------------------------------------------------
+r410 | tekkub | 2007-06-06 17:05:31 -0700 (Wed, 06 Jun 2007) | 1 line
+
+OptionHouse - Added ESC menu button
+------------------------------------------------------------------------
+r409 | tekkub | 2007-06-06 12:22:02 -0700 (Wed, 06 Jun 2007) | 1 line
+
+OptionHouse - It might be fake, but it scrolls!
+------------------------------------------------------------------------
+r408 | tekkub | 2007-06-06 01:12:48 -0700 (Wed, 06 Jun 2007) | 1 line
+
+OptionHouse - Reworked title fontstrings to prevent wrapping/overflow,
but still use as much space as is available
+------------------------------------------------------------------------
+r407 | tekkub | 2007-06-05 23:08:40 -0700 (Tue, 05 Jun 2007) | 1 line
+
+OptionHouse - Let's not clutter up the global namespace with frames
+------------------------------------------------------------------------
+r406 | tekkub | 2007-06-05 21:32:00 -0700 (Tue, 05 Jun 2007) | 1 line
+
+OptionHouse - Enable/disable all buttons added
+------------------------------------------------------------------------
+r405 | tekkub | 2007-06-05 20:47:18 -0700 (Tue, 05 Jun 2007) | 4 lines
+
+OptionHouse
+- Color addon name for some cases (LoD, Disabled, Error)
+- Checkbox now enable/disables
+- Added reloadui button
+------------------------------------------------------------------------
+r404 | tekkub | 2007-06-05 20:06:07 -0700 (Tue, 05 Jun 2007) | 1 line
+
+OptionHouse - Management tab now shows real data, but doesn't scroll
or enable/disable yet
+------------------------------------------------------------------------
+r403 | tekkub | 2007-06-05 18:39:29 -0700 (Tue, 05 Jun 2007) | 1 line
+
+OptionHouse - Oh look, the tabs actually do something now.
+------------------------------------------------------------------------
+r402 | tekkub | 2007-06-05 12:18:09 -0700 (Tue, 05 Jun 2007) | 1 line
+
+OptionHouse - Only register sample addons on first load
+------------------------------------------------------------------------
+r401 | tekkub | 2007-06-05 12:11:46 -0700 (Tue, 05 Jun 2007) | 1 line
+
+OptionHouse - More tab stuff, why were we calling
getglobal(frame:GetName()... when we know the frame's name is a constant?
+------------------------------------------------------------------------
+r400 | tekkub | 2007-06-05 11:27:32 -0700 (Tue, 05 Jun 2007) | 1 line
+
+OptionHouse - Fixing tab selection on first open
+------------------------------------------------------------------------
+r398 | shadowed.wow | 2007-06-05 00:05:22 -0700 (Tue, 05 Jun 2007) | 3 lines
+
+Added in OptionHouse:RegisterAddOn, addonObj:RegisterCategory,
addonObj:RegisterSubCategory. RegisterAddOn will return an addonObj
that can be used for the category and sub category registering,
currently the filters page will support this but they don't actually
call the frames functions yet, have to work out a solution to figure
out what function/handler to call.
+
+Moved DongleFrames/AddonPage to load before OptionHouse, also modified
AddonPage to use the Register* functions as an example.
+------------------------------------------------------------------------
+r393 | shadowed.wow | 2007-05-31 10:52:44 -0700 (Thu, 31 May 2007) | 1 line
+
+Silly Tekkub, "OptionHouseFrame" not "OptionsHouseFrame"
+------------------------------------------------------------------------
+r392 | tekkub | 2007-05-30 23:37:45 -0700 (Wed, 30 May 2007) | 1 line
+
+OptionHouse - ESC is a good thing
+------------------------------------------------------------------------
+r391 | tekkub | 2007-05-30 19:02:33 -0700 (Wed, 30 May 2007) | 1 line
+
+Renaming OptionsHouse >> OptionHouse, part 2
+------------------------------------------------------------------------
+r389 | tekkub | 2007-05-30 18:58:53 -0700 (Wed, 30 May 2007) | 1 line
+
+OptionHouse - Adding sample config frame generator
+------------------------------------------------------------------------
+r388 | jnwhiteh | 2007-05-30 04:16:38 -0700 (Wed, 30 May 2007) | 2 lines
+
+* Comment out a bad line, so we don't error for right now.
+
+------------------------------------------------------------------------
+r387 | jnwhiteh | 2007-05-30 03:58:30 -0700 (Wed, 30 May 2007) | 2 lines
+
+* Added Mikk's portrait texture
+
+------------------------------------------------------------------------
+r386 | shadowed.wow | 2007-05-29 23:00:50 -0700 (Tue, 29 May 2007) | 3 lines
+
+Modifying buttons in LUA sucks.
+
+Changed text positioning so it's aligned to the left, text is moved
over to the right by 8px for categories, and 20px for sub-categories,
also moved some code around.
+------------------------------------------------------------------------
+r385 | shadowed.wow | 2007-05-29 22:50:14 -0700 (Tue, 29 May 2007) | 1 line
+
+Changed left-sided-quest-thing-that-we-need-a-name-for to use IDs
instead of text.
+------------------------------------------------------------------------
+r384 | shadowed.wow | 2007-05-29 19:01:02 -0700 (Tue, 29 May 2007) | 1 line
+
+Reverted sub-category count showing up next to name, fixed a couple of
positionings, and also removed local oh = frame because clad is silly.
+------------------------------------------------------------------------
+r383 | shadowed.wow | 2007-05-29 18:45:37 -0700 (Tue, 29 May 2007) | 1 line
+
+Added number of sub categories if any next to the categories name.
+------------------------------------------------------------------------
+r382 | shadowed.wow | 2007-05-29 18:27:57 -0700 (Tue, 29 May 2007) | 1 line
+
+Added scroll frame support, go to SSPVP -> Join for an example of the
scroll frame.
+------------------------------------------------------------------------
+r381 | shadowed.wow | 2007-05-29 17:02:15 -0700 (Tue, 29 May 2007) | 4 lines
+
+Changed local name to "OptionsHouseFrame" for consistency with all the
object naming.
+Added filters in, hack example code, because they work like the AH
filters you can have as many categories as you want per an addon, but
only one sub-category.
+Added a quick example table of an addon just to make the example
actually work.
+Moved frame to a local of OptionsHouse.lua instead of
makeOptionsFrame, since the filter and tab stuff needs the frame object.
+------------------------------------------------------------------------
+r380 | jnwhiteh | 2007-05-29 15:39:15 -0700 (Tue, 29 May 2007) | 2 lines
+
+* I'm lazy, use the player portait texture until I can bribe Mikk
+
+------------------------------------------------------------------------
+r379 | jnwhiteh | 2007-05-29 15:34:43 -0700 (Tue, 29 May 2007) | 4 lines
+
+* Frame is now draggable and clamped to screen
+* Only the title bar is draggable, may be off by a few pixels, feel
free to adjust
+* Added slash command /oh for dev, cause I'm lazy
+
+------------------------------------------------------------------------
+r378 | jnwhiteh | 2007-05-29 15:09:50 -0700 (Tue, 29 May 2007) | 2 lines
+
+* Frame will only be shown when you use the /opthouse slash command
+
+------------------------------------------------------------------------
+r377 | shadowed.wow | 2007-05-28 20:29:29 -0700 (Mon, 28 May 2007) | 4 lines
+
+Fixed tabs so they'll actually resize too the text.
+Also moved the tabs name from "OptionsHouseTabX"
to "OptionsHouseFrameTabX" because the old naming was causing issues
when using the PanelTemplates_* functions, tabs should function like
they do on the auction house UI now.
+
+Renamed the "Enable/Disable Addon" tab to "Addon Management" to be
more consistant with the other ones, and because it makes more sense.
+------------------------------------------------------------------------
+r376 | jnwhiteh | 2007-05-28 19:26:44 -0700 (Mon, 28 May 2007) | 2 lines
+
+* Added .toc and .lua for initial OptionsHouse work
+
+------------------------------------------------------------------------
+r375 | jnwhiteh | 2007-05-28 19:25:40 -0700 (Mon, 28 May 2007) | 2 lines
+
+* Branch for OH work
+
+------------------------------------------------------------------------