WoWInterface SVN OneCompanion

Compare Revisions

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

Rev 34 → Rev 35

options.lua
18,9 → 18,9
local L = LibStub("AceLocale-3.0"):GetLocale("OneCompanion")
local AC = LibStub("AceConfig-3.0")
local ACD = LibStub("AceConfigDialog-3.0")
local stratas = {["BACKGROUND"]="BACKGROUND", ["LOW"]="LOW", ["MEDIUM"]="MEDIUM", ["HIGH"]="HIGH", ["DIALOG"]="DIALOG",
["FULLSCREEN"]="FULLSCREEN", ["FULLSCREEN_DIALOG"]="FULLSCREEN_DIALOG", ["TOOLTIP"]="TOOLTIP"}
local borderstyles = {
local stratas = {["BACKGROUND"] = "BACKGROUND", ["LOW"] = "LOW", ["MEDIUM"] = "MEDIUM", ["HIGH"] = "HIGH", ["DIALOG"] = "DIALOG",
["FULLSCREEN"] = "FULLSCREEN", ["FULLSCREEN_DIALOG"] = "FULLSCREEN_DIALOG", ["TOOLTIP"] = "TOOLTIP"}
local borderstyles = {
[""] = "none",
["Interface\\Tooltips\\UI-Tooltip-Border"] = "UI-Tooltip-Border",
["Interface\\AchievementFrame\\UI-Achievement-WoodBorder"] = "UI-Achievement-WoodBorder",
28,7 → 28,49
["Interface\\DialogFrame\\UI-DialogBox-Gold-Border"] = "UI-DialogBox-Gold-Border",
["Interface\\CHARACTERFRAME\\UI-Party-Border"] = "UI-Party-Border",
["Interface\\BUTTONS\\UI-SliderBar-Border"] = "UI-SliderBar-Border",
["Interface\\MINIMAP\\TooltipBackdrop"] = "TooltipBackdrop",
["Interface\\QuestFrame\\UI-TextBackground-Backdrop"] = "UI-TextBackground-Backdrop",
["Interface\\Tooltips\\ChatBubble-Backdrop"] = "ChatBubble-Backdrop",
}
local bgstyles = {
[""] = "none",
["World\\Expansion01\\Doodads\\HellfirePeninsula\\DARKPORTAL\\Hellfire_DarkPortal_Background"] = "Hellfire_DarkPortal_Background",
["World\\ENVIRONMENT\\DOODAD\\HELLFIREPENINSULA\\DARKPORTALFX\\HELLFIRE_DARKPORTAL_BACKGROUND_CLOUDS"] = "HELLFIRE_DARKPORTAL_BACKGROUND_CLOUDS",
["Interface\\AchievementFrame\\UI-Achievement-AchievementBackground"] = "UI-Achievement-AchievementBackground",
["Interface\\CHARACTERFRAME\\UI-Party-Background"] = "UI-Party-Background",
["Interface\\ChatFrame\\ChatFrameBackground"] = "ChatFrameBackground",
["Interface\\DialogFrame\\UI-DialogBox-Background"] = "UI-DialogBox-Background",
["Interface\\DialogFrame\\UI-DialogBox-Gold-Background"] = "UI-DialogBox-Gold-Background",
["Interface\\DressUpFrame\\DressUpBackground-BloodElf1"] = "DressUpBackground-BloodElf1",
["Interface\\DressUpFrame\\DressUpBackground-Draenei1"] = "DressUpBackground-Draenei1",
["Interface\\DressUpFrame\\DressUpBackground-Dwarf1"] = "DressUpBackground-Dwarf1",
["Interface\\DressUpFrame\\DressUpBackground-Human1"] = "DressUpBackground-Human1",
["Interface\\DressUpFrame\\DressUpBackground-NightElf1"] = "DressUpBackground-NightElf1",
["Interface\\DressUpFrame\\DressUpBackground-Orc1"] = "DressUpBackground-Orc1",
["Interface\\DressUpFrame\\DressUpBackground-Scourge1"] = "DressUpBackground-Scourge1",
["Interface\\DressUpFrame\\DressUpBackground-Tauren1"] = "DressUpBackground-Tauren1",
["Interface\\TabardFrame\\TabardFrameBackground"] = "TabardFrameBackground",
["Interface\\TARGETINGFRAME\\UI-TargetingFrame-LevelBackground"] = "UI-TargetingFrame-LevelBackground",
["Interface\\Tooltips\\UI-Tooltip-Background"] = "UI-Tooltip-Background",
["Textures\\GuildEmblems\\Background_00_TL_U"] = "Background_00_TL_U",
["Textures\\GuildEmblems\\Background_03_TL_U"] = "Background_03_TL_U",
["Textures\\GuildEmblems\\Background_06_TL_U"] = "Background_06_TL_U",
["Textures\\GuildEmblems\\Background_09_TL_U"] = "Background_09_TL_U",
["Textures\\GuildEmblems\\Background_12_TL_U"] = "Background_12_TL_U",
["Textures\\GuildEmblems\\Background_15_TL_U"] = "Background_15_TL_U",
["Textures\\GuildEmblems\\Background_18_TL_U"] = "Background_18_TL_U",
["Textures\\GuildEmblems\\Background_21_TL_U"] = "Background_21_TL_U",
["Textures\\GuildEmblems\\Background_24_TL_U"] = "Background_24_TL_U",
["Textures\\GuildEmblems\\Background_27_TL_U"] = "Background_27_TL_U",
["Textures\\GuildEmblems\\Background_30_TL_U"] = "Background_30_TL_U",
["Textures\\GuildEmblems\\Background_33_TL_U"] = "Background_33_TL_U",
["Textures\\GuildEmblems\\Background_36_TL_U"] = "Background_36_TL_U",
["Textures\\GuildEmblems\\Background_39_TL_U"] = "Background_39_TL_U",
["Textures\\GuildEmblems\\Background_42_TL_U"] = "Background_42_TL_U",
["Textures\\GuildEmblems\\Background_45_TL_U"] = "Background_45_TL_U",
["Textures\\GuildEmblems\\Background_48_TL_U"] = "Background_48_TL_U",
["Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Background"] = "UI-CharacterCreate-Background",
}
 
local defaults = {
profile = {
58,6 → 100,35
model = {0.203921568627451, 0.2117647058823529, 0.2078431372549019, 0.9299999997019768},
bmodel = {0.7019607843137254, 0.3137254901960784, 0.5686274509803921, 1},
},
styles = {
background_index = "Interface\\ChatFrame\\ChatFrameBackground",
border_index = "Interface\\Tooltips\\UI-Tooltip-Border",
tile_index = false,
tileSize_index = 16,
edgeSize_index = 16,
i_left_index = 5,
i_right_index = 5,
i_top_index = 5,
i_bottom_index = 5,
background_footer = "Interface\\ChatFrame\\ChatFrameBackground",
border_footer = "Interface\\Tooltips\\UI-Tooltip-Border",
tile_footer = false,
tileSize_footer = 16,
edgeSize_footer = 16,
i_left_footer = 5,
i_right_footer = 5,
i_top_footer = 5,
i_bottom_footer = 5,
background_model = "Interface\\ChatFrame\\ChatFrameBackground",
border_model = "Interface\\Tooltips\\UI-Tooltip-Border",
tile_model = false,
tileSize_model = 16,
edgeSize_model = 16,
i_left_model = 5,
i_right_model = 5,
i_top_model = 5,
i_bottom_model = 5,
},
misc = {
clamp = true,
mclamp = false,
68,7 → 139,6
lockbag = false,
stratabase = "BACKGROUND",
stratabtn = "BACKGROUND",
borderstyles = "Interface\\Tooltips\\UI-Tooltip-Border"
}
}
}
126,28 → 196,38
name = L["Sizes"],
desc = L["Sizes options"],
args = {
mainframe = {
order = 0,
type = "header",
name = L["Main frame"],
},
h = {
order = 0,
name = L["Index height"],
desc = L["Change the index frame height"],
order = 1,
name = L["Height"],
desc = L["Change the height"],
type = "range",
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,
},
w = {
order = 5,
name = L["Index width"],
desc = L["Change the index frame width"],
order = 3,
name = L["Width"],
desc = L["Change the width"],
type = "range",
min = 59, max = 1000, step = 1,
set = "ToggleMainFrameWidth",
get = function() return OneCompanionFrames.base:GetWidth() end,
},
modelframe = {
order = 4,
type = "header",
name = L["Model frame"],
},
mh = {
order = 6,
name = L["Model height"],
desc = L["Change the model frame height"],
name = L["Height"],
desc = L["Change the height"],
type = "range",
min = 40, max = 1000, step = 1,
set = function(_, value) OneCompanion.db.profile.sizes.mh = value OneCompanionFrames.model:SetHeight(OneCompanion.db.profile.sizes.mh) end,
155,17 → 235,22
},
mw = {
order = 7,
name = L["Model width"],
desc = L["Change the model frame width"],
name = L["Width"],
desc = L["Change the width"],
type = "range",
min = 40, max = 1000, step = 1,
set = "ToggleModelFrameWidth",
get = function() return OneCompanionFrames.model:GetWidth() end,
},
buttonframe = {
order = 8,
type = "header",
name = L["Button frames"],
},
sc = {
order = 10,
name = L["Button scale"],
desc = L["Change the companion buttons scale"],
name = L["Scale"],
desc = L["Change the scale"],
type = "range",
min = .1, max = 2, step = 0.05,
set = "ToggleButtonScale",
182,8 → 267,8
},
buttonpad = {
order = 11,
name = L["Button padding"],
desc = L["Change the size between each button"],
name = L["Padding"],
desc = L["Change the padding"],
type = "range",
min = 0, max = 20, step = 0.1,
set = function(_, value) OneCompanion.db.profile.sizes.buttonpad = value OneCompanionOptions:ToggleButtonScale(nil, nil, value, nil) end,
206,46 → 291,61
name = L["Colors"],
desc = L["Colors options"],
args = {
mainframe = {
order = 0,
type = "header",
name = L["Main frame"],
},
index = {
order = 0,
name = L["Index window"],
desc = L["Change the index window background color"],
order = 1,
name = L["Background"],
desc = L["Change the background color"],
type = "color",
hasAlpha = true,
get = function() return unpack(OneCompanion.db.profile.colors.index) end,
set = "SetColor",
},
footer = {
order = 10,
name = L["Footer window"],
desc = L["Change the footer window background color"],
bindex = {
order = 5,
name = L["Border"],
desc = L["Change the border color"],
type = "color",
hasAlpha = true,
get = function() return unpack(OneCompanion.db.profile.colors.footer) end,
get = function() return unpack(OneCompanion.db.profile.colors.bindex) end,
set = "SetColor",
},
bindex = {
order = 5,
name = L["Index border"],
desc = L["Change the index window border color"],
footerframe = {
order = 9,
type = "header",
name = L["Footer frame"],
},
footer = {
order = 10,
name = L["Background"],
desc = L["Change the background color"],
type = "color",
hasAlpha = true,
get = function() return unpack(OneCompanion.db.profile.colors.bindex) end,
get = function() return unpack(OneCompanion.db.profile.colors.footer) end,
set = "SetColor",
},
bfooter = {
order = 15,
name = L["Footer border"],
desc = L["Change the footer window border color"],
name = L["Border"],
desc = L["Change the border color"],
type = "color",
hasAlpha = true,
get = function() return unpack(OneCompanion.db.profile.colors.bfooter) end,
set = "SetColor",
},
modelframe = {
order = 16,
type = "header",
name = L["Model frame"],
},
model = {
order = 20,
name = L["Model window"],
desc = L["Change the model window background color"],
name = L["Background"],
desc = L["Change the background color"],
type = "color",
hasAlpha = true,
get = function() return unpack(OneCompanion.db.profile.colors.model) end,
253,8 → 353,8
},
bmodel = {
order = 25,
name = L["Model border"],
desc = L["Change the model window border color"],
name = L["Border"],
desc = L["Change the border color"],
type = "color",
hasAlpha = true,
get = function() return unpack(OneCompanion.db.profile.colors.bmodel) end,
262,54 → 362,337
},
}
},
styles = {
order = 6,
type = "group",
name = L["Styles"],
desc = L["Styles options"],
args = {
mainframe = {
order = 0,
type = "header",
name = L["Main frame"],
},
background_index = {
order = 1,
type = "select",
name = L["Background style"],
desc = L["Change the background style"],
values = bgstyles,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.background_index end,
},
border_index = {
order = 5,
type = "select",
name = L["Border style"],
desc = L["Change the border style"],
values = borderstyles,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.border_index end,
},
tile_index = {
order = 10,
type = "toggle",
name = L["tile"],
desc = L["Change the background tile"],
set = function(value) OneCompanionOptions:ToggleBackdrop("index", value) end,
get = function() return OneCompanion.db.profile.styles.tile_index end,
},
tileSize_index = {
order = 15,
type = "range",
name = L["tileSize"],
desc = L["Change the background tileSize"],
min = 0, max = 500, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.tileSize_index end,
},
edgeSize_index = {
order = 20,
type = "range",
name = L["edgeSize"],
desc = L["Change the background edgeSize"],
min = 0, max = 500, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.edgeSize_index end,
},
i_left_index = {
order = 25,
type = "range",
name = L["insetLeft"],
desc = L["Change the insetLeft value"],
min = 0, max = 50, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.i_left_index end,
},
i_right_index = {
order = 30,
type = "range",
name = L["insetRight"],
desc = L["Change the insetRight value"],
min = 0, max = 50, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.i_right_index end,
},
i_top_index = {
order = 35,
type = "range",
name = L["insetTop"],
desc = L["Change the insetTop value"],
min = 0, max = 50, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.i_top_index end,
},
i_bottom_index = {
order = 40,
type = "range",
name = L["insetBottom"],
desc = L["Change the insetBottom value"],
min = 0, max = 50, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.i_bottom_index end,
},
footerframe = {
order = 45,
type = "header",
name = L["Footer frame"],
},
background_footer = {
order = 50,
type = "select",
name = L["Background style"],
desc = L["Change the background style"],
values = bgstyles,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.background_footer end,
},
border_footer = {
order = 55,
type = "select",
name = L["Border style"],
desc = L["Change the border style"],
values = borderstyles,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.border_footer end,
},
tile_footer = {
order = 60,
type = "toggle",
name = L["tile"],
desc = L["Change the background tile"],
set = function(value) OneCompanionOptions:ToggleBackdrop("footer", value) end,
get = function() return OneCompanion.db.profile.styles.tile_footer end,
},
tileSize_footer = {
order = 65,
type = "range",
name = L["tileSize"],
desc = L["Change the background tileSize"],
min = 0, max = 500, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.tileSize_footer end,
},
edgeSize_footer = {
order = 70,
type = "range",
name = L["edgeSize"],
desc = L["Change the background edgeSize"],
min = 0, max = 500, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.edgeSize_footer end,
},
i_left_footer = {
order = 75,
type = "range",
name = L["insetLeft"],
desc = L["Change the insetLeft value"],
min = 0, max = 50, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.i_left_footer end,
},
i_right_footer = {
order = 80,
type = "range",
name = L["insetRight"],
desc = L["Change the insetRight value"],
min = 0, max = 50, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.i_right_footer end,
},
i_top_footer = {
order = 85,
type = "range",
name = L["insetTop"],
desc = L["Change the insetTop value"],
min = 0, max = 50, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.i_top_footer end,
},
i_bottom_footer = {
order = 90,
type = "range",
name = L["insetBottom"],
desc = L["Change the insetBottom value"],
min = 0, max = 50, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.i_bottom_footer end,
},
modelframe = {
order = 95,
type = "header",
name = L["Model frame"],
},
background_model = {
order = 100,
type = "select",
name = L["Background style"],
desc = L["Change the background style"],
values = bgstyles,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.background_model end,
},
border_model = {
order = 105,
type = "select",
name = L["Border style"],
desc = L["Change the border style"],
values = borderstyles,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.border_model end,
},
tile_model = {
order = 110,
type = "toggle",
name = L["tile"],
desc = L["Change the background tile"],
set = function(value) OneCompanionOptions:ToggleBackdrop("model", value) end,
get = function() return OneCompanion.db.profile.styles.tile_model end,
},
tileSize_model = {
order = 115,
type = "range",
name = L["tileSize"],
desc = L["Change the background tileSize"],
min = 0, max = 500, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.tileSize_model end,
},
edgeSize_model = {
order = 120,
type = "range",
name = L["edgeSize"],
desc = L["Change the background edgeSize"],
min = 0, max = 500, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.edgeSize_model end,
},
i_left_model = {
order = 125,
type = "range",
name = L["insetLeft"],
desc = L["Change the insetLeft value"],
min = 0, max = 50, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.i_left_model end,
},
i_right_model = {
order = 130,
type = "range",
name = L["insetRight"],
desc = L["Change the insetRight value"],
min = 0, max = 50, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.i_right_model end,
},
i_top_model = {
order = 135,
type = "range",
name = L["insetTop"],
desc = L["Change the insetTop value"],
min = 0, max = 50, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.i_top_model end,
},
i_bottom_model = {
order = 140,
type = "range",
name = L["insetBottom"],
desc = L["Change the insetBottom value"],
min = 0, max = 50, step = 0.1,
set = "ToggleBackdrop",
get = function() return OneCompanion.db.profile.styles.i_bottom_model end,
},
}
},
misc = {
order = 10,
type = "group",
name = L["Misc"],
desc = L["Miscellaneous options"],
args = {
mainframe = {
order = 0,
type = "header",
name = L["Main frame"],
},
clamp = {
order = 0,
order = 1,
type = "toggle",
name = L["Clamped index"],
desc = L["Clamp the index frame to the screen"],
name = L["Clamp"],
desc = L["Clamp to the screen"],
set = "ToggleMainFrameClamp",
get = function() return OneCompanion.db.profile.misc.clamp end,
},
mclamp = {
order = 1,
type = "toggle",
name = L["Clamped model"],
desc = L["Clamp the model frame to the screen"],
set = "ToggleModelFrameClamp",
get = function() return OneCompanion.db.profile.misc.mclamp end,
},
grip = {
order = 5,
type = "toggle",
name = L["Hide index grip"],
desc = L["Hide or show the index frame grip"],
name = L["Hide grip"],
desc = L["Hide the grip"],
set = "ToggleShowGrip",
get = function() return OneCompanion.db.profile.misc.grip end,
},
modelframe = {
order = 10,
type = "header",
name = L["Model frame"],
},
mclamp = {
order = 11,
type = "toggle",
name = L["Clamp"],
desc = L["Clamp to the screen"],
set = "ToggleModelFrameClamp",
get = function() return OneCompanion.db.profile.misc.mclamp end,
},
mgrip = {
order = 6,
order = 16,
type = "toggle",
name = L["Hide model grip"],
desc = L["Hide or show the model frame grip"],
name = L["Hide grip"],
desc = L["Hide the grip"],
set = "ToggleShowModelGrip",
get = function() return OneCompanion.db.profile.misc.mgrip end,
},
tipsframe = {
order = 20,
type = "header",
name = L["Tooltips frames"],
},
tip = {
order = 10,
order = 25,
type = "toggle",
name = L["Hide tooltips"],
name = L["Hide"],
desc = L["Hide or show the tooltips shown on mouseovering AddOn icons"],
set = "ToggleShowTooltips",
get = function() return OneCompanion.db.profile.misc.tip end,
},
locks = {
order = 30,
type = "header",
name = L["Lock frames"],
},
lockbreanni = {
order = 15,
order = 35,
type = "toggle",
name = L["Lock Breanni"],
desc = L["Lock the position of Breanni's icon"],
317,21 → 700,17
get = function() return OneCompanion.db.profile.misc.lockbreanni end,
},
lockbag = {
order = 20,
order = 40,
type = "toggle",
name = L["Lock inventory"],
desc = L["Lock the position of the companion's inventory bag"],
set = "ToggleLockBag",
get = function() return OneCompanion.db.profile.misc.lockbag end,
},
borderstyles = {
order = 49,
type = "select",
name = L["Border style"],
desc = L["Change the border style"],
values = borderstyles,
set = "ToggleBorders",
get = function() return OneCompanion.db.profile.misc.borderstyles end,
stratas = {
order = 45,
type = "header",
name = L["Stratas"],
},
stratabase = {
order = 50,
367,34 → 746,47
OneCompanionOptions.options = options
OneCompanionOptions.defaults = defaults
 
function OneCompanionOptions:ToggleBorders(key, value)
local self, fra, opt = OneCompanion, OneCompanionFrames, OneCompanionOptions
if key then self.db.profile.misc[key[3]] = value end
local defaultBackdrop = {
bgFile = [[Interface\ChatFrame\ChatFrameBackground]],
edgeFile = self.db.profile.misc.borderstyles,
tile = true, tileSize = 16, edgeSize = 16,
insets = { left = 5, right = 5, top = 5, bottom = 5 } }
fra.model:SetBackdrop(defaultBackdrop)
fra.footer:SetBackdrop(defaultBackdrop)
fra.index:SetBackdrop(defaultBackdrop)
function OneCompanionOptions:ToggleBackdrop(key, value)
local self, fra, opt, ocdb = OneCompanion, OneCompanionFrames, OneCompanionOptions, OneCompanion.db.profile.styles
if type(key) == "table" then ocdb[key[3]] = value
elseif key == "index" then ocdb.tile_index = not ocdb.tile_index
elseif key == "footer" then ocdb.tile_footer = not ocdb.tile_footer
elseif key == "model" then ocdb.tile_model = not ocdb.tile_model end
local Backdrop_index = {
bgFile = ocdb.background_index,
edgeFile = ocdb.border_index,
tile = ocdb.tile_index, tileSize = ocdb.tileSize_index, edgeSize = ocdb.edgeSize_index,
insets = { left = ocdb.i_left_index, right = ocdb.i_right_index, top = ocdb.i_top_index, bottom = ocdb.i_bottom_index } }
local Backdrop_footer = {
bgFile = ocdb.background_footer,
edgeFile = ocdb.border_footer,
tile = ocdb.tile_footer, tileSize = ocdb.tileSize_footer, edgeSize = ocdb.edgeSize_footer,
insets = { left = ocdb.i_left_footer, right = ocdb.i_right_footer, top = ocdb.i_top_footer, bottom = ocdb.i_bottom_footer } }
local Backdrop_model = {
bgFile = ocdb.background_model,
edgeFile = ocdb.border_model,
tile = ocdb.tile_model, tileSize = ocdb.tileSize_model, edgeSize = ocdb.edgeSize_model,
insets = { left = ocdb.i_left_model, right = ocdb.i_right_model, top = ocdb.i_top_model, bottom = ocdb.i_bottom_model } }
fra.model:SetBackdrop(Backdrop_model)
fra.footer:SetBackdrop(Backdrop_footer)
fra.index:SetBackdrop(Backdrop_index)
opt:SetColor(nil, nil, nil, nil, nil)
end
 
function OneCompanionOptions:ToggleStrata(key, value)
local self, fra, btn = OneCompanion, OneCompanionFrames, OneCompanionButtons
if key then self.db.profile.misc[key[3]] = value end
fra.base:SetFrameStrata(self.db.profile.misc.stratabase)
local self, fra, btn, ocdb = OneCompanion, OneCompanionFrames, OneCompanionButtons, OneCompanion.db.profile.misc
if key then ocdb[key[3]] = value end
fra.base:SetFrameStrata(ocdb.stratabase)
for i, j in ipairs(btn) do
j:SetToplevel(true)
j:SetFrameStrata(self.db.profile.misc.stratabtn)
j:SetFrameStrata(ocdb.stratabtn)
end
end
 
function OneCompanionOptions:ToggleLockBag(value)
local self, fra, btn = OneCompanion, OneCompanionFrames, OneCompanionButtons
if value then self.db.profile.misc.lockbag = not self.db.profile.misc.lockbag end
if self.db.profile.misc.lockbag then
local self, fra, btn, ocdb = OneCompanion, OneCompanionFrames, OneCompanionButtons, OneCompanion.db.profile.misc
if value then ocdb.lockbag = not ocdb.lockbag end
if ocdb.lockbag then
fra.base:SetMovable(false)
OCstart, OCstop = nil, nil
else
420,9 → 812,9
end
 
function OneCompanionOptions:ToggleLockBreanni(value)
local self, fra = OneCompanion, OneCompanionFrames
if value then self.db.profile.misc.lockbreanni = not self.db.profile.misc.lockbreanni end
if self.db.profile.misc.lockbreanni then
local self, fra, ocdb = OneCompanion, OneCompanionFrames, OneCompanion.db.profile.misc
if value then ocdb.lockbreanni = not ocdb.lockbreanni end
if ocdb.lockbreanni then
fra.breanni:SetMovable(false)
fra.breanni:SetScript("OnDragStart", nil)
fra.breanni:SetScript("OnDragStop", nil)
445,18 → 837,18
end]]
 
function OneCompanionOptions:ToggleMainFrameWidth(_, value)
local self, fra, opt = OneCompanion, OneCompanionFrames, OneCompanionOptions
if value then self.db.profile.sizes.w = value end
fra.base:SetWidth(self.db.profile.sizes.w)
fra.index:SetWidth(self.db.profile.sizes.w)
fra.footer:SetWidth(self.db.profile.sizes.w)
local self, fra, opt, ocdb = OneCompanion, OneCompanionFrames, OneCompanionOptions, OneCompanion.db.profile.sizes
if value then ocdb.w = value end
fra.base:SetWidth(ocdb.w)
fra.index:SetWidth(ocdb.w)
fra.footer:SetWidth(ocdb.w)
opt:ToggleButtonScale(nil, nil, nil, nil)
end
 
function OneCompanionOptions:ToggleModelFrameWidth(_, value)
local self, fra = OneCompanion, OneCompanionFrames
if value then self.db.profile.sizes.mw = value end
fra.model:SetWidth(self.db.profile.sizes.mw)
local self, fra, ocdb = OneCompanion, OneCompanionFrames, OneCompanion.db.profile.sizes
if value then ocdb.mw = value end
fra.model:SetWidth(ocdb.mw)
end
 
function OneCompanionOptions:IsMainFrameHeight()
466,17 → 858,17
end
 
function OneCompanionOptions:ToggleBreanniScale(_, value)
local self, fra = OneCompanion, OneCompanionFrames
if value then self.db.profile.sizes.bsc = value end
fra.breanni:SetScale(self.db.profile.sizes.bsc)
fra.breanni:SetPoint(self.db.profile.sizes.breannipt, UIParent, self.db.profile.sizes.breannirpt, self.db.profile.sizes.breannix / self.db.profile.sizes.bsc, self.db.profile.sizes.breanniy / self.db.profile.sizes.bsc)
local self, fra, ocdb = OneCompanion, OneCompanionFrames, OneCompanion.db.profile.sizes
if value then ocdb.bsc = value end
fra.breanni:SetScale(ocdb.bsc)
fra.breanni:SetPoint(ocdb.breannipt, UIParent, ocdb.breannirpt, ocdb.breannix / ocdb.bsc, ocdb.breanniy / ocdb.bsc)
end
 
function OneCompanionOptions:ToggleButtonScale(_, v, w, x)
local self, fra, btn, starter, l = OneCompanion, OneCompanionFrames, OneCompanionButtons, 1, 0
if v then self.db.profile.sizes.sc = v else v = self.db.profile.sizes.sc end
if w then self.db.profile.sizes.buttonpad = w else w = self.db.profile.sizes.buttonpad end
if x then self.db.profile.sizes.borderpad = x else x = self.db.profile.sizes.borderpad end
local self, fra, btn, starter, l, ocdb = OneCompanion, OneCompanionFrames, OneCompanionButtons, 1, 0, OneCompanion.db.profile.sizes
if v then ocdb.sc = v else v = ocdb.sc end
if w then ocdb.buttonpad = w else w = ocdb.buttonpad end
if x then ocdb.borderpad = x else x = ocdb.borderpad end
for i, j in ipairs(btn) do
local function newLine()
local h, a = j:GetHeight(), j:GetHeight()
520,47 → 912,47
end
 
function OneCompanionOptions:ToggleMainFrameClamp(value)
local self, fra = OneCompanion, OneCompanionFrames
if value then self.db.profile.misc.clamp = not self.db.profile.misc.clamp end
fra.base:SetClampedToScreen(self.db.profile.misc.clamp)
local self, fra, ocdb = OneCompanion, OneCompanionFrames, OneCompanion.db.profile.misc
if value then ocdb.clamp = not ocdb.clamp end
fra.base:SetClampedToScreen(ocdb.clamp)
end
 
function OneCompanionOptions:ToggleModelFrameClamp(value)
local self, fra = OneCompanion, OneCompanionFrames
if value then self.db.profile.misc.mclamp = not self.db.profile.misc.mclamp end
fra.model:SetClampedToScreen(self.db.profile.misc.mclamp)
local self, fra, ocdb = OneCompanion, OneCompanionFrames, OneCompanion.db.profile.misc
if value then ocdb.mclamp = not ocdb.mclamp end
fra.model:SetClampedToScreen(ocdb.mclamp)
end
 
function OneCompanionOptions:SetColor(key, r, g, b, a)
local self, fra = OneCompanion, OneCompanionFrames
local self, fra, ocdb = OneCompanion, OneCompanionFrames, OneCompanion.db.profile.colors
if key then
local t = self.db.profile.colors[key[3]]
local t = ocdb[key[3]]
t[1] = r t[2] = g t[3] = b t[4] = a
end
r, g, b, a = unpack(self.db.profile.colors.index) fra.index:SetBackdropColor(r, g, b, a)
r, g, b, a = unpack(self.db.profile.colors.footer) fra.footer:SetBackdropColor(r, g, b, a)
r, g, b, a = unpack(self.db.profile.colors.bindex) fra.index:SetBackdropBorderColor(r, g, b, a)
r, g, b, a = unpack(self.db.profile.colors.bfooter) fra.footer:SetBackdropBorderColor(r, g, b, a)
r, g, b, a = unpack(self.db.profile.colors.model) fra.model:SetBackdropColor(r, g, b, a)
r, g, b, a = unpack(self.db.profile.colors.bmodel) fra.model:SetBackdropBorderColor(r, g, b, a)
r, g, b, a = unpack(ocdb.index) fra.index:SetBackdropColor(r, g, b, a)
r, g, b, a = unpack(ocdb.footer) fra.footer:SetBackdropColor(r, g, b, a)
r, g, b, a = unpack(ocdb.bindex) fra.index:SetBackdropBorderColor(r, g, b, a)
r, g, b, a = unpack(ocdb.bfooter) fra.footer:SetBackdropBorderColor(r, g, b, a)
r, g, b, a = unpack(ocdb.model) fra.model:SetBackdropColor(r, g, b, a)
r, g, b, a = unpack(ocdb.bmodel) fra.model:SetBackdropBorderColor(r, g, b, a)
end
 
function OneCompanionOptions:ToggleShowGrip(value)
local self, fra = OneCompanion, OneCompanionFrames
if value then self.db.profile.misc.grip = not self.db.profile.misc.grip end
if self.db.profile.misc.grip then fra.grip:Hide() else fra.grip:Show() end
local self, fra, ocdb = OneCompanion, OneCompanionFrames, OneCompanion.db.profile.misc
if value then ocdb.grip = not ocdb.grip end
if ocdb.grip then fra.grip:Hide() else fra.grip:Show() end
end
 
function OneCompanionOptions:ToggleShowModelGrip(value)
local self, fra = OneCompanion, OneCompanionFrames
if value then self.db.profile.misc.mgrip = not self.db.profile.misc.mgrip end
if self.db.profile.misc.mgrip then fra.mgrip:Hide() else fra.mgrip:Show() end
local self, fra, ocdb = OneCompanion, OneCompanionFrames, OneCompanion.db.profile.misc
if value then ocdb.mgrip = not ocdb.mgrip end
if ocdb.mgrip then fra.mgrip:Hide() else fra.mgrip:Show() end
end
 
function OneCompanionOptions:ToggleShowTooltips(value)
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
local self, fra, g, btn, ocdb = OneCompanion, OneCompanionFrames, GameTooltip, OneCompanionButtons, OneCompanion.db.profile.misc
if value then ocdb.tip = not ocdb.tip end
if ocdb.tip then
fra.cfgButton:SetScript("OnEnter", nil)
fra.modButton:SetScript("OnEnter", nil)
for i, j in ipairs(btn) do j:SetScript("OnEnter", nil) end