• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Still no natives to get unit type icons etc.?

Status
Not open for further replies.
Level 25
Joined
Feb 2, 2006
Messages
1,686
I am just wondering if there are still no natives to retrieve the icon path of units, items, abilities etc. with the new natives from Reforged. Currently, I am using a hashtable in my map storing all icons I need: wowr/Systems.j at master · tdauth/wowr
Something like this:

JASS:
function AddUnitTypeIcon takes integer unitTypeId, string icon returns nothing
     call SaveStr(ObjectIdIconsHashTable, unitTypeId, 0, icon)
endfunction

function AddItemTypeIcon takes integer itemTypeId, string icon returns nothing
     call SaveStr(ObjectIdIconsHashTable, itemTypeId, 0, icon)
endfunction

function GetIconByUnitType takes integer unitTypeId returns string
    local string result = LoadStr(ObjectIdIconsHashTable, unitTypeId, 0)
    if (result == null or result == "") then
        return "ReplaceableTextures\\WorldEditUI\\Editor-Random-Unit.blp"
    endif

    return result
endfunction

function GetIconByItemType takes integer itemTypeId returns string
    local string result = LoadStr(ObjectIdIconsHashTable, itemTypeId, 0)
    if (result == null or result == "") then
        return "ReplaceableTextures\\WorldEditUI\\Editor-Random-Item.blp"
    endif

    return result
endfunction

Did I miss some natives?

I was wondering if there is a system if they do not exist yet which automatically provides the paths for standard Warcraft unit types/abilities/item types. Otherwise, I will have to register a lot by myself but I guess it wouldn't make much sense since you could change the icons of some standard object data.

Or maybe there is a tool which extracts the icons from the object data and generates the paths or function calls?
 
One can get the icon of unit/item/ability/tech codes using call BlzGetAbilityIcon(integer abilCode) call BlzGetAbilityIcon('Hpal'), sadly it does not work for buffCodes.

It works the same way for the tooltips using BlzGetAbilityTooltip(abilCode, 0) BlzGetAbilityExtendedTooltip(abilCode, 0)
 
Status
Not open for further replies.
Top