#textdomain wesnoth
# These are clutter, scheduled to be removed.

# ! in comments is used for generating HTML documentation, ignore it otherwise.

#wmllint: markcheck off
#define DEPRECATE MACRO_NAME VERSION_NAME
    # Tag macros for removal, the VERSION_NAME argument is the
    # release where the message is shown the first time.
    # The removal will be 2 versions later.
    [deprecated_message]
        message="Macro '" + {MACRO_NAME} + "' is scheduled for removal in Wesnoth " + {VERSION_NAME} + "."
    [/deprecated_message]
#enddef
#wmllint: markcheck on

#define ADD_HERO_ICON FILTER
    # Add hero icon to specified units
    {DEPRECATE ADD_HERO_ICON 1.7.2}
    [store_unit]
        [filter]
            {FILTER}
        [/filter]

        variable=MODIFY_UNIT_store
        kill=yes
    [/store_unit]

    {FOREACH MODIFY_UNIT_store MODIFY_UNIT_i}
        [set_variable]
            name=MODIFY_UNIT_store[$MODIFY_UNIT_i].overlays
            value="misc/hero-icon.png"
        [/set_variable]

        [unstore_unit]
            variable=MODIFY_UNIT_store[$MODIFY_UNIT_i]
            find_vacant=no
        [/unstore_unit]
    {NEXT MODIFY_UNIT_i}

    {CLEAR_VARIABLE MODIFY_UNIT_store}
#enddef

#define REMOVE_HERO_ICON FILTER
    # Remove the hero icon from a unit by ID or other filter
    {DEPRECATE REMOVE_HERO_ICON 1.7.2}
    [store_unit]
        [filter]
            {FILTER}
        [/filter]

        kill=no
        variable=hero_removal_target
    [/store_unit]

    [remove_unit_overlay]
        x,y=$hero_removal_target.x,$hero_removal_target.y
        image=misc/hero-icon.png
    [/remove_unit_overlay]

    [clear_variable]
        name=hero_removal_target
    [/clear_variable]
#enddef
