• 0

    posted a message on Help making a minimap button
    Thank all you guys SOOOOOO much! With a little bit more tweaking i got everything the way i like and it works great, well great for my lack of programming skills anyway :P Thanks a ton, now for future reference i think ill be able to do this a lot easier. Woulda epic failed without you guys.
    Just uploaded it to curse and wowinterface and awaiting approval, at least hope any downloaders of it are satisfied :P
    Posted in: Need Help?
  • 0

    posted a message on Help making a minimap button
    Thank you soooo much. Now i don't know how it handles hiding the minimap icon itself, so i made another function to make sure the icon is hidden/shown based on user preference. I use this same function to hide/show all my frames upon login and it works fine but im getting thrown an error, even though the function stills perfoorms properly.

    [2009/02/02 23:53:19-704-x1]: LibDBIcon-1.0\LibDBIcon-1.0.lua:242: attempt to index field '?' (a nil value)
    Boks_Easy_Warr-2.7.0\Boks_Easy_Warr.lua:589: in function `FramesVisi_OnLoad'
    <string>:"*:OnEvent":1: in function <[string "*:OnEvent"]:1>


    It seems like it cant index the object? The function performs fine but this error is annoying. I put this function high up in my Lua to make sure it wasn't a problem with the order. From reviewing it it also seems like the library might have a auto hide/show feature? And from what someone said earlier i think it does but its not doing anything about this. Must i provide some dummy value for the addon to use?

    Also the function that the library uses to hide the icon seems to be a simple reference to the icon frame itself so i might just do that myself, it'll keep it the same as to how my addon handles all of its showing/hiding.
    Posted in: Need Help?
  • 0

    posted a message on Help making a minimap button
    I did change the saved file in my toc to BEWdb, BokSettings is my main table that stores all my values so i had to create a new empty table to store the minimapIcon values
    All the current code pertaining to this problem is here in this pasteybin link

    http://pastebin.com/d7617bd68
    Posted in: Need Help?
  • 0

    posted a message on Help making a minimap button
    Well i found out how to make the tooltip appear by looking into another addons code but im still having the problem. I believe im initializing my tables properly, how should i be? Ive had no problem with my normal settings table so far. And yes BEWdb was a brand new table i created that stores no other options.
    However i do believe i've seen a flaw. Moving the minimap icon does not appear to be changing the value in the table, so the value to save upon log out is the same as when it was logged in.
    So when i load the addon for the very first time it checks to see if BEWdb.minimapIcon has any values associated with it, if not it assigns the Libs default values.
    If i move the icon, hide it, etc it will not alter the table at all, causing the values on log out to be the same as when i logged in.
    When it next loads it sees that the table does have values from the last login so it doesnt change those, but wont even use the assigned values that it generated last time, it still just randomizes it.

    Hope that made sense. Im guessing the lib is suppose to alter the variables itself upon log out, but it's not effect the variables at all besides it preliminary launch when it generates its defaults.
    Posted in: Need Help?
  • 0

    posted a message on Help making a minimap button
    Well with a tiny bit of descronstructing from another addon i managed to get the tooltips working, but my minimap icon still randomly generates its position upon loggin.
    I have looked at this and tried to change it as much as possible to get it to work, i don't wanna keep posting here because i wanted to try and solve it myself but i'm thoroughly stumped. I dunno if my eyes are fooling me and the name is misspelled somewhere but ive checked over it to the extent of my knowledge with assistance from the web. The table does not seem to be saving or loading up properly. It saved the table once and now won't save it so the addon keeps randomizing the minimap button position upon log in. All the code that can affect the data object in anyway can be found here

    http://pastebin.com/d6afd065b
    Posted in: Need Help?
  • 0

    posted a message on Help making a minimap button
    Thanks for all the help, and sorry for my extreme noobiness with this code, that was perfectly and was simple enough that i should have noticed it myself.
    Everything shows up now, my only problem is making the tooltip show up. using the above code ( but with the first line of the tooltip code replacing self.defaultTitle with "Boks Easy Warr" ) it will never show up. It says different display addons might take different ways, but testing it on multiple display addons still won't show a tooltip on any of them.

    Edit: Also i've marked the table with which the Icon uses as its saved table to be saved in my toc, and atleast part of it does seem to be saving it does not seem to be loading up and using those saved variables or altering them now.
    AKA at first it saved minimapPos and radius as values, but now even if i move the icon, hide it, move the minimap itself, etc none of those two set values ever change, or a new value is never added (like it says it should save wether its hidden or not, and yet it does not do that.) So those initial values which it saved the first time arent changing and arent even being used, it just puts the minimap icon in a different spot everytime.
    I hid it using the LibStub("LibDBIcon-1.0"):Hide("BoksEasyWarr") which worked but it doesnt save that.
    Posted in: Need Help?
  • 0

    posted a message on Help making a minimap button
    LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("BoksEasyWarr", {
    	type = "launcher",
    	icon = "Interface\\Icons\\INV_Gizmo_TheBiggerOne",
    	tocname = "Boks_Easy_Warr",
    	OnClick = function(clickedframe, button)
    		BewConfigLauncher()
    	end,		
    	OnTooltipShow = function(tt)
    		tt:AddLine(self.defaultTitle)
    		tt:AddLine("|cffffff00" .. L["Click|r to open BEW config screen."])
    	end,		
    })
    LibStub("LibDBIcon-1.0"):Register("BoksEasyWarr", BoksEasyWarr, BokSettings.MinimapIcon)


    heres my embeds.xml which i run first in my toc if that could be the problem

    <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="Libs\LibStub\LibStub.lua"/>
    <Include file="Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua"/>
    <Script file="Libs\LibDataBroker-1.1\LibDataBroker-1.1.lua"/>
    <Script file="Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua"/>
    
    </UI>


    and thats all the code pertaining to the LibDB stuff

    Edit: And although the error persisted for awhile im no longer able to replicate the buttonbin error.
    Posted in: Need Help?
  • 0

    posted a message on Help making a minimap button
    I did that but im still receiving the error
    1. LibDBIcon-1.0\LibDBIcon-1.0.lua:206: attempt to index local 'object' (a nil value)
    Boks_Easy_Warr-2.7.0\Boks_Easy_Warr.lua:935: in main chunk


    also i was using buttonbin to test my object, and it was working fine, but then once when i did a console reloadui it broke for some reason. this is the error
    2. ButtonBin-1.0.60\ButtonBin.lua:461: attempt to index local 'tt' (a function value)
    ButtonBin-1.0.60\ButtonBin.lua:1749: in function `UpdateBlock'
    ButtonBin-1.0.60\ButtonBin.lua:494: in function `EnableDataObject'
    ButtonBin-1.0.60\ButtonBin.lua:338: in function `LibDataBroker_DataObjectCreated'
    ButtonBin-1.0.60\ButtonBin.lua:632: in function `ApplyProfile'
    ButtonBin-1.0.60\ButtonBin.lua:520: in function <Interface\AddOns\ButtonBin\ButtonBin.lua:510>
    (tail call): ?:
    <in C code>: ?
    <string>:"safecall Dispatcher[1]":9: in function <[string "safecall Dispatcher[1]"]:5>
    (tail call): ?:
    AceAddon-3.0\AceAddon-3.0.lua:366: in function `EnableAddon'
    AceAddon-3.0\AceAddon-3.0.lua:436: in function <...\AddOns\ButtonBin\Libs\AceAddon-3.0\AceAddon-3.0.lua:422>
    <in C code>: in function `LoadAddOn'
    Interface\FrameXML\UIParent.lua:229: in function `UIParentLoadAddOn':
    Interface\FrameXML\UIParent.lua:252: in function `CombatLog_LoadUI':
    Interface\FrameXML\UIParent.lua:414: in function `UIParent_OnEvent':
    <string>:"*:OnEvent":1: in function <[string "*:OnEvent"]:1>


    im not sure what caused that, as deleting everything that could effect it in my code doesnt work
    Posted in: Need Help?
  • 0

    posted a message on Help making a minimap button
    Ok, if i can just recieve one last bit of help for this ill be fine
    So i understand atleast decently well but im still having two problems.

    My icon shows in any LDB Display addon, but i still cannot get LDBIcon to work, is it implemented the same way as any other library? It has its own toc (although i didnt put that in ) but i cannot get it to work. I mean right now it seems like my icon will work with any LDB Display addon but i'd still like to try and get a minimap icon, and the documentation for LDBIcon seems scarce from my searchings.

    Also im having trouble getting the tooltip to be shown upon mousing over it. I've tried the several methods it lists but in none of the Display addons ive tried will it work.

    Once again thanks for all the help and any future help.

    Hoping you read this -BokTheGolem
    Posted in: Need Help?
  • 0

    posted a message on Help making a minimap button
    Thanks for all the help so far, iv'e done what i think ive should of done so far, but i get an error upon logging in
    Using the example the basic first code template off of GitHub i made a new data object and then i registered the icon or w/e LDBIcon tells you to do, and it seems like its atleast running correctly, but then i get an error when it tries to Register the DataObject

    The error is

    Libs\LibDBIcon-1.0.lua:206: attempt to index local 'object' (a nil value)
    Boks-Easy-Warr-1.5.5\Boks_Easy_Warr.lua:933: in main chunk


    i tried to look it over, and i tried to see the problem but none of my solutions worked

    (Also all this time ive forgotten to update my tocs version number in my addon, just a little note to myself)
    Posted in: Need Help?
  • 0

    posted a message on Help making a minimap button
    Well i looked it up, and i get what your saying im just having a few short term problems.
    Where exactly do i download these libraries? I cannot find anywhere to do so, or is this worked differently? Do the addons that support LDB have some built in support? Im pretty sure i understand what your saying, but with all this info on the Data Broker things i cant seem to make out exactly "how" to go about this.
    It seems this would be very useful, i just cant understand how this works exactly, as its supposed to be a sorta one for all type of thing? ( well in its very base atleast it seems to me, of course its more complex than that. )
    Edit: Its getting late and i gtg, but im gonna check back here tommorrow, so any help is still appreciated for me to read later.
    I ( think?) found the LDB forums but it still all confuses me. Curse.com also still confuses me, it seems the Data Broker forums are in a seperate section not acessable from the main forum index? I dunno, my mind might just be to hazy from a long period of no sleep so it might make sense to me later.
    Posted in: Need Help?
  • 0

    posted a message on Help making a minimap button
    Now these forums don't seem too active, but i hope i get some helpful responses.
    Now i searched it up a bit, but all of the guides, libraries, general info about this was heavily outdated and old or abandoned.
    I just want to add a minimap button for my addon. Now i understand the basics of this, i know the requirements for the specific frame dimensions and how to make it, im just wondering on how getting it to clamp to the minimap. I read something about Get the cursor position relative to the minmap but im still a new addon writer and i am not the most knowledged person.
    I just want to know how to make a simple minimap button that clamps to the minimap border.

    Any help is appreciated.
    Posted in: Need Help?
  • To post a comment, please or register a new account.