Minimap code help
For context, when you hover over the minimap or buttons, the buttons appear. When you are not hovering over it, they are hidden.
I have created a short delay for when the buttons disappear for visual pleasure. The problem lies with the last block of text, more specfically, "Minimap" and "MiniMapMailFrame". When my cursor goes from the Minimap or the MiniMapMailFrame to any of the specified buttons. Instead of cancelling the delay as it should. It continues with the delay and hides the buttons even when my cursor is on top of one of the buttons. Here is my code: https://pastebin.com/Taj8G9is |
You could fix this by using a boolean variable for show/hide. set the value to true OnEnter and to false OnLeave. In your function in which you set the alpha value you check this variable and only set alpha to 0 if the value is false.
|
would you mind showing me how to do so? Im new to coding so I just need an example to go off of if youre willing, thanks!
|
I did a rewrite of your code, i could tell its really messy :D
Check it out and tell me if it works as desired, i kept your way of canceling the timers. Code:
assert(LoadAddOn("Blizzard_TimeManager")) Something to point out, some mistakes you made:
|
Thank you so much for the wonderfully written and detailed response! It started as me wanting to hide a few things on my screen cause the default UI feels so cluttered and it turned into such a long journey of foruming and api scavenging. Its quite overwhelming trying to code properly as well as finding all the bugs.
I get a lua error down at line 57 "SetupHooks(frame): ". I assume something should be added there. |
just delete the colon in this line then it should be fine. Sorry :)
|
It works perfectly! Im sure ill be posting more on here about some other stuff. Im just making a (what I thought to be simple) addon that fades the micro menu, minimap buttons, and everything on the chat except the font string container. Would you be willing to give those a look when you have the time? If not I understand, you have already done so much.
|
sure, i am always down to help.
just create a new topic in the forums. Since i dont check the forums every day feel free to write me a pm this way i cant miss it. |
Keep posting publicly. It's really nice of pas06 to offer direct help, but it's better to keep your questions and issues public so that anyone can help. I've been in a similar situation before that turned into many PMs on another forum years ago, not that I'm suggesting you'll do that. It would've been better for that poster and me if the help was distributed around others willing to answer, along with any possible issues that would help someone later when they come across the thread.
|
Exactly, this is why i said he should post in forum and just write me a PM so i notice it and will answer in public so everyone can benefit :)
|
All times are GMT -6. The time now is 06:36 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI