Thread Tools Display Modes
11-20-22, 10:06 PM   #1
reyard
A Defias Bandit
Join Date: Nov 2022
Posts: 2
Can you help me?

Hi I have a problem with this simple addon.
It's the code:

Code:


local addonName = ...
local f = CreateFrame ("frame")
f.db = {}

f:RegisterEvent ("ADDON_LOADED")
f:RegisterEvent ("TALKINGHEAD_REQUESTED")

f:SetScript ("OnEvent", function (self, event, arg1)
	if (event == "TALKINGHEAD_REQUESTED") then
		local displayInfo, cameraID, vo, duration, lineNumber, numLines, name, text, isNewTalkingHead = C_TalkingHead.GetCurrentLineInfo()
		if (f.db.already_saw [vo]) then
			C_Timer.After (1, TalkingHeadFrame_CloseImmediately)
		else
			f.db.already_saw [vo] = true
		end
	elseif (event == "ADDON_LOADED" and arg1 == addonName) then
		TalkingHeadRemovalDB = TalkingHeadRemovalDB or {already_saw = {}}
		if (not TalkingHeadRemovalDB.already_saw) then
			TalkingHeadRemovalDB.already_saw = {}
		end
		f.db = TalkingHeadRemovalDB
	end
end)
It works fine but It have LUA error.

Code:
1x Usage: C_Timer.After(seconds, callback)
[string "=[C]"]: in function `After'
[string "@YouOnlyHearOnce/YouOnlyHearOnce.lua"]:14: in function <YouOnlyHearOnce/YouOnlyHearOnce.lua:10>

Locals:
(*temporary) = "Usage: C_Timer.After(seconds, callback)"
This addon is an automatic close for talking head frame.
  Reply With Quote
11-20-22, 10:19 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
TalkingHeadFrame_CloseImmediately no longer exists in 10.x

Code:
C_Timer.After (1, function() C_TalkingHead.TalkingheadClose() end)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
11-21-22, 12:32 AM   #3
reyard
A Defias Bandit
Join Date: Nov 2022
Posts: 2
Originally Posted by Fizzlemizz View Post
TalkingHeadFrame_CloseImmediately no longer exists in 10.x

Code:
C_Timer.After (1, function() C_TalkingHead.TalkingheadClose() end)
Thanks but now I see this error.

Code:
1x YouOnlyHearOnce/YouOnlyHearOnce.lua:12: attempt to call field 'TalkingheadClose' (a nil value)
[string "@YouOnlyHearOnce/YouOnlyHearOnce.lua"]:12: in function <YouOnlyHearOnce/YouOnlyHearOnce.lua:12>

Locals:
(*temporary) = nil
(*temporary) = "attempt to call field 'TalkingheadClose' (a nil value)"
  Reply With Quote
11-21-22, 12:49 AM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
Code:
C_Timer.After (1, function() TalkingHeadFrame:CloseImmediately() end)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Can you help me?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off