Scaleforms - manups4e/ScaleformUI GitHub Wiki

These are all the Scaleforms that ScaleformUI handles for you, providing a user friendly API for you to implement in your scritps!


BigMessage

image


the Big Message feature is located in
C#:

ScaleformUI.BigMessageInstance

Lua:

ScaleformUI.Scaleforms.BigMessageInstance

Methods available for C#:

ShowMissionPassedMessage(string msg, int time = 5000)  
ShowColoredShard(string msg, string desc, HudColor textColor, HudColor bgColor, int time = 5000)  
ShowOldMessage(string msg, int time = 5000)  
ShowSimpleShard(string title, string subtitle, int time = 5000)  
ShowRankupMessage(string msg, string subtitle, int rank, int time = 5000)  
ShowWeaponPurchasedMessage(string bigMessage, string weaponName, WeaponHash weapon, int time = 5000)  
ShowMpMessageLarge(string msg, int time = 5000)  
ShowMpWastedMessage(string msg, string sub, int time = 5000)
ShowCustomShard(string funcName, params object[] paremeters)  

Functions available for Lua (Note: if time is not specified, it will be fixed at 5000):

ShowMissionPassedMessage(msg, time)
ShowColoredShard(msg, desc, textColor, bgColor, time)
ShowOldMessage(msg, time)
ShowSimpleShard(msg, subtitle, time)
ShowRankupMessage(msg, subtitle, rank, time)
ShowWeaponPurchasedMessage(bigMessage, weaponName, weaponHash, time)
ShowMpMessageLarge(msg, time)
ShowMpWastedMessage(msg, subtitle, time)

MediumMessage

image

Located in:
C#:

ScaleformUI.MedMessageInstance

Lua:

ScaleformUI.Scaleforms.MidMessageInstance

At the moment this scaleform consists of only 1 function
C#:

ShowColoredShard(string msg, string desc, HudColor bgColor, bool useDarkerShard = false, bool useCondensedShard = false, int time = 5000)

Lua (Note: if the time is not declared it will be dafaulted to 5000):

ShowColoredShard(msg, desc, textColor, useDarkerShard, useCondensedShard, time)

InstructionalButtons

image

The instructional buttons are used to guide the player while using the menus but they can be used for whatever reason (one of them is the saving notification). It's located in:
C#:

ScaleformUI.InstructionalButtons

Lua:

ScaleformUI.Scaleforms.InstructionalButtons

Before showing what and how this scaleform performs, we need to look at one more component to make it work, an InstructionalButton must be declared for each control the developer wants to add or remove.

the InstructionalButton can be created in a list in c# or in a table in lua and then the list/table can be added via the instructionalButtons's SetInstructionalButtons function.

here's an example:
C#:

// new InstructionalButton(Control control, string text, PadCheck padFilter = PadCheck.Any)
// new InstructionalButton(List<Control> controls, string text, PadCheck padFilter = PadCheck.Any)
// new InstructionalButton(Control gamepadControl, Control keyboardControl, string text)
// InstructionalButton(List<Control> gamepadControls, List<Control> keyboardControls, string text)
// InstructionalButton(InputGroup control, string text, PadCheck padFilter = PadCheck.Any)

List<InstructionalButton> buttons = new List<InstructionalButton>()
{
	new InstructionalButton(Control.PhoneCancel, Game.GetGXTEntry("HUD_INPUT3")),
	new InstructionalButton(Control.LookUpDown, "Scroll text", PadCheck.Controller),
	new InstructionalButton(InputGroup.INPUTGROUP_CURSOR_SCROLL, "Scroll text", PadCheck.Keyboard)
	// cannot make difference between controller / keyboard here in 1 line because we are using the InputGroup for keyboard
};
ScaleformUI.InstructionalButtons.SetInstructionalButtons(buttons);

Lua:

-- InstructionalButton.New(text, padcheck, gamepadControls, keyboardControls, inputGroup)

-- padCheck can be -1 for both, 0 for gamepad, 1 for keyboard and mouse, it filters to show that control only for the selected control or both
-- gamepadControls can be one or a table of controls, for example 51 or {51, 47, 176, 177}
-- keyboardControls the same as gamepadControls,
-- inpuGroup can be set to handle all the buttons needed automatically (needs gamepad and keyboard controls to be -1)

local buttons = {
	InstructionalButton.New(GetLabelText("HUD_INPUT3"), -1, 177, 177, -1),
	InstructionalButton.New("Scroll text", 0, 2, -1, -1),
	InstructionalButton.New("Scroll text", 1, -1, -1, "INPUTGROUP_CURSOR_SCROLL")
	-- cannot make difference between controller / keyboard here in 1 line because we are using the InputGroup for keyboard
}
ScaleformUI.Scaleforms.InstructionalButtons:SetInstructionalButtons(buttons)

The InstructionalButton can be filtered, setting 1 or more controls for controller / keyboard separately and can handle InputGroups, using the padcheck the control selected will be shown only if the player is using one of the 2 input methods.

Back to the Instructional Buttons let's see what this baby can do:
C#:

IsSaving // used to check if the saving notification is showing (the one with the rotating circle)
SetInstructionalButtons(List<InstructionalButton> buttons)
RemoveInstructionalButtons(List<InstructionalButton> buttons)
AddInstructionalButton(InstructionalButton button)
RemoveInstructionalButton(InstructionalButton button)
RemoveInstructionalButton(int button)
ClearButtonList()
AddSavingText(LoadingSpinnerType spinnerType, string text, int time)
HideSavingText()

Lua:

.IsSaving // used to check if the saving notification is showing (the one with the rotating circle)
SetInstructionalButtons(buttons)
AddInstructionalButton(button)
RemoveInstructionalButton(button)
ClearButtonList()
ShowBusySpinner(spinnerType, text, time)
HideBusySpinner()

PopupWarning

image

The Warning screen is a customizable screen that can be updated on the go and is compatible with instructionalButtons to make the user decide the action he/she/they wants to make.

It is located in:
C#:

ScaleformUI.Warning

Lua:

ScaleformUI.Scaleforms.Warning

Its functions consist of:
C#

ShowWarning(string title, string subtitle, string prompt = "", string errorMsg = "", WarningPopupType type = WarningPopupType.Classic)
ShowWarningWithButtons(string title, string subtitle, string prompt, List<InstructionalButton> buttons, string errorMsg = "", WarningPopupType type = WarningPopupType.Classic)
UpdateWarning(string title, string subtitle, string prompt = "", string errorMsg = "", WarningPopupType type = WarningPopupType.Classic)
Dispose() // used to stop showing the Warning
OnButtonPressed (InstructionalButton button) // this is an event called if one of the instructional buttons available are pressed while the warning is showing

Lua:

ShowWarning(title, subtitle, prompt, errorMsg, warningType)
ShowWarningWithButtons(title, subtitle, prompt, buttons, errorMsg, warningType)
UpdateWarning(title, subtitle, prompt, errorMsg, warningType)
Dispose() -- used to stop showing the Warning
OnButtonPressed = function(button) end -- function called if one of the instructional buttons available are pressed while the warning is showing

MinimapOverlays

image

Let's add as many overlays (textures) as you want to the ingame Map and Minimap, useful for custom maps!

It is located in:
C#:

ScaleformUI.MinimapOverlays

Lua:

ScaleformUI.Scaleforms.MinimapOverlays

Its functions consist of:
C#:

static async Task<int> AddOverlayToMinimap(string textureDict, string textureName, float x, float y, float width = -1, float height = -1, int alpha = -1, bool centered = false) // values set to -1 are ignored, if centered is false, texture pivot center will be on its Top-Left corner
void RemoveOverlayFromMinimap(int overlayId) // removes the selected overlay from the minimap

Lua:

:AddOverlayToMinimap(textureDict, textureName, x, y, width, height, alpha, centered) --  values set to -1 are ignored, if centered is false texture pivot center will be on its Top-Left corner
-- [x, y, width, height are floats, values cannot be integers!], [textureDict, textureName, x, y MUST BE GIVEN]
:RemoveOverlayFromMinimap(overlayId) -- removes the selected overlay from the minimap

BigFeed

image

the Big Feed feature is located in
C#:

ScaleformUI.BigFeed

Lua:

ScaleformUI.Scaleforms.BigFeed

Methods available for C#:

bool RightAligned // Decides if the feed is centered or right aligned, *MUST* be called before Enabled
bool DisabledNotifications // If true disables all kind of notifications while the feed is showing
string Title // Sets the title of the BigFeedInstance
string Subtitle // Sets the subtitle of the BigFeedInstance
string BodyText // Sets the body text of the BigFeedInstance
string TextureDictionary // The Texture Dictionary (TXD) where the texture is loaded
string TextureName // The texture in the dictionary
bool Enabled // Toggles the BigFeedInstance on or off
void UpdatePicture(string txd, string txn) // updates the texture

Functions available for Lua (Note: if time is not specified, it will be fixed at 5000):

:Title(title) -- Sets the title of the BigFeedInstance, if no title is provided it will return the current title
:Subtitle(subtitle) -- Sets the subtitle of the BigFeedInstance, if no subtitle is provided it will return the current subtitle
:BodyText(body) -- Sets the body text of the BigFeedInstance, if no body text is provided it will return the current body text
:RightAligned(rightAligned) -- [boolean] Sets the BigFeedInstance to be right aligned, if no state is provided it will return the current state
:Texture(textureName, textureDictionary) -- Sets the texture of the BigFeedInstance, if no texture is provided it will return the current texture
:Enabled(enabled) -- [boolean] Toggles the BigFeedInstance on or off, if a state is not provided it will return the current enabled state

Countdown

2022-12-17_15-42-59.mp4

the Countdown feature is located in
C#:

ScaleformUI.Countdown

Lua:

ScaleformUI.Scaleforms.Countdown

Methods available for C#:

async Task Start(int number = 3, HudColor hudColor = HudColor.HUD_COLOUR_GREEN, string countdownAudioName = "321", string countdownAudioRef = "Car_Club_Races_Pursuit_Series_Sounds", string goAudioName = "Go", string goAudioRef = "Car_Club_Races_Pursuit_Series_Sounds")
// This will start a countdown and play the audio for each step, default is 3, 2, 1, GO
// method is awaitable and will return when the countdown shows "GO"

Lua

:Start(number, hudColour, countdownAudioName, countdownAudioRef, goAudioName, goAudioRef)
---Starts the countdown
@param number number? - The number to start the countdown from
@param hudColour number? - The hud colour to use for the countdown
@param countdownAudioName string? - The audio name to play for each number
@param countdownAudioRef string? - The audio ref to play for each number
@param goAudioName string? - The audio name to play when the countdown is finished
@param goAudioRef string? - The audio ref to play when the countdown is finished
@return promise
-- consider that:
  if number == nil then number = 3 end
  if hudColour == nil then hudColour = 18 end
  if countdownAudioName == nil then countdownAudioName = "321" end
  if countdownAudioRef == nil then countdownAudioRef = "Car_Club_Races_Pursuit_Series_Sounds" end
  if goAudioName == nil then goAudioName = "Go" end
  if goAudioRef == nil then goAudioRef = "Car_Club_Races_Pursuit_Series_Sounds" end

MissionSelector

image

The mission selector handler implements the use of the JobSelectionButton, JobSelectionCard and MissionDetailsItem (details below)

the Mission Selector feature is located in
C#:

ScaleformUI.JobMissionSelection

Lua:

ScaleformUI.Scaleforms.JobMissionSelector

Methods available for C#:

int[] Votes // up to 9 votes (6 cards + 3 buttons)
int VotedFor
int MaxVotes
int SelectedCard
HudColor VotesColor // defaulted to HudColor.HUD_COLOUR_BLUE
JobSelectionTitle JobTitle
List<JobSelectionCard> Cards // 6 cards
List<JobSelectionButton> Buttons // 3 buttons
bool Enabled
bool AlreadyVoted
void SetTitle(string title)
void SetVotes(int actual, string label = "")
void AddCard(JobSelectionCard card)
void AddButton(JobSelectionButton button)
void ShowPlayerVote(int idx, string playerName, HudColor color, bool showCheckMark = false, bool flashBG = false)

Lua

.Votes
.VotedFor
.VotesColor -- default Colours.HUD_COLOUR_BLUE
:SetTitle(title)
:SetVotes(actual, label)
:AddCard(card)
:AddButton(button)
:Enabled(bool)
:AlreadyVoted()
:ShowPlayerVote(idx, playerName, color, showCheckMark, flashBG)

Example code for the Mission Selector C#

if (ScaleformUI.Main.JobMissionSelection.Enabled)
{
    ScaleformUI.Main.JobMissionSelection.Enabled = false;
    return;
}

long txd = API.CreateRuntimeTxd("test");
long _paneldui = API.CreateDui("https://i.imgur.com/mH0Y65C.gif", 288, 160);
API.CreateRuntimeTextureFromDuiHandle(txd, "panelbackground", API.GetDuiHandle(_paneldui));

ScaleformUI.Main.JobMissionSelection.SetTitle("MISSION SELECTOR");
ScaleformUI.Main.JobMissionSelection.MaxVotes = 3;
ScaleformUI.Main.JobMissionSelection.SetVotes(0, "VOTES");
ScaleformUI.Main.JobMissionSelection.Cards = new List<JobSelectionCard>();

JobSelectionCard card = new JobSelectionCard("Test 1", "~y~Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat", "test", "panelbackground", 12, 15, JobSelectionCardIcon.BASE_JUMPING, HudColor.HUD_COLOUR_FREEMODE, 2, new List<MissionDetailsItem>()
{
    new MissionDetailsItem("Left Label", "Right Label", 0, HudColor.HUD_COLOUR_FREEMODE),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)1, HudColor.HUD_COLOUR_GOLD),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)2, HudColor.HUD_COLOUR_PURPLE),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)3, HudColor.HUD_COLOUR_GREEN),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)4, HudColor.HUD_COLOUR_WHITE, true),
});
ScaleformUI.Main.JobMissionSelection.AddCard(card);

JobSelectionCard card1 = new JobSelectionCard("Test 2", "~y~Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat", "test", "panelbackground", 12, 15, JobSelectionCardIcon.BASE_JUMPING, HudColor.HUD_COLOUR_FREEMODE, 2, new List<MissionDetailsItem>()
{
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)5, HudColor.HUD_COLOUR_FREEMODE),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)6, HudColor.HUD_COLOUR_GOLD),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)7, HudColor.HUD_COLOUR_PURPLE),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)8, HudColor.HUD_COLOUR_GREEN),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)9, HudColor.HUD_COLOUR_WHITE, true),
});
ScaleformUI.Main.JobMissionSelection.AddCard(card1);

JobSelectionCard card2 = new JobSelectionCard("Test 3", "~y~Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat", "test", "panelbackground", 12, 15, JobSelectionCardIcon.BASE_JUMPING, HudColor.HUD_COLOUR_FREEMODE, 2, new List<MissionDetailsItem>()
{
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)10, HudColor.HUD_COLOUR_FREEMODE),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)11, HudColor.HUD_COLOUR_GOLD),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)12, HudColor.HUD_COLOUR_PURPLE),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)13, HudColor.HUD_COLOUR_GREEN),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)14, HudColor.HUD_COLOUR_WHITE, true),
});
ScaleformUI.Main.JobMissionSelection.AddCard(card2);

JobSelectionCard card3 = new JobSelectionCard("Test 4", "~y~Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat", "test", "panelbackground", 12, 15, JobSelectionCardIcon.BASE_JUMPING, HudColor.HUD_COLOUR_FREEMODE, 2, new List<MissionDetailsItem>()
{
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)15, HudColor.HUD_COLOUR_FREEMODE),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)16, HudColor.HUD_COLOUR_GOLD),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)17, HudColor.HUD_COLOUR_PURPLE),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)18, HudColor.HUD_COLOUR_GREEN),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)19, HudColor.HUD_COLOUR_WHITE, true),
});
ScaleformUI.Main.JobMissionSelection.AddCard(card3);

JobSelectionCard card4 = new JobSelectionCard("Test 5", "~y~Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat", "test", "panelbackground", 12, 15, JobSelectionCardIcon.BASE_JUMPING, HudColor.HUD_COLOUR_FREEMODE, 2, new List<MissionDetailsItem>()
{
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)20, HudColor.HUD_COLOUR_FREEMODE),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)21, HudColor.HUD_COLOUR_GOLD),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)22, HudColor.HUD_COLOUR_PURPLE),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)23, HudColor.HUD_COLOUR_GREEN),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)24, HudColor.HUD_COLOUR_WHITE, true),
});
ScaleformUI.Main.JobMissionSelection.AddCard(card4);

JobSelectionCard card5 = new JobSelectionCard("Test 6", "~y~Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat", "test", "panelbackground", 12, 15, JobSelectionCardIcon.BASE_JUMPING, HudColor.HUD_COLOUR_FREEMODE, 2, new List<MissionDetailsItem>()
{
    new MissionDetailsItem("Left Label", "Right Label", 0, HudColor.HUD_COLOUR_FREEMODE),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)1, HudColor.HUD_COLOUR_GOLD),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)2, HudColor.HUD_COLOUR_PURPLE),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)3, HudColor.HUD_COLOUR_GREEN),
    new MissionDetailsItem("Left Label", "Right Label", (JobIcon)4, HudColor.HUD_COLOUR_WHITE, true),
});
ScaleformUI.Main.JobMissionSelection.AddCard(card5);

ScaleformUI.Main.JobMissionSelection.Buttons = new List<JobSelectionButton>()
{
    new JobSelectionButton("Test1", "description test", new List<MissionDetailsItem>()) {Selectable = false },

    new JobSelectionButton("Test2", "description test", new List<MissionDetailsItem>()) {Selectable = false },

    new JobSelectionButton("Test3", "description test", new List<MissionDetailsItem>()) {Selectable = true },
};
ScaleformUI.Main.JobMissionSelection.Buttons[0].OnButtonPressed += () =>
{
    Screen.ShowSubtitle($"Button Pressed => {ScaleformUI.Main.JobMissionSelection.Buttons[0].Text}");
};

ScaleformUI.Main.JobMissionSelection.Enabled = true;

await Delay(1000);
ScaleformUI.Main.JobMissionSelection.ShowPlayerVote(2, "PlayerName", HudColor.HUD_COLOUR_GREEN, true, true);

Lua

local MissionSelectorVisible = false
function CreateMissionSelectorMenu()

	MissionSelectorVisible = not MissionSelectorVisible

	if not MissionSelectorVisible then 
		ScaleformUI.Scaleforms.JobMissionSelector:Enabled(false) 
		return
	end

	local txd = CreateRuntimeTxd("test")
	local _paneldui = CreateDui("https://i.imgur.com/mH0Y65C.gif", 288, 160)
	CreateRuntimeTextureFromDuiHandle(txd, "panelbackground", GetDuiHandle(_paneldui))

	ScaleformUI.Scaleforms.JobMissionSelector:SetTitle("MISSION SELECTOR")
	ScaleformUI.Scaleforms.JobMissionSelector.MaxVotes = 3
	ScaleformUI.Scaleforms.JobMissionSelector:SetVotes(0, "VOTED")
	ScaleformUI.Scaleforms.JobMissionSelector.Cards = {}

	local card = JobSelectionCard.New("Test 1", "~y~Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat", "test", "panelbackground", 12, 15, JobSelectionCardIcon.BASE_JUMPING, Colours.HUD_COLOUR_FREEMODE, 2, {
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOMission, Colours.HUD_COLOUR_FREEMODE),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.Deathmatch, Colours.HUD_COLOUR_GOLD),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.RaceFinish, Colours.HUD_COLOUR_PURPLE),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOSurvival, Colours.HUD_COLOUR_GREEN),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.TeamDeathmatch, Colours.HUD_COLOUR_WHITE, true),
	})
	ScaleformUI.Scaleforms.JobMissionSelector:AddCard(card)

	local card1 = JobSelectionCard.New("Test 2", "~y~Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat", "test", "panelbackground", 12, 15, JobSelectionCardIcon.BASE_JUMPING, Colours.HUD_COLOUR_FREEMODE, 2, {
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOMission, Colours.HUD_COLOUR_FREEMODE),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.Deathmatch, Colours.HUD_COLOUR_GOLD),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.RaceFinish, Colours.HUD_COLOUR_PURPLE),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOSurvival, Colours.HUD_COLOUR_GREEN),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.TeamDeathmatch, Colours.HUD_COLOUR_WHITE, true),
	})
	ScaleformUI.Scaleforms.JobMissionSelector:AddCard(card1)

	local card2 = JobSelectionCard.New("Test 3", "~y~Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat", "test", "panelbackground", 12, 15, JobSelectionCardIcon.BASE_JUMPING, Colours.HUD_COLOUR_FREEMODE, 2, {
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOMission, Colours.HUD_COLOUR_FREEMODE),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.Deathmatch, Colours.HUD_COLOUR_GOLD),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.RaceFinish, Colours.HUD_COLOUR_PURPLE),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOSurvival, Colours.HUD_COLOUR_GREEN),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.TeamDeathmatch, Colours.HUD_COLOUR_WHITE, true),
	})
	ScaleformUI.Scaleforms.JobMissionSelector:AddCard(card2)

	local card3 = JobSelectionCard.New("Test 4", "~y~Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat", "test", "panelbackground", 12, 15, JobSelectionCardIcon.BASE_JUMPING, Colours.HUD_COLOUR_FREEMODE, 2, {
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOMission, Colours.HUD_COLOUR_FREEMODE),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.Deathmatch, Colours.HUD_COLOUR_GOLD),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.RaceFinish, Colours.HUD_COLOUR_PURPLE),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOSurvival, Colours.HUD_COLOUR_GREEN),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.TeamDeathmatch, Colours.HUD_COLOUR_WHITE, true),
	})
	ScaleformUI.Scaleforms.JobMissionSelector:AddCard(card3)

	local card4 = JobSelectionCard.New("Test 5", "~y~Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat", "test", "panelbackground", 12, 15, JobSelectionCardIcon.BASE_JUMPING, Colours.HUD_COLOUR_FREEMODE, 2, {
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOMission, Colours.HUD_COLOUR_FREEMODE),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.Deathmatch, Colours.HUD_COLOUR_GOLD),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.RaceFinish, Colours.HUD_COLOUR_PURPLE),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOSurvival, Colours.HUD_COLOUR_GREEN),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.TeamDeathmatch, Colours.HUD_COLOUR_WHITE, true),
	})
	ScaleformUI.Scaleforms.JobMissionSelector:AddCard(card4)

	local card5 = JobSelectionCard.New("Test 6", "~y~Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat", "test", "panelbackground", 12, 15, JobSelectionCardIcon.BASE_JUMPING, Colours.HUD_COLOUR_FREEMODE, 2, {
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOMission, Colours.HUD_COLOUR_FREEMODE),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.Deathmatch, Colours.HUD_COLOUR_GOLD),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.RaceFinish, Colours.HUD_COLOUR_PURPLE),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOSurvival, Colours.HUD_COLOUR_GREEN),
		MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.TeamDeathmatch, Colours.HUD_COLOUR_WHITE, true),
	})
	ScaleformUI.Scaleforms.JobMissionSelector:AddCard(card5)

	ScaleformUI.Scaleforms.JobMissionSelector.Buttons = {
		JobSelectionButton.New("Button 1", "description test", {
			MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOMission, Colours.HUD_COLOUR_FREEMODE),
			MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.Deathmatch, Colours.HUD_COLOUR_GOLD),
			MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.RaceFinish, Colours.HUD_COLOUR_PURPLE),
			MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOSurvival, Colours.HUD_COLOUR_GREEN),
			MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.TeamDeathmatch, Colours.HUD_COLOUR_WHITE, true),
		}),
		JobSelectionButton.New("Button 2", "description test", {
			MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOMission, Colours.HUD_COLOUR_FREEMODE),
			MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.Deathmatch, Colours.HUD_COLOUR_GOLD),
			MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.RaceFinish, Colours.HUD_COLOUR_PURPLE),
			MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOSurvival, Colours.HUD_COLOUR_GREEN),
			MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.TeamDeathmatch, Colours.HUD_COLOUR_WHITE, true),
		}),
		JobSelectionButton.New("Button 3", "description test", {
			MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOMission, Colours.HUD_COLOUR_FREEMODE),
			MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.Deathmatch, Colours.HUD_COLOUR_GOLD),
			MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.RaceFinish, Colours.HUD_COLOUR_PURPLE),
			MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.GTAOSurvival, Colours.HUD_COLOUR_GREEN),
			MissionDetailsItem.New("Left Label", "Right Label", false, JobIcon.TeamDeathmatch, Colours.HUD_COLOUR_WHITE, true),
		}),
	}
	ScaleformUI.Scaleforms.JobMissionSelector.Buttons[1].Selectable = false
	ScaleformUI.Scaleforms.JobMissionSelector.Buttons[2].Selectable = false
	ScaleformUI.Scaleforms.JobMissionSelector.Buttons[3].Selectable = true

	ScaleformUI.Scaleforms.JobMissionSelector.Buttons[1].OnButtonPressed = function()
		ScaleformUI.Notifications:ShowSubtitle("Button Pressed => " .. ScaleformUI.Scaleforms.JobMissionSelector.Buttons[1].Text)
	end
	ScaleformUI.Scaleforms.JobMissionSelector:Enabled(true)
	
	Citizen.Wait(1000)
	ScaleformUI.Scaleforms.JobMissionSelector:ShowPlayerVote(3, "PlayerName", Colours.HUD_COLOUR_GREEN, true, true)
end

JobSelectionCard

C#

string Title
string Description 
string Txd 
string Txn 
int RpMultiplier 
int CashMultiplier
JobSelectionCardIcon Icon 
HudColor IconColor 
int ApMultiplier 
List<MissionDetailsItem> Details // not more than 4!!

JobSelectionCard(string title, string description, string txd, string txn, int rpMult, int cashMult, JobSelectionCardIcon icon, HudColor iconColor, int apMultiplier, List<MissionDetailsItem> details)

Lua

@param title string
@param description string
@param txd string
@param txn string
@param rpMult number
@param cashMult number
@param icon JobSelectionCardIcon
@param iconColor Colours
@param apMultiplier number
@param details table<MissionDetailsItem>
JobSelectionCard.New(title, description, txd, txn, rpMult, cashMult, icon, iconColor, apMultiplier, details)
@field public Title string
@field public Description string
@field public Txd string
@field public Txn string
@field public RpMultiplier number
@field public CashMultiplier number
@field public Icon JobSelectionCardIcon
@field public IconColor Colours
@field public ApMultiplier number
@field public Details table<MissionDetailsItem> -- not more than 4!!

JobSelectionButton

C#

string Text
string Description
List<MissionDetailsItem> // NOT MORE THAN 5
JobSelectionButtonEvent OnButtonPressed
JobSelectionButton(string text, string description, List<MissionDetailsItem> details)

Lua

@param title string
@param description string
@param details table<MissionDetailsItem>
JobSelectionButton.New(title, description, details)
@field public Text string
@field public Description string
@field public Details table<MissionDetailsItem> -- NOT MORE THAN 5
@field public OnButtonPressed fun(self: JobSelectionButton)

MissionDetailsItem

C#

JobIcon Icon
string TextLeft
string TextRight
HudColor IconColor
int Type
bool Tick
MissionDetailsItem(string textLeft, string textRight, bool separator)
MissionDetailsItem(string textLeft, string textRight, JobIcon icon, HudColor iconColor = HudColor.NONE, bool tick = false)

Lua

@param textLeft string
@param textRight string
@param seperator boolean
@param icon JobIcon
@param iconColor Colours
@param tick boolean
MissionDetailsItem.New(textLeft, textRight, seperator, icon, iconColor, tick)

@field public Type number
@field public TextLeft string
@field public TextRight string
@field public Icon JobIcon
@field public IconColor Colours
@field public Tick boolean

Rankbar

image

the Rankbar feature is located in
C#:

ScaleformUI.RankBarInstance

Lua:

ScaleformUI.Scaleforms.RankbarHandler

Methods available for C#:

HudColor Color // Set the color of the Rank Bar when displayed
void SetScores(int limitStart, int limitEnd, int previousValue, int currentValue, int currentRank) // Shows the rank bar
/// <param name="limitStart">Floor value of experience e.g. 0</param>
/// <param name="limitEnd">Ceiling value of experience e.g. 800</param>
/// <param name="previousValue">Previous Experience value </param>
/// <param name="currentValue">New Experience value</param>
/// <param name="currentRank">Current rank</param>
void Remove()
void OverrideAnimationSpeed(int speed = 1000)
void OverrideOnscreenDuration(int duration = 4000)

Functions available for Lua:

@field public SetScores fun(limitStart:number, limitEnd:number, previousValue:number, currentValue:number, currentRank:number):nil
@field public SetColour fun(rankBarColor:number):nil
@field public Remove fun():nil
@field public OverrideAnimationSpeed fun(speed:number):nil
@field public OverrideOnscreenDuration fun(duration:number):nil
⚠️ **GitHub.com Fallback** ⚠️