From af8efcbf4af36b06284cb5623b509781e274d603 Mon Sep 17 00:00:00 2001 From: Sergey Gut Date: Wed, 29 May 2024 00:16:58 +0300 Subject: [PATCH] make new option type for internal purposes --- Core/Handler/SettingsHandler.cs | 7 +++++++ Core/Options/OptionType.cs | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Core/Handler/SettingsHandler.cs b/Core/Handler/SettingsHandler.cs index 039efbd..8619a1b 100644 --- a/Core/Handler/SettingsHandler.cs +++ b/Core/Handler/SettingsHandler.cs @@ -159,6 +159,12 @@ public class SettingsHandler : CommonHandler button.Text += $" ({currentChoice.ShortName})"; break; } + + case OptionType.Hidden: + { + button = null; + break; + } } return button; @@ -185,6 +191,7 @@ public class SettingsHandler : CommonHandler { var keyboardLayout = _options.ToAsyncEnumerable() .SelectAwait(async x => await GetKeyboardButton(x)) + .Where(x => x != null) // for OptionType.Hidden .ToEnumerable() .Chunk(2); diff --git a/Core/Options/OptionType.cs b/Core/Options/OptionType.cs index 6c65c56..8acff19 100644 --- a/Core/Options/OptionType.cs +++ b/Core/Options/OptionType.cs @@ -3,5 +3,6 @@ public enum OptionType { OnOff, - Select + Select, + Hidden } \ No newline at end of file