Skip to content

Commit

Permalink
implemented issue #72
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuller committed Oct 22, 2011
1 parent 5434e94 commit e09c0ce
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
21 changes: 1 addition & 20 deletions Dominos.lua
Expand Up @@ -126,24 +126,6 @@ function Dominos:GetDefaults()
end
function Dominos:UpdateSettings(major, minor, bugfix)
if major == '1' and minor < '23' then
for profile,sets in pairs(self.db.sv.profiles) do
local frames = sets.frames
if frames then
local frameSets = frames[1]
if frameSets then
local rogueStates = frameSets.pages and frameSets.pages['ROGUE']
if rogueStates then
local shadowDance = rogueStates['[bonusbar:2]']
if not shadowDance then
rogueStates['[bonusbar:2]'] = 6
end
end
end
end
end
end
--perform state translation to handle updates from older versions
if major < '4' then
for profile,sets in pairs(self.db.sv.profiles) do
Expand Down Expand Up @@ -219,6 +201,7 @@ function Dominos:Load()
for i = 1, self:NumBars() do
self.ActionBar:New(i)
end
if HasClassBar() then
self.ClassBar:New()
end
Expand All @@ -234,8 +217,6 @@ function Dominos:Load()
--anchor everything
self.Frame:ForAll('Reanchor')
-- self.Frame:ForAll('UpdateAlpha')
-- self.Frame:ForAll('UpdateWatched')
--minimap button
self:UpdateMinimapButton()
Expand Down
43 changes: 31 additions & 12 deletions menuBar.lua
@@ -1,9 +1,28 @@
--[[
MenuBar, by Goranaws
--]]
local MenuBar = Dominos:CreateClass('Frame', Dominos.Frame)
Dominos.MenuBar = MenuBar
local WIDTH_OFFSET = 2
local HEIGHT_OFFSET = 20
local MENU_BUTTON_NAMES = {
[CharacterMicroButton] = CHARACTER_BUTTON,
[SpellbookMicroButton] = SPELLBOOK_ABILITIES_BUTTON,
[TalentMicroButton] = TALENTS_BUTTON,
[AchievementMicroButton] = ACHIEVEMENT_BUTTON,
[QuestLogMicroButton] = QUESTLOG_BUTTON,
[GuildMicroButton] = LOOKINGFORGUILD,
[PVPMicroButton] = PLAYER_V_PLAYER,
[LFDMicroButton] = DUNGEONS_BUTTON,
[EJMicroButton] = ENCOUNTER_JOURNAL,
[RaidMicroButton] = RAID,
[MainMenuMicroButton] = MAINMENU_BUTTON,
[HelpMicroButton] = HELP_BUTTON
}
local getButtons = function(...)
local buttons = {}
for i = 1, select('#', ...) do
Expand Down Expand Up @@ -85,8 +104,8 @@ do
end
function MenuBar:Layout()

self.buttons = {}
for i = 1, self:NumMenuButtons() do
if not self.sets.disabled[self:GetMenuButton(i):GetName()] and (i <= self:NumButtons(self) ) then
self:GetMenuButton(i):Show()
Expand All @@ -96,8 +115,6 @@ function MenuBar:Layout()
end
end


if #self.buttons > 0 then
local cols = min(self:NumColumns(), #self.buttons)
local rows = ceil(#self.buttons / cols)
Expand All @@ -120,7 +137,7 @@ function MenuBar:Layout()
local w = b:GetWidth() + spacing - WIDTH_OFFSET
local h = b:GetHeight() + spacing - HEIGHT_OFFSET
for i,b in pairs(self.buttons) do
for i, b in pairs(self.buttons) do
local col
local row
if isLeftToRight then
Expand Down Expand Up @@ -175,24 +192,26 @@ local function AddLayoutPanel(menu)
panel_AddSizeSlider(p)
end
local function NewCheckButton(title, p)
local tog = p:NewCheckButton(title)
local function NewCheckButton(name, button, p)
local tog = p:NewCheckButton(name)
tog:SetScript('OnClick', function(self)
self:GetParent().owner.sets.disabled[title] = self:GetChecked() or nil
self:GetParent().owner.sets.disabled[button:GetName()] = self:GetChecked() or nil
self:GetParent().owner:Layout()
end)
tog:SetScript('OnShow', function(self)
self:SetChecked(self:GetParent().owner.sets.disabled[title])
self:SetChecked(self:GetParent().owner.sets.disabled[button:GetName()])
end)
return tog


end
local function AddDisableButtonPanel(menu)
local p = menu:NewPanel("Disable Buttons")
local p = menu:NewPanel(LibStub('AceLocale-3.0'):GetLocale('Dominos-Config').DisableMenuButtons)
for i = 1, MenuBar:NumMenuButtons() do
NewCheckButton(MenuBar:GetMenuButton(i):GetName(), p)
local button = MenuBar:GetMenuButton(i)
NewCheckButton(MENU_BUTTON_NAMES[button] or button:GetName(), button, p)
end
end
Expand Down

0 comments on commit e09c0ce

Please sign in to comment.