Skip to content
This repository was archived by the owner on Jun 16, 2024. It is now read-only.

ADD_ITEM

Leonardo Emanuele edited this page Oct 25, 2021 · 4 revisions

result

One of the biggest and most important functions, this adds one of the varius items available in the menu.

This function has variable parameters, here we can see the first 3 parameters common for every menu item.

Parameters TYPE Optional Description
id Int The item type
label String The item's label
description String the item's description
Returns VOID

UIMenuItem

The classic item with a label and sometimes a right label too. Can be colored if specified, you can find the color table in the related wiki page in this list Repository.

Parameters TYPE Optional Description
id Int The item type (id = 0)
label String The item's label
description String the item's description
itemColor Int Backgroung color when not highlighted
highlightColor Int Backgroung color when highlighted
textColor Int Text color when not highlighted
highlightTextColor Int Text color when highlighted

Warning! When specifying the textColor and the highlightTextColor parameters, all the a colors in the texts will be ignored!! This counts for EVERY item BUT NOT the description.

Example:

  • C#
NativeUIScaleform.CallFunction("ADD_ITEM", 0, "UIMenuItem", $"Description!!");
  • Lua
BeginScaleformMovieMethod(scaleformUI, "ADD_ITEM")
ScaleformMovieMethodAddParamInt(0)
ScaleformMovieMethodAddParamTextureNameString("UIMenuItem")
ScaleformMovieMethodAddParamTextureNameString("Description!!")
EndScaleformMovieMethod()

UIMenuListItem

The List item this will be a bit tricky but it's the only way to not make the script too heavy. Can be colored if specified, you can find the color table in the related wiki page in this list Repository.

Parameters TYPE Optional Description
id Int The item type (id = 1)
label String The item's label
description String the item's description
listItems String The item's items list
index Int the item's start index
itemColor Int Backgroung color when not highlighted
highlightColor Int Backgroung color when highlighted
textColor Int Text color when not highlighted
highlightTextColor Int Text color when highlighted

This item is quite tricky to create but easy once you get it.
I could have made a function to loop into to send every item for the list.. but make 10 ListItems with 100 items in each list... 100 loops * 10 = 10000.. No thanks.
Instead the trick is to simply concatenate all the items in the list in a string separated by "," (commas).
The scaleform will handle the rest.

Example:

  • C#
List<dynamic> list = new List<dynamic>() { "this", "is", "my", "list", 12, 13453, 542545, 2452345324 };
string strList = string.Join(",", list);
NativeUIScaleform.CallFunction("ADD_ITEM", 1, "UIMenuListItem", $"Description!!", strList, 0);
  • Lua
local list = { "this", "is", "my", "list", 12, 13453, 542545, 2452345324 }
local strList = table.concat(list, ",")

BeginScaleformMovieMethod(scaleformUI, "ADD_ITEM")
ScaleformMovieMethodAddParamInt(1)
ScaleformMovieMethodAddParamTextureNameString("UIMenuListItem")
ScaleformMovieMethodAddParamTextureNameString("Description!!")
ScaleformMovieMethodAddParamTextureNameString(strList)
ScaleformMovieMethodAddParamInt(0)
EndScaleformMovieMethod()

UIMenuCheckboxItem

This item is fairly simple, you only have to decide to use tick or cross and its initial value.

Parameters TYPE Optional Description
id Int The item type (id = 2)
label String The item's label
description String the item's description
check_style Int The item's items list (0 for cross, 1 for tick)
checked Bool the item's start index
itemColor Int Backgroung color when not highlighted
highlightColor Int Backgroung color when highlighted
textColor Int Text color when not highlighted
highlightTextColor Int Text color when highlighted

Example:

  • C#
NativeUIScaleform.CallFunction("ADD_ITEM", 2, "UIMenuCheckboxItem", $"Description!!", 1, false);
  • Lua
BeginScaleformMovieMethod(scaleformUI, "ADD_ITEM")
ScaleformMovieMethodAddParamInt(2)
ScaleformMovieMethodAddParamTextureNameString("UIMenuCheckboxItem")
ScaleformMovieMethodAddParamTextureNameString("Description!!")
ScaleformMovieMethodAddParamInt(1)
ScaleformMovieMethodAddParamBool(false)
EndScaleformMovieMethod()

UIMenuSliderItem

This item has a slider that can be moved left or right to select a preference in a percent value.

Parameters TYPE Optional Description
id Int The item type (id = 3)
label String The item's label
description String the item's description
maximum Int The item's max value (starts always with 0!)
multipler Int the item's multiplier (value + multiplier)
startIndex Int the item's start index
itemColor Int Backgroung color when not highlighted
highlightColor Int Backgroung color when highlighted
textColor Int Text color when not highlighted
highlightTextColor Int Text color when highlighted
sliderBGColor Int slider Background color
sliderColor Int slider color
heritage Bool if true the arrows become heritage icons

The item's slider moves based on the multipler, if I set max to 100 and multipler to 1, when moving the slider it will move 1 step at a time, but with a multiplier of 5 it will be 5 steps at a time.

Example:

  • C#
NativeUIScaleform.CallFunction("ADD_ITEM", 3, "UIMenuSliderItem", $"Description!!", 10, 1, 0);
  • Lua
BeginScaleformMovieMethod(scaleformUI, "ADD_ITEM")
ScaleformMovieMethodAddParamInt(3)
ScaleformMovieMethodAddParamTextureNameString("UIMenuSliderItem")
ScaleformMovieMethodAddParamTextureNameString("Description!!")
ScaleformMovieMethodAddParamInt(10)
ScaleformMovieMethodAddParamInt(1)
ScaleformMovieMethodAddParamInt(0)
EndScaleformMovieMethod()

UIMenuProgressItem

Similar to the Slider Item the difference is that this doesn't move its slider, it's progressive (like the volume bar in Settings)

Parameters TYPE Optional Description
id Int The item type (id = 4)
label String The item's label
description String the item's description
maximum Int The item's max value (starts always with 0!)
multipler Int the item's multiplier (value + multiplier)
startIndex Int the item's start index
itemColor Int Backgroung color when not highlighted
highlightColor Int Backgroung color when highlighted
textColor Int Text color when not highlighted
highlightTextColor Int Text color when highlighted
sliderBGColor Int slider Background color
sliderColor Int slider color

Example:

  • C#
NativeUIScaleform.CallFunction("ADD_ITEM", 4, "UIMenuProgressItem", $"Description!!", 10, 1, 0);
  • Lua
BeginScaleformMovieMethod(scaleformUI, "ADD_ITEM")
ScaleformMovieMethodAddParamInt(4)
ScaleformMovieMethodAddParamTextureNameString("UIMenuProgressItem")
ScaleformMovieMethodAddParamTextureNameString("Description!!")
ScaleformMovieMethodAddParamInt(10)
ScaleformMovieMethodAddParamInt(1)
ScaleformMovieMethodAddParamInt(0)
EndScaleformMovieMethod()

Clone this wiki locally