ScaleformUI - The Gary
ScaleformUI - The Gary is finally out!
This update is game changing! If you decide to switch to this version you will have to change all of your menus! Be sure to update the ScaleformUI_Assets script too as it's a MUST!
- Goodbye submenus!! The big change in this super update is the new way to handle how players are moved between menus!
- You can create all the menus you want (like you'd do for submenus) or you can create them outside your menu and then with a simple function you can Switch® your menu to the new menu! it can be done inside events too for example:
I want to open a submenu with the parents window inside
local windowItem = UIMenuItem.New("Windows item", "Yeah created on its own and handled on item selection")
windowItem:RightLabel("~HUD_COLOUR_DEGEN_CYAN~>>>")
exampleMenu:AddItem(windowItem)Then i only need to switch to the new Menu when item is pressed
local windowMenu = UIMenu.New("Windows Menu", "Windows Subtitle")
local heritageWindow = UIMenuHeritageWindow.New(0, 0)
local detailsWindow = UIMenuDetailsWindow.New("Parents resemblance", "Dad:", "Mom:", true, {})
windowMenu:AddWindow(heritageWindow)
windowMenu:AddWindow(detailsWindow)
local momNames = {names...}
local dadNames = {names...}
local momListItem = UIMenuListItem.New("Mom", momNames, 0)
local dadListItem = UIMenuListItem.New("Dad", dadNames, 0)
local heritageSliderItem = UIMenuSliderItem.New("Heritage Slider", 100, 5, 0, true, "This is Useful on heritage")
windowMenu:AddItem(momListItem)
windowMenu:AddItem(dadListItem)
windowMenu:AddItem(heritageSliderItem)
windowItem.Activated = function(menu, item)
menu:SwitchTo(windowMenu, 1, true) -- parameters are: UIMenu:SwitchTo([UIMenu]newMenu, [number]newMenuInitialIndex, [bool]inheritPrevMenuParams)
endAs simple as copy pasting! And don't worry for going back, the new BreadcrumbsHandler keeps history of your menu navigation like a web browser to let you go back to your previous menus!
Also this applies in the same way for C# users!
-
New Pagination subsystem:
- Doesn't matter where left your menu before going to another.. if you go back.. the new pagination subsystem will check the currentSelection of your menu, get the right page (totalitems / maxItemsVisible) and will draw those N items (if endless scrolling is enabled and not enough items in last page, the menu will start drawing from first index to keep a sense of infinte scrolling)
-
Scrolling the menu is now a feature! You decide how your players will scroll their menus! This power comes in 3 different ways:
- Classic => The menu will go from start to end and will go back to start and vice versa.. the old style
- Paginated => The menu will be divided in pages based on MaxItemsOnScreen parameter, you scroll from first item to last item in page and then change page like in a book
- Endless => The newer feature, your menu will never end.. first item and last item will always be connected making your scroll undefinitely infinite.
simply use
menu.ScrollingTypefor C# or menu:ScrollingType()` for Lua -
InstructionalButtons are now dynamically drawn! No need to set Enabled param anymore, they'll draw as soon as you add some buttons.. and will stop drawing when you clear the button List
-
All scaleforms are now static (means nothing to you.. but it meas a lot to the library!)
-
Colorful labels! No more need to "specify your text color" you can now format your items labels and right labels as you wish!! simply use the classic ~ text formatting
-
MenuPool became MenuHandler and removed its constraints, no more need to create a MenuHandler and add menus to it.. MenuHandler is now a Static object (it means you can call it wherever you want)
- Removed CloseAllMenus(), FlushAllMenus(), any WTFMenus(),
- Added instead a couple of new Functions:
- MenuHandler:SwitchTo([UIMenu]currentMenu, [UIMenu]newMenu, [number]newMenuCurrentSelection, [bool]inheritOldMenuParams)
- MenuHandler:CloseAndClearHistory() -- this function closes the current visible menu and clears the Breadcrumbs history
-
Added fading animations when opening / closing your menus
-
Removed MenuChanged event and reintroduced OnMenuOpen / OnMenuClose (you can check if menu is switching with BreadcrumbsHandler.SwitchInProgress (boolean) both in Lua and C#)
-
You can change fonts to items and SidePanel items, fonts are separated for left and right label (where right label is available), you can register you own with ItemFont.RegisterFont(gfxName, fontName) or use one of the provided via ScaleformFonts static class (available both in Lua and C#).
-
fixed various bugs you guys pointed me to.
-
Work to update the library to support C# Mono V2 has begun
-
Work to support JS runtime for FiveM has begun too (i haven't forgotten about you my JS friends!)
What's Changed
- Add notification characters + comment goback function to explain boolean call by @Mathu-lmn in #127
- chore: update version for package by @Local9 in #128
- fix: f7 example closes #120 by @Local9 in #129
- patch: update notification characters to match lua by @Local9 in #130
- [LUA] ShowFloatingHelpNotification Fix by @hellyet in #133
- C#: Paginate up fix by @QuadrupleTurbo in #138
- Fix IsUsingController use by @Mathu-lmn in #139
- Fix adding instructional buttons by @Mathu-lmn in #140
- Fix separator by @Mathu-lmn in #144
- ScaleformUI - The Gary merge changes for release by @manups4e in #143
New Contributors
Full Changelog: 3.0.2...4.0