diff --git a/ImproveAny.toc b/ImproveAny.toc index 8be3740..530cbb6 100644 --- a/ImproveAny.toc +++ b/ImproveAny.toc @@ -1,10 +1,10 @@ -## Interface-Classic: 11503 +## Interface-Classic: 11504 ## Interface-BCC: 20504 ## Interface-Wrath: 30403 ## Interface-Cata: 40400 ## Interface: 110002 -## Version: 0.9.100 +## Version: 0.9.101 ## Title: ImproveAny by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/ImproveAny_Cata.toc b/ImproveAny_Cata.toc index 43f7370..c40b5d9 100644 --- a/ImproveAny_Cata.toc +++ b/ImproveAny_Cata.toc @@ -1,5 +1,5 @@ ## Interface: 40400 -## Version: 0.9.100 +## Version: 0.9.101 ## Title: ImproveAny |T136033:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/ImproveAny_TBC.toc b/ImproveAny_TBC.toc index 383ead2..bb15251 100644 --- a/ImproveAny_TBC.toc +++ b/ImproveAny_TBC.toc @@ -1,5 +1,5 @@ ## Interface: 20504 -## Version: 0.9.100 +## Version: 0.9.101 ## Title: ImproveAny |T136033:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/ImproveAny_Vanilla.toc b/ImproveAny_Vanilla.toc index 21d9af1..a952833 100644 --- a/ImproveAny_Vanilla.toc +++ b/ImproveAny_Vanilla.toc @@ -1,5 +1,5 @@ -## Interface: 11503 -## Version: 0.9.100 +## Interface: 11504 +## Version: 0.9.101 ## Title: ImproveAny |T136033:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/ImproveAny_Wrath.toc b/ImproveAny_Wrath.toc index a7a3f81..be51c4b 100644 --- a/ImproveAny_Wrath.toc +++ b/ImproveAny_Wrath.toc @@ -1,5 +1,5 @@ ## Interface: 30403 -## Version: 0.9.100 +## Version: 0.9.101 ## Title: ImproveAny |T136033:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/core.lua b/core.lua index fad0974..1ff568d 100644 --- a/core.lua +++ b/core.lua @@ -268,7 +268,7 @@ function ImproveAny:Event(event, ...) ["icon"] = 136033, ["var"] = mmbtn, ["dbtab"] = IATAB, - ["vTT"] = {{"ImproveAny |T136033:16:16:0:0|t", "v|cff3FC7EB0.9.100"}, {ImproveAny:GT("LEFTCLICK"), ImproveAny:GT("MMBTNLEFT")}, {ImproveAny:GT("RIGHTCLICK"), ImproveAny:GT("MMBTNRIGHT")}}, + ["vTT"] = {{"ImproveAny |T136033:16:16:0:0|t", "v|cff3FC7EB0.9.101"}, {ImproveAny:GT("LEFTCLICK"), ImproveAny:GT("MMBTNLEFT")}, {ImproveAny:GT("RIGHTCLICK"), ImproveAny:GT("MMBTNRIGHT")}}, ["funcL"] = function() ImproveAny:ToggleSettings() end, diff --git a/ele/minimap.lua b/ele/minimap.lua index 55c44a7..74d59a1 100644 --- a/ele/minimap.lua +++ b/ele/minimap.lua @@ -441,7 +441,7 @@ function ImproveAny:InitMinimap() ImproveAny:ConvertToMinimapButton("MiniMapMailFrame", true) -- Mail -- Retail ImproveAny:ConvertToMinimapButton("MiniMapTrackingButton", true) -- Tracking - if MiniMapTracking then + if MiniMapTracking and MiniMapTrackingButton then hooksecurefunc( MiniMapTrackingButton, "SetPoint", diff --git a/libs/D4Lib/D4Frames.lua b/libs/D4Lib/D4Frames.lua index c830719..45ecc0d 100644 --- a/libs/D4Lib/D4Frames.lua +++ b/libs/D4Lib/D4Frames.lua @@ -107,9 +107,30 @@ function D4:CreateSlider(tab) tab.steps = tab.steps or 1 tab.decimals = tab.decimals or 0 tab.key = tab.key or tab.name or "" - local slider = CreateFrame("Slider", tab.key, tab.parent, "OptionsSliderTemplate") - slider:SetWidth(tab.sw) + local slider = CreateFrame("Slider", tab.key, tab.parent, "UISliderTemplate") + slider:SetSize(tab.sw, 16) slider:SetPoint(unpack(tab.pTab)) + if slider.Low == nil then + slider.Low = slider:CreateFontString(nil, nil, "GameFontNormal") + slider.Low:SetPoint("BOTTOMLEFT", slider, "BOTTOMLEFT", 0, -12) + slider.Low:SetFont(STANDARD_TEXT_FONT, 10, "THINOUTLINE") + slider.Low:SetTextColor(1, 1, 1) + end + + if slider.High == nil then + slider.High = slider:CreateFontString(nil, nil, "GameFontNormal") + slider.High:SetPoint("BOTTOMRIGHT", slider, "BOTTOMRIGHT", 0, -12) + slider.High:SetFont(STANDARD_TEXT_FONT, 10, "THINOUTLINE") + slider.High:SetTextColor(1, 1, 1) + end + + if slider.Text == nil then + slider.Text = slider:CreateFontString(nil, nil, "GameFontNormal") + slider.Text:SetPoint("TOP", slider, "TOP", 0, 16) + slider.Text:SetFont(STANDARD_TEXT_FONT, 12, "THINOUTLINE") + slider.Text:SetTextColor(1, 1, 1) + end + slider.Low:SetText(tab.vmin) slider.High:SetText(tab.vmax) local struct = D4:Trans(tab.key) @@ -314,3 +335,63 @@ function D4:AppendSlider(key, value, min, max, steps, decimals, func, lstr) D4:CreateSlider(slider) Y = Y - 30 end + +function D4:CreateDropdown(key, value, choices, parent) + if TAB[key] == nil then + TAB[key] = value + end + + local text = parent:CreateFontString(nil, nil, "GameFontNormal") + text:SetPoint("TOPLEFT", 10, Y) + text:SetText(D4:Trans(key)) + Y = Y - 18 + if D4:GetWoWBuild() == "RETAIL" then + local Dropdown = CreateFrame("DropdownButton", key, parent, "WowStyle1DropdownTemplate") + Dropdown:SetDefaultText(choices[TAB[key]]) + Dropdown:SetPoint("TOPLEFT", 10, Y) + Dropdown:SetWidth(200) + Dropdown:SetupMenu( + function(dropdown, rootDescription) + rootDescription:CreateTitle(D4:Trans(key)) + for i, v in pairs(choices) do + rootDescription:CreateButton( + i, + function() + TAB[key] = v + Dropdown:SetDefaultText(i) + end + ) + end + end + ) + else + local dropDown = CreateFrame("Frame", "WPDemoDropDown", PARENT, "UIDropDownMenuTemplate") + dropDown:SetPoint("TOPLEFT", -10, Y) + UIDropDownMenu_SetWidth(dropDown, 200) + function WPDropDownDemo_Menu(frame, level, menuList) + local info = UIDropDownMenu_CreateInfo() + if level == 1 then + for i, v in pairs(choices) do + info.text = v + info.arg1 = i + info.checked = v == choices[TAB[key]] + info.func = dropDown.SetValue + UIDropDownMenu_AddButton(info) + end + end + end + + UIDropDownMenu_Initialize(dropDown, WPDropDownDemo_Menu) + UIDropDownMenu_SetText(dropDown, choices[TAB[key]]) + function dropDown:SetValue(newValue) + TAB[key] = newValue + UIDropDownMenu_SetText(dropDown, newValue) + CloseDropDownMenus() + end + end +end + +function D4:AppendDropdown(key, value, choices) + D4:CreateDropdown(key, value, choices, PARENT) + Y = Y - 30 +end diff --git a/settings.lua b/settings.lua index 6eb99dd..6c81365 100644 --- a/settings.lua +++ b/settings.lua @@ -150,9 +150,30 @@ end local function AddSlider(x, key, val, func, vmin, vmax, steps, extra) if sls[key] == nil then - sls[key] = CreateFrame("Slider", "sls[" .. key .. "]", IASettings.SC, "OptionsSliderTemplate") - sls[key]:SetWidth(IASettings.SC:GetWidth() - 30 - x) + sls[key] = CreateFrame("Slider", "sls[" .. key .. "]", IASettings.SC, "UISliderTemplate") + sls[key]:SetSize(IASettings.SC:GetWidth() - 30 - x, 16) sls[key]:SetPoint("TOPLEFT", IASettings.SC, "TOPLEFT", x + 5, posy) + if sls[key].Low == nil then + sls[key].Low = sls[key]:CreateFontString(nil, nil, "GameFontNormal") + sls[key].Low:SetPoint("BOTTOMLEFT", sls[key], "BOTTOMLEFT", 0, -12) + sls[key].Low:SetFont(STANDARD_TEXT_FONT, 10, "THINOUTLINE") + sls[key].Low:SetTextColor(1, 1, 1) + end + + if sls[key].High == nil then + sls[key].High = sls[key]:CreateFontString(nil, nil, "GameFontNormal") + sls[key].High:SetPoint("BOTTOMRIGHT", sls[key], "BOTTOMRIGHT", 0, -12) + sls[key].High:SetFont(STANDARD_TEXT_FONT, 10, "THINOUTLINE") + sls[key].High:SetTextColor(1, 1, 1) + end + + if sls[key].Text == nil then + sls[key].Text = sls[key]:CreateFontString(nil, nil, "GameFontNormal") + sls[key].Text:SetPoint("TOP", sls[key], "TOP", 0, 16) + sls[key].Text:SetFont(STANDARD_TEXT_FONT, 12, "THINOUTLINE") + sls[key].Text:SetTextColor(1, 1, 1) + end + if type(vmin) == "number" then sls[key].Low:SetText(vmin) sls[key].High:SetText(vmax) @@ -420,8 +441,8 @@ function ImproveAny:InitIASettings() IASettings:Hide() end - ImproveAny:SetVersion(AddonName, 136033, "0.9.100") - IASettings.TitleText:SetText(format("ImproveAny |T136033:16:16:0:0|t v|cff3FC7EB%s", "0.9.100")) + ImproveAny:SetVersion(AddonName, 136033, "0.9.101") + IASettings.TitleText:SetText(format("ImproveAny |T136033:16:16:0:0|t v|cff3FC7EB%s", "0.9.101")) IASettings.CloseButton:SetScript( "OnClick", function()