[snippet] RefreshUI

Scripts

13 years
edited 8 years
Sometimes the unit interface needs to be refreshed in order to be displayed correctly.

For example, try to change the xp of an unit like every 0.05 s without refreshing the ui, and with it.

Code (jass) Select
library RefreshUI

    globals
        // just make sure you define an ability which will be never used
        private constant integer DUMMY_ABILITY = 'AImo'
    endglobals

    function RefreshUI takes unit u returns nothing
        call UnitAddAbility(u,DUMMY_ABILITY)
        call UnitRemoveAbility(u,DUMMY_ABILITY)
    endfunction

endlibrary
13 years
Nice snippet.

I remember I used to have those problems and someone told me to kill a unit to refresh the UI. iirc it worked, but it was a long time before I found out I could simply do this. :P
13 years
So you mean that if i kill a random unit every units' UI are refreshed ?!
13 years
Approved, this is an awesome snippet because it's short and sweet :D