Need some help with implementating LibDaraBroker :(
For now i managed pretty well with resources on Internet but now I'm starting to loose it so hoping you can help me.
I'm trying to make a broker for my (first)mod and actually it worked nice until i disabled other mods (in this case recount+broker_recount). Then i got errors. So i'm guessing my mod isn't taking my own LibDataBroker but one from another mod but i leave that up to you. This is the code i use in my mod: LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("MyModNameHere", { type = "launcher", icon = "Interface\\Icons\\Spell_Fire_Fireball02", OnTooltipShow = function(self) GameTooltip:AddLine("Text", HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b) end, OnClick = function(clickedframe, button) if button == "LeftButton" then Frame1:Show(); end end, I have added 3 files in the root of my addon: LibStub.lua CallbackHandler.xml LibDataBroker-1.1.lua and also added these in this order in my .toc file. When logging in without any other mods enabled Swatter gives to following error: Message: ..\AddOns\HitAssist\Frame.lua line 35: Cannot find a library instance of "LibDataBroker-1.1". Debug: [C]: ? [C]: error() !Swatter\Support\LibRevision.lua:47: GetLibrary() HitAssist\Frame.lua:35: in main chunk -------------------- and Message: ..\AddOns\HitAssist\LibDataBroker-1.1.lua line 3: LibDataBroker-1.1 requires CallbackHandler-1.0 Debug: [C]: ? [C]: assert() HitAssist\LibDataBroker-1.1.lua:3: in main chunk So i hope anyone got any idea what i'm doing wrong and if you could explain it not to techie English would be great :p /cheer |
Quote:
|
First, it's CallbackHandler-1.0.xml (@twobits: the .xml file loads the .lua file- .xml files should be used in toc's if available instead of the lua files, as it makes it easier for you when the library author updates the lib and adds/removes files to it).
Second, if you have the lib files in folders inside your addon folder, make sure that that is part of your path in the toc file (ie, CallbackHandler-1.0\CallbackHandler-1.0.xml). Third, have you completely exited and restarted the game since adding those libraries to your project *and* its toc file? |
[quote=Tutje;115320]
I have added 3 files in the root of my addon: LibStub.lua CallbackHandler.xml LibDataBroker-1.1.lua and also added these in this order in my .toc file. Quote:
Indeed, but they say they put those 3 files in the directory, but none of them are the lua that the xml would want to then load, and the name of the xml missing the -1.0 by itself is fine as long as they have it changed the same in both places. |
Thanks alot for your reply's m8's :) Indeed i forgot the 1.0 in the callbackhandler, probably copied stuff from other mods and forgot that. Although that didn't solve the problem(only one of the 2 errors) i finally found the problem. (ow its so stupid) In my toc file i first call my frame.xml and frame.lua and Then my libs. But it turns out that should be the other way around. So stupid that i didn't notice that in other mods, but now its works :)
For seerah. I see other mods doing this as well and the callbackhandler.xml just looks like a redirect to me. So why do you want to put another callbackhandler file in your addon dir.? When there is a update you need to replace the xml file as well. Again, thanks alot! Its good to know there is an active forum for this stuff. /cheer |
Quote:
Quote:
Code:
libs/AceAddon-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceAddon-3.0/ The good side with wowinterface is that you also have a webinterface http://svn.wowinterface.com/svn.php to publish package directly from svn to your addon pages, so the zip will be generated with libs already included because wowinterface goes to download them for you because you had setup svn:externals links =) Sounds huge at starts but thats really easy to understand, anything you include in your mod which is not coded by you is a library you should setup in svn:externals to not care then on dlding it on x site to upload on y svn. There is just for now Git projects to force in your mod like LibDataBroker doesnt use svn but git and so on you cannot put a git link in your svn interface so better to upload directly only such mods in yours, but stuff like Callbackhandler are from Ace3 and directly available there svn://svn.wowace.com/wow/ace3/mainline/trunk/ for easy embedding |
pfff, it does sounds overwhelming indeed :) but interesting as well. I'm gonna check it out. For now my mod works so i can focus on some other updates needed. Thanks for writing it all down:)
For now my mod can be downloaded at www.hitassist.tk in case your interested :) /cheer |
All times are GMT -6. The time now is 02:27 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI