Releases: manups4e/ScaleformUI
Bug Fixing
As always we repeat that you MUST update the assets script along with the API.
What's Changed
Full Changelog: 4.6...4.7
Menu Filtering and BugFixing
Small update with bugfixing and added a small feature for both C# and Lua: Menu filtering.
- You can now filter your UIMenu(s) and sort them with specific functions:
-
Filtering:
- Lua - menu:FilterMenuItems(predicate) will let you filter only the items with the returned predicate(
function(_item)
) when true, example:
itemFilter.Activated = function(menu, item) local inputString = "" AddTextEntry('FMscui_KEY_TIP1', "Input filter") --Sets the Text above the typing field in the black square DisplayOnscreenKeyboard(1, "FMscui_KEY_TIP1", "", "Item", "", "", "", 10) --Actually calls the Keyboard Input while UpdateOnscreenKeyboard() ~= 1 and UpdateOnscreenKeyboard() ~= 2 do --While typing is not aborted and not finished, this loop waits Citizen.Wait(0) end if UpdateOnscreenKeyboard() ~= 2 then local result = GetOnscreenKeyboardResult() --Gets the result of the typing Citizen.Wait(250) --Little Time Delay, so the Keyboard won't open again if you press enter to finish the typing inputString = result --Returns the result else Citizen.Wait(250) --Little Time Delay, so the Keyboard won't open again if you press enter to finish the typing inputString = "" --Returns false if the typing got aborted end -- filter predicate receives the item on its own and process it as you desire, consider that only when the predicate returns true, the item will be added to the Items list menu:FilterMenuItems(function(itemToCheck) return string.lower(itemToCheck:Label()):find(string.lower(inputString)) ~= nil end) end
- While for C# it's a bit more clear:
UIMenuItem itemFilter = new UIMenuItem("Item filtering", "Select this item to filter items based on their labels"); itemFilter.Activated += async (menu, item) => { string filter = await Game.GetUserInput(10); menu.FilterMenuItems((mb) => mb.Label.ToLower().Contains(filter.ToLower())); };
- Lua - menu:FilterMenuItems(predicate) will let you filter only the items with the returned predicate(
-
Ordering:
- Lua: menu:SortMenuItems(predicate) where predicate is a function receiving 2 items (
function(pair1, pair2)
) you can then process the 2 items to make your checks and only those returning true will be added to the list, example:
local itemSort = UIMenuItem.New("Item sorting", "Activate this item to sort items alphabetically") itemSort.Activated = function(menu, item) -- sort predicate receives 2 parameters.. item1, item2.. items input is automatically filled by the system. menu:SortMenuItems(function(pair1, pair2) return string.lower(pair1:Label()) < string.lower(pair2:Label()) -- pairs from shortest label to longest end) end
- in c# it's a bit more clear:
UIMenuItem itemSorter = new UIMenuItem("Item sorting", "Activate this item to sort items alphabetically"); itemSorter.Activated += (menu, item) => { menu.SortMenuItems((pair1, pair2) => pair1.Label.ToString().ToLower().CompareTo(pair2.Label.ToString().ToLower())); };
- Lua: menu:SortMenuItems(predicate) where predicate is a function receiving 2 items (
-
Clearing items, simply call menu:ResetFilter() / menu.ResetFilter() to restore all the items to their original order.
-
What's Changed
Full Changelog: 4.5.1...4.6
If you didn't do that yet, join my discord server to talk about scripting, scaleformui, coding, and chilling :D https://discord.gg/KKN7kRT2vM
Colors! Colors everywhere!! (Revamped PauseMenu / Lobby Finale)
⚠️ CODE BREAKING UPDATE AHEAD! UPDATING WILL REQUIRE YOU TO EDIT YOUR CODE TO MEET THE LATEST CHANGES!
Here we are in our final update for the PauseMenu and LobbyMenu enhancements plan!! This time.. all ScaleformUI API was updated!
- The biggest feature for this update is the new SColor class for both Lua and C#!
- SColor is a class that let's you handle your favourite colors (both system.. custom.. and HUD colors), its main features are the ability to handle such colors in their
A
,R
,G
,B
values.- For C# devs.. this is an exensions of
System.Drawing.Color
with some goodies like Hex support and HudColor support. - For Lua devs.. this is a MetaTable with custom initializers such as
FromArgb(number)
,FromArgb(a,r,g,b)
,FromHex(hexString)
,FromHudColor(colorId)
, with added functions likeToArgb() [number]
,ToHex() [string]
,Brightness() [number]
,Hue() [number]
,Saturation() [number]
, SColor can be printed directly to show all the color data in one print (example:print(color)
) - SColor handles
A
,R
,G
,B
values for both Lua/C# and provides extended color functionalities to the scaleforms that were restricted with HudColors before. - This changes requires you to change your code both in Lua and C# to meet the requirements.. luckily.. SColor provides all the system colors and HudColors already converted.. simply use
SColor.HUD_Freemode
for hud freemode color(116)
orSColor.Purple
for system color purple(-8388480)
- Custom colors can be loaded by
hex
,argbInt
,[a,r,g,b]
,HudColor
values, the class also provides aFromRandomValues()
function that will randomize the color for you 😄 - SColor is not restricted to ScaleformUI.. with its
a,r,g,b
, nature.. it can be used with Natives that wanta,r,g,b
values as input.
- For C# devs.. this is an exensions of
- Lua: Renamed
Colours
enum intoHudColours
to meet C# naming conventions - PauseMenu and Lobby both in their multi column interface now lets you choose between newStyle or oldStyle, with a simple parameter in Lobby / PlayerListTab constructor you can now decide how players will navigate the menu.
- NewStyle is the new navigation system where left/right changes column selection
- OldStyle is the GTA:O navigation system where left/right are disabled and you can change column with
SelectColumn
function both in Lua and C# (tab.SelectColumn/tab:SelectColumn
) parameter can be the column to switch to.. or its index never been so easier!
- a new
CreawTag
class has been made for both Lua and C# for the PlayerItems in Lobby/PauseMenu this is the original R* tag and since it's not a simple string but a regex one, the constructor will help you deciding how to make your players tag (max 5 chars / 4 chars with the R* symbol)
👀 Don't forget to take a look at the example files to check the added changes!
What's Changed
Full Changelog: 4.3.5...4.5.1
⚠️ UPDATING THE ASSETS IS MANDATORY AS ALWAYS! ⚠️
Revamped PauseMenu and Lobby (Part 2)
This is the second part of the Revamp!!
- PauseMenu PlayerListTab and Lobby now have introduced the UIMenu's Pagination system, this means that you can now add up to 5000 items without the menu lagging nor erroring out!!! 🎉 🎉
This may seem just an update.. but it's actually a complete rework of the internal system! You can also set the scrolling type for each column choosing between Classic (default), Paginated and Endless!
Full Changelog: 4.3...4.3.5
UPDATING ASSETS RESOURCE IS MANDATORY!!!
❤️❤️ If you enjoy my work and my menus, and you want to support me, you can contribute by donating via PayPal / ko-fi or by buying ScaleformUI on Tebex (You decide the price!)
Revamped PauseMenu and Lobby! (Part 1)
It may seem that nothing changed!! But a lot has changed!!
- Added a new Lobby / PlayerListTab MissionsColumn where you can add the new MissionItem settings its color own color and its own icons!! Like in GTA:O PauseMenu!!!
- The code to create a new PlayerListTab has changed.. now it's the same as for Lobby in both C# and Lua!
What's Changed (Contributions)
- chore: bump version by @Local9 in #175
- C#: Remove Debug lines by @ash2148 in #176
- C#: Fix index issue when scrolling left/right in tabs by @ash2148 in #177
New Contributors
Look at all the changes here: 4.2.5...4.3
❤️❤️ If you enjoy my work and my menus, and you want to support me, you can contribute by donating via PayPal / ko-fi or by buying ScaleformUI on Tebex (You decide the price!)
UIRadioMenu and BugFixing
A new Radial Menu has been added UIRadioMenu
is now available to test and create, using the original Radio Stations Scaleform (and animated) you can now create your own menus and submenus in a riadial form with it.
What's Changed
- Fix current index on UiMenu:Clear() by @Zedsku in #169
- fix(notification / lua) : type default by @Mathu-lmn in #174
- [C# MinimapOverlays: fix overlay removing] (42fef50)
- C# example: added 3d settings for menu
- C# UIMenu: Default itemsPerPage is 7 and not 0
- Lua: fix for pause menu stopping the loop
- [Lua: fix for MouseControlsEnabled still selecting menu onclick when disabled] (15e5240)
- C# Added Clear methods for lobby /playerTab columns
- C# fix for Lobby SettingsItem made with wrong label
- C# Added feature to add settings items with menu open
- Lua: Sync latest C# commits
- Lua: Sync latest C# commints, part 2
- Lua: reIntroduced Edge camera controls
- C# Added new UIRadioMenu using RadioStation HUD scaleform
- C# MenuHandler: handle UIRadioMenu when switching
- Lua: Sync UIRadioMenu from C#
- Other minor fixes in Scaleforms code for performance and bugfixing.
New Contributors
Full Changelog: 4.2.3...4.2.5
❤️❤️ If you enjoy my work and my menus, and you want to support me, you can contribute by donating via PayPal / ko-fi or by buying ScaleformUI on Tebex (You decide the price!)
MinimapOverlays and bug fixing.
We are super glad to announce that thanks to @wowjeeez we just started to port ScaleformUI to the JS community! Keep an eye to the commits and releases! ScaleformUI for the V8 community is coming!!!!! 🥳 🥳 🎉 🎉
This release brings you the super awesome ability to stream any texture you want (both ytd and DUI) on Pause Map and Minimap!!
We added both in Lua and C# the new mega extreme MinimapOverlays
class!
2 simple methods/functions to throw your aweomse textures in minimap!
AddSizedOverlayToMap(string textureDict, string textureName, float x, float y, float rotation = 0, float width = -1, float height = -1, int alpha)
andAddScaledOverlayToMap(string textureDict, string textureName, float x, float y, float rotation = 0, float xScale = 100f, float yScale = 100f, int alpha = 100, bool centered = false)
The difference between the 2 is very simple:
- The first.. lets you decide the pixel size override of your texture (for example, the texture is 1920x1080 but you want it at 400x600) (default values are -1 to keep the size to the original texture)
- The second one lets you scale your texture (from a starting
default
value of 100 , you can downscale or upscale both width or height in percentage)
Lua users, don't worry.. you're not bounded to set only float values, ScaleformUI rounds every value adding a float if you push an integer value!
What's Changed
- C# MenuHandler: fix for CloseAndClearHistory
- (Lua) C# MenuHandler: make sure the InstructionalButtons are cleared when closing everything.
- C# / Lua: Added MinimapOverlays class with examples.
- Lua Notifications: NotificationIcon is useless remove it.
- C# RadialMenu: Added InstructionalButtons methods
- C#/Lua: UIMenu add switch for 3D animations
- patch: countdown handler renders itself by @Local9 in #163
- On Card Pressed Handler by @Morji789 in #164
- fix: syntax error in JobSelectionCard by @Local9 in #165
- C#: Spam protection and making sure that the previous menu isn't empty by @QuadrupleTurbo in #166
New Contributors
Full Changelog: 4.2.0...4.2.3
❤️❤️ If you enjoy my work and my menus, and you want to support me, you can contribute by donating via PayPal / ko-fi or by buying ScaleformUI on Tebex (You decide the price!)
The Gary - Radial Menu and fixes!
With this release we introduce you the new RadialMenu!
Inspired by the original HUD_WEAPON_WHEEL with some goodies and 3D animations!
It's fully compatible with UIMenu and the new SwitchTo method to change menu, this means you can switch from UIMenu to RadialMenu and vice versa!
Make sure to check the MenuExample.cs and / or example.lua files to check how the RadialMenu is built and shown!!
What's changed:
- UIMenu shows some new 3D animations while scrolling and showing side panels.
- Lua: Fixed PauseMenu's OnPauseMenuTabChanged
- C#/Lua: fixed InstructionalButtons bugs + add C# UIMenu functions.
- C# - Renamed ScaleformUI.ScaleformUI to ScaleformUI.Main (a nice change for c#, this will let you call the adapted scaleforms without having to specify twice
ScaleformUI.ScaleformUI
- C# BREAKING: Reorganized project and added NameSpaces (this way you only load the namespace you need instead of everything)
- Lua: Fix scaleforms initialization race condition
- C#: (f39bc3f)
- Added RadialMenu
- Generalized with MenuBase for UIMenu and RadialMenu
- Adapted BreadcrumbsHandler to support MenuBase and its variants
- C# Make BreadcrumbsHandler public.
- C# RadialMenu: (d94cb16)
- Added quantity for SegmentItems
- Added Enable3D parameter for menu
- Lua: Refactored folder structure in sync with C#
- Lua: UIMenu (8b94bde)
- Removed "DisEnableControls".. old method.. stupid and confusing.. outrageous
- Added cleaner menu:DisableNonMenuControls() method
- Added Controls class to handle controls with cleaner interface. you can add remove controls in
Controls.NecessaryControlsKeyboard
andControls.NecessaryControlsGamePad
- Lua: Ported RadialMenu to the Project in sync with its c# counterpart
- Lua UIMenu: changed from DisableNonMenuControls to DisableGameControls (this is very important!!!)
- Lua: bugfixing + SwitchTo compatibility with radial menu
- C# PauseMenu: check if textures are available before setting the backgrounds
- Lua TabView: check if textures are available before setting the backgrounds
- Lots of bugfixing Scaleform sides 👍
❤️❤️ As always: if you enjoy my work and my menus, and you want to support me, you can contribute by donating via PayPal / ko-fi or by buying ScaleformUI on Tebex (You decide the price!)
The Gary - Revamped Pause / Lobby
In this release we focused on updating / fixing Pause Menu e Lobby Menu:
- Updated to latest ScaleformUI features (with support for text formatting, text coloring, custom fonts where possible)
- Added custom Backgrounds for TextTab, and SubMenuTab (Info, Stats and Settings types)
- Various bugfixing for both Lobby and Pause.
What's Changed (contributions)
- Fix separator issue on menu build by @Mathu-lmn in #152
- [LUA] Fix softlock if WarningInstance input buttons are disabled by @Asaayu in #150
- chore: bump version by @Local9 in #155
- fix: example menu type for UIMenuSeparatorItem by @Local9 in #157
New Contributors
Full Changelog: 4.0.1...4.1.0
❤️❤️ As always: if you enjoy my work and my menus, and you want to support me, you can contribute by donating via PayPal / ko-fi or by buying ScaleformUI on Tebex (You decide the price!)
The Gary - 4.0.1, scaleform bugfixing
Bugfixing in the Scaleform, updating is a must!
- Fixed various bugs and the "ListItem scrolling" bug