-
Notifications
You must be signed in to change notification settings - Fork 52
Scaleforms

the Big Message feature is located in
C#:
ScaleformUI.BigMessageInstanceLua:
ScaleformUI.Scaleforms.BigMessageInstanceMethods 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)
Located in:
C#:
ScaleformUI.MedMessageInstanceLua:
ScaleformUI.Scaleforms.MidMessageInstanceAt 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)
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.InstructionalButtonsLua:
ScaleformUI.Scaleforms.InstructionalButtonsBefore 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)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)
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.WarningLua:
ScaleformUI.Scaleforms.WarningIts 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 showingLua:
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
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.MinimapOverlaysLua:
ScaleformUI.Scaleforms.MinimapOverlaysIts 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 minimapLua:
: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 [textureDict, textureName, x, y MUST BE GIVEN]
:RemoveOverlayFromMinimap(overlayId) -- removes the selected overlay from the minimap