Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
C# - Renamed ScaleformUI.ScaleformUI to ScaleformUI.Main
  • Loading branch information
manups4e committed Jul 27, 2023
1 parent e5e830f commit 65c400f
Show file tree
Hide file tree
Showing 34 changed files with 265 additions and 265 deletions.
96 changes: 48 additions & 48 deletions MenuExample/MenuExample.cs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions ScaleformUI_Csharp/Hud/Notifications/Notifications.cs
Expand Up @@ -321,17 +321,17 @@ public static void StartLoadingMessage(string label, LoadingSpinnerType busySpin
if (string.IsNullOrEmpty(textOutput))
textOutput = label;
if (savingTime > 0)
ScaleformUI.InstructionalButtons.AddSavingText(busySpinner, textOutput, savingTime);
Main.InstructionalButtons.AddSavingText(busySpinner, textOutput, savingTime);
else
ScaleformUI.InstructionalButtons.AddSavingText(busySpinner, textOutput);
Main.InstructionalButtons.AddSavingText(busySpinner, textOutput);
}

/// <summary>
/// Removes the loading prompt.
/// </summary>
public static void StopLoadingMessage()
{
ScaleformUI.InstructionalButtons.HideSavingText();
Main.InstructionalButtons.HideSavingText();
}

internal static async Task<Tuple<int, string>> GetPedMugshotAsync(Ped ped, bool transparent = false)
Expand Down
2 changes: 1 addition & 1 deletion ScaleformUI_Csharp/Items/UIMenuCheckboxItem.cs
Expand Up @@ -75,7 +75,7 @@ public bool Checked
_checked = value;
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("SET_INPUT_EVENT", 16, Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), value);
Main._ui.CallFunction("SET_INPUT_EVENT", 16, Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), value);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion ScaleformUI_Csharp/Items/UIMenuDynamicListItem.cs
Expand Up @@ -19,7 +19,7 @@ public string CurrentListItem
currentListItem = value;
if (Parent is not null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("UPDATE_LISTITEM_LIST", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), currentListItem, 0);
Main._ui.CallFunction("UPDATE_LISTITEM_LIST", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), currentListItem, 0);
}
}
}
Expand Down
40 changes: 20 additions & 20 deletions ScaleformUI_Csharp/Items/UIMenuItem.cs
Expand Up @@ -220,7 +220,7 @@ public HudColor MainColor
mainColor = value;
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("UPDATE_COLORS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)value, (int)highlightColor, (int)textColor, (int)highlightedTextColor);
Main._ui.CallFunction("UPDATE_COLORS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)value, (int)highlightColor, (int)textColor, (int)highlightedTextColor);
}
}
}
Expand All @@ -235,7 +235,7 @@ public HudColor HighlightColor
highlightColor = value;
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("UPDATE_COLORS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)mainColor, (int)value, (int)textColor, (int)highlightedTextColor);
Main._ui.CallFunction("UPDATE_COLORS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)mainColor, (int)value, (int)textColor, (int)highlightedTextColor);
}
}
}
Expand All @@ -251,7 +251,7 @@ public HudColor TextColor
textColor = value;
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("UPDATE_COLORS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)mainColor, (int)highlightColor, (int)value, (int)highlightedTextColor);
Main._ui.CallFunction("UPDATE_COLORS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)mainColor, (int)highlightColor, (int)value, (int)highlightedTextColor);
}
}
}
Expand All @@ -266,7 +266,7 @@ public HudColor HighlightedTextColor
highlightedTextColor = value;
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("UPDATE_COLORS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)mainColor, (int)highlightColor, (int)textColor, (int)value);
Main._ui.CallFunction("UPDATE_COLORS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)mainColor, (int)highlightColor, (int)textColor, (int)value);
}
}
}
Expand All @@ -279,7 +279,7 @@ public ItemFont LabelFont
labelFont = value;
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("SET_ITEM_LABEL_FONT", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), labelFont.FontName, labelFont.FontID);
Main._ui.CallFunction("SET_ITEM_LABEL_FONT", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), labelFont.FontName, labelFont.FontID);
}
if (ParentColumn != null && ParentColumn.Parent.Visible)
{
Expand All @@ -299,7 +299,7 @@ public ItemFont RightLabelFont
rightLabelFont = value;
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("SET_ITEM_RIGHT_LABEL_FONT", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), rightLabelFont.FontName, rightLabelFont.FontID);
Main._ui.CallFunction("SET_ITEM_RIGHT_LABEL_FONT", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), rightLabelFont.FontName, rightLabelFont.FontID);
}
if (ParentColumn != null && ParentColumn.Parent.Visible)
{
Expand Down Expand Up @@ -401,7 +401,7 @@ public bool BlinkDescription
blinkDescription = value;
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("SET_BLINK_DESC", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), blinkDescription);
Main._ui.CallFunction("SET_BLINK_DESC", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), blinkDescription);
}
if (ParentColumn != null && ParentColumn.Parent.Visible)
{
Expand Down Expand Up @@ -442,7 +442,7 @@ public virtual bool Selected
}
if (Parent != null && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("SET_ITEM_LABELS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _formatLeftLabel, _formatRightLabel);
Main._ui.CallFunction("SET_ITEM_LABELS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _formatLeftLabel, _formatRightLabel);
}
if (ParentColumn != null && ParentColumn.Parent != null && ParentColumn.Parent.Visible)
{
Expand Down Expand Up @@ -474,7 +474,7 @@ public virtual string Description
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
API.AddTextEntry($"menu_{BreadcrumbsHandler.CurrentDepth}_desc_{Parent.MenuItems.IndexOf(this)}", description);
API.BeginScaleformMovieMethod(ScaleformUI._ui.Handle, "UPDATE_ITEM_DESCRIPTION");
API.BeginScaleformMovieMethod(Main._ui.Handle, "UPDATE_ITEM_DESCRIPTION");
API.ScaleformMovieMethodAddParamInt(Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)));
API.BeginTextCommandScaleformString($"menu_{BreadcrumbsHandler.CurrentDepth}_desc_{Parent.MenuItems.IndexOf(this)}");
API.EndTextCommandScaleformString_2();
Expand Down Expand Up @@ -517,7 +517,7 @@ public virtual uint DescriptionHash
description = string.Empty;
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
API.BeginScaleformMovieMethod(ScaleformUI._ui.Handle, "UPDATE_ITEM_DESCRIPTION");
API.BeginScaleformMovieMethod(Main._ui.Handle, "UPDATE_ITEM_DESCRIPTION");
API.ScaleformMovieMethodAddParamInt(Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)));
API.BeginTextCommandScaleformString("STRTNM1");
API.AddTextComponentSubstringTextLabelHashKey(descriptionHash);
Expand Down Expand Up @@ -565,8 +565,8 @@ public virtual bool Enabled
Label = _label;
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("SET_ITEM_LABELS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _formatLeftLabel, _formatRightLabel);
ScaleformUI._ui.CallFunction("ENABLE_ITEM", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _enabled);
Main._ui.CallFunction("SET_ITEM_LABELS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _formatLeftLabel, _formatRightLabel);
Main._ui.CallFunction("ENABLE_ITEM", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _enabled);
}
if (ParentColumn != null && ParentColumn.Parent.Visible)
{
Expand Down Expand Up @@ -612,7 +612,7 @@ public virtual string Label
}
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("SET_LEFT_LABEL", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _formatLeftLabel);
Main._ui.CallFunction("SET_LEFT_LABEL", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _formatLeftLabel);
}
if (ParentColumn != null && ParentColumn.Parent.Visible)
{
Expand All @@ -634,7 +634,7 @@ public virtual void SetLeftBadge(BadgeIcon badge)
LeftBadge = badge;
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("SET_LEFT_BADGE", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)badge);
Main._ui.CallFunction("SET_LEFT_BADGE", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)badge);
}
if (ParentColumn != null && ParentColumn.Parent.Visible)
{
Expand All @@ -654,7 +654,7 @@ public virtual void SetRightBadge(BadgeIcon badge)
RightBadge = badge;
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("SET_RIGHT_BADGE", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)badge);
Main._ui.CallFunction("SET_RIGHT_BADGE", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)badge);
}
if (ParentColumn != null && ParentColumn.Parent.Visible)
{
Expand Down Expand Up @@ -696,7 +696,7 @@ private set
}
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("SET_RIGHT_LABEL", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _formatRightLabel);
Main._ui.CallFunction("SET_RIGHT_LABEL", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _formatRightLabel);
}
if (ParentColumn != null && ParentColumn.Parent.Visible)
{
Expand Down Expand Up @@ -732,7 +732,7 @@ public virtual void RemovePanelAt(int Index)
Panels.RemoveAt(Index);
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("REMOVE_PANEL", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), Index);
Main._ui.CallFunction("REMOVE_PANEL", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), Index);
}
}

Expand All @@ -750,9 +750,9 @@ public virtual void AddSidePanel(UIMenuSidePanel panel)
{
case UIMissionDetailsPanel:
UIMissionDetailsPanel mis = (UIMissionDetailsPanel)panel;
ScaleformUI._ui.CallFunction("ADD_SIDE_PANEL_TO_ITEM", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), 0, (int)mis.PanelSide, (int)mis._titleType, mis.Title, (int)mis.TitleColor, mis.TextureDict, mis.TextureName);
Main._ui.CallFunction("ADD_SIDE_PANEL_TO_ITEM", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), 0, (int)mis.PanelSide, (int)mis._titleType, mis.Title, (int)mis.TitleColor, mis.TextureDict, mis.TextureName);
foreach (UIFreemodeDetailsItem _it in mis.Items)
ScaleformUI._ui.CallFunction("ADD_MISSION_DETAILS_DESC_ITEM", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _it.Type, _it.TextLeft, _it.TextRight, (int)_it.Icon, (int)_it.IconColor, _it.Tick);
Main._ui.CallFunction("ADD_MISSION_DETAILS_DESC_ITEM", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _it.Type, _it.TextLeft, _it.TextRight, (int)_it.Icon, (int)_it.IconColor, _it.Tick);
break;
}
}
Expand All @@ -766,7 +766,7 @@ public virtual void RemoveSidePanel()
SidePanel = null;
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("REMOVE_SIDE_PANEL_TO_ITEM", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)));
Main._ui.CallFunction("REMOVE_SIDE_PANEL_TO_ITEM", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)));
}
}

Expand Down
4 changes: 2 additions & 2 deletions ScaleformUI_Csharp/Items/UIMenuListItem.cs
Expand Up @@ -31,7 +31,7 @@ public int Index
else
_index = value;
if (Parent is not null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
ScaleformUI._ui.CallFunction("SET_ITEM_VALUE", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _index);
Main._ui.CallFunction("SET_ITEM_VALUE", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _index);
}
}

Expand Down Expand Up @@ -134,7 +134,7 @@ public void ChangeList(List<dynamic> list, int index)
_items = list;
_index = index;
if (Parent != null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
ScaleformUI._ui.CallFunction("UPDATE_LISTITEM_LIST", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), string.Join(",", _items), index);
Main._ui.CallFunction("UPDATE_LISTITEM_LIST", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), string.Join(",", _items), index);
}

public override void SetRightBadge(BadgeIcon badge)
Expand Down
4 changes: 2 additions & 2 deletions ScaleformUI_Csharp/Items/UIMenuProgressItem.cs
Expand Up @@ -18,7 +18,7 @@ public HudColor SliderColor
sliderColor = value;
if (Parent is not null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("UPDATE_COLORS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)MainColor, (int)HighlightColor, (int)TextColor, (int)HighlightedTextColor, (int)value);
Main._ui.CallFunction("UPDATE_COLORS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)MainColor, (int)HighlightColor, (int)TextColor, (int)HighlightedTextColor, (int)value);
}
}
}
Expand Down Expand Up @@ -58,7 +58,7 @@ public int Value
_value = value;
ProgressChanged(Value);
if (Parent is not null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
ScaleformUI._ui.CallFunction("SET_ITEM_VALUE", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _value);
Main._ui.CallFunction("SET_ITEM_VALUE", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _value);
}
}

Expand Down
4 changes: 2 additions & 2 deletions ScaleformUI_Csharp/Items/UIMenuSliderItem.cs
Expand Up @@ -13,7 +13,7 @@ public HudColor SliderColor
sliderColor = value;
if (Parent is not null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("UPDATE_COLORS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)MainColor, (int)HighlightColor, (int)TextColor, (int)HighlightedTextColor, (int)value);
Main._ui.CallFunction("UPDATE_COLORS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)MainColor, (int)HighlightColor, (int)TextColor, (int)HighlightedTextColor, (int)value);
}
}
}
Expand Down Expand Up @@ -63,7 +63,7 @@ public int Value
_value = value;
SliderChanged(_value);
if (Parent is not null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
ScaleformUI._ui.CallFunction("SET_ITEM_VALUE", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _value);
Main._ui.CallFunction("SET_ITEM_VALUE", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), _value);
}
}
/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions ScaleformUI_Csharp/Items/UIMenuStatsItem.cs
Expand Up @@ -24,7 +24,7 @@ public HudColor Color
sliderColor = value;
if (Parent is not null && Parent.Visible && Parent.Pagination.IsItemVisible(Parent.MenuItems.IndexOf(this)))
{
ScaleformUI._ui.CallFunction("UPDATE_COLORS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)MainColor, (int)HighlightColor, (int)TextColor, (int)HighlightedTextColor, (int)value);
Main._ui.CallFunction("UPDATE_COLORS", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), (int)MainColor, (int)HighlightColor, (int)TextColor, (int)HighlightedTextColor, (int)value);
}
}
}
Expand All @@ -45,7 +45,7 @@ public UIMenuStatsItem(string text, string subtitle, int value, HudColor color)

public void SetValue(int value)
{
ScaleformUI._ui.CallFunction("SET_ITEM_VALUE", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), value);
Main._ui.CallFunction("SET_ITEM_VALUE", Parent.Pagination.GetScaleformIndex(Parent.MenuItems.IndexOf(this)), value);
OnStatChanged?.Invoke(value);
}

Expand Down

0 comments on commit 65c400f

Please sign in to comment.