reload unit frames 3s after settings changes

This commit is contained in:
pepopo978
2025-08-06 10:40:02 -07:00
parent 74f5c80e22
commit 00c22ea07d
3 changed files with 13 additions and 3 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
## Interface: 11200
## Title: [|CFF33AAFFSUPERWOW|R] Cursive 2.4.0
## Title-zhCN: [|CFF33AAFFSUPERWOW|R] Cursive 2.4.0
## Title: [|CFF33AAFFSUPERWOW|R] Cursive 2.4.1
## Title-zhCN: [|CFF33AAFFSUPERWOW|R] Cursive 2.4.1
## Author: Pepopo
## Notes: Uses SuperWoW GUIDs to show units in combat and track curses
## Notes-zhCN: 使用SuperWoW的GUID功能来显示战斗中的单位并监视诅咒等
-1
View File
@@ -180,7 +180,6 @@ local barOptions = {
if v ~= Cursive.db.profile.bartexture then
Cursive.db.profile.bartexture = v
Cursive.UpdateFramesFromConfig()
Cursive.ResetUnitFrames()
end
end,
},
+11
View File
@@ -157,9 +157,20 @@ Cursive.UpdateFramesFromConfig = function()
if ui.rootBarFrame then
UpdateRootBarFrame()
end
-- after 3 seconds reset the unit frames so all changes are applied
Cursive:ScheduleEvent("resetUnitFrames", Cursive.ResetUnitFrames, 3)
end
Cursive.ResetUnitFrames = function()
-- hide all existing unit frames
for col, rows in pairs(ui.unitFrames) do
for row, unitFrame in pairs(rows) do
if unitFrame and unitFrame:IsShown() then
unitFrame:Hide()
end
end
end
-- clear cached frames so they are recreated
ui.unitFrames = {}
end