From 9df1b05beef22478b9305c5bf7ae58f69060c188 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 16 Mar 2020 15:33:25 +0100 Subject: [PATCH] allow changing auto nav mode value --- MLEM.Ui/UiControls.cs | 3 +-- MLEM.Ui/UiSystem.cs | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/MLEM.Ui/UiControls.cs b/MLEM.Ui/UiControls.cs index 6a41ee2..66a1918 100644 --- a/MLEM.Ui/UiControls.cs +++ b/MLEM.Ui/UiControls.cs @@ -31,8 +31,7 @@ namespace MLEM.Ui { public bool HandleKeyboard = true; public bool HandleTouch = true; public bool HandleGamepad = true; - - public bool IsAutoNavMode { get; private set; } + public bool IsAutoNavMode; public UiControls(UiSystem system, InputHandler inputHandler = null) { this.System = system; diff --git a/MLEM.Ui/UiSystem.cs b/MLEM.Ui/UiSystem.cs index 1187fb9..6883e0b 100644 --- a/MLEM.Ui/UiSystem.cs +++ b/MLEM.Ui/UiSystem.cs @@ -237,7 +237,7 @@ namespace MLEM.Ui { }; } - public void SelectElement(Element element) { + public void SelectElement(Element element, bool? autoNav = null) { if (this.SelectedElement == element) return; @@ -247,6 +247,9 @@ namespace MLEM.Ui { this.System.OnElementSelected?.Invoke(element); this.SelectedElement = element; this.System.OnSelectedElementChanged?.Invoke(element); + + if (autoNav != null) + this.System.Controls.IsAutoNavMode = autoNav.Value; } }