• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Targeting Mode

Status
Not open for further replies.
After I saw how TriggerHappy uses BlzFrameIsVisible to know, if a game is a replay. I had the idea that one could use a similar technique to know, if the local player is selecting a target for his current command.
That Technique in not sync on itself and might be not 100% safe.
In Targeting mode all command Buttons except the last (cancel) are hidden -> Means when only the 11. Button is visible the player is probably in Targeting Mode.

When one runs that function frequently one should be able to detect it.
Lua:
function isInTargetingMode()
    local index = 0
    repeat
        if BlzFrameIsVisible(BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, index)) then break end
        index = index + 1
    until index == 12 --when 12 is reached no button is visible

    return index == 11 --when the loop broke in index == 11 its targeting mode
end
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
I’m pretty excited about this. Been working on a system that allows multiple point targeting for spells and I’ve been stuck trying to detect if they’re still in targeting mode trying to use periodic timers that force hotkeys.
 
Status
Not open for further replies.
Top