/trunk
function OneCompanion:ToggleShowHide() |
local fra = OneCompanionFrames |
if fra.base:IsShown() then PlaySound("igInventoryClose") fra.base:Hide() else PlaySound("igInventoryOepn") fra.base:Show() end |
if fra.base:IsShown() then PlaySound("igInventoryClose") fra.base:Hide() |
else PlaySound("igInventoryOepn") fra.base:Show() end |
end |
--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-- |
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 } } |
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 } } |
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 } } |
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) |
end |
end |
for i, j in ipairs(btn) do |
j:SetScript("OnDragStart", OCstart) |
j:SetScript("OnDragStop", OCstop) |
j:SetScript("OnDragStart", function() PickupCompanion(j.type,j.petID) end) |
end |
end |
bgFile = [[Interface\Buttons\UI-SliderBar-Background]], |
edgeFile = [[Interface\Buttons\UI-SliderBar-Border]], |
tile = true, tileSize = 8, edgeSize = 8, |
insets = { left = 3, right = 3, top = 3, bottom = 3 } } |
insets = { left = 3, right = 3, top = 3, bottom = 3 } |
} |
texture:SetAllPoints(breanni) |
texture:SetTexture([[Interface\AddOns\OneCompanion\textures\breanni]]) |
breanni:SetPoint(self.db.profile.sizes.breannipt, UIParent, self.db.profile.sizes.breannirpt, self.db.profile.sizes.breannix, self.db.profile.sizes.breanniy) |
slider:SetValueStep(0.001) |
slider:SetValue(0) |
slider:SetScript("OnValueChanged", function(this) |
local max = child:GetHeight() - scrollindex:GetHeight() |
local val = this:GetValue() * max |
local max_ = child:GetHeight() - scrollindex:GetHeight() |
local val = this:GetValue() * max_ |
if math.abs(scrollindex:GetVerticalScroll() - val) < 1 then |
return |
end |
j:Hide() |
end |
for i = 1, mount + critter do |
local slot = CreateFrame("Button", "OneCompanionSlot" .. i, fra.child, "BankItemButtonGenericTemplate") |
local slot = CreateFrame("CheckButton", "OneCompanionSlot" .. i, fra.child, "BankItemButtonGenericTemplate") |
local cool = CreateFrame("Cooldown", "OneCompanionSlot" .. i .. "Cooldown", slot, "CooldownFrameTemplate") |
local texture, type, petID = slot:CreateTexture("OneCompanionTexture" .. i), nil, nil |
if i <= mount then type = "MOUNT" petID = i else type = "CRITTER" petID = i - mount end |
if i <= mount then type = "MOUNT" petID = i |
else type = "CRITTER" petID = i - mount end |
local creatureID, creatureName, spellID, icon, active = GetCompanionInfo(type, petID) |
slot.cool, slot.type, slot.petID, slot.creatureID, slot.creatureName, slot.spellID, slot.active = cool, type, petID, creatureID, creatureName, spellID, active |
cool:SetAllPoints(slot) |
fra.model:Show() |
fra.ShowSlider() |
fra.modelindex:SetCreature(creatureID) |
elseif SpellCanTargetItem() then |
self:Print("Will be implemented when Blizzard will. Yet you can enchant mounts only when they are in you inventory before learning them.") |
else |
local creatureID, creatureName, spellID, icon, active = GetCompanionInfo(type, petID) |
if active then |