• 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.

[General] Minimap UI Button Detection

Status
Not open for further replies.
Level 4
Joined
Aug 26, 2012
Messages
123
How about using Camera Events?
(He means that when you clicked the minimap, the camera will go there, won't it?)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Never heard of that, going to check it out right now (don't pings change the spacebar location? Maybe like that... although there are many things that change the spacebar location :p).

I already found something like
JASS:
GetAllyColorFilterState( )
I'll go check it out when combined with local players to see if it works. Going to keep you updated :D

Edit:
JASS:
function getFilters takes nothing returns nothing
    local integer i = 0
    local integer colorFilter
    local boolean creepFilter
    
    loop
        exitwhen i == 16
        
        if GetLocalPlayer() == Player(i) then
            // 0 = no filter
            // 1 = minimap colors filtered
            // 2 = all colors filtered
            set colorFilter = GetAllyColorFilterState( )
            // true = creep camps on
            // false = creep camps off
            set creepFilter = GetCreepCampFilterState( )
        endif
        
        set i = i+1
    endloop
endfunction
This works as intended. You can loop through this and see when something has changed.
I couldn't find anything for the formations, terrain toggle and ping (aside from the spacebar location).
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I thought I had an idea for the formation, but it probably won't work because triggers don't pay attention to the formation :p

(I thought of creating a melee and ranged unit and let them do a very short race to a region - the thing is that the ranged unit would have a head-start. If formation is on, the ranged unit would be last because he would wait for the melee unit to pass first, if formation is on he would be first).
Didn't test it, but you need to select those units at the same time and order them to move, otherwise the formation won't activate.

I've looked at many functions, but couldn't find anything relevant There are some of which I have no clue what they do :p (such as SetUnitTypeSlots takes unit, integer).
Maybe the answer lies within those unknown functions, but I certainly couldn't find it.


The ping is still plausible though. What can change spacebar locations? As far as I know it's always with a unit (or structure) at the center. So if the spacebar location is different from the previous one and does not have a unit at its center (you can check within a reasonable range), then it must be a ping.
The main problem is that you can ping at units as well, which would completely ruin the idea :p

Besides that, I can't be of any more help. I hope others will still look at this thread.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Brilliant question, seems like I've failed quite a bit :p
There is something called SetCameraQuickPosition( ... ), which sets the spacebar location, but there is no GetCameraQuickPosition( ... ).
Seems like I misread that at first, which is pretty stupid of me. Why didn't Blizzard add that? D:
(Even though there are multiple of them per player, they could at least return the latest one).

Sorry about that :3
 
Status
Not open for further replies.
Top