From 98e3d16d42ad45bfb8a529a06607219ca2a5a03c Mon Sep 17 00:00:00 2001 From: Jim Whitehead Date: Thu, 29 Aug 2019 07:30:14 +0200 Subject: [PATCH] Shuffle some talent code --- BindConfig.lua | 7 +++---- OptionsPanel.lua | 23 +++++++++++------------ 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/BindConfig.lua b/BindConfig.lua index 066813c..a3e1d4c 100755 --- a/BindConfig.lua +++ b/BindConfig.lua @@ -47,16 +47,15 @@ function CliqueConfig:OnHide() self:UpdateAlert() end --- compat:classic function CliqueConfig:SetupTalents() - if not GetNumSpecializations then - self.talents = {L["Default"]} - else + if addon.compatRelease then self.talents = {} for i = 1, GetNumSpecializations() do local id, name = GetSpecializationInfo(i) self.talents[i] = name end + else + self.talents = {L["Default"]} end end diff --git a/OptionsPanel.lua b/OptionsPanel.lua index 2910b36..13a5eab 100755 --- a/OptionsPanel.lua +++ b/OptionsPanel.lua @@ -88,20 +88,19 @@ function panel:CreateOptions() UIDropDownMenu_SetWidth(self.talentProfiles[i], 200) BlizzardOptionsPanel_SetupDependentControl(self.specswap, self.talentProfiles[i]) end + else + for i = 1, 1 do + local _, specName = "Default" + local name = "CliqueOptionsSpec" .. i + local label = make_label(name .. "Label", self, "GameFontNormalSmall") + label:SetText(L["Talent profile: %s"]:format("Default")) + self.talentProfiles[i] = make_dropdown(name, self) + self.talentProfiles[i].profileLabel = label + UIDropDownMenu_SetWidth(self.talentProfiles[i], 200) + BlizzardOptionsPanel_SetupDependentControl(self.specswap, self.talentProfiles[i]) + end end - for i = 1, 1 do - local _, specName = "Default" - local name = "CliqueOptionsSpec" .. i - local label = make_label(name .. "Label", self, "GameFontNormalSmall") - label:SetText(L["Talent profile: %s"]:format("Default")) - self.talentProfiles[i] = make_dropdown(name, self) - self.talentProfiles[i].profileLabel = label - UIDropDownMenu_SetWidth(self.talentProfiles[i], 200) - BlizzardOptionsPanel_SetupDependentControl(self.specswap, self.talentProfiles[i]) - end - - self.profilelabel = make_label("CliqueOptionsProfileMgmtLabel", self, "GameFontNormalSmall") self.profilelabel:SetText(L["Profile Management:"]) self.profiledd = make_dropdown("CliqueOptionsProfileMgmt", self) -- 1.7.9.5