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

Any event to detect moonwell rightclicks?

Status
Not open for further replies.
Level 15
Joined
Nov 30, 2007
Messages
1,202
when you right click, you should get issued some order, check that

I'm pretty sure its gonna be "smart"

I want to change 12 units life and hp based on the real unit. Not sure if just looping through them is better then checking the events.

Maybe this is wiser:
JASS:
private function periodic takes nothing returns boolean
        local integer i = 0
        local real hp
        local real mana
        loop
            if menu[i].c != 0 and city[menu[i].c].p == Player(i) then
                set hp = GetUnitState(city[menu[i].c].u, UNIT_STATE_LIFE)
                set mana = GetUnitState(city[menu[i].c].u, UNIT_STATE_MANA)
                if hp != menu[i].hp_cur then 
                    call SetUnitState(menu[i].control, UNIT_STATE_LIFE, hp)
                    set menu[i].hp_cur = hp
                endif
                if mana != menu[i].mana_cur then 
                    call SetUnitState(menu[i].control, UNIT_STATE_MANA, mana)
                    set menu[i].mana_cur = mana
                endif
        
            endif
            set  i = i + 1
            exitwhen i == bj_MAX_PLAYER_SLOTS
        endloop
        return false 
    endfunction
Then actually checking the events.
 
Last edited:
Status
Not open for further replies.
Top