Hi Red,
It would be awesome if we could change the colour of the outside of the radial menu from the default blue
Hi Red,
It would be awesome if we could change the colour of the outside of the radial menu from the default blue
Hey, do you mean the color of all radial menus (including the buit-in ones)? Or only colors for radial menus created by plugins (via Player.showRadialMenu())? Do you want to set a general color for the entire menu, or individual colors per entry/item?
Ideally the accent colour on all menus, built in and API loaded ones.
But if we could set individual colours for each item that would be a bonus.
I could add a method to provide individual colors for each items (for plugin-created radial menus) However, changing built-in radial menus is a bit tricky... they're created dynamically, so it's very difficult to access them through the Internals class... the cleanest way for that would be to have an event (the event could then provide methods to modify the radial menu). It's on our to-do list, but unfortunately I have no ETA for that yet
But for plugin-created radial menus, it's actually already possible to modify it by overwriting the internal style of the menu. Unfortunately it's a bit cumbersome. The path to the entry is RadialMenuLayer/radialMenu/radial_X_Y_selector, while X is the amount of entries of the radial menu, and Y is the entry you want to change (first entry is 0).
For example, if you create a radial menu with 5 entries (i.e the arrays you provide have a length of 5) and you want to change the color of the first entry, the path would be RadialMenuLayer/radialMenu/radial_5_0_selector. The last entry, for example, would be RadialMenuLayer/radialMenu/radial_5_4_selector etc. The code could look like this:
But I will also add a parameter for that (to the Player.showRadialMenu() method), so there is no need to deal with internal styles. Probably it'll make it into the upcoming update
Thanks mate, that makes sense!
I'll have a mess with the Internals class.
Hi red51
Sorry to be a pain, but can you show an example for the MessageBoxLayer?
I've been trying to hack it for a few hours but I think just asking you may be easier
Sure, but it depends a bit on which message box you're using, because they have a slightly different layout Like the radial menu, they're created and attached dynamically, so you have to overwrite the style right after showing the message box to the player.
When showing a regular message box (via Player.showMessageBox()) and you want to change the left button, for example, the path would be MessageBoxLayer/DefaultMessageBox/buttonContainer/buttonCenterContainer/buttonLeft. The code to do that could look like this:
If you want to change the background color of the message box itself, for example, just apply the style to MessageBoxLayer/DefaultMessageBox. But keep in mind that message boxes have a background image, so instead of changing the backgroundColor, you have to change backgroundImageTintColor.
To get the path to elements, the easiest way is usually to use the integrated UI debugger (just enter uidebugger without parameters into console). Since active message boxes prevent you from opening the console, you can enable the UI debugger first, then bring up a message box. Hover the element to see the path of it (rightclick on it to copy the path, or alternatively find the path in the top left corner)
Don’t have an account yet? Create a new account now and be part of our community!