You don't have to change the UI template for that. Because it is a template.
The K5 Kerrigan uses the template and creates the UI elements for you if the unit exists and if you are the owner.
Take a look in the Actor of type Unit of the Unit K5 Kerrigan, and search for the field "Custom Unit Status Frame".
As you can see, the value is "HotS_UnitStatus/KerriganHeroUnitStatusFrameTemplate".
In the UI Editor, find the layout "HotS_UnitStatus".
From here, you can go to the Trigger Editor to hook up UI elements and do you changes.
Use the functions "UI - Hookup Unit Status Dialog Item" and "UI - Hookup Dialog Item", stock in a variable if necessary.
BECAREFUL ! THE TREE IN THE UI EDITOR IS NOT THE TREE CREATED IN THE GAME !!!
Use the UI debug shortcut Ctrl + Alt + F12 if you want to see the UI tree.
---
1/ Use the function "UI - Hookup Unit Status Dialog Item" on your unit which embeds the template. As for the parameter "Name", insert the string "UnitNameLabel".
2/ Same thing but you will now hook up the label, insert the string "UnitNameLabel/Label" (because the label dialog item is a child of the frame dialog item).
3/ You can now use the function to change the text of this label dialog item.
HAVE FUN
And a nice day.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I want to modify K5 Kerrigan's name on the status bar (HeroUnitEnergyStatusFrameTemplate) to another string, how do I do it in runtime by trigger?
I tried to send an actor message, but the "SetText" message is no use.
Hello,
You don't have to change the UI template for that. Because it is a template.
The K5 Kerrigan uses the template and creates the UI elements for you if the unit exists and if you are the owner.
Take a look in the Actor of type Unit of the Unit K5 Kerrigan, and search for the field "Custom Unit Status Frame".
As you can see, the value is "HotS_UnitStatus/KerriganHeroUnitStatusFrameTemplate".
In the UI Editor, find the layout "HotS_UnitStatus".
From here, you can go to the Trigger Editor to hook up UI elements and do you changes.
Use the functions "UI - Hookup Unit Status Dialog Item" and "UI - Hookup Dialog Item", stock in a variable if necessary.
BECAREFUL ! THE TREE IN THE UI EDITOR IS NOT THE TREE CREATED IN THE GAME !!!
Use the UI debug shortcut Ctrl + Alt + F12 if you want to see the UI tree.
---
1/ Use the function "UI - Hookup Unit Status Dialog Item" on your unit which embeds the template. As for the parameter "Name", insert the string "UnitNameLabel".
2/ Same thing but you will now hook up the label, insert the string "UnitNameLabel/Label" (because the label dialog item is a child of the frame dialog item).
3/ You can now use the function to change the text of this label dialog item.
HAVE FUN
And a nice day.