diff --git a/ElvUI_SLE/locales/english.lua b/ElvUI_SLE/locales/english.lua index 94d3262..51bba36 100644 --- a/ElvUI_SLE/locales/english.lua +++ b/ElvUI_SLE/locales/english.lua @@ -157,6 +157,9 @@ L["Farm Portal Bar"] = true L["Tilled Soil"] = true L['Right-click to drop the item.'] = true +--Import Section +L["SLE_IMPORTS"] = "|cffFF0000Note:|r Use the filter imports with caution as these will overwrite any custom ones made!\nImporting a class filter will overwrite any modifications you have made to that class filter." + --Marks-- L["Raid Marks"] = true L["Show/Hide raid marks."] = true diff --git a/ElvUI_SLE/modules/imports/load_imports.xml b/ElvUI_SLE/modules/imports/load_imports.xml new file mode 100644 index 0000000..f743ebb --- /dev/null +++ b/ElvUI_SLE/modules/imports/load_imports.xml @@ -0,0 +1,3 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file='options.lua'/> +</Ui> \ No newline at end of file diff --git a/ElvUI_SLE/modules/imports/options.lua b/ElvUI_SLE/modules/imports/options.lua new file mode 100644 index 0000000..5af02b9 --- /dev/null +++ b/ElvUI_SLE/modules/imports/options.lua @@ -0,0 +1,429 @@ +local E, L, V, P, G, _ = unpack(ElvUI); +local AI = E:GetModule('AddonInstaller'); + +local selectedAuthor +local selectedClass +local selectedOption +local authors +local options = { + Filters = "Filters", + Addons = "Addons", +} +local classes = { + Priest = "Priest", + Druid = "Druid", + Paladin = "Paladin", + Shaman = "Shaman", + Monk = "Monk", + Rogue = "Rogue", + Mage = "Mage", + Warrior = "Warrior", + Deathknight = "Deathknight", +} +local addons = { + +} + +local function UpdateAuthor() + if selectedAuthor == 'Affinitii' then + if not selectedAuthor then + E.Options.args.sle.args.importing.args.authorGroup = nil + E.Options.args.sle.args.importing.args.optionGroup = nil + return + end + + E.Options.args.sle.args.importing.args.authorGroup = { + type = 'group', + name = selectedAuthor, + guiInline = true, + order = 10, + args = { + importOptions = { + name = L["Import Options"], + type = 'select', + order = 1, + guiInline = true, + get = function(info) return selectedOption end, + set = function(info, value) selectedOption = value; UpdateAuthor(); end, + values = function() + local option = {} + option[''] = NONE + for k in pairs(options) do + option[k] = k + end + + return option + end, + }, + }, + } + if not selectedOption or selectedOption == '' then + E.Options.args.sle.args.importing.args.optionGroup = nil + return + end + + if selectedOption == 'Filters' then + E.Options.args.sle.args.importing.args.optionGroup = { + type = "group", + name = selectedOption, + order = 15, + guiInline = true, + args = { + selectClass = { + name = L["Select Class"], + type = 'select', + order = 1, + guiInline = true, + get = function(info) return selectedClass end, + set = function(info, value) selectedClass = value; UpdateAuthor(); end, + values = function() + local class = {} + class[''] = NONE + for k in pairs(classes) do + class[k] = k + end + + return class + end, + }, + }, + } + if not selectedClass or selectedClass == '' then + E.Options.args.sle.args.importing.args.optionGroup.args.class = nil + return + end + E.Options.args.sle.args.importing.args.optionGroup.args.class = { + type = 'execute', + order = 2, + name = L["Import"]..' '..selectedClass, + func = function(info, value) + if selectedClass == "Monk" then + E.global.unitframe.buffwatch.MONK = { + { + ["color"] = { + ["r"] = 1, + ["g"] = 1, + ["b"] = 1, + }, + ["displayText"] = true, + ["style"] = "NONE", + }, -- [1] + { + ["enabled"] = false, + }, -- [2] + { + ["color"] = { + ["r"] = 1, + ["g"] = 1, + ["b"] = 1, + }, + ["displayText"] = true, + ["yOffset"] = 8, + ["style"] = "NONE", + }, -- [3] + { + ["color"] = { + ["r"] = 1, + ["g"] = 1, + ["b"] = 1, + }, + ["displayText"] = true, + ["yOffset"] = 8, + ["style"] = "NONE", + }, -- [4] + { + ["enabled"] = true, + ["anyUnit"] = false, + ["point"] = "TOPRIGHT", + ["color"] = { + ["b"] = 1, + ["g"] = 1, + ["r"] = 1, + }, + ["id"] = 115175, + ["displayText"] = false, + ["style"] = "texturedIcon", + ["yOffset"] = 0, + }, -- [5] + } + else + print("class not monk") + end + end, + } + elseif selectedOption == 'Addons' then + E.Options.args.sle.args.importing.args.optionGroup = { + type = "group", + name = selectedOption, + order = 15, + guiInline = true, + args = { + BigWigs = { + type = 'execute', + order = 2, + name = L['Big Wigs'], + func = function(info, value) AI:LoadAddons("Affinitii, BigWigs"); end, + }, + Hermes = { + type = 'execute', + order = 2, + name = L['Hermes'], + func = function(info, value) AI:LoadAddons("Affinitii, Hermes"); end, + }, + xCT = { + type = 'execute', + order = 2, + name = L['xCT+'], + func = function(info, value) AI:LoadAddons("Affinitii, xCT+"); end, + }, + }, + } + end + elseif selectedAuthor == 'Repooc' then + if not selectedAuthor then + E.Options.args.sle.args.importing.args.authorGroup = nil + E.Options.args.sle.args.importing.args.optionGroup = nil + return + end + + E.Options.args.sle.args.importing.args.authorGroup = { + type = 'group', + name = selectedAuthor, + guiInline = true, + order = 10, + args = { + importOptions = { + name = L["Import Options"], + type = 'select', + order = 1, + guiInline = true, + get = function(info) return selectedOption end, + set = function(info, value) selectedOption = value; UpdateAuthor(); end, + values = function() + local option = {} + option[''] = NONE + for k in pairs(options) do + option[k] = k + end + + return option + end, + }, + }, + } + if not selectedOption or selectedOption == '' then + E.Options.args.sle.args.importing.args.optionGroup = nil + return + end + + if selectedOption == 'Filters' then + E.Options.args.sle.args.importing.args.optionGroup = { + type = "group", + name = selectedOption, + order = 15, + guiInline = true, + args = { + selectClass = { + name = L["Select Class"], + type = 'select', + order = 1, + guiInline = true, + get = function(info) return selectedClass end, + set = function(info, value) selectedClass = value; UpdateAuthor(); end, + values = function() + local class = {} + class[''] = NONE + for k in pairs(classes) do + class[k] = k + end + + return class + end, + }, + }, + } + if not selectedClass or selectedClass == '' then + E.Options.args.sle.args.importing.args.optionGroup.args.class = nil + return + end + E.Options.args.sle.args.importing.args.optionGroup.args.class = { + type = 'execute', + order = 2, + name = L["Import"]..' '..selectedClass, + func = function(info, value) --[[UF:Update_AllFrames()]] end, + } + elseif selectedOption == 'Addons' then + E.Options.args.sle.args.importing.args.optionGroup = { + type = "group", + name = selectedOption, + order = 15, + guiInline = true, + args = { + BigWigs = { + type = 'execute', + order = 2, + name = L['Big Wigs'], + func = function(info, value) AI:LoadAddons("Affinitii, BigWigs"); end, + }, + Hermes = { + type = 'execute', + order = 2, + name = L['Hermes'], + func = function(info, value) AI:LoadAddons("Affinitii, Hermes"); end, + }, + xCT = { + type = 'execute', + order = 2, + name = L['xCT+'], + func = function(info, value) AI:LoadAddons("Affinitii, xCT+"); end, + }, + }, + } + end + elseif selectedAuthor == 'Darth' then + if not selectedAuthor then + E.Options.args.sle.args.importing.args.authorGroup = nil + E.Options.args.sle.args.importing.args.optionGroup = nil + return + end + + E.Options.args.sle.args.importing.args.authorGroup = { + type = 'group', + name = selectedAuthor, + guiInline = true, + order = 10, + args = { + importOptions = { + name = L["Import Options"], + type = 'select', + order = 1, + guiInline = true, + get = function(info) return selectedOption end, + set = function(info, value) selectedOption = value; UpdateAuthor(); end, + values = function() + local option = {} + option[''] = NONE + for k in pairs(options) do + option[k] = k + end + + return option + end, + }, + }, + } + if not selectedOption or selectedOption == '' then + E.Options.args.sle.args.importing.args.optionGroup = nil + return + end + + if selectedOption == 'Filters' then + E.Options.args.sle.args.importing.args.optionGroup = { + type = "group", + name = selectedOption, + order = 15, + guiInline = true, + args = { + selectClass = { + name = L["Select Class"], + type = 'select', + order = 1, + guiInline = true, + get = function(info) return selectedClass end, + set = function(info, value) selectedClass = value; UpdateAuthor(); end, + values = function() + local class = {} + class[''] = NONE + for k in pairs(classes) do + class[k] = k + end + + return class + end, + }, + }, + } + if not selectedClass or selectedClass == '' then + E.Options.args.sle.args.importing.args.optionGroup.args.class = nil + return + end + E.Options.args.sle.args.importing.args.optionGroup.args.class = { + type = 'execute', + order = 2, + name = L["Import"]..' '..selectedClass, + func = function(info, value) --[[UF:Update_AllFrames()]] end, + } + elseif selectedOption == 'Addons' then + E.Options.args.sle.args.importing.args.optionGroup = { + type = "group", + name = selectedOption, + order = 15, + guiInline = true, + args = { + BigWigs = { + type = 'execute', + order = 2, + name = L['Big Wigs'], + func = function(info, value) AI:LoadAddons("Affinitii, BigWigs"); end, + }, + Hermes = { + type = 'execute', + order = 2, + name = L['Hermes'], + func = function(info, value) AI:LoadAddons("Affinitii, Hermes"); end, + }, + xCT = { + type = 'execute', + order = 2, + name = L['xCT+'], + func = function(info, value) AI:LoadAddons("Affinitii, xCT+"); end, + }, + }, + } + end + else + if not selectedAuthor or selectedAuthor == "" then + E.Options.args.sle.args.importing.args.authorGroup = nil + E.Options.args.sle.args.importing.args.optionGroup = nil + return + end + end +end + +local function configTable() + E.Options.args.sle.args.importing = { + type = 'group', + name = L['Extra Importing'], + order = 199, + args = { + header = { + order = 1, + type = "header", + name = L["Author Specific Imports"], + }, + description = { + order = 2, + type = "description", + name = L["SLE_IMPORTS"], + }, + selectAuthor = { + order = 3, + type = 'select', + name = L['Select Author'], + get = function(info) return selectedAuthor end, + set = function(info, value) if value == '' then selectedAuthor = value; selectedClass = nil; selectedOption = nil; else selectedAuthor = value end; UpdateAuthor() end, + values = function() + local authors = {} + authors[''] = NONE + + authors['Affinitii'] = 'Affinitii' + authors['Repooc'] = 'Repooc' + authors['Darth'] = 'Darth' + return authors + end, + }, + }, + } +end + +table.insert(E.SLEConfigs, configTable) \ No newline at end of file diff --git a/ElvUI_SLE/modules/install/install.lua b/ElvUI_SLE/modules/install/install.lua index be8a74c..d5f583f 100644 --- a/ElvUI_SLE/modules/install/install.lua +++ b/ElvUI_SLE/modules/install/install.lua @@ -2219,9 +2219,9 @@ function E:AffinitiiSetup(loadAddons) --The function to switch from class ElvUI end end - if loadAddons then - AI:LoadAddons("Affinitii, All") - end + --if loadAddons then + -- AI:LoadAddons("Affinitii, All") + --end E:UpdateAll(true) end function E:HudSimple() @@ -2402,7 +2402,7 @@ local function SetPage(PageNum) InstallOption1Button:SetText(L["Darth's Config"]) InstallOption2Button:Show() - InstallOption2Button:SetScript('OnClick', function() E:StaticPopup_Show("ELVUI_SLE_AFFINITII") end) + InstallOption2Button:SetScript('OnClick', function() E:AffinitiiSetup() end) InstallOption2Button:SetText(L["Affinitii's Config"]) InstallOption3Button:Show() diff --git a/ElvUI_SLE/modules/install/load_install.xml b/ElvUI_SLE/modules/install/load_install.xml index 4825a0e..c1350a1 100644 --- a/ElvUI_SLE/modules/install/load_install.xml +++ b/ElvUI_SLE/modules/install/load_install.xml @@ -5,7 +5,6 @@ <Script file='BigWigsFights.lua'/> <Script file='BigWigsIcon.lua'/> <Script file='Clique.lua'/> - <Script file='ElvUIFilters.lua'/> <Script file='Hermes.lua'/> <Script file='xCT+.lua'/> </Ui> \ No newline at end of file diff --git a/ElvUI_SLE/modules/load_modules.xml b/ElvUI_SLE/modules/load_modules.xml index bf972eb..c6dd126 100644 --- a/ElvUI_SLE/modules/load_modules.xml +++ b/ElvUI_SLE/modules/load_modules.xml @@ -11,6 +11,7 @@ <Include file='errors\load_errors.xml'/> <Include file='exprepbar\load_exprepbar.xml'/> <Include file='farm\load_farm.xml'/> + <Include file='imports\load_imports.xml'/> <Include file='marks\load_marks.xml'/> <Include file='minimap\load_minimap.xml'/> <Include file='raidutility\load_raidutility.xml'/>