30
30
31
31
namespace
32
32
{
33
+ const QColor STICK_GATE_COLOR = Qt::lightGray;
33
34
const QColor C_STICK_GATE_COLOR = Qt::yellow;
34
35
const QColor CURSOR_TV_COLOR = 0xaed6f1 ;
35
36
const QColor TILT_GATE_COLOR = 0xa2d9ce ;
@@ -72,7 +73,9 @@ QColor MappingIndicator::GetCenterColor() const
72
73
73
74
QColor MappingIndicator::GetDeadZoneColor () const
74
75
{
75
- return palette ().shadow ().color ();
76
+ QColor color = GetBBoxBrush ().color ().valueF () > 0.5 ? Qt::black : Qt::white;
77
+ color.setAlphaF (0.25 );
78
+ return color;
76
79
}
77
80
78
81
QPen MappingIndicator::GetDeadZonePen () const
@@ -96,9 +99,10 @@ QColor MappingIndicator::GetAltTextColor() const
96
99
return palette ().highlightedText ().color ();
97
100
}
98
101
99
- QColor MappingIndicator::GetGateColor () const
102
+ void MappingIndicator::AdjustGateColor (QColor* color)
100
103
{
101
- return palette ().mid ().color ();
104
+ if (GetBBoxBrush ().color ().valueF () < 0.5 )
105
+ color->setHsvF (color->hueF (), color->saturationF (), 1 - color->valueF ());
102
106
}
103
107
104
108
MappingIndicator::MappingIndicator (ControllerEmu::ControlGroup* group) : m_group(group)
@@ -211,8 +215,11 @@ void MappingIndicator::DrawCursor(ControllerEmu::Cursor& cursor)
211
215
{
212
216
const auto center = cursor.GetCenter ();
213
217
214
- const QColor tv_brush_color = CURSOR_TV_COLOR;
215
- const QColor tv_pen_color = tv_brush_color.darker (125 );
218
+ QColor tv_brush_color = CURSOR_TV_COLOR;
219
+ QColor tv_pen_color = tv_brush_color.darker (125 );
220
+
221
+ AdjustGateColor (&tv_brush_color);
222
+ AdjustGateColor (&tv_pen_color);
216
223
217
224
const auto raw_coord = cursor.GetState (false );
218
225
const auto adj_coord = cursor.GetState (true );
@@ -294,14 +301,17 @@ void MappingIndicator::DrawReshapableInput(ControllerEmu::ReshapableInput& stick
294
301
295
302
const auto center = stick.GetCenter ();
296
303
297
- QColor gate_brush_color = GetGateColor () ;
304
+ QColor gate_brush_color = STICK_GATE_COLOR ;
298
305
299
306
if (is_c_stick)
300
307
gate_brush_color = C_STICK_GATE_COLOR;
301
308
else if (is_tilt)
302
309
gate_brush_color = TILT_GATE_COLOR;
303
310
304
- const QColor gate_pen_color = gate_brush_color.darker (125 );
311
+ QColor gate_pen_color = gate_brush_color.darker (125 );
312
+
313
+ AdjustGateColor (&gate_brush_color);
314
+ AdjustGateColor (&gate_pen_color);
305
315
306
316
const auto raw_coord = stick.GetReshapableState (false );
307
317
@@ -482,8 +492,11 @@ void MappingIndicator::DrawForce(ControllerEmu::Force& force)
482
492
{
483
493
const auto center = force.GetCenter ();
484
494
485
- const QColor gate_brush_color = SWING_GATE_COLOR;
486
- const QColor gate_pen_color = gate_brush_color.darker (125 );
495
+ QColor gate_brush_color = SWING_GATE_COLOR;
496
+ QColor gate_pen_color = gate_brush_color.darker (125 );
497
+
498
+ AdjustGateColor (&gate_brush_color);
499
+ AdjustGateColor (&gate_pen_color);
487
500
488
501
const auto raw_coord = force.GetState (false );
489
502
WiimoteEmu::EmulateSwing (&m_motion_state, &force, 1 .f / INDICATOR_UPDATE_FREQ);
@@ -677,7 +690,7 @@ void ShakeMappingIndicator::DrawShake()
677
690
p.drawLine (QPointF{grid_line_x, -1.0 } * scale, QPointF{grid_line_x, 1.0 } * scale);
678
691
679
692
// Position history.
680
- const QColor component_colors[] = {Qt::red , Qt::green, Qt::blue };
693
+ const QColor component_colors[] = {Qt::blue , Qt::green, Qt::red };
681
694
p.setBrush (Qt::NoBrush);
682
695
for (std::size_t c = 0 ; c != raw_coord.data .size (); ++c)
683
696
{
0 commit comments