mirror of
https://github.com/Lacustat/Freewood-OctoWoW-Mail.git
synced 2026-11-07 13:48:58 +00:00
0.1.241: Briefkasten: MAIL_INBOX_UPDATE zusammengefasst (Einfrieren beim Oeffnen) [ungeprueft]
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
735b3c36ef
commit
dd1a019d93
@@ -3,7 +3,7 @@
|
||||
## Notes: Own mailbox window: open all or selected mails safely, recent recipients, mailing lists with automatic sending, multi-item mails, gold surplus and cash on delivery.
|
||||
## Notes-deDE: Eigenes Briefkasten-Fenster: alles oder Ausgewähltes sicher öffnen, letzte Empfänger, Mailinglisten mit Automatik, mehrere Items, Gold-Überschuss und Nachnahme.
|
||||
## Author: Lacustat
|
||||
## Version: 0.1.240
|
||||
## Version: 0.1.241
|
||||
## Dependencies: Freewood-OctoWoW-Core
|
||||
## OptionalDeps: Freewood-OctoWoW-Creator, Freewood-OctoWoW-Brett
|
||||
|
||||
|
||||
@@ -1062,10 +1062,23 @@ function Mail:OnMailClosed()
|
||||
FW:Fire("MAIL_WINDOW_HIDE")
|
||||
end
|
||||
|
||||
-- Der Client meldet MAIL_INBOX_UPDATE zeitweise zigtausendmal in einem Bild. Darum nur vormerken und hoechstens alle 0,2 s einmal aufbauen.
|
||||
function Mail:OnInboxUpdate()
|
||||
if self.run then self.run.updated = true end
|
||||
if self.open and Mail.Loading() and (not self.loader or not self.loader:IsShown()) then self:StartLoader() end
|
||||
FW:Fire("MAIL_INBOX_CHANGED")
|
||||
self.updDirty = true
|
||||
if not self.updFrame then
|
||||
self.updFrame = CreateFrame("Frame")
|
||||
local acc = 0
|
||||
self.updFrame:SetScript("OnUpdate", function(f, elapsed)
|
||||
if not Mail.updDirty then acc = 0 return end
|
||||
acc = acc + (elapsed or 0)
|
||||
if acc < 0.2 then return end
|
||||
acc = 0
|
||||
Mail.updDirty = false
|
||||
if Mail.open and Mail.Loading() and (not Mail.loader or not Mail.loader:IsShown()) then Mail:StartLoader() end
|
||||
FW:Fire("MAIL_INBOX_CHANGED")
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function Mail:OnSendSuccess()
|
||||
|
||||
Reference in New Issue
Block a user