LemonUIbyLemon / LemonUI

LemonUI for .NET (FiveM, RageMP, RagePluginHook and ScriptHookVDotNet 3)
MIT License
177 stars 40 forks source link

Submenu items use Menu.subtitle instead of Menu.title for the generated MenuItem #113

Closed jaymirecki closed 1 year ago

jaymirecki commented 1 year ago

When you add a submenu, the item created in the parent menu uses the submenu's subtitle as the item's title (rather than the submenu's title, which I had assumed was used).

This seems like an intentional choice, but it was confusing to me at first (especially when I'm lazy and don't give a submenu a subtitle). Could we document this be documented more explicitly? Here's the code: https://github.com/LemonUIbyLemon/LemonUI/blob/master/LemonUI/Menus/NativeSubmenuItem.cs#L35

justalemon commented 1 year ago

The API of LemonUI is based on a subset of the NativeUI API, which does indeed uses Title for the banner text.

https://github.com/Guad/NativeUI/blob/1c6bfd48a6bce610acbec687a67b08d3c533ac64/NativeUI/UIMenu.cs#L220

I will probably end up marking Title as deprecated and create a new property called BannerText with the same usage and purpose.

jaymirecki commented 1 year ago

Yeah, that makes sense. I also went back and looked at how the in-game menus work, and it's the same way. I need to think of it more a: Title == Title of the group of menus Subtitle == Title of the specific menu that is visible right now.

justalemon commented 1 year ago

Ill keep this open so can remember to update the description of both properties.

justalemon commented 1 year ago

Title is now BannerText Subtitle is now Name SubtitleBehavior is now NameBehavior

justalemon commented 1 year ago

Update: SubtitleBehavior is now HeaderBehavior