Updating tooltip while tooltip is still active.
ok i am still a bit on the newb side, so im asking this question to see if this is something that is even possible. i can show a tiny snippet of my code to see what im tying to accomplish.
Lua Code:
i used the minimap button creation tips i had found thru searching and atm it all works well for me, with one minor issue, i cant seem to find any documentation anywhere about how to update that last tooltip:AddLine("information here"); while the tooltip is still open and displaying. If this is something that cant be currently done that would be nice to know as well. What my main goal is here is to add in some displayfunctionality to my addon to show current state of your combat logging. i do believe i have accomplished that with just this one issue perplexing me. Only reason i wanted to add this sort of ability is because i used loggerhead for a long while and liked how it functioned, however its not been updated for atleast last 2 patches. I know my addon is going to be NO WHERE near the functionality as that one. If i need to post my entire LUA file here please let me know as well, i just wanted to atleast get some inut as to what im looking to do is capable |
You can call GameTooltip:AddLine() whenever you want and add text just fine. What you're missing is that you should always call GameTooltip:Show() after adding to it in order to refresh the tooltip, make sure everything is shown that you want, and to make the GameTooltip resize itself to fit your new lines.
|
i can get my tooltip to display perfectly with one exception, i would like for it to reset when i right click to update the tooltip info without having to move my mouse off the tooltip and rehover. i tried adding what your proposing and it isnt working. i tried adding just the GameTooltip:Show() in under my right onclick events and it just doesnt reset the tooltip unless i rehover over the tooltip. Am i missing something in my understanding? or can you not refresh a tooltip on a mouseclick?
++++++ sorry i passed my event in an incorrect variable i had similar to the enable and disable logging functions. it adds a line just fine, however if i just keep clicking i can end up with 500 lines of tooltips. Is there a way to simply overwrite an existing ine in your tooltip? |
AHHH i did figure it out, sorry to have bugged ya with the reply, it took me some figuring out to call a GameTooltip:ClearLines() first then append all the tooltips i want added back after that call. Tho it would be much nicer if there was a way to just remove line 3 and replace it with a new line. Sorry to seem such a newb and TY for your help, you pointed me in the right direction and i definatly appreciate that. Guess now that leaves my TODO list at figuring out how to save the position of my minimap icon properly lol thats another day tho.
|
Just change the text of line three then. ;)
GameTooltipTextLeft3:SetText("new text!") |
Generally, if you have access to the function that creates the tooltip in the first place, you can just call it again. It shouldn't matter if the tooltip is still showing.
|
Well ty again guys, i do appreciate all your help. I am having trouble with another issue now and it keep reading and still havent found my answer so possibly maybe you could also give me alil more help. What im trying to do is have my minimap icon remember its position and well i just cant seem to figure this one out, ive read 5 different sites and each one seems to have completely different ways of doing it and i cant seem to get any of them to work, so ill post my LUA file and see if you could possibly point me in a direction other than ive attempted.
Lua Code:
That is the part of my LUA that has anything to do with my icon aside from my already assigned functions: LOGSTATE() enablelogging() disablelogging() my toc file contains a line reading ## SavedVariables: MaggzAutoLogDB i cant seem to figure out what im doing wrong. its probably something so simple and im just too dumb to figure it out. |
Quote:
|
Quote:
The bad thing if you start off programming directly with libraries is you never really learn how the actual WoW API works, instead, the libraries are doing all the grunt work for you and you develop a dependency on them. Let's say you name your global MaggzAutoLog_Options: ToC: Code:
## SavedVariables: MaggzAutoLog_Options Lua Code:
This is pretty much a self-contained addon, all that it needs is an interface that toggles LoggingCombat(). If anyone with Ace3 knowledge wants to create better code, go right ahead. :D Edit: Line 38: Code:
local vars = LibStub("AceDB-3.0"):New("MaggzAutoLogBD", defaults); |
ty for seeing that darn typo, im actually not looking to add a variable in to call for if the log is enabled, thats something i can easily do in game, im having an issue with setting and remembering minimap icon position. i have been reading alot more and did get my DB to add my character nam and realm to the DB which is something im not trying to do but atleast my DB is adding stuff altho its not the right stuff lol. ill keep at this and see if i get any luck TY all for your help here BTW.
ok with a few more changes im getting my DB to have the correct data, however i dont know how to get my minimap icon to load at the saved position, still reading thru stuff so i may end up getting this one however if someone sees changes i need to make to do this here is my NEW lua file:: Lua Code:
still working some things out so it is still a but messy. |
The problem is that you are initializing your DB before the user's saved DB is actually loaded, so it's always resetting to defaults, and ignoring whatever the user had saved before.
Using AceAddon is massive overkill for something so small. Using AceDB is probably also overkill for something so simple. Unless you plan to add a large number of complex options that users are likely to want to share between some characters but not others and take a long time to set up, I'd avoid using AceDB. For shared settings, use SavedVariables. For per-character settings, use SavedVariablesPerCharacter. I'd go with something like this: Code:
local f = CreateFrame("Frame", "MaggzAutoLog") |
Ty phanx, your setup definatly assisted me in getting my addon working 100%. I didnt end up using your simpler approach mainly because i couldnt figure out how to change the minimap icon using frames. it just seemed easier to do it in something similar to my original setup. I wouldnt have been able to even get this nailed down tho if it wasnt for you and seerah's help for sure so i thank you VERY VERY much. This will allow me to now change my autolog from just a text based cmd line addon to something nicer, along the lines of what loggerhead was prior to it adding in the learning based on previous instances. maybe eventually ill head that way with this addon however i mainly used this addon to help me learn all this stuff as i am wanting to do something else after this.
|
What do you mean by "change the minimap icon"? Change it how? When?
|
Quote:
|
LibDBIcon just uses your data object's icon.
Code:
f.dataObject = { |
ahh see i was calling for the icon change in the functions i created and it wasnt working for me with that method which is why i chose to use the libDbicon method which just allowed me to call externally outside the actual object i was creating. was doing that to try and keep things clean and understandable to me in the future incase i have to update things later, however it seems your way does do the same thing and im just a nub who didnt figure it out. only issue im really having now with it is, if i am in a raid instance do a /reload or logout and back in (either form does this to me) is that my initial icon does not change i did try putting the IF THEN ELSE setup you showed me there to have it set the icon on load to whichever is currently the state of logging, however it seems to return errors using that in the first half of the creation.
Ill probably try and see about setting up a DB to perform this function at a later date, just have some other things im working on atm. however regardless ty for the suggestions and help thus far. |
Quote:
|
A big Thank You
Ok i wanted to post to this thread again even tho it is a bit late. I finished my addon and posted it for download, it all works great (even tho i tend to mess with it EVERYDAY). Anyhow i wanted to specifically thank Phanx and Seerah for your immense help. After a week or so i actually went thru it all and redid all my ACE3 bloat functions and removed them defaulting back to the normal coding you guys posted here as help for me. Not only where you both correct that this addon i made was FAR to small to even need any of that stuff, when i tried adding new features (hiding minimap icon so a UI looks clean while having chocolate bar or something similar) it just made things so confusing for me i broke the addon itself because of all the confusion. So in essence i want to thank the both of you for your help and showing me there is NO need for all that bloat on small addons. I just wanted to post this message as a thanks to you for all your help.
|
SDPhantom spoke of no need for libraries, not me. (Though I agree with him on it - I only use libs to make my options panels, and then only if they're more than just a few settings.)
|
Well then i also extend my thank you to them as well.
|
All times are GMT -6. The time now is 10:06 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI