From 7ebc4c02599437b97ab7cda76c213ae248e4e262 Mon Sep 17 00:00:00 2001 From: Hannele Ruiz Date: Sat, 16 Dec 2023 03:25:50 -0300 Subject: [PATCH] Make sure that Spacers can't be clicked --- LemonUI/Menus/NativeItem.cs | 2 +- LemonUI/Menus/NativeMenu.cs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/LemonUI/Menus/NativeItem.cs b/LemonUI/Menus/NativeItem.cs index a36969b..9128523 100644 --- a/LemonUI/Menus/NativeItem.cs +++ b/LemonUI/Menus/NativeItem.cs @@ -393,7 +393,7 @@ public virtual void UpdateColors() badgeRight.Color = Colors.BadgeRightDisabled; } } - else if (lastSelected) + else if (lastSelected && !(this is NativeSpacerItem)) { background.Color = Colors.BackgroundHovered; title.Color = Colors.TitleHovered; diff --git a/LemonUI/Menus/NativeMenu.cs b/LemonUI/Menus/NativeMenu.cs index c941294..d4bc6ab 100644 --- a/LemonUI/Menus/NativeMenu.cs +++ b/LemonUI/Menus/NativeMenu.cs @@ -1284,6 +1284,11 @@ private void ProcessControls() // If the cursor is inside of the selection rectangle if (GameScreen.IsCursorInArea(item.title.Position.X - itemOffsetX, item.title.Position.Y - itemOffsetY, Width, itemHeight)) { + if (item is NativeSpacerItem) + { + return; + } + // If the item is selected, activate it if (item == selectedItem) { @@ -1426,7 +1431,7 @@ private void Draw() continue; } - if (item.IsHovered && UseMouse) + if (item.IsHovered && UseMouse && !(item is NativeSpacerItem)) { hoveredRect.Position = item.lastPosition; hoveredRect.Size = item.lastSize;