diff --git a/XOutput/App.xaml b/XOutput/App.xaml
index 4ad2566d..914a9e54 100644
--- a/XOutput/App.xaml
+++ b/XOutput/App.xaml
@@ -24,5 +24,6 @@
+
diff --git a/XOutput/Devices/Input/InputDiagnostics.cs b/XOutput/Devices/Input/InputDiagnostics.cs
index 26ab147e..9fcdd528 100644
--- a/XOutput/Devices/Input/InputDiagnostics.cs
+++ b/XOutput/Devices/Input/InputDiagnostics.cs
@@ -26,6 +26,7 @@ public IEnumerable GetResults()
GetButtonsResult(),
GetDPadResult(),
GetForceFeedbackResult(),
+ GetSlidersResult(),
};
}
@@ -48,6 +49,17 @@ public DiagnosticsResult GetAxesResult()
return result;
}
+ public DiagnosticsResult GetSlidersResult()
+ {
+ int slidersCount = device.Sliders.Count();
+ return new DiagnosticsResult
+ {
+ Value = slidersCount,
+ Type = InputDiagnosticsTypes.SlidersCount,
+ State = DiagnosticsResultState.Passed,
+ };
+ }
+
public DiagnosticsResult GetButtonsResult()
{
int buttonsCount = device.Buttons.Count();
diff --git a/XOutput/Devices/Input/InputDiagnosticsTypes.cs b/XOutput/Devices/Input/InputDiagnosticsTypes.cs
index e73c6bb4..bef36a75 100644
--- a/XOutput/Devices/Input/InputDiagnosticsTypes.cs
+++ b/XOutput/Devices/Input/InputDiagnosticsTypes.cs
@@ -8,10 +8,10 @@ namespace XOutput.Devices.Input
{
public enum InputDiagnosticsTypes
{
-
AxesCount,
ButtonsCount,
DPadCount,
+ SlidersCount,
ForceFeedbackCount,
}
}
diff --git a/XOutput/Resources/languages.txt b/XOutput/Resources/languages.txt
index 28e48d6e..e53417b2 100644
--- a/XOutput/Resources/languages.txt
+++ b/XOutput/Resources/languages.txt
@@ -40,7 +40,19 @@ WaitingForInputFor=Waiting for input for
Keyboard=Keyboard
Warning=Warning
Error=Error
+True=true
+False=false
Test=Test
+System=System
+DiagnosticsMenu=Diagnostics
+InputDiagnosticsTypes.AxesCount=Axes count
+InputDiagnosticsTypes.ButtonsCount=Buttons count
+InputDiagnosticsTypes.DPadCount=DPad count
+InputDiagnosticsTypes.SlidersCount=Sliders count
+InputDiagnosticsTypes.ForceFeedbackCount=Force feedback motors count
+XInputDiagnosticsTypes.XDevice=Virtualization software is installed
+XInputDiagnosticsTypes.ScpDevice=SCPToolkit is installed
+XInputDiagnosticsTypes.VigemDevice=ViGEm is installed
VersionCheckError=There was an error while checking for updates.
VersionCheckNewRelease=This is a development release.
VersionCheckUpToDate=The software is up to date.
@@ -269,6 +281,18 @@ Keyboard=Billentyűzet
Warning=Figyelmeztetés
Error=Hiba
Test=Teszt
+True=igaz
+False=hamis
+System=Rendszer
+DiagnosticsMenu=Diagnosztika
+InputDiagnosticsTypes.AxesCount=Tengelyek száma
+InputDiagnosticsTypes.ButtonsCount=Gombok száma
+InputDiagnosticsTypes.DPadCount=DPadok száma
+InputDiagnosticsTypes.SlidersCount=Csúszkák száma
+InputDiagnosticsTypes.ForceFeedbackCount=Rezgő motorok száma
+XInputDiagnosticsTypes.XDevice=Virtualizációs szoftver telepítve
+XInputDiagnosticsTypes.ScpDevice=SCPToolkit telepítve
+XInputDiagnosticsTypes.VigemDevice=ViGEm telepítve
VersionCheckError=Hiba történt a frissítés keresése közben.
VersionCheckNewRelease=Ez egy fejlesztői verzió.
VersionCheckUpToDate=Az alkalmazás legfrissebb verzióját használja.
diff --git a/XOutput/UI/Component/DiagnosticsItemView.xaml b/XOutput/UI/Component/DiagnosticsItemView.xaml
index 4b883f75..60dbd14f 100644
--- a/XOutput/UI/Component/DiagnosticsItemView.xaml
+++ b/XOutput/UI/Component/DiagnosticsItemView.xaml
@@ -4,39 +4,68 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:XOutput.UI.Component"
+ xmlns:diagnostics="clr-namespace:XOutput.Diagnostics"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:DiagnosticsItemViewModel, IsDesignTimeCreatable=False}"
d:DesignHeight="30" d:DesignWidth="490">
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
diff --git a/XOutput/UI/Component/DiagnosticsItemViewModel.cs b/XOutput/UI/Component/DiagnosticsItemViewModel.cs
index 1f0ffe70..4051bafd 100644
--- a/XOutput/UI/Component/DiagnosticsItemViewModel.cs
+++ b/XOutput/UI/Component/DiagnosticsItemViewModel.cs
@@ -23,7 +23,7 @@ public DiagnosticsItemViewModel(DiagnosticsItemModel model, IDiagnostics diagnos
protected string SourceToString(object source)
{
if (source == null)
- return "System";
+ return LanguageModel.Instance.Translate("System");
if (source is IInputDevice)
return (source as IInputDevice).DisplayName;
return null;
diff --git a/XOutput/UI/Converters/DynamicLanguageConverter.cs b/XOutput/UI/Converters/DynamicLanguageConverter.cs
index 571add5f..72807dfa 100644
--- a/XOutput/UI/Converters/DynamicLanguageConverter.cs
+++ b/XOutput/UI/Converters/DynamicLanguageConverter.cs
@@ -33,26 +33,33 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur
key = values[1].GetType().Name + "." + values[1].ToString();
return getTranslation(translations, key) ?? values[1].ToString();
}
- key = values[1] as string;
+ else if (values[1] is string)
+ key = values[1] as string;
+ else if (values[1] is bool)
+ key = (bool)values[1] ? "True" : "False";
+ else if (values[1] is sbyte || values[1] is byte || values[1] is char || values[1] is short || values[1] is ushort || values[1] is int || values[1] is uint || values[1] is long || values[1] is ulong || values[1] is decimal)
+ return values[1].ToString();
+ else
+ throw new ArgumentException(values[1] + " cannot be translated");
return getTranslation(translations, key) ?? key;
}
- ///
- /// Intentionally not implemented.
- ///
- /// Ignored
- /// Ignored
- /// Ignored
- /// Ignored
- ///
- public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ ///
+ /// Intentionally not implemented.
+ ///
+ /// Ignored
+ /// Ignored
+ /// Ignored
+ /// Ignored
+ ///
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
protected string getTranslation(Dictionary translations, string key)
{
- if(translations == null || key == null || !translations.ContainsKey(key))
+ if (translations == null || key == null || !translations.ContainsKey(key))
{
return null;
}
diff --git a/XOutput/UI/Converters/EqualsToVisibilityConverter.cs b/XOutput/UI/Converters/EqualsToVisibilityConverter.cs
new file mode 100644
index 00000000..c1574e23
--- /dev/null
+++ b/XOutput/UI/Converters/EqualsToVisibilityConverter.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Media;
+
+namespace XOutput.UI.Converters
+{
+ ///
+ /// Compares enum value and converts to visibility.
+ /// Cannot be used backwards.
+ ///
+ public class EqualsToVisibilityConverter : IValueConverter
+ {
+ ///
+ /// Compares enum value and converts to visibility.
+ ///
+ /// Value to convert
+ /// Ignored
+ /// Ignored
+ /// Ignored
+ /// If the value is not null
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value.Equals(parameter) ? Visibility.Visible : Visibility.Collapsed;
+ }
+
+ ///
+ /// Intentionally not implemented.
+ ///
+ /// Ignored
+ /// Ignored
+ /// Ignored
+ /// Ignored
+ ///
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/XOutput/UI/Windows/DiagnosticsWindow.xaml b/XOutput/UI/Windows/DiagnosticsWindow.xaml
index 6e6328cb..be955c1f 100644
--- a/XOutput/UI/Windows/DiagnosticsWindow.xaml
+++ b/XOutput/UI/Windows/DiagnosticsWindow.xaml
@@ -9,7 +9,7 @@
Loaded="WindowLoaded"
Closed="WindowClosed"
d:DataContext="{d:DesignInstance Type=local:DiagnosticsViewModel, IsDesignTimeCreatable=False}"
- Title="Diagnostics" Height="550" Width="550">
+ Title="{Binding LanguageModel.Data, Converter={StaticResource LanguageConverter}, ConverterParameter='DiagnosticsMenu'}" Height="750" Width="550">
diff --git a/XOutput/UI/Windows/MainWindowViewModel.cs b/XOutput/UI/Windows/MainWindowViewModel.cs
index 7d25f883..53df0f9c 100644
--- a/XOutput/UI/Windows/MainWindowViewModel.cs
+++ b/XOutput/UI/Windows/MainWindowViewModel.cs
@@ -242,9 +242,9 @@ public void OpenSettings()
public void OpenDiagnostics()
{
- ICollection elements = Model.Controllers.Select(c => c.ViewModel.Model.Controller.InputDevice)
+ IList elements = Model.Controllers.Select(c => c.ViewModel.Model.Controller.InputDevice)
.Select(d => new InputDiagnostics(d)).OfType().ToList();
- elements.Add(new Devices.XInput.XInputDiagnostics());
+ elements.Insert(0, new Devices.XInput.XInputDiagnostics());
new DiagnosticsWindow(new DiagnosticsViewModel(new DiagnosticsModel(), elements)).ShowDialog();
}
diff --git a/XOutput/XOutput.csproj b/XOutput/XOutput.csproj
index 2b362507..e11f82c1 100644
--- a/XOutput/XOutput.csproj
+++ b/XOutput/XOutput.csproj
@@ -144,6 +144,7 @@
+