Skip to content

Commit

Permalink
v0.9.101
Browse files Browse the repository at this point in the history
  • Loading branch information
d4kir92 committed Sep 25, 2024
1 parent 9bf8831 commit dbddf65
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 15 deletions.
4 changes: 2 additions & 2 deletions ImproveAny.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion ImproveAny_Cata.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion ImproveAny_TBC.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions ImproveAny_Vanilla.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion ImproveAny_Wrath.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion ele/minimap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
85 changes: 83 additions & 2 deletions libs/D4Lib/D4Frames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
29 changes: 25 additions & 4 deletions settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit dbddf65

Please sign in to comment.