API:ActionButtonGroupSetTintColor
From RoR Wiki
UI Lua API · ActionButtonGroup functions
Version: WAR 1.4.8
Tints one button of an ActionButtonGroup.
ActionButtonGroupSetTintColor(groupName, buttonIndex, r, g, b)
Arguments
- groupName
string– Name of an ActionButtonGroup window.- buttonIndex
number– Button number, starting at 1.- r, g, b
number– Red, green and blue on a 0–255 scale.255, 255, 255removes the tint.
Returns
Nothing.
Details
- Bug: the client reads the green value twice and never reads
b. The blue channel is always set to the same value as green. Grey tints (r = g = b), which is what the stock UI mostly uses, are not affected. - The values are divided by 255 (fractions are kept). The alpha used is the group's own opacity.
- The tint is applied to all the images of that button.
buttonIndexmust be between 1 and the number of buttons; otherwise the not a valid ButtonIndex error is raised. Fractions are dropped.- Unlike the other ActionButtonGroup functions, the does not exist message ends with a full stop.
- The function also has a No window specified. error, but it never triggers: a missing name is treated as an empty string, which gives the does not exist error instead.
Errors
Error in function call 'ActionButtonGroupSetTintColor': Window %s does not exist.Error in function call 'ActionButtonGroupSetTintColor': Window %s is not a ActionButtonGroupError in function call 'ActionButtonGroupSetTintColor': '%d' is not a valid ButtonIndex. (NumButtons = '%d')Error in function call 'ActionButtonGroupSetTintColor': No window specified.(never triggers)
Example
Greying out slots, from ea_guildvaultwindow/source/guildvaultwindow.lua:
ActionButtonGroupSetTintColor("GuildVaultWindowSlots", i, 128, 128, 128)
...
ActionButtonGroupSetTintColor("GuildVaultWindowSlots", i, 255, 255, 255)
