Permalink
Browse files

Added font flag option

Removed test print function

git-svn-id: svn://svn.wowinterface.com/pMinimap-54/trunk@80 ae24c21f-2f0c-4c94-9256-0092abe71e0d
  • Loading branch information...
1 parent 6ab01bb commit 1f24e46db1448f4aadec7e768d657708169d8aa5 p3lim-52096 committed Mar 21, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 pMinimap_Config/pMinimap_Config.lua
@@ -1 +1 @@
-local LSM = LibStub('LibSharedMedia-3.0')local list = LSM:List('font')local function AddToFontStrings() pMinimap.Mail:SetFont(LSM:Fetch('font', pMinimapDB.font), pMinimapDB.fontsize, pMinimapDB.fontflag) MinimapZoneText:SetFont(LSM:Fetch('font', pMinimapDB.font), pMinimapDB.fontsize, pMinimapDB.fontflag) if(pMinimapDB.clock) then TimeManagerClockTicker:SetFont(LSM:Fetch('font', pMinimapDB.font), pMinimapDB.fontsize, pMinimapDB.fontflag) end if(pMinimapDB.coords) then pMinimap.Coord.Text:SetFont(LSM:Fetch('font', pMinimapDB.font), pMinimapDB.fontsize, pMinimapDB.fontflag) endendLibStub('AceConfigDialog-3.0'):AddToBlizOptions('pMinimap', 'pMinimap')LibStub('AceConfig-3.0'):RegisterOptionsTable('pMinimap', { name = 'pMinimap Options', type = 'group', args = { lock = { type = 'toggle', order = 0, name = 'Unlocked', get = function() return pMinimapDB.unlocked end, set = function() pMinimapDB.unlocked = not pMinimapDB.unlocked if(pMinimapDB.unlocked) then Minimap:SetBackdropColor(0, 1, 0, 0.5) else Minimap:SetBackdropColor(unpack(pMinimapDB.colors)) end end }, clock = { type = 'toggle', order = 1, name = 'Clock', get = function() return pMinimapDB.clock end, set = function() pMinimapDB.clock = not pMinimapDB.clock if(pMinimapDB.clock) then if(not pMinimap.RunClock) then pMinimap:CreateClock() else TimeManagerClockButton:Show() TimeManagerClockButton:ClearAllPoints() TimeManagerClockButton:SetPoint(pMinimapDB.coords and 'BOTTOMLEFT' or 'BOTTOM', Minimap) end else TimeManagerClockButton:Hide() end if(pMinimapDB.coords) then pMinimap.Coord:ClearAllPoints() pMinimap.Coord:SetPoint(pMinimapDB.clock and 'BOTTOMRIGHT' or 'BOTTOM', Minimap) end end }, coords = { type = 'toggle', order = 2, name = 'Coords', get = function() return pMinimapDB.coords end, set = function() pMinimapDB.coords = not pMinimapDB.coords if(pMinimapDB.coords) then if(not pMinimap.RunCoords) then pMinimap:CreateCoords() else pMinimap.Coord:Show() pMinimap.Coord:ClearAllPoints() pMinimap.Coord:SetPoint(pMinimapDB.clock and 'BOTTOMRIGHT' or 'BOTTOM', Minimap) end else pMinimap.Coord:Hide() end if(pMinimapDB.clock) then TimeManagerClockButton:ClearAllPoints() TimeManagerClockButton:SetPoint(pMinimapDB.coords and 'BOTTOMLEFT' or 'BOTTOM', Minimap) end end }, zone = { type = 'toggle', order = 3, name = 'ZoneText', get = function() return pMinimapDB.zone end, set = function() pMinimapDB.zone = not pMinimapDB.zone if(pMinimapDB.zone) then MinimapZoneTextButton:Show() else MinimapZoneTextButton:Hide() end end }, mail = { type = 'toggle', order = 4, name = 'Mail', get = function() return pMinimapDB.mail end, set = function() pMinimapDB.mail = not pMinimapDB.mail if(pMinimapDB.mail) then MiniMapMailFrame:RegisterEvent('UPDATE_PENDING_MAIL') if(HasNewMail()) then MiniMapMailFrame:Show() end else MiniMapMailFrame:UnregisterEvent('UPDATE_PENDING_MAIL') MiniMapMailFrame:Hide() end end }, dura = { type = 'toggle', order = 5, name = 'Durability', get = function() return pMinimapDB.dura end, set = function() pMinimapDB.dura = not pMinimapDB.dura if(pMinimapDB.dura) then DurabilityFrame:SetAlpha(0) pMinimap:RegisterEvent('UPDATE_INVENTORY_ALERTS') pMinimap.UPDATE_INVENTORY_ALERTS() else DurabilityFrame:SetAlpha(1) pMinimap:UnregisterEvent('UPDATE_INVENTORY_ALERTS') Minimap:SetBackdropColor(unpack(pMinimapDB.colors)) end end }, scale = { type = 'range', order = 6, name = 'Minimap Scale', min = 0.50, max = 2.50, step = 0.01, get = function() return pMinimapDB.scale end, set = function(_, value) pMinimapDB.scale = value Minimap:SetScale(value) end, }, bgthick = { type = 'range', order = 7, name = 'Backdrop Thickness', min = 0, max = 10, step = 0.5, get = function() return pMinimapDB.offset end, set = function(_, value) pMinimapDB.offset = value Minimap:SetBackdrop({bgFile = [=[Interface\ChatFrame\ChatFrameBackground]=], insets = {top = - value, left = - value, bottom = - value, right = - value}}) Minimap:SetBackdropColor(unpack(pMinimapDB.colors)) end }, fontsize = { type = 'range', order = 8, name = 'Font Size', min = 5, max = 18, step = 1, get = function() return pMinimapDB.fontsize end, set = function(_, value) pMinimapDB.fontsize = value AddToFontStrings() end }, level = { type = 'range', order = 9, name = 'Frame level', min = 1, max = 15, step = 1, get = function() return pMinimapDB.level end, set = function(_, value) pMinimapDB.level = value Minimap:SetFrameLevel(value) end }, zoneoffset = { type = 'range', order = 10, name = 'ZoneText offset', min = -25, max = 25, step = 0.5, get = function() return pMinimapDB.zoneOffset end, set = function(_, value) pMinimapDB.zoneOffset = value MinimapZoneTextButton:ClearAllPoints() MinimapZoneTextButton:SetPoint(pMinimapDB.zonePoint1, Minimap, pMinimapDB.zonePoint2, 0, value) end }, bgcolor = { type = 'color', order = 11, name = 'Backdrop Color', hasAlpha = true, get = function() return unpack(pMinimapDB.colors) end, set = function(_, r, g, b, a) pMinimapDB.colors = {r, g, b, a} Minimap:SetBackdropColor(r, g, b, a) end }, strata = { type = 'select', order = 12, name = 'Frame Strata', values = {['DIALOG'] = 'DIALOG', ['HIGH'] = 'HIGH', ['MEDIUM'] = 'MEDIUM', ['LOW'] = 'LOW', ['BACKGROUND'] = 'BACKGROUND'}, get = function() return pMinimapDB.strata end, set = function(_, strata) pMinimapDB.strata = strata Minimap:SetFrameStrata(strata) end }, zonepoint = { type = 'select', order = 13, name = 'ZoneText point', values = {['TOP'] = 'TOP', ['BOTTOM'] = 'BOTTOM'}, get = function() return pMinimapDB.zonePoint2 end, set = function(_, point) print(point) pMinimapDB.zonePoint2 = point if(point == 'TOP') then pMinimapDB.zonePoint1 = 'BOTTOM' MinimapZoneTextButton:ClearAllPoints() MinimapZoneTextButton:SetPoint('BOTTOM', Minimap, point, 0, pMinimapDB.zoneOffset) else pMinimapDB.zonePoint1 = 'TOP' MinimapZoneTextButton:ClearAllPoints() MinimapZoneTextButton:SetPoint('TOP', Minimap, point, 0, pMinimapDB.zoneOffset) end end }, font = { type = 'select', order = 14, name = 'Font', values = list, get = function() for k, v in next, list do if(v == pMinimapDB.font) then return k end end end, set = function(_, font) pMinimapDB.font = list[font] AddToFontStrings() end } }})
+local LSM = LibStub('LibSharedMedia-3.0')local list = LSM:List('font')local function AddToFontStrings() pMinimap.Mail:SetFont(LSM:Fetch('font', pMinimapDB.font), pMinimapDB.fontsize, pMinimapDB.fontflag) MinimapZoneText:SetFont(LSM:Fetch('font', pMinimapDB.font), pMinimapDB.fontsize, pMinimapDB.fontflag) if(pMinimapDB.clock) then TimeManagerClockTicker:SetFont(LSM:Fetch('font', pMinimapDB.font), pMinimapDB.fontsize, pMinimapDB.fontflag) end if(pMinimapDB.coords) then pMinimap.Coord.Text:SetFont(LSM:Fetch('font', pMinimapDB.font), pMinimapDB.fontsize, pMinimapDB.fontflag) endendLibStub('AceConfigDialog-3.0'):AddToBlizOptions('pMinimap', 'pMinimap')LibStub('AceConfig-3.0'):RegisterOptionsTable('pMinimap', { name = 'pMinimap Options', type = 'group', args = { lock = { type = 'toggle', order = 0, name = 'Unlocked', get = function() return pMinimapDB.unlocked end, set = function() pMinimapDB.unlocked = not pMinimapDB.unlocked if(pMinimapDB.unlocked) then Minimap:SetBackdropColor(0, 1, 0, 0.5) else Minimap:SetBackdropColor(unpack(pMinimapDB.colors)) end end }, clock = { type = 'toggle', order = 1, name = 'Clock', get = function() return pMinimapDB.clock end, set = function() pMinimapDB.clock = not pMinimapDB.clock if(pMinimapDB.clock) then if(not pMinimap.RunClock) then pMinimap:CreateClock() else TimeManagerClockButton:Show() TimeManagerClockButton:ClearAllPoints() TimeManagerClockButton:SetPoint(pMinimapDB.coords and 'BOTTOMLEFT' or 'BOTTOM', Minimap) end else TimeManagerClockButton:Hide() end if(pMinimapDB.coords) then pMinimap.Coord:ClearAllPoints() pMinimap.Coord:SetPoint(pMinimapDB.clock and 'BOTTOMRIGHT' or 'BOTTOM', Minimap) end end }, coords = { type = 'toggle', order = 2, name = 'Coords', get = function() return pMinimapDB.coords end, set = function() pMinimapDB.coords = not pMinimapDB.coords if(pMinimapDB.coords) then if(not pMinimap.RunCoords) then pMinimap:CreateCoords() else pMinimap.Coord:Show() pMinimap.Coord:ClearAllPoints() pMinimap.Coord:SetPoint(pMinimapDB.clock and 'BOTTOMRIGHT' or 'BOTTOM', Minimap) end else pMinimap.Coord:Hide() end if(pMinimapDB.clock) then TimeManagerClockButton:ClearAllPoints() TimeManagerClockButton:SetPoint(pMinimapDB.coords and 'BOTTOMLEFT' or 'BOTTOM', Minimap) end end }, zone = { type = 'toggle', order = 3, name = 'ZoneText', get = function() return pMinimapDB.zone end, set = function() pMinimapDB.zone = not pMinimapDB.zone if(pMinimapDB.zone) then MinimapZoneTextButton:Show() else MinimapZoneTextButton:Hide() end end }, mail = { type = 'toggle', order = 4, name = 'Mail', get = function() return pMinimapDB.mail end, set = function() pMinimapDB.mail = not pMinimapDB.mail if(pMinimapDB.mail) then MiniMapMailFrame:RegisterEvent('UPDATE_PENDING_MAIL') if(HasNewMail()) then MiniMapMailFrame:Show() end else MiniMapMailFrame:UnregisterEvent('UPDATE_PENDING_MAIL') MiniMapMailFrame:Hide() end end }, dura = { type = 'toggle', order = 5, name = 'Durability', get = function() return pMinimapDB.dura end, set = function() pMinimapDB.dura = not pMinimapDB.dura if(pMinimapDB.dura) then DurabilityFrame:SetAlpha(0) pMinimap:RegisterEvent('UPDATE_INVENTORY_ALERTS') pMinimap.UPDATE_INVENTORY_ALERTS() else DurabilityFrame:SetAlpha(1) pMinimap:UnregisterEvent('UPDATE_INVENTORY_ALERTS') Minimap:SetBackdropColor(unpack(pMinimapDB.colors)) end end }, scale = { type = 'range', order = 6, name = 'Minimap Scale', min = 0.50, max = 2.50, step = 0.01, get = function() return pMinimapDB.scale end, set = function(_, value) pMinimapDB.scale = value Minimap:SetScale(value) end, }, bgthick = { type = 'range', order = 7, name = 'Backdrop Thickness', min = 0, max = 10, step = 0.5, get = function() return pMinimapDB.offset end, set = function(_, value) pMinimapDB.offset = value Minimap:SetBackdrop({bgFile = [=[Interface\ChatFrame\ChatFrameBackground]=], insets = {top = - value, left = - value, bottom = - value, right = - value}}) Minimap:SetBackdropColor(unpack(pMinimapDB.colors)) end }, fontsize = { type = 'range', order = 8, name = 'Font Size', min = 5, max = 18, step = 1, get = function() return pMinimapDB.fontsize end, set = function(_, value) pMinimapDB.fontsize = value AddToFontStrings() end }, level = { type = 'range', order = 9, name = 'Frame level', min = 1, max = 15, step = 1, get = function() return pMinimapDB.level end, set = function(_, value) pMinimapDB.level = value Minimap:SetFrameLevel(value) end }, zoneoffset = { type = 'range', order = 10, name = 'ZoneText offset', min = -25, max = 25, step = 0.5, get = function() return pMinimapDB.zoneOffset end, set = function(_, value) pMinimapDB.zoneOffset = value MinimapZoneTextButton:ClearAllPoints() MinimapZoneTextButton:SetPoint(pMinimapDB.zonePoint1, Minimap, pMinimapDB.zonePoint2, 0, value) end }, bgcolor = { type = 'color', order = 11, name = 'Backdrop Color', hasAlpha = true, get = function() return unpack(pMinimapDB.colors) end, set = function(_, r, g, b, a) pMinimapDB.colors = {r, g, b, a} Minimap:SetBackdropColor(r, g, b, a) end }, strata = { type = 'select', order = 12, name = 'Frame Strata', values = {['DIALOG'] = 'DIALOG', ['HIGH'] = 'HIGH', ['MEDIUM'] = 'MEDIUM', ['LOW'] = 'LOW', ['BACKGROUND'] = 'BACKGROUND'}, get = function() return pMinimapDB.strata end, set = function(_, strata) pMinimapDB.strata = strata Minimap:SetFrameStrata(strata) end }, zonepoint = { type = 'select', order = 13, name = 'ZoneText point', values = {['TOP'] = 'TOP', ['BOTTOM'] = 'BOTTOM'}, get = function() return pMinimapDB.zonePoint2 end, set = function(_, point) pMinimapDB.zonePoint2 = point if(point == 'TOP') then pMinimapDB.zonePoint1 = 'BOTTOM' MinimapZoneTextButton:ClearAllPoints() MinimapZoneTextButton:SetPoint('BOTTOM', Minimap, point, 0, pMinimapDB.zoneOffset) else pMinimapDB.zonePoint1 = 'TOP' MinimapZoneTextButton:ClearAllPoints() MinimapZoneTextButton:SetPoint('TOP', Minimap, point, 0, pMinimapDB.zoneOffset) end end }, font = { type = 'select', order = 14, name = 'Font', values = list, get = function() for k, v in next, list do if(v == pMinimapDB.font) then return k end end end, set = function(_, font) pMinimapDB.font = list[font] AddToFontStrings() end }, fontflag = { type = 'select', order = 15, name = 'Font flag', values = {['OUTLINE'] = 'OUTLINE', ['THICKOUTLINE'] = 'THICKOUTLINE', ['MONOCHROME'] = 'MONOCHROME', ['NONE'] = 'NONE'}, get = function() return pMinimapDB.fontflag end set = function(_, flag) pMinimapDB.fontflag = flag AddToFontStrings() end } }})

0 comments on commit 1f24e46

Please sign in to comment.