WoWInterface SVN OneCompanion

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/OneCompanion/opts
    from Rev 29 to Rev 30
    Reverse comparison

Rev 29 → Rev 30

options.lua
115,7 → 115,7
name = L["Height"],
desc = L["Change mainframe height"],
type = "range",
min = 100, max = 800, step = 1,
min = 68, max = 1000, step = 1,
set = function(_, value) OneCompanion.db.profile.sizes.h = value OneCompanionFrames.base:SetHeight(OneCompanion.db.profile.sizes.h) OneCompanionFrames.ShowSlider() end,
get = function() return OneCompanionFrames.base:GetHeight() end,
},
124,7 → 124,7
name = L["Width"],
desc = L["Change mainframe width"],
type = "range",
min = 112, max = 800, step = 1,
min = 50, max = 1000, step = 1,
set = "ToggleMainFrameWidth",
get = function() return OneCompanionFrames.base:GetWidth() end,
},
178,9 → 178,7
desc = L["Change the background color for the index window"],
type = "color",
hasAlpha = true,
get = function()
return unpack(OneCompanion.db.profile.colors.index)
end,
get = function() return unpack(OneCompanion.db.profile.colors.index) end,
set = "SetColor",
},
footer = {
189,9 → 187,7
desc = L["Change the background color for the footer window"],
type = "color",
hasAlpha = true,
get = function()
return unpack(OneCompanion.db.profile.colors.footer)
end,
get = function() return unpack(OneCompanion.db.profile.colors.footer) end,
set = "SetColor",
},
bindex = {
200,9 → 196,7
desc = L["Change the border color for the index window"],
type = "color",
hasAlpha = true,
get = function()
return unpack(OneCompanion.db.profile.colors.bindex)
end,
get = function() return unpack(OneCompanion.db.profile.colors.bindex) end,
set = "SetColor",
},
bfooter = {
211,9 → 205,7
desc = L["Change the border color for the footer window"],
type = "color",
hasAlpha = true,
get = function()
return unpack(OneCompanion.db.profile.colors.bfooter)
end,
get = function() return unpack(OneCompanion.db.profile.colors.bfooter) end,
set = "SetColor",
},
}
405,13 → 397,23
end
end
end
local f, s, p = fra.footerText:GetFont()
if fra.footer:GetWidth() < 140 then
local f, s, p, e = fra.footerText:GetFont()
local e = fra.footer:GetWidth()
if e < 94 then
fra.footerText:SetFont(f, 6, p)
fra.footerRev:SetFont(f, 6, p)
fra.footerText:SetPoint("BOTTOMRIGHT", fra.footerRev, "TOPRIGHT", 0, 0)
fra.footerText:SetText("One|cffffcc00C|r")
elseif e < 140 then
fra.footerText:SetFont(f, 8, p)
fra.footerRev:SetFont(f, 8, p)
fra.footerText:SetPoint("BOTTOMRIGHT", fra.footerRev, "TOPRIGHT", 0, 0)
fra.footerText:SetText("One|cffffcc00Companion|r")
else
fra.footerText:SetFont(f, 12, p)
fra.footerRev:SetFont(f, 8, p)
fra.footerText:SetPoint("BOTTOMRIGHT", fra.footerRev, "TOPLEFT", 0, -4)
fra.footerText:SetText("One|cffffcc00Companion|r")
end
fra.ShowSlider()
end
440,21 → 442,61
if self.db.profile.misc.grip then fra.grip:Hide() else fra.grip:Show() end
end
 
function OneCompanionOptions:ToggleShowTooltips(value)
local self, fra, gam = OneCompanion, OneCompanionFrames, GameTooltip
function OneCompanionOptions:ToggleShowTooltips(value, spellID, b)
local self, fra, g, btn = OneCompanion, OneCompanionFrames, GameTooltip, OneCompanionButtons
if value then self.db.profile.misc.tip = not self.db.profile.misc.tip end
if self.db.profile.misc.tip then
fra.cfgButton:SetScript("OnEnter", nil)
if b then b:SetScript("OnEnter", nil)
elseif value then
for i, j in ipairs(btn) do j:SetScript("OnEnter", nil) end
end
else
fra.cfgButton:SetScript("OnEnter", function(self)
if ( GetCVar("UberTooltips") == "1" ) then
GameTooltip_SetDefaultAnchor(gam, self)
if GetCVar("UberTooltips") == "1" then
GameTooltip_SetDefaultAnchor(g, self)
else
gam:SetOwner(self, "ANCHOR_RIGHT")
g:SetOwner(self, "ANCHOR_RIGHT")
end
gam:AddLine(L["Settings"])
gam:Show()
g:AddLine(L["Settings"])
g:Show()
end)
fra.cfgButton:SetScript("OnLeave", function(self) gam:Hide() end)
fra.cfgButton:SetScript("OnLeave", function(self) g:Hide() end)
if b then
b:SetScript("OnEnter", function(self)
if GetCVar("UberTooltips") == "1" then
GameTooltip_SetDefaultAnchor(g, self)
else
g:SetOwner(self, "ANCHOR_LEFT")
end
if g:SetHyperlink("spell:" .. spellID) then
self.UpdateTooltip = self
else
self.UpdateTooltip = nil
end
end)
elseif value then
for i, j in ipairs(btn) do
local d = GetNumCompanions("MOUNT")
local creatureID, creatureName, spellID, icon, active
if i <= d then
creatureID, creatureName, spellID, icon, active = GetCompanionInfo("MOUNT", i)
else
creatureID, creatureName, spellID, icon, active = GetCompanionInfo("CRITTER", i-d)
end
j:SetScript("OnEnter", function(self)
if GetCVar("UberTooltips") == "1" then
GameTooltip_SetDefaultAnchor(g, self)
else
g:SetOwner(self, "ANCHOR_LEFT")
end
if g:SetHyperlink("spell:" .. spellID) then
self.UpdateTooltip = self
else
self.UpdateTooltip = nil
end
end)
end
end
end
end