Skip to content

Commit

Permalink
v0.9.81
Browse files Browse the repository at this point in the history
  • Loading branch information
d4kir92 committed Jul 4, 2024
1 parent 3bb7d92 commit 03a7e8c
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 15 deletions.
2 changes: 1 addition & 1 deletion ImproveAny.toc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Interface-Cata: 40400
## Interface: 100207, 110000

## Version: 0.9.80
## Version: 0.9.81
## 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.80
## Version: 0.9.81
## 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.80
## Version: 0.9.81
## 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_Vanilla.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 11502
## Version: 0.9.80
## Version: 0.9.81
## 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.80
## Version: 0.9.81
## 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
35 changes: 30 additions & 5 deletions libs/D4Lib/D4Frames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,21 @@ function D4:CreateEditBox(tab)
end

function D4:CreateSlider(tab)
if tab.key == nil then
D4:MSG("[D4][CreateSlider] Missing format string:", tab.key, tab.value)

return
elseif tab.value == nil then
D4:MSG("[D4][CreateSlider] Missing value:", tab.key, tab.value)

return
end

tab.sw = tab.sw or 200
tab.sh = tab.sh or 25
tab.parent = tab.parent or UIParent
tab.pTab = tab.pTab or "CENTER"
tab.value = tab.value or nil
tab.value = tab.value or 1
tab.vmin = tab.vmin or 1
tab.vmax = tab.vmax or 1
tab.steps = tab.steps or 1
Expand All @@ -99,16 +109,17 @@ function D4:CreateSlider(tab)
slider.Low:SetText(tab.vmin)
slider.High:SetText(tab.vmax)
local struct = D4:Trans(tab.key)
if struct then
if struct and tab.value then
slider.Text:SetText(string.format(struct, tab.value))
else
D4:MSG("[D4] missing format string:", tab.key)
end

slider:SetMinMaxValues(tab.vmin, tab.vmax)
slider:SetObeyStepOnDrag(true)
slider:SetValueStep(tab.steps)
slider:SetValue(tab.value)
if tab.value then
slider:SetValue(tab.value)
end

slider:SetScript(
"OnValueChanged",
function(sel, val)
Expand Down Expand Up @@ -250,6 +261,20 @@ end

function D4:AppendSlider(key, value, min, max, steps, decimals, func, lstr)
Y = Y - 15
if key == nil then
D4:MSG("[D4][AppendSlider] Missing key:", tab.key, tab.value)

return
elseif value == nil then
D4:MSG("[D4][AppendSlider] Missing value:", tab.key, tab.value)

return
end

if TAB[key] == nil then
TAB[key] = value
end

local slider = {}
slider.key = key
slider.parent = PARENT
Expand Down
17 changes: 16 additions & 1 deletion libs/D4Lib/D4Lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,28 @@ end

function D4:GetSpellInfo(spellID)
if spellID == nil then return nil end
if C_Spell and C_Spell.GetSpellInfo then return C_Spell.GetSpellInfo(spellID) end
if GetSpellInfo then return GetSpellInfo(spellID) end
if C_Spell and C_Spell.GetSpellInfo then
local tab = C_Spell.GetSpellInfo(spellID)
if tab then return tab.name, tab.rank, tab.iconID, tab.castTime, tab.minRange, tab.maxRange, tab.spellID end

return tab
end

D4:MSG("[D4][GetSpellInfo] FAILED")

return nil
end

function D4:IsSpellInRange(spellID, spellType, unit)
if spellID == nil then return nil end
if IsSpellInRange then return IsSpellInRange(spellID, spellType, unit) end
if C_Spell and C_Spell.IsSpellInRange then return C_Spell.IsSpellInRange(spellID, spellType, unit) end
D4:MSG("[D4][IsSpellInRange] FAILED")

return nil
end

function D4:GetMouseFocus()
if GetMouseFoci then return GetMouseFoci() end
if GetMouseFocus then return GetMouseFocus() end
Expand Down
4 changes: 2 additions & 2 deletions libs/D4Lib/D4Translations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ function D4:AddTrans(lang, key, value)
end

if key == nil then
D4:MSG("[D4:AddTrans] key is nil")
D4:MSG("[D4][AddTrans] key is nil")

return false
end

if value == nil then
D4:MSG("[D4:AddTrans] value is nil")
D4:MSG("[D4][AddTrans] value is nil")

return false
end
Expand Down
4 changes: 2 additions & 2 deletions settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ function ImproveAny:InitIASettings()
IASettings:Hide()
end

ImproveAny:SetVersion(AddonName, 136033, "0.9.80")
IASettings.TitleText:SetText(format("ImproveAny |T136033:16:16:0:0|t v|cff3FC7EB%s", "0.9.80"))
ImproveAny:SetVersion(AddonName, 136033, "0.9.81")
IASettings.TitleText:SetText(format("ImproveAny |T136033:16:16:0:0|t v|cff3FC7EB%s", "0.9.81"))
IASettings.CloseButton:SetScript(
"OnClick",
function()
Expand Down

0 comments on commit 03a7e8c

Please sign in to comment.