WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Make frame register click and propagate it (https://www.wowinterface.com/forums/showthread.php?t=58174)

waxballoon 08-25-20 08:06 AM

Make frame register click and propagate it
 
Hi, I'm new to writing code in LUA and using the WoW API. I'm trying to build a small addon that keeps track of my gold on various characters / servers.
I'd like to make the visible frame in which I show the data partially transparent whenever a user start moving, either though keyboard press or a mouse click (middle or left and right simultaneously).
I've found out how to register and propagate keyboard clicks but while I have found "OnMouseDown" and "OnMouseUp" for mouse clicks I can't seem to register the clicks without preventing them to do any other action.
I have first tried just to use `SetScript` on my own frame and then since I wanted to register clicks anywhere on the screen that started movement I tried `HookScript` on the UIParent. As I previously mentioned this blocked any other click action.
I would like to just be able to notice that the user has started moving through the mouse clicks and use those as trigger to modify the alpha, without preventing other actions.
Does someone know how I can obtain the desired behavior?
Thank you in advance!

Edit: I encountered problems even with keyboard events since propagating the clicks prevents me from using "OnKeyUp" and therefore knowing when the user has stopped inputting movement.
Is there an all together simpler solution for detecting player movement?

d87 08-25-20 09:55 AM

PLAYER_STARTED_MOVING, PLAYER_STOPPED_MOVING events

waxballoon 08-25-20 10:11 AM

Well, that's great and solves my problem, thank you!

For now I've mostly learnt from https://wow.gamepedia.com, https://wowwiki.fandom.com/ and random question answers that pop up from here whenever I search for a specific problem. Is there any other big resource that I'm missing on?

myrroddin 08-25-20 03:34 PM

The WoWWiki is not current, and hasn't been actively updated (iE: passive data scrapes) in years. Stick to Gamepedia. You can also check out https://www.townlong-yak.com/ Tools menu. I often refer to the FramesXML/Globalstrings.lua file amongst others.


All times are GMT -6. The time now is 10:46 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI