# HG changeset patch # User Farmbuyer of US-Kilrogg # Date 1327056418 0 # Node ID a561a967b5e6dc00bb48194c6eb828aa4393f185 # Parent 78a25e2d25bfc5bf00c31378570c3843426ab062 Add simple button to Blizzard options. Fix case insensitivity of tab title scanning from command line. diff -r 78a25e2d25bf -r a561a967b5e6 core.lua --- 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 diff -r 78a25e2d25bf -r a561a967b5e6 gui.lua --- 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)