/
Description: OneCompanion is an alternative to the default companion frame introduced in WotLK that combines all your companions and mounts into one fully customizable frame |
]] |
local WotLK = select(4,GetBuildInfo()) >= 30000 |
if not WotLK then return end |
if not (select(4,GetBuildInfo()) >= 30000) then return end |
local MINOR_VERSION = tonumber(("$Revision$"):match("%d+")) |
if MINOR_VERSION > _G.OneCompanion_MINOR_VERSION then G.OneCompanion_MINOR_VERSION = MINOR_VERSION end |
OneCompanionFrames, OneCompanionButtons, OneCompanionMaxHeight = {}, {}, 0 |
local L = LibStub("AceLocale-3.0"):GetLocale("OneCompanion") |
local version = GetAddOnMetadata("OneCompanion", "Version") |
function OneCompanionFrames:build() |
local self, fra, opt = OneCompanion, OneCompanionFrames, OneCompanionOptions |
local child = CreateFrame("Frame", "OneCompanionIndexChild", scrollindex) |
local footer = CreateFrame("Frame", "OneCompanionFooterFrame", base) |
local footerText = footer:CreateFontString(nil, nil, "GameFontNormal") |
local footerRev = footer:CreateFontString(nil, nil, "GameFontNormal") |
local cfgButton = CreateFrame("Button", nil, footer) |
local sliderBackdrop = { |
bgFile = [[Interface\Buttons\UI-SliderBar-Background]], |
grip:SetScript("OnMouseUp", function() base:SetScript("OnSizeChanged", nil) this:GetParent():GetParent():StopMovingOrSizing() grip:SetScript("OnUpdate", nil) end) |
grip:SetPoint("BOTTOMRIGHT", index, "BOTTOMRIGHT", -1, 1) |
grip:SetFrameLevel(30) |
footerText:SetPoint("RIGHT", footer, "RIGHT", -10, 0) |
footerRev:SetPoint("BOTTOMRIGHT", footer, "BOTTOMRIGHT", -5, 5) |
footerRev:SetText("r|cff7a7a7a" .. _G.OneCompanion_MINOR_VERSION .. "|r") |
footerText:SetText("One|cffffcc00Companion|r") |
footerText:SetJustifyH("LEFT") |
footerText:SetTextColor(1, 1, 1, 0.95) |
local f, s, p = footerRev:GetFont() |
footerRev:SetFont(f, 8, p) |
cfgButton:SetNormalTexture([[Interface\Icons\Ability_Repair]]) |
cfgButton:SetHighlightTexture([[Interface\Buttons\ButtonHilight-Square]]) |
cfgButton:SetPoint("LEFT", footer, "LEFT", 7, 0) |
fra.grip = grip |
fra.cfgButton = cfgButton |
fra.breanni = breanni |
fra.footerText = footerText |
fra.footerRev = footerRev |
-- fra:SetAnchors(nil) |
opt:ToggleShowTooltips(nil) |
function OneCompanionFrames:SetBreanniAnchors(f) |
local self , fra = OneCompanion, OneCompanionFrames |
if f then self.db.profile.sizes.breannipt, _, self.db.profile.sizes.breannirpt, self.db.profile.sizes.breannix, self.db.profile.sizes.breanniy = f:GetPoint() end |
if f then |
self.db.profile.sizes.breannipt, _, self.db.profile.sizes.breannirpt, self.db.profile.sizes.breannix, self.db.profile.sizes.breanniy = f:GetPoint() |
self.db.profile.sizes.breannix = self.db.profile.sizes.breannix * self.db.profile.sizes.bsc |
self.db.profile.sizes.breanniy = self.db.profile.sizes.breanniy * self.db.profile.sizes.bsc |
end |
end |
function OneCompanionFrames:buildButtons() |
Description: OneCompanion is an alternative to the default companion frame introduced in WotLK that combines all your companions and mounts into one fully customizable frame |
]] |
if not (select(4,GetBuildInfo()) >= 30000) then return end |
local MINOR_VERSION = tonumber(("$Revision$"):match("%d+")) |
_G.OneCompanion_MINOR_VERSION = MINOR_VERSION |
local L = LibStub("AceLocale-3.0"):NewLocale("OneCompanion", "enUS", true) |
L["AceGUI"] = true |
Description: OneCompanion is an alternative to the default companion frame introduced in WotLK that combines all your companions and mounts into one fully customizable frame |
]] |
if not (select(4,GetBuildInfo()) >= 30000) then return end |
local MINOR_VERSION = tonumber(("$Revision$"):match("%d+")) |
if MINOR_VERSION > _G.OneCompanion_MINOR_VERSION then G.OneCompanion_MINOR_VERSION = MINOR_VERSION end |
local L = LibStub("AceLocale-3.0"):NewLocale("OneCompanion", "zhTW", true) |
L["AceGUI"] = "AceGUI" |
Description: OneCompanion is an alternative to the default companion frame introduced in WotLK that combines all your companions and mounts into one fully customizable frame |
]] |
if not (select(4,GetBuildInfo()) >= 30000) then return end |
local MINOR_VERSION = tonumber(("$Revision$"):match("%d+")) |
if MINOR_VERSION > _G.OneCompanion_MINOR_VERSION then G.OneCompanion_MINOR_VERSION = MINOR_VERSION end |
local L = LibStub("AceLocale-3.0"):NewLocale("OneCompanion", "ruRU", true) |
L["AceGUI"] = "AceGUI" |
Ï : \195\143 Ï = \195\143 |
]] |
if not (select(4,GetBuildInfo()) >= 30000) then return end |
local MINOR_VERSION = tonumber(("$Revision$"):match("%d+")) |
if MINOR_VERSION > _G.OneCompanion_MINOR_VERSION then G.OneCompanion_MINOR_VERSION = MINOR_VERSION end |
local L = LibStub("AceLocale-3.0"):NewLocale("OneCompanion", "esES", true) |
L["AceGUI"] = "AceGUI" |
Ï : \195\143 Ï = \195\143 |
]] |
if not (select(4,GetBuildInfo()) >= 30000) then return end |
local MINOR_VERSION = tonumber(("$Revision$"):match("%d+")) |
if MINOR_VERSION > _G.OneCompanion_MINOR_VERSION then G.OneCompanion_MINOR_VERSION = MINOR_VERSION end |
local L = LibStub("AceLocale-3.0"):NewLocale("OneCompanion", "frFR", false) |
L["AceGUI"] = "AceGUI" |
Ï : \195\143 Ï = \195\143 |
]] |
if not (select(4,GetBuildInfo()) >= 30000) then return end |
local MINOR_VERSION = tonumber(("$Revision$"):match("%d+")) |
if MINOR_VERSION > _G.OneCompanion_MINOR_VERSION then G.OneCompanion_MINOR_VERSION = MINOR_VERSION end |
local L = LibStub("AceLocale-3.0"):NewLocale("OneCompanion", "deDE", true) |
L["AceGUI"] = "AceGUI" |
Description: OneCompanion is an alternative to the default companion frame introduced in WotLK that combines all your companions and mounts into one fully customizable frame |
]] |
if not (select(4,GetBuildInfo()) >= 30000) then return end |
local MINOR_VERSION = tonumber(("$Revision$"):match("%d+")) |
if MINOR_VERSION > _G.OneCompanion_MINOR_VERSION then G.OneCompanion_MINOR_VERSION = MINOR_VERSION end |
local L = LibStub("AceLocale-3.0"):NewLocale("OneCompanion", "zhCN", true) |
L["AceGUI"] = "AceGUI" |
Description: OneCompanion is an alternative to the default companion frame introduced in WotLK that combines all your companions and mounts into one fully customizable frame |
]] |
if not (select(4,GetBuildInfo()) >= 30000) then return end |
local MINOR_VERSION = tonumber(("$Revision$"):match("%d+")) |
if MINOR_VERSION > _G.OneCompanion_MINOR_VERSION then G.OneCompanion_MINOR_VERSION = MINOR_VERSION end |
local L = LibStub("AceLocale-3.0"):NewLocale("OneCompanion", "koKR", true) |
L["AceGUI"] = "AceGUI" |
Description: OneCompanion is an alternative to the default companion frame introduced in WotLK that combines all your companions and mounts into one fully customizable frame |
]] |
local WotLK = select(4,GetBuildInfo()) >= 30000 |
if not WotLK then DEFAULT_CHAT_FRAME:AddMessage("One|cffffcc00Companion|r: wrong WoW client, OneCompanion is built for WotLK only.") return end |
if not (select(4,GetBuildInfo()) >= 30000) then DEFAULT_CHAT_FRAME:AddMessage("One|cffffcc00Companion|r: wrong WoW client, OneCompanion is built for WotLK only.") return end |
local MINOR_VERSION = tonumber(("$Revision$"):match("%d+")) |
if MINOR_VERSION > _G.OneCompanion_MINOR_VERSION then _G.OneCompanion_MINOR_VERSION = MINOR_VERSION end |
OneCompanion = LibStub("AceAddon-3.0"):NewAddon("OneCompanion", "AceConsole-3.0", "AceEvent-3.0") |
local L = LibStub("AceLocale-3.0"):GetLocale("OneCompanion") |
Description: OneCompanion is an alternative to the default companion frame introduced in WotLK that combines all your companions and mounts into one fully customizable frame |
]] |
local WotLK = select(4,GetBuildInfo()) >= 30000 |
if not WotLK then return end |
if not (select(4,GetBuildInfo()) >= 30000) then return end |
local MINOR_VERSION = tonumber(("$Revision$"):match("%d+")) |
if MINOR_VERSION > _G.OneCompanion_MINOR_VERSION then G.OneCompanion_MINOR_VERSION = MINOR_VERSION end |
OneCompanionOptions = {} |
local L = LibStub("AceLocale-3.0"):GetLocale("OneCompanion") |
OCstop = function() fra.base:StopMovingOrSizing() fra:SetAnchors(fra.base) end |
end |
for i, j in pairs(fra) do |
if type(fra[i]) ~= "function" and i ~= "breanni" and i ~= "grip" and i ~= "slider" then |
if type(fra[i]) ~= "function" and i ~= "breanni" and i ~= "grip" and i ~= "slider" and i ~= "footerText" and i ~= "footerRev" then |
if i == "scrollindex" then fra[i]:SetFrameLevel(0) end |
fra[i]:SetScript("OnMouseDown", OCstart) |
fra[i]:SetScript("OnMouseUp", OCstop) |
end |
end |
end |
local f, s, p = fra.footerText:GetFont() |
if fra.footer:GetWidth() < 140 then |
fra.footerText:SetFont(f, 8, p) |
fra.footerText:SetPoint("BOTTOMRIGHT", fra.footerRev, "TOPRIGHT", 0, 0) |
else |
fra.footerText:SetFont(f, 12, p) |
fra.footerText:SetPoint("BOTTOMRIGHT", fra.footerRev, "TOPLEFT", 0, -4) |
end |
fra.ShowSlider() |
end |