hi there all im trying to add my ding code to a addon im building. and it all seems ok. but when loaded it shows things in dubble. i looked into what it could be and it seems to be the xml used for the ding. is there a way i can add this to the code without the need of the xml.
Code:
AutoDingFunc = true
--AutoDing
if AutoDingFunc then
function AutoDing_OnLoad()
this:RegisterEvent("PLAYER_LEVEL_UP");
DEFAULT_CHAT_FRAME:AddMessage("AutoDing Loaded", 1, 1, 0);
end
function AutoDing_OnEvent()
local DingMsg;
if (event == "PLAYER_LEVEL_UP") then
DingMsg = "DING! " .. tostring(arg1);
DEFAULT_CHAT_FRAME:AddMessage(msg, 1, 1, 0);
SendChatMessage(DingMsg,"PARTY");
SendChatMessage(DingMsg,"GUILD");
SendChatMessage(DingMsg,"Raid");
end
end
end
and the xml
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file ="wUltz.lua"/>
<Frame name="AutoDingFrame" parent="UIParent" >
<Scripts>
<OnLoad>AutoDing_OnLoad();</OnLoad>
<OnEvent>AutoDing_OnEvent();</OnEvent>
</Scripts>
</Frame>
</Ui>
so do i 1st need to make a
local Ding = CreateFrame("Frame")
then set the onload and on event to something else for the main part to call.
thanks all for your help