diff --git a/.gitignore b/.gitignore
index aff6ba6..fe2831d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -262,3 +262,7 @@ __pycache__/
dependencies/MenuAPI\.net\.dll
postbuild\.cmd
+
+postbuild-fivem.cmd
+
+postbuild-redm.cmd
diff --git a/MenuAPI/Menu.cs b/MenuAPI/Menu.cs
index 5d03a57..c7b9b4b 100644
--- a/MenuAPI/Menu.cs
+++ b/MenuAPI/Menu.cs
@@ -1,11 +1,12 @@
using System;
using System.Collections.Generic;
-using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CitizenFX.Core;
using static CitizenFX.Core.Native.API;
+using static CitizenFX.Core.Native.Function;
+using static CitizenFX.Core.Native.Hash;
namespace MenuAPI
{
@@ -72,6 +73,7 @@ public class Menu
/// The new of this item.
public delegate void IndexChangedEvent(Menu menu, MenuItem oldItem, MenuItem newItem, int oldIndex, int newIndex);
+#if FIVEM
///
/// Triggered when the changes.
///
@@ -90,6 +92,7 @@ public class Menu
/// The current position of the slider bar.
/// The index of this .
public delegate void SliderItemSelectedEvent(Menu menu, MenuSliderItem sliderItem, int sliderPosition, int itemIndex);
+#endif
///
/// Triggered when a 's value was changed.
@@ -151,7 +154,7 @@ public class Menu
/// Parameters: menu, oldSelectedItem, newSelectedItem, oldIndex, newIndex.
///
public event IndexChangedEvent OnIndexChange;
-
+#if FIVEM
///
/// Triggered when the changes.
/// Parameters: menu, sliderItem, oldPosition, newPosition, itemIndex
@@ -163,6 +166,7 @@ public class Menu
/// Parameters: menu, sliderItem, sliderPosition, itemIndex.
///
public event SliderItemSelectedEvent OnSliderItemSelect;
+#endif
///
/// Triggered when a 's value was changed.
@@ -257,6 +261,7 @@ protected virtual void IndexChangeEvent(Menu menu, MenuItem oldItem, MenuItem ne
OnIndexChange?.Invoke(menu, oldItem, newItem, oldIndex, newIndex);
}
+#if FIVEM
///
/// Triggered when the changes.
///
@@ -281,6 +286,7 @@ protected virtual void SliderSelectedEvent(Menu menu, MenuSliderItem sliderItem,
{
OnSliderItemSelect?.Invoke(menu, sliderItem, sliderPosition, itemIndex);
}
+#endif
///
/// Triggered when a 's value was changed.
@@ -304,18 +310,24 @@ protected virtual void DynamicListItemSelectEvent(Menu menu, MenuDynamicListItem
{
OnDynamicListItemSelect?.Invoke(menu, dynamicListItem, currentItem);
}
-
#endregion
#endregion
#region constants or readonlys
+#if FIVEM
public const float Width = 500f;
+#endif
+#if REDM
+ public const float Width = 300F;
+#endif
#endregion
#region private variables
- private static SizeF headerSize = new SizeF(Width, 110f);
+ private static KeyValuePair headerSize = new KeyValuePair(Width, 110f);
+
private int index = 0;
+
public int ViewIndexOffset { get; private set; } = 0;
private List