Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

210 feature request: skills profession window #228

Merged
merged 18 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DragonflightUI.toc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ XML\Castbar.xml
XML\ConfigCategoryList.xml
XML\Config.xml
XML\Profession.xml
XML\ProfessionSpellbook.xml
XML\ProfessionTwo.xml
XML\QuickKeybind.xml
XML\SettingsList.xml
Expand Down
84 changes: 84 additions & 0 deletions Mixin/CharacterTab.mixin.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
DragonflightUICharacterTabMixin = {}

function DragonflightUICharacterTabMixin:sasasas()

end

function DragonflightUICharacterTabMixin:Tab_OnClick(self, frame)
DragonflightUICharacterTabMixin:SetTab(frame, self:GetID())
end

function DragonflightUICharacterTabMixin:SetTab(frame, id)
frame.selectedTab = id;
DragonflightUICharacterTabMixin:UpdateTabs(frame);
end

local function GetTabByIndex(frame, index)
return frame.Tabs and frame.Tabs[index] or _G[frame:GetName() .. "Tab" .. index];
end

function DragonflightUICharacterTabMixin:UpdateTabs(frame)
if (frame.selectedTab) then
local tab;
for i = 1, frame.numTabs, 1 do
tab = GetTabByIndex(frame, i);
if (tab.isDisabled) then
-- PanelTemplates_SetDisabledTabState(tab);
elseif (i == frame.selectedTab) then
DragonflightUICharacterTabMixin:SelectTab(tab);
else
DragonflightUICharacterTabMixin:DeselectTab(tab);
end
end
end
end

function DragonflightUICharacterTabMixin:DeselectTab(tab)
local name = tab:GetName();

local left = tab.Left or _G[name .. "Left"];
local middle = tab.Middle or _G[name .. "Middle"];
local right = tab.Right or _G[name .. "Right"];
left:Show();
middle:Show();
right:Show();
-- tab:UnlockHighlight();
-- tab:Enable();
-- tab:SetNormal(true)
local text = tab.Text or _G[name .. "Text"];
text:SetPoint("CENTER", tab, "CENTER", (tab.deselectedTextX or 0), (tab.deselectedTextY or 2));

local leftDisabled = tab.LeftDisabled or _G[name .. "LeftDisabled"];
local middleDisabled = tab.MiddleDisabled or _G[name .. "MiddleDisabled"];
local rightDisabled = tab.RightDisabled or _G[name .. "RightDisabled"];
if leftDisabled then leftDisabled:Hide(); end
if middleDisabled then middleDisabled:Hide(); end
if rightDisabled then rightDisabled:Hide(); end
end

function DragonflightUICharacterTabMixin:SelectTab(tab)
local name = tab:GetName();

local left = tab.Left or _G[name .. "Left"];
local middle = tab.Middle or _G[name .. "Middle"];
local right = tab.Right or _G[name .. "Right"];
left:Hide();
middle:Hide();
right:Hide();
-- tab:LockHighlight();
-- tab:Disable();
-- tab:SetNormal(false)
tab:SetDisabledFontObject(GameFontHighlightSmall);
local text = tab.Text or _G[name .. "Text"];
text:SetPoint("CENTER", tab, "CENTER", (tab.selectedTextX or 0), (tab.selectedTextY or -3));

local leftDisabled = tab.LeftDisabled or _G[name .. "LeftDisabled"];
local middleDisabled = tab.MiddleDisabled or _G[name .. "MiddleDisabled"];
local rightDisabled = tab.RightDisabled or _G[name .. "RightDisabled"];
if leftDisabled then leftDisabled:Show(); end
if middleDisabled then middleDisabled:Show(); end
if rightDisabled then rightDisabled:Show(); end

local tooltip = GetAppropriateTooltip();
if tooltip:IsOwned(tab) then tooltip:Hide(); end
end
1 change: 1 addition & 0 deletions Mixin/Profession.mixin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,7 @@ professionDataTable[794] = {
icon = 441139
} -- archeology
professionDataTable[666] = {tex = 'ProfessionBackgroundArtAlchemy', bar = 'professionsfxalchemy', icon = 136242} -- poison
DragonFlightUIProfessionMixin.ProfessionDataTable = professionDataTable

function DragonFlightUIProfessionMixin:UpdateHeader()
self.NineSlice.Text:SetText('**')
Expand Down
Loading