Function BlzUnitDisableAbility

  • Enables/disables and hides/unhides an ability for a unit. A visible disabled ability is shown as deactivated, an invisible ability disappears from the grid.

    Example (Lua):

    -- assume u is Human Peasant, AHbu is ability for Human building.
    -- keep enabled, but hide icon
    BlzUnitDisableAbility(u, FourCC"AHbu", false, true)

    Parameters

    • whichUnit: Unit<UnitEventMap>

      Unit to apply this to.

    • abilId: number

      Rawcode of ability.

    • flag: boolean

      isDisabled: true to disable (cannot click), false to enable ability.

    • hideUI: boolean

      isHidden: true to completely hide the icon, false to show icon. Icons are different for disabled/enabled abilities.

    Returns void

    Bug

    (1.32.10 confirmed) The game counts isDisabled and hideUI internally as integers(?) If you called 5 times "hideUI = true" to hide an icon then you'll need to multiple times "hideUI = false" to show it again. I do not exactly understand how it's counted. https://www.hiveworkshop.com/threads/blzunithideability-and-blzunitdisableability-dont-work.312477/

    Patch

    1.29

Generated using TypeDoc