The game re-arranges panels depending on stuff…
Probably far from perfect but maybe easier, you could possibly add a professions button the the housing menu (not fancy, just an idea):
Copy/Paste to the website addon.bool.no to create/download as an addon:
local point, relative, topoint, x, y
local function OnHide(self)
ProfessionsFrame:SetParent(UIParent)
if point then
self:ClearAllPoints()
self:SetPoint(point, relative, topoint, x, y)
end
end
local function OnShow(self)
if HouseEditorFrame and HouseEditorFrame:IsShown() then
self:SetParent(HouseEditorFrame)
self:ClearAllPoints()
self:SetPoint("CENTER")
self:Show()
end
end
local function OnLeave(self)
local parent = self
if self:GetObjectType() == "Button" then
parent = self:GetParent()
end
if not parent:IsMouseOver() then
parent:Hide()
end
end
EventUtil.ContinueOnAddOnLoaded("Blizzard_Professions", function()
ProfessionsFrame:HookScript("OnHide", OnShow)
ProfessionsFrame:HookScript("OnHide", OnHide)
end)
EventUtil.ContinueOnAddOnLoaded("Blizzard_HousingControls", function()
local f = CreateFrame("Button", nil, HousingControlsFrame, "UIPanelButtonTemplate")
HousingControlsFrame:HookScript("OnHide", function(self)
if ProfessionsFrame and ProfessionsFrame:IsShown() then
ProfessionsFrame:Hide()
end
end)
f:SetSize(70, 25)
f:SetPoint("LEFT", HousingControlsFrame.OwnerControlFrame.ExitButton, "RIGHT", 5, 0)
f:SetText("Prof.")
f:SetScript("OnClick", function(self)
if ProfessionsFrame and ProfessionsFrame:IsShown() then
ProfessionsFrame:Hide()
else
if not self.ProfList then
self.ProfParent = CreateFrame("Frame", self)
self.ProfParent:SetSize(self:GetSize())
self.ProfParent:SetPoint("TOPLEFT", self)
self.ProfParent:SetScript("OnLeave", OnLeave)
self.ProfParent:Hide()
local profList = { GetProfessions() }
self.ProfList = {}
for k, v in pairs(profList) do
local name, icon, skillLevel, maxSkillLevel, numAbilities, spelloffset, skillLine, skillModifier, specializationIndex, specializationOffset = GetProfessionInfo(v)
tinsert(self.ProfList, { name=name, skillline=skillLine, })
end
table.sort(self.ProfList, function(a, b)
return a.name < b.name
end)
local count, last = 0
for i, v in ipairs(self.ProfList) do
count = count + 1
v.frame = CreateFrame("Button", nil, self.ProfParent)
local f = v.frame
f:SetSize(self:GetWidth(), 15)
f.BG = f:CreateTexture()
f.BG:SetAllPoints()
f.BG:SetColorTexture(0.2, 0.2, 0.2, 0.3)
f.Name = f:CreateFontString()
f.Name:SetFontObject(GameFontNormalSmall)
f.Name:SetPoint("LEFT", 5, 0)
f.Name:SetText(v.name)
f.skillline = v.skillline
if i == 1 then
f:SetPoint("TOPLEFT", self.ProfParent, "TOPLEFT", 0, -self:GetHeight())
else
f:SetPoint("TOPLEFT", last, "BOTTOMLEFT")
end
f:SetScript("OnLeave", OnLeave)
f:SetScript("OnClick", function(self)
OpenProfessionUIToSkillLine(self.skillline) -- Enchanting
if not point then
point, relative, topoint, x, y = ProfessionsFrame:GetPoint(1)
end
OnShow(ProfessionsFrame)
self:GetParent():Hide()
end)
last = f
end
self.ProfParent:SetHeight(self:GetHeight() + (15 * count))
end
self.ProfParent:Show()
end
end)
end)