• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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
 
Status
Not open for further replies.
Top