diff verbage.lua @ 96:780b7e0eeeeb

Break the options panel out of gui.lua into new options.lua. Move default item lists from verbage.lua there also. Redo options panel as a tree instead of a massive scrolling thing, and prepare data structures to let plugins/etc add their own options code.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Thu, 26 Jul 2012 20:46:00 +0000
parents 3546c7b55986
children ba5ff82dcf19
line wrap: on
line diff
--- a/verbage.lua	Thu Jul 26 03:34:56 2012 +0000
+++ b/verbage.lua	Thu Jul 26 20:46:00 2012 +0000
@@ -1,25 +1,6 @@
 local addon = select(2,...)
 if addon.NOLOAD then return end
 
--- Don't bother recording any of this loot:
-addon.default_itemfilter = {
-	-- could probably remove most of this now
---	[29434]		= true, -- Badge of Justice
---	[40752]		= true, -- Emblem of Heroism
---	[40753]		= true, -- Emblem of Valor
---	[45624]		= true, -- Emblem of Conquest
---	[43228]		= true, -- Stone Keeper's Shard
---	[47241]		= true, -- Emblem of Triumph
---	[49426]		= true, -- Emblem of Frost
-}
-
--- Mark these as straight to guild vault:
-addon.default_itemvault = {
-	[52078]		= true, -- Chaos Orb
-	[69237]		= true, -- Living Ember
-	[71998]		= true, -- Essence of Destruction
-}
-
 local todo = [[
 - Right-clicking the [ouroloot] chat link could do something different than
 the current left-clicking.  Popup small menu in place?
@@ -32,7 +13,7 @@
 that would be likely to drive me batshiat insane.
 ]]
 
-addon.helptree = {
+local helptree = {
 	{
 		value = "about",
 		text = "About",
@@ -120,6 +101,7 @@
 -- Help text.  Formatting doesn't matter, but use a blank line to split
 -- paragraphs.  This file needs to be edited with a text editor that doesn't
 -- do anything stupid by placing extra spaces at the end of lines.
+local helptext
 do
 local replacement_colors = {
 	["+"]="|cff30adff", -- blue: right-click options, control panel names
@@ -583,7 +565,7 @@
 
 -- Fill out the table that will actually be used.  Join adjacent lines here so
 -- that they'll wrap properly.
-addon.helptext = {}
+helptext = {}
 for k,text in pairs(T) do
 	local funkykey = k:gsub('_','\001')  -- this is how TreeGroup makes unique keys
 	local wrapped = text
@@ -594,7 +576,7 @@
 	wrapped = wrapped:gsub ("Ouroboros", "|cffa335ee<Ouroboros>|r")
 	--safeprint(wrapped)
 	wrapped = wrapped:gsub ("%*%(", "<") :gsub("%)%*", ">") :gsub(":PLUS:", "+")
-	addon.helptext[funkykey] = wrapped
+	helptext[funkykey] = wrapped
 end
 end -- do scope
 todo = nil
@@ -610,11 +592,13 @@
 
 	-- Clicking an entry on the left tree column.
 	local help_OnGroupSelected_func = function (treeg,event,category)
+		-- Some way of just reusing the same Label widget when clicking
+		-- different topics?
 		treeg:ReleaseChildren()
 		local txt = AceGUI:Create("Label")
 		txt:SetFullWidth(true)
 		txt:SetFontObject(GameFontNormal)--Highlight)
-		txt:SetText(addon.helptext[category])
+		txt:SetText(helptext[category])
 		local sf = AceGUI:Create("ScrollFrame")
 		sf:SetStatusTable(status_for_scroll)
 		sf:SetLayout("Fill")
@@ -642,7 +626,7 @@
 		left:SetFullWidth(true)
 		left:SetFullHeight(true)
 		left:EnableButtonTooltips(false)
-		left:SetTree(addon.helptree)
+		left:SetTree(helptree)
 		left:SetCallback("OnGroupSelected", help_OnGroupSelected_func)
 		container:AddChild(left)
 		if status_for_select.selected then