basically i just want to change the colour for a item dynamically. is it possible? (without replacing the icon of the button with an imported icon with different colour)
I would say use set Dialog Item Desatured Flag to True and then play around with Set Dialog Item Desaturated Color to emulate the colors for each race.
You need to hookup border image of a button. It is tricky and i'm not sure if i know how to do it. Anyway you need to find command button template for inventory buttons in ui editor and find BorderImage in it to know the exact path for hook up...
i have hooked UIContainer/ConsoleUIContainer/InventoryPanel/InventoryButtons/Button00/GameButtonBorderImage and it really works.
The Button00 inherits from a button, which inherits from a button, which inherits from GameButton which has a GameButtonBorderImage. (i start thinking OO is shit)
Setting it to Desaturated colour works exactly as it should. thx
btw do you know the colour code of protoss buttons?
Hmm, i'm rly shit in programming so i usualy have an issues with this inheriting in xml objects (not always can see clearly the hierarchy). Glad that youre more skilled in this :>. No, i dont know the code, but are you sure it's tint? mb you should change texture file for this? I saw there are separate images for each race.. not sure though.
it works as it should (see screenshot). and it only affects the button not the background (the grey stuff). colour code for protoss buttons is (28%, 55%, 100%). i have choosen red and not zerg colour but any colour is possible. my trigger:
@FunkyUserName: Go
I would say use set Dialog Item Desatured Flag to True and then play around with Set Dialog Item Desaturated Color to emulate the colors for each race.
@Apollys: Go
ok i tried that. what is does: it coloures everything that is white with the colour, the button itself stays blueish protoic.
You need to hookup border image of a button. It is tricky and i'm not sure if i know how to do it. Anyway you need to find command button template for inventory buttons in ui editor and find BorderImage in it to know the exact path for hook up...
@abvdzh: Go
i have hooked UIContainer/ConsoleUIContainer/InventoryPanel/InventoryButtons/Button00/GameButtonBorderImage and it really works.
The Button00 inherits from a button, which inherits from a button, which inherits from GameButton which has a GameButtonBorderImage. (i start thinking OO is shit) Setting it to Desaturated colour works exactly as it should. thx
btw do you know the colour code of protoss buttons?
Hmm, i'm rly shit in programming so i usualy have an issues with this inheriting in xml objects (not always can see clearly the hierarchy). Glad that youre more skilled in this :>. No, i dont know the code, but are you sure it's tint? mb you should change texture file for this? I saw there are separate images for each race.. not sure though.
@abvdzh: Go
it works as it should (see screenshot). and it only affects the button not the background (the grey stuff). colour code for protoss buttons is (28%, 55%, 100%). i have choosen red and not zerg colour but any colour is possible. my trigger:
Parameter
player = 0 <int>
button = 0 <int>
colour = Color(0,0,0) <color>
local Variables
inventoryButtonImage = c_invalidDialogControlId <control>
inventoryButtonBorderImage = "" <string>
SetVariable(inventoryButtonBorderImage, (CombineStringsMult("UIContainer/ConsoleUIContainer/InventoryPanel/InventoryButtons/Button0", (IntToString(button)), "/GameButtonBorderImage")))
DialogControlHookupStandard(c_triggerControlTypeImage, inventoryButtonBorderImage)
SetVariable(inventoryButtonImage, (DialogControlLastCreated()))
SetDialogItemDesaturated(inventoryButtonImage, true, (PlayerGroupSingle(player)))
SetDialogItemDesaturationColor(inventoryButtonImage, colour, (PlayerGroupSingle(player)))
DialogControlDestroy(inventoryButtonImage)
important to destroy the hook or it will only work once.
should i necro all posts regarding this problem and linking to this?
can you tint the buttons icons as well based on race?
@herdal8: Go
which icons? you can hook up nearly everything
@FunkyUserName: Go
the icons for the buttons that are tinted based on race
well, i guess you have to turn it off on the buttons and then hook them up (the command buttons) and set them manually, but you have to test it.
is there a tutorial about hooking things i haven't manged to get it to work