So I have made a function that looks up the icon of a button and returns it as a string, you enter the button ID and it returns a string such as "Assets\Textures\btn-techupgrade-terran-empround.dds"
shopItemImages is a variable of type File > Image, when setting this variable you can enter a string directly into the "custom script", however for some reason it wont work with my function even if my function returns the exact same string.
This works
lib6EC3B984_gv_shopItemImages[lv_itemIndex] = "Assets\ \Textures\ \btn-techupgrade-terran-empround.dds";
This doesn't
lib6EC3B984_gv_shopItemImages[lv_itemIndex] = GetButtonIconImageString("SomeButtonId");
It's always the way, solve it yourself 5 seconds after you post!
For anyone else that has this sort of problem, it's because I was using the function name without the library reference, so instead of using GetButtonIconImageString() I needed to use lib6EC3B984_gf_GetButtonIconImageString()
Unfortunately because it is a File > Type Image, and not a string type, I have to put it in as a custom script as it wont show up in the function list.
As far as I know there is no way to turn a string into a file-image
So I have made a function that looks up the icon of a button and returns it as a string, you enter the button ID and it returns a string such as "Assets\Textures\btn-techupgrade-terran-empround.dds"
shopItemImages is a variable of type File > Image, when setting this variable you can enter a string directly into the "custom script", however for some reason it wont work with my function even if my function returns the exact same string.
This works
lib6EC3B984_gv_shopItemImages[lv_itemIndex] = "Assets\ \Textures\ \btn-techupgrade-terran-empround.dds";
This doesn't
lib6EC3B984_gv_shopItemImages[lv_itemIndex] = GetButtonIconImageString("SomeButtonId");
Any ideas? :(
It's always the way, solve it yourself 5 seconds after you post!
For anyone else that has this sort of problem, it's because I was using the function name without the library reference, so instead of using GetButtonIconImageString() I needed to use lib6EC3B984_gf_GetButtonIconImageString()
Unfortunately because it is a File > Type Image, and not a string type, I have to put it in as a custom script as it wont show up in the function list.
As far as I know there is no way to turn a string into a file-image
@KratsAU: Go
Necro time!
Solved -> http:www.sc2mapster.com/forums/resources/trigger-libraries/26708-get-image-from-script/#p1