1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-16 02:53:11 +01:00

allow changing auto nav mode value

This commit is contained in:
Ellpeck 2020-03-16 15:33:25 +01:00
parent 76cb94bb34
commit 9df1b05bee
2 changed files with 5 additions and 3 deletions

View file

@ -31,8 +31,7 @@ namespace MLEM.Ui {
public bool HandleKeyboard = true; public bool HandleKeyboard = true;
public bool HandleTouch = true; public bool HandleTouch = true;
public bool HandleGamepad = true; public bool HandleGamepad = true;
public bool IsAutoNavMode;
public bool IsAutoNavMode { get; private set; }
public UiControls(UiSystem system, InputHandler inputHandler = null) { public UiControls(UiSystem system, InputHandler inputHandler = null) {
this.System = system; this.System = system;

View file

@ -237,7 +237,7 @@ namespace MLEM.Ui {
}; };
} }
public void SelectElement(Element element) { public void SelectElement(Element element, bool? autoNav = null) {
if (this.SelectedElement == element) if (this.SelectedElement == element)
return; return;
@ -247,6 +247,9 @@ namespace MLEM.Ui {
this.System.OnElementSelected?.Invoke(element); this.System.OnElementSelected?.Invoke(element);
this.SelectedElement = element; this.SelectedElement = element;
this.System.OnSelectedElementChanged?.Invoke(element); this.System.OnSelectedElementChanged?.Invoke(element);
if (autoNav != null)
this.System.Controls.IsAutoNavMode = autoNav.Value;
} }
} }