Skip to content

Commit

Permalink
RedM: Fix the SelectItem method for some MenuItem types.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomGrobbe committed Nov 21, 2019
1 parent 6063d36 commit 87ff61a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions MenuAPI/Menu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,6 @@ public void SelectItem(MenuItem item)
{
if (item != null && item.Enabled)
{
#if FIVEM
if (item is MenuCheckboxItem checkbox)
{
checkbox.Checked = !checkbox.Checked;
Expand All @@ -647,23 +646,27 @@ public void SelectItem(MenuItem item)
{
ListItemSelectEvent(this, listItem, listItem.ListIndex, listItem.Index);
}
else if (item is MenuSliderItem slider)
{
SliderSelectedEvent(this, slider, slider.Position, slider.Index);
}
else if (item is MenuDynamicListItem dynamicListItem)
{
DynamicListItemSelectEvent(this, dynamicListItem, dynamicListItem.CurrentItem);
}
#if FIVEM
else if (item is MenuSliderItem slider)
{
SliderSelectedEvent(this, slider, slider.Position, slider.Index);
}
else
{
ItemSelectedEvent(item, item.Index);
}
PlaySoundFrontend(-1, "SELECT", "HUD_FRONTEND_DEFAULT_SOUNDSET", false);
#endif
#if REDM
ItemSelectedEvent(item, item.Index);
Call((CitizenFX.Core.Native.Hash)0xCE5D0FFE83939AF1, -1, "SELECT", "HUD_SHOP_SOUNDSET", 1);
else
{
ItemSelectedEvent(item, item.Index);
Call((CitizenFX.Core.Native.Hash)0xCE5D0FFE83939AF1, -1, "SELECT", "HUD_SHOP_SOUNDSET", 1);
}
#endif
if (MenuController.MenuButtons.ContainsKey(item))
{
Expand Down

0 comments on commit 87ff61a

Please sign in to comment.