Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.

Commit 6ef369d

Browse files
committed
DPad color fix
1 parent 645de73 commit 6ef369d

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

XOutput/UI/Component/XBox.xaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,13 @@
264264
<MatrixTransform Matrix="4.0721273 0 0 4.2220691 -1211.0046 -1685.8277"/>
265265
</Path.RenderTransform>
266266
</Path>
267-
<Path Name="path4981" Fill="#FF999999" StrokeThickness="1" Stroke="#FF000000" StrokeLineJoin="Miter" StrokeStartLineCap="Flat" StrokeEndLineCap="Flat">
267+
<Path Name="DPADBackground" StrokeThickness="1" Stroke="#FF000000" StrokeLineJoin="Miter" StrokeStartLineCap="Flat" StrokeEndLineCap="Flat">
268+
<Path.Fill>
269+
<MultiBinding Converter="{StaticResource ColorConverter}" ConverterParameter="DPAD|back">
270+
<Binding Path="Model.XInputType"/>
271+
<Binding Path="Model.Highlight"/>
272+
</MultiBinding>
273+
</Path.Fill>
268274
<Path.Data>
269275
<PathGeometry Figures="m 278.39977 580.99975 10.66974 0.50507 c 0 0 3.21985 1.2627 3.78807 4.41942 0.41789 2.3216 2.90419 14.14214 3.6618 14.77349 0.75762 0.63134 4.16688 6.56599 7.19734 6.94479 3.03046 0.37881 23.35978 3.283 24.62247 4.41942 1.26269 1.13642 3.15672 6.06092 3.15672 6.06092 l 0.25254 12.2481 c 0 0 -0.75761 3.78807 -1.89403 4.41941 -1.13642 0.63135 -22.09709 2.65165 -22.09709 2.65165 0 0 -6.31345 1.51523 -7.44988 5.17704 -1.13642 3.6618 -3.40926 18.81409 -4.41941 19.82424 -1.01016 1.01015 -2.39911 3.15673 -5.3033 3.53553 -2.90419 0.37881 -17.1726 0.63135 -17.1726 0.63135 0 0 -5.3033 -1.13642 -6.56599 -2.90419 -1.26269 -1.76777 -4.41942 -17.42513 -4.41942 -17.42513 0 0 -2.0203 -5.55584 -8.33375 -7.19734 -6.31346 -1.6415 -18.18275 -0.25254 -21.71828 -1.89403 -3.53554 -1.6415 -5.93465 -4.67196 -6.18719 -7.32361 -0.25254 -2.65165 -1.38896 -11.86929 -0.88388 -12.62691 0.50507 -0.75761 2.90419 -5.3033 4.29315 -5.42957 1.38896 -0.12627 20.45559 -2.27284 22.60216 -3.91434 2.14657 -1.6415 6.94481 -5.42957 7.19734 -7.95495 0.25253 -2.52538 1.35892 -16.72262 2.33597 -16.73066 0.80286 -0.72867 1.47665 -0.94007 2.0996 -1.26982 1.04765 -0.55455 3.79211 -0.70026 7.30745 -0.75048 4.41941 -0.0631 7.26047 -0.1894 7.26047 -0.1894 z" FillRule="NonZero"/>
270276
</Path.Data>

XOutput/UI/Converters/ColorConverter.cs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public class ColorConverter : IMultiValueConverter
2020
protected Dictionary<XInputTypes, Brush> foregroundColors = new Dictionary<XInputTypes, Brush>();
2121
protected Dictionary<XInputTypes, Brush> backgroundColors = new Dictionary<XInputTypes, Brush>();
2222

23-
protected static readonly Brush dpad = CreateData(134, 134, 134);
23+
protected static readonly Brush dpad = CreateData(153, 153, 153);
24+
protected static readonly Brush dpadBack = CreateData(134, 134, 134);
2425

2526
public ColorConverter()
2627
{
@@ -70,9 +71,18 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur
7071
bool back = parameters.Length > 1 && parameters[1] == "back";
7172
if (parameters[0] == "DPAD")
7273
{
73-
if (highlight == true && XInputHelper.Instance.IsDPad(activeType.Value))
74-
return new SolidColorBrush(Color.FromRgb(128, 0, 0));
75-
return dpad;
74+
if (back)
75+
{
76+
if (highlight == true && XInputHelper.Instance.IsDPad(activeType.Value))
77+
return new SolidColorBrush(Color.FromRgb(128, 0, 0));
78+
return dpadBack;
79+
}
80+
else
81+
{
82+
if (highlight == true && XInputHelper.Instance.IsDPad(activeType.Value))
83+
return new SolidColorBrush(Color.FromRgb(255, 0, 0));
84+
return dpad;
85+
}
7686
}
7787
else
7888
{

0 commit comments

Comments
 (0)