Deathlog

Deathlog

2M Downloads

The DeathAlert Message never disappears

jhj0517 opened this issue ยท 4 comments

commented

I don't know if this only happens to me, but when I test the latest version from Github, the DeathAlert message never disappears from the screen. This version is different from the one on CurseForge, as the CurseForge version works fine.
It seems the recently merged part becomes problematic :

death_alert_frame:Show()
death_alert_frame.text:SetFont(
fonts[deathlog_settings[widget_name]["font"]],
deathlog_settings[widget_name]["font_size"]
)

The DeathAlert message never goes away from the screen when I /run Deathlog_DeathAlertFakeDeath() and when the real DeathAlert appeared.
Maybe because of calling SetFont() after Show()?

The error message in console is

Message: FontString:SetFont(): Arguments: ("font", fontHeight [, flags])
Time: Tue Sep 19 04:33:02 2023
Count: 3
Stack: FontString:SetFont(): Arguments: ("font", fontHeight [, flags])
[string "=[C]"]: in function `SetFont'
[string "@Interface/AddOns/Deathlog/Widgets/DeathAlert/widget.lua"]:288: in function `Deathlog_DeathAlertPlay'
[string "@Interface/AddOns/Deathlog/Widgets/DeathAlert/widget.lua"]:79: in function `Deathlog_DeathAlertFakeDeath'
[string "Deathlog_DeathAlertFakeDeath()"]:1: in main chunk
[string "=[C]"]: in function `RunScript'
[string "@Interface/FrameXML/ChatFrame.lua"]:2235: in function `?'
[string "@Interface/FrameXML/ChatFrame.lua"]:4966: in function `ChatEdit_ParseText'
[string "@Interface/FrameXML/ChatFrame.lua"]:4629: in function `ChatEdit_SendText'
[string "@Interface/FrameXML/ChatFrame.lua"]:4665: in function `ChatEdit_OnEnterPressed'
[string "*ChatFrame.xml:121_OnEnterPressed"]:1: in function <[string "*ChatFrame.xml:121_OnEnterPressed"]:1>

Locals: (*temporary) = FontString {
 0 = <userdata>
}
(*temporary) = nil
(*temporary) = 16
commented

I closed this issue thinking it was duplicated with #33, but it seems this is different, so I am reopening it. sorry.

commented

Did you recently remove an addon that had the font that you were using? Either way, we should try to handle that case

commented

try master if you don't mind. I added a fallback in case the font is missing

commented

@aaronma37 I just tested it and it works fine with fallback, thanks!
I'm closing.