changeset 44:a561a967b5e6

Add simple button to Blizzard options. Fix case insensitivity of tab title scanning from command line.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Fri, 20 Jan 2012 10:46:58 +0000
parents 78a25e2d25bf
children 1001dd95dbeb
files core.lua gui.lua
diffstat 2 files changed, 23 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/core.lua	Fri Jan 13 01:18:32 2012 +0000
+++ b/core.lua	Fri Jan 20 10:46:58 2012 +0000
@@ -511,6 +511,28 @@
 	-- LOOT_ITEM_SELF_MULTIPLE = "You receive loot: %sx%d." --> You receive loot: (.+)(x%d+)%.
 	g_LOOT_ITEM_SELF_MULTIPLE_ss = _G.LOOT_ITEM_SELF_MULTIPLE:gsub('%.$','%%.'):gsub('%%s','(.+)'):gsub('x%%d','(x%%d+)')
 
+	--[[
+	Stick something in the Blizzard addons options list, where most users
+	will probably look these days.  Try to be conservative about needless
+	frame creation.
+	]]
+	local bliz = CreateFrame("Frame")
+	bliz.name = "Ouro Loot"
+	bliz:SetScript("OnShow", function(_b)
+		local button = CreateFrame("Button",nil,_b,"UIPanelButtonTemplate")
+		button:SetWidth(150)
+		button:SetHeight(22)
+		button:SetScript("OnClick", function()
+			_G.InterfaceOptionsFrameCancel:Click()
+			_G.HideUIPanel(GameMenuFrame)
+			addon:OpenMainDisplayToTab"Options"
+		end)
+		button:SetText('"/ouroloot opt"')
+		button:SetPoint("TOPLEFT",20,-20)
+		_b:SetScript("OnShow",nil)
+	end)
+	_G.InterfaceOptions_AddCategory(bliz)
+
 	if self.debug.flow then self:Print"is in control-flow debug mode." end
 end
 --function addon:OnDisable() end
--- a/gui.lua	Fri Jan 13 01:18:32 2012 +0000
+++ b/gui.lua	Fri Jan 20 10:46:58 2012 +0000
@@ -2014,7 +2014,7 @@
 end
 
 function addon:OpenMainDisplayToTab (text)
-	text = '^'..text
+	text = '^'..text:lower()
 	for tab,v in pairs(_tabtexts) do
 		if v.title:lower():find(text) then
 			self:BuildMainDisplay(tab)