Skip to content

@alexguirre alexguirre released this Jun 27, 2021

Available on NuGet.

Changelog (click to expand)

Features

  • Added Localization class (#100):
    • Includes various properties/methods related to localization.
    • Allows to override or create new text labels with custom strings.
  • Added support for accessing textures embedded in fragments (.yft) or drawables (.ydr) in native functions such as DRAW_SPRITE (#101):
    • To access an embedded texture, use embed:model_name as the texture dictionary. For example, texture dictionary embed:prop_bbq_2 and texture name p_v_bbq_2.
    • The model needs to be loaded first to be able to access the texture.
    • embed:model_name can be used with RAGENativeUI.Elements.Sprite but the model needs to be loaded by the user. The class assumes that it is always loaded, so Sprite.IsTextureDictionaryLoaded always returns true and Sprite.LoadTextureDictionary() does nothing.
  • Added UIMenuPanel classes (#113):
    • Interactive panels displayed below a UIMenu, after the description.
    • Implementations added in this release:
      • UIMenuGridPanel: grid where the user can choose a 2D point between (0, 0) and (1, 1) (from GTA Online character creator).
      • UIMenuSliderPanel: slider bar where the user can choose a value between 0 and 1 (from GTA Online character creator).
      • UIMenuStatsPanel: displays multiple named values (from Los Santos Customs menu).
    • Use UIMenuItem.Panels to set the panels shown when this item is selected.
    • Use UIMenu.PanelsOverride to set the panels shown always instead of the UIMenuItem.Panels of the selected item.
  • Added option to disable background postfx in TabView with the TabView.PlayBackgroundEffect property.
  • Published NuGet package.

Fixes

  • Fixed crash when UIMenuItem.Text is null (#96).
  • Fixed incorrect custom menu banner position when the game is windowed (#97).
  • Fixed stretched menus in ultrawide resolutions (#98).
  • Fixed incorrect foreground color of selected UIMenuItem when TabInteractiveListItem is unfocused.
  • Fixed TabMissionSelectItem not drawing MissionLogos that use game textures (#108).
  • Fixed issue in some multiple display setups causing the camera to rotate when opening a menu (#109).
  • Fixed crash in TabSubmenuItem without items (#122).
  • Fixed incorrect behaviour of TabView.Visible causing TabView.IsAnyPauseMenuVisible to always return true in some cases (#125).
1 person reacted
Assets 3

@alexguirre alexguirre released this Aug 12, 2020

Changelog (click to expand)

Features

  • UIMenu
    • Added UIMenu.IsAnyMenuVisible which allows to detect if any UIMenu is currently open, including menus from different plugins.
    • Added UIMenu.InstructionalButtons property which returns the InstructionalButtons instance of the UIMenu.
    • Added UIMenu.InstructionalButtonsEnabled property.
    • Added UIMenu.DescriptionOverride property.
    • Added UIMenu.OnMenuOpen event.
    • Added UIMenu.Width property.
    • Added public setter to UIMenu.WidthOffset property.
    • Added UIMenu.AdjustedWidth property.
    • Added UIMenu.Offset property.
    • Added UIMenu.RemoveBanner() method for having banner-less menus, alternative to setting the banner to an invisible ResRectangle.
    • Make more UIMenu methods virtual: UIMenu.DrawBanner(Rage.Graphics), UIMenu.Draw(), UIMenu.GoUp(), UIMenu.GoDown(), UIMenu.GoLeft(), UIMenu.GoRight(), UIMenu.SelectItem(), UIMenu.GoBack(), UIMenu.ProcessMouse(), UIMenu.ProcessControl().
    • Added UIMenu.OpenChildMenu(UIMenuItem) method.
    • Added UIMenu.Close(bool) method.
    • Added UIMenu.SetKeyAcceleration(Common.MenuControls, AccelerationStep[]) method.
    • Added UIMenu.MaxItemsOnScreen property.
    • Added UIMenu.FirstItemOnScreen/LastItemOnScreen properties.
    • Added UIMenu.TitleText property.
    • Added UIMenu.TitleStyle property.
    • Added UIMenu.SubtitleText property.
    • Added UIMenu.SubtitleStyle property.
    • Added UIMenu.SubtitleBackgroundColor property.
    • Added UIMenu.CounterStyle property.
    • Added UIMenu.DescriptionStyle property.
    • Added UIMenu.DescriptionSeparatorColor property.
    • Added UIMenu.UpDownArrowsBackgroundColor property.
    • Added UIMenu.UpDownArrowsHighlightColor property.
    • Added UIMenu.UpDownArrowsForegroundColor property.
    • Added UIMenu.AddItems(IEnumerable<UIMenuItem>)/AddItems(params UIMenuItem[]) allowing to add multiple items at once.
    • Added UIMenuItem.DisabledForeColor property.
    • Added UIMenuItem.CurrentForeColor property.
    • Added UIMenuItem.Activate(UIMenu) method to allow activating an item from user code.
    • Added UIMenuItem.Draw(float, float, float, float) method.
    • Added UIMenuItem.OnInput(UIMenu, Common.MenuControls) method that handles input events from the parent menu when selected.
    • Added UIMenuItem.OnMouseInput(UIMenu, RectangleF, PointF, MouseInput) method that handles mouse input events from the parent menu when selected.
    • Added UIMenuItem.TextStyle property.
    • Added public setter to UIMenuItem.RightLabel property.
    • Added UIMenuItem.RightLabelStyle property.
    • Added public setter to UIMenuItem.LeftBadge property.
    • Added public setter to UIMenuItem.RightBadge property.
    • Added UIMenuItem.BadgeInfo class that allows to create custom badges.
    • Added UIMenuItem.LeftBadgeInfo property.
    • Added UIMenuItem.RightBadgeInfo property.
    • Added new UIMenuItem.BadgeStyles: CardSuitClubs, CardSuitDiamonds, CardSuitHearts, CardSuitSpades, Art, Blank (for indenting item contents without drawing a badge) and Custom (for user created BadgeInfos).
    • Added UIMenuScrollerItem base class with UIMenuListScrollerItem<T> and UIMenuNumericScrollerItem<T> derived classes. Replacement for UIMenuListItem.
    • Added UIMenuScrollerSliderBar class that allows to display a UIMenuScrollerItem with a slider bar instead of left/right arrows.
    • Added UIMenuCheckboxItem.Toggle(UIMenu) method to allow toggling a checkbox from user code.
    • Added UIMenuCheckboxItem.Style property and UIMenuCheckboxStyle enum allowing to display a cross instead of a tick in checkboxes.
    • Now the setter of UIMenuItem.RightBadge property can be used with UIMenuCheckboxItems and UIMenuListItems.
  • Timer Bars
    • Added TimerBarBase.LabelStyle property.
    • Added TimerBarBase.LabelOffset property.
    • Added TimerBarBase.Highlight property.
    • Added TimerBarBase.Accent property.
    • Added TextTimerBar.TextStyle property.
    • Added TextTimerBar.TextOffset property.
    • Added BarTimerBar.Markers property.
    • Added IconsTimerBar class. A timer bar that displays a list of icons.
    • Added CheckpointsTimerBar class. A timer bar that displays a list of checkpoints.
  • Pause Menu
    • Added TabView.IsAnyPauseMenuVisible which allows to detect if any pause menu TabView is currently open, including pause menus from different plugins.
    • Added TabView.InstructionalButtons property which returns the InstructionalButtons instance of the TabView.
    • Added TabView.PauseGame property.
    • Added TabInteractiveListItem.BackingMenu property which returns the UIMenu used internally by the tab item.
  • Instructional Buttons
    • Added InstructionalButtonGroup that allows displaying multiple buttons in a single slot.
    • Added IInstructionalButtonSlot interface. Implemented by InstructionalButton and InstructionalButtonGroup.
    • Added IInstructionalButtonSlot.BindedControl which binds a GameControl to a slot, allowing the user to click it which simulates pressing the control (InstructionalButtons.MouseButtonsEnabled needs to be set to true).
    • Added InstructionalButtonId struct which wraps the different kind of buttons: from a string (t_, T_ or w_ based on length), from a GameControl and from a raw button ID (b_).
    • Added InstructionalButtons.BackgroundColor property.
    • Added InstructionalButtons.MaxWidth property.
    • Added InstructionalButtons.MouseButtonsEnabled property.
    • Added support for displaying arbitrary key icons in help prompts.
  • Misc
    • Added HudColor enum.
    • Added HudColorExtensions class including GetName, GetColor and SetColor extension methods for HudColor.
    • Added TextStyle structure.
    • Added TextFont enum.
    • Added TextJustification enum.
    • Added an overload to BigMessageHandler.ShowMpMessageLarge that allows to specify the subtitle string.
    • Added BaseCollection<T>.Add(params T[])/AddRange(IEnumerable<T>) allowing to add multiple items at once (e.g. with MenuPool, TimerBarPool or InstructionalButtonsCollection).

Fixes

  • UIMenu
    • Improved performance.
    • Fixed UIMenu display issues in large resolution setups.
    • Fixed crashes when UIMenu has no items.
    • Fixed slight flicker when changing menus (i.e. opening a child menu or going back to the parent menu).
  • Timer Bars
    • Fixed timer bars from different TimerBarPools overlapping, including timer bars from different plugins.
    • Fixed timer bars overlapping the game native timer bars.
  • Pause Menu
    • Fixed background post-fx remaining active when unloading a plugin with a TabView open.
    • Fixed TabSubmenuItem and its selected child TabItem receiving input at the same time.
    • Fixed TabInteractiveListItem not properly supporting all UIMenuItems.
    • Fixed drawing position of TabView.Photo.
  • Misc
    • Fixed BigMessageHandler.ShowMpMessageLarge showing a hardcoded string as the subtitle.
    • Fixed BigMessageHandler.ShowColoredShard using textColor and bgColor parameters incorrectly, textColor was used as the background color and bgColor as the text color.
    • Fixed game recording stopping when opening a menu.

Breaking changes

  • UIMenu
    • Marked UIMenu.Title property as obsolete in favor of UIMenu.TitleText.
    • Marked UIMenu.Subtitle property as obsolete in favor of UIMenu.SubtitleText.
    • Removed UIMenuItem._text and UIMenuItem._labelText protected fields in favor of UIMenuItem.TextStyle and UIMenuItem.RightLabelTextStyle.
    • Removed UIMenuItem._rectangle, UIMenuItem._selectedSprite, UIMenuItem._badgeLeft and UIMenuItem._badgeRight protected fields.
    • Marked UIMenu.HoldTimeBeforeScroll as obsolete in favor of UIMenu.SetKeyAcceleration().
    • Marked UIMenu.IsControlBeingPressed method as obsolete.
    • Marked UIMenu.HasControlJustBeenPressed method as obsolete.
    • Marked UIMenu.HasControlJustBeenReleased method as obsolete.
    • Removed UIMenu.SetKey(Common.MenuControls, Keys) overload.
    • Removed MenuPool.SetKey(Common.MenuControls, Keys) overload.
    • Removed UIMenu.ProcessKey.
    • Removed MenuPool.ProcessKey.
    • Changed UIMenu.ProcessControl(Keys) signature to UIMenu.ProcessControl().
    • Marked UIMenuListItem.HoldTimeBeforeScroll as obsolete in favor of using UIMenu.SetKeyAcceleration() on the parent menu when selecting the item.
    • Marked UIMenu.SetMenuWidthOffset(int) method as obsolete in favor of the UIMenu.WidthOffset setter.
    • Marked UIMenu.IsMouseInBounds(Point, Size) method as obsolete.
    • Marked UIMenu.IsMouseInListItemArrows(UIMenuListItem, Point, Point) method as obsolete.
    • Marked UIMenu.GoUpOverflow() method as obsolete in favor of UIMenu.GoUp().
    • Marked UIMenu.GoDownOverflow() method as obsolete in favor of UIMenu.GoDown().
    • Marked UIMenuItem.SetVerticalPosition(int) method as obsolete.
    • Marked UIMenuItem.Draw() method as obsolete.
    • Marked UIMenuItem.Offset property as obsolete.
    • Marked UIMenuItem.SetLeftBadge(BadgeStyle) method as obsolete in favor of UIMenuItem.LeftBadge public setter.
    • Marked UIMenuItem.SetRightBadge(BadgeStyle) method as obsolete in favor of UIMenuItem.RightBadge public setter.
    • Marked UIMenuItem.SetRightLabel(string) method as obsolete in favor of UIMenuItem.RightLabel public setter.
  • Instructional Buttons
    • InstructionalButtonsCollection now derives from BaseCollection<IInstructionalButtonSlot> instead of BaseCollection<InstructionalButton>
    • Removed InstructionalButton.ButtonText/ButtonControl properties in favor of InstructionalButton.Button.
  • Misc
    • Updated to .NET Framework v4.7.2 and C# 8.0.
    • Marked StringMeasurer class as obsolete.
    • Removed RAGENativeUI.Elements.HudColor enum in favor of RAGENativeUI.HudColor.
Assets 3
Aug 7, 2020
Merge pull request #92 from alexguirre/token-parser
Implement token parser for arbitrary key icons