diff options
| author | 2021-02-06 21:34:08 -0600 | |
|---|---|---|
| committer | 2021-02-07 00:15:24 -0600 | |
| commit | 8893b766c3b582e6d2594e9a544cbf9d6ee689c7 (patch) | |
| tree | 933566039f8a669a98029dbdd98b741e314317a9 /src | |
| parent | Refresh debug controller settings (diff) | |
| download | yuzu-8893b766c3b582e6d2594e9a544cbf9d6ee689c7.tar.gz yuzu-8893b766c3b582e6d2594e9a544cbf9d6ee689c7.tar.xz yuzu-8893b766c3b582e6d2594e9a544cbf9d6ee689c7.zip | |
Add GC controller animation
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/configuration/configure_input_player_widget.cpp | 466 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player_widget.h | 15 |
2 files changed, 429 insertions, 52 deletions
diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp index 1e3251547..e3e8bde48 100644 --- a/src/yuzu/configuration/configure_input_player_widget.cpp +++ b/src/yuzu/configuration/configure_input_player_widget.cpp | |||
| @@ -289,7 +289,8 @@ void PlayerControlPreview::DrawLeftController(QPainter& p, const QPointF center) | |||
| 289 | DrawLeftZTriggersTopView(p, center, button_values[ZL]); | 289 | DrawLeftZTriggersTopView(p, center, button_values[ZL]); |
| 290 | } | 290 | } |
| 291 | 291 | ||
| 292 | { // Draw joysticks | 292 | { |
| 293 | // Draw joysticks | ||
| 293 | using namespace Settings::NativeAnalog; | 294 | using namespace Settings::NativeAnalog; |
| 294 | DrawJoystick(p, center + QPointF(9, -69) + (axis_values[LStick].value * 8), 1.8f, | 295 | DrawJoystick(p, center + QPointF(9, -69) + (axis_values[LStick].value * 8), 1.8f, |
| 295 | button_values[Settings::NativeButton::LStick]); | 296 | button_values[Settings::NativeButton::LStick]); |
| @@ -403,7 +404,8 @@ void PlayerControlPreview::DrawRightController(QPainter& p, const QPointF center | |||
| 403 | DrawRightZTriggersTopView(p, center, button_values[ZR]); | 404 | DrawRightZTriggersTopView(p, center, button_values[ZR]); |
| 404 | } | 405 | } |
| 405 | 406 | ||
| 406 | { // Draw joysticks | 407 | { |
| 408 | // Draw joysticks | ||
| 407 | using namespace Settings::NativeAnalog; | 409 | using namespace Settings::NativeAnalog; |
| 408 | DrawJoystick(p, center + QPointF(-9, 11) + (axis_values[RStick].value * 8), 1.8f, | 410 | DrawJoystick(p, center + QPointF(-9, 11) + (axis_values[RStick].value * 8), 1.8f, |
| 409 | button_values[Settings::NativeButton::RStick]); | 411 | button_values[Settings::NativeButton::RStick]); |
| @@ -512,7 +514,8 @@ void PlayerControlPreview::DrawDualController(QPainter& p, const QPointF center) | |||
| 512 | DrawDualZTriggersTopView(p, center, button_values[ZL], button_values[ZR]); | 514 | DrawDualZTriggersTopView(p, center, button_values[ZL], button_values[ZR]); |
| 513 | } | 515 | } |
| 514 | 516 | ||
| 515 | { // Draw joysticks | 517 | { |
| 518 | // Draw joysticks | ||
| 516 | using namespace Settings::NativeAnalog; | 519 | using namespace Settings::NativeAnalog; |
| 517 | DrawJoystick(p, center + QPointF(-65, -65) + (axis_values[LStick].value * 7), 1.62f, | 520 | DrawJoystick(p, center + QPointF(-65, -65) + (axis_values[LStick].value * 7), 1.62f, |
| 518 | button_values[Settings::NativeButton::LStick]); | 521 | button_values[Settings::NativeButton::LStick]); |
| @@ -597,7 +600,8 @@ void PlayerControlPreview::DrawHandheldController(QPainter& p, const QPointF cen | |||
| 597 | DrawHandheldTriggers(p, center, button_values[Settings::NativeButton::L], | 600 | DrawHandheldTriggers(p, center, button_values[Settings::NativeButton::L], |
| 598 | button_values[Settings::NativeButton::R]); | 601 | button_values[Settings::NativeButton::R]); |
| 599 | DrawHandheldBody(p, center); | 602 | DrawHandheldBody(p, center); |
| 600 | { // Draw joysticks | 603 | { |
| 604 | // Draw joysticks | ||
| 601 | using namespace Settings::NativeAnalog; | 605 | using namespace Settings::NativeAnalog; |
| 602 | DrawJoystick(p, center + QPointF(-171, -41) + (axis_values[LStick].value * 4), 1.0f, | 606 | DrawJoystick(p, center + QPointF(-171, -41) + (axis_values[LStick].value * 4), 1.0f, |
| 603 | button_values[Settings::NativeButton::LStick]); | 607 | button_values[Settings::NativeButton::LStick]); |
| @@ -692,7 +696,8 @@ void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center) | |||
| 692 | DrawProTriggers(p, center, button_values[Settings::NativeButton::L], | 696 | DrawProTriggers(p, center, button_values[Settings::NativeButton::L], |
| 693 | button_values[Settings::NativeButton::R]); | 697 | button_values[Settings::NativeButton::R]); |
| 694 | DrawProBody(p, center); | 698 | DrawProBody(p, center); |
| 695 | { // Draw joysticks | 699 | { |
| 700 | // Draw joysticks | ||
| 696 | using namespace Settings::NativeAnalog; | 701 | using namespace Settings::NativeAnalog; |
| 697 | DrawProJoystick(p, center + QPointF(-111, -55) + (axis_values[LStick].value * 11), | 702 | DrawProJoystick(p, center + QPointF(-111, -55) + (axis_values[LStick].value * 11), |
| 698 | button_values[Settings::NativeButton::LStick]); | 703 | button_values[Settings::NativeButton::LStick]); |
| @@ -775,6 +780,63 @@ void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center) | |||
| 775 | DrawSymbol(p, center + QPoint(29, -56), Symbol::House, 3.9f); | 780 | DrawSymbol(p, center + QPoint(29, -56), Symbol::House, 3.9f); |
| 776 | } | 781 | } |
| 777 | 782 | ||
| 783 | void PlayerControlPreview::DrawGCController(QPainter& p, const QPointF center) { | ||
| 784 | DrawGCTriggers(p, center, button_values[Settings::NativeButton::ZL], | ||
| 785 | button_values[Settings::NativeButton::ZR]); | ||
| 786 | DrawGCButtonZ(p, center, button_values[Settings::NativeButton::R]); | ||
| 787 | DrawGCBody(p, center); | ||
| 788 | { | ||
| 789 | // Draw joysticks | ||
| 790 | using namespace Settings::NativeAnalog; | ||
| 791 | DrawGCJoystick(p, center + QPointF(-111, -44) + (axis_values[LStick].value * 10), false); | ||
| 792 | button_color = colors.button2; | ||
| 793 | DrawCircleButton(p, center + QPointF(61, 37) + (axis_values[RStick].value * 9.5f), false, | ||
| 794 | 15); | ||
| 795 | p.setPen(colors.transparent); | ||
| 796 | p.setBrush(colors.font); | ||
| 797 | DrawSymbol(p, center + QPointF(61, 37) + (axis_values[RStick].value * 9.5f), Symbol::C, | ||
| 798 | 1.0f); | ||
| 799 | DrawRawJoystick(p, center + QPointF(-198, -125), axis_values[LStick].raw_value, | ||
| 800 | axis_values[LStick].properties); | ||
| 801 | DrawRawJoystick(p, center + QPointF(198, -125), axis_values[RStick].raw_value, | ||
| 802 | axis_values[RStick].properties); | ||
| 803 | } | ||
| 804 | |||
| 805 | using namespace Settings::NativeButton; | ||
| 806 | |||
| 807 | // Face buttons constants | ||
| 808 | constexpr float text_size = 1.1f; | ||
| 809 | |||
| 810 | // Face buttons | ||
| 811 | p.setPen(colors.outline); | ||
| 812 | button_color = colors.button; | ||
| 813 | DrawCircleButton(p, center + QPoint(111, -44), button_values[A], 21); | ||
| 814 | DrawCircleButton(p, center + QPoint(70, -23), button_values[B], 13); | ||
| 815 | DrawGCButtonX(p, center, button_values[Settings::NativeButton::X]); | ||
| 816 | DrawGCButtonY(p, center, button_values[Settings::NativeButton::Y]); | ||
| 817 | |||
| 818 | // Face buttons text | ||
| 819 | p.setPen(colors.transparent); | ||
| 820 | p.setBrush(colors.font); | ||
| 821 | DrawSymbol(p, center + QPoint(111, -44), Symbol::A, 1.5f); | ||
| 822 | DrawSymbol(p, center + QPoint(70, -23), Symbol::B, text_size); | ||
| 823 | DrawSymbol(p, center + QPoint(151, -53), Symbol::X, text_size); | ||
| 824 | DrawSymbol(p, center + QPoint(100, -83), Symbol::Y, text_size); | ||
| 825 | |||
| 826 | // D-pad buttons | ||
| 827 | const QPointF dpad_postion = center + QPoint(-61, 37); | ||
| 828 | const float dpad_size = 0.8f; | ||
| 829 | DrawArrowButton(p, dpad_postion, Direction::Up, button_values[DUp], dpad_size); | ||
| 830 | DrawArrowButton(p, dpad_postion, Direction::Left, button_values[DLeft], dpad_size); | ||
| 831 | DrawArrowButton(p, dpad_postion, Direction::Right, button_values[DRight], dpad_size); | ||
| 832 | DrawArrowButton(p, dpad_postion, Direction::Down, button_values[DDown], dpad_size); | ||
| 833 | DrawArrowButtonOutline(p, dpad_postion, dpad_size); | ||
| 834 | |||
| 835 | // Minus and Plus buttons | ||
| 836 | p.setPen(colors.outline); | ||
| 837 | DrawCircleButton(p, center + QPoint(0, -44), button_values[Plus], 8); | ||
| 838 | } | ||
| 839 | |||
| 778 | constexpr std::array<float, 13 * 2> symbol_a = { | 840 | constexpr std::array<float, 13 * 2> symbol_a = { |
| 779 | -1.085f, -5.2f, 1.085f, -5.2f, 5.085f, 5.0f, 2.785f, 5.0f, 1.785f, | 841 | -1.085f, -5.2f, 1.085f, -5.2f, 5.085f, 5.0f, 2.785f, 5.0f, 1.785f, |
| 780 | 2.65f, -1.785f, 2.65f, -2.785f, 5.0f, -5.085f, 5.0f, -1.4f, 1.0f, | 842 | 2.65f, -1.785f, 2.65f, -2.785f, 5.0f, -5.085f, 5.0f, -1.4f, 1.0f, |
| @@ -819,6 +881,29 @@ constexpr std::array<float, 12 * 2> symbol_x = { | |||
| 819 | 881 | ||
| 820 | }; | 882 | }; |
| 821 | 883 | ||
| 884 | constexpr std::array<float, 7 * 2> symbol_l = { | ||
| 885 | 2.4f, -3.23f, 2.4f, 2.1f, 5.43f, 2.1f, 5.43f, 3.22f, 0.98f, 3.22f, 0.98f, -3.23f, 2.4f, -3.23f, | ||
| 886 | }; | ||
| 887 | |||
| 888 | constexpr std::array<float, 98 * 2> symbol_r = { | ||
| 889 | 1.0f, 0.0f, 1.0f, -0.1f, 1.1f, -3.3f, 4.3f, -3.2f, 5.1f, -3.1f, 5.4f, -3.0f, 5.6f, -2.9f, | ||
| 890 | 5.7f, -2.8f, 5.9f, -2.7f, 5.9f, -2.6f, 6.0f, -2.5f, 6.1f, -2.3f, 6.2f, -2.2f, 6.2f, -2.1f, | ||
| 891 | 6.3f, -2.0f, 6.3f, -1.9f, 6.2f, -0.8f, 6.2f, -0.7f, 6.1f, -0.6f, 6.1f, -0.5f, 6.0f, -0.4f, | ||
| 892 | 6.0f, -0.3f, 5.9f, -0.2f, 5.7f, -0.1f, 5.7f, 0.0f, 5.6f, 0.1f, 5.4f, 0.2f, 5.1f, 0.3f, | ||
| 893 | 4.7f, 0.4f, 4.7f, 0.5f, 4.9f, 0.6f, 5.0f, 0.7f, 5.2f, 0.8f, 5.2f, 0.9f, 5.3f, 1.0f, | ||
| 894 | 5.5f, 1.1f, 5.5f, 1.2f, 5.6f, 1.3f, 5.7f, 1.5f, 5.8f, 1.6f, 5.9f, 1.8f, 6.0f, 1.9f, | ||
| 895 | 6.1f, 2.1f, 6.2f, 2.2f, 6.2f, 2.3f, 6.3f, 2.4f, 6.4f, 2.6f, 6.5f, 2.7f, 6.6f, 2.9f, | ||
| 896 | 6.7f, 3.0f, 6.7f, 3.1f, 6.8f, 3.2f, 6.8f, 3.3f, 5.3f, 3.2f, 5.2f, 3.1f, 5.2f, 3.0f, | ||
| 897 | 5.1f, 2.9f, 5.0f, 2.7f, 4.9f, 2.6f, 4.8f, 2.4f, 4.7f, 2.3f, 4.6f, 2.1f, 4.5f, 2.0f, | ||
| 898 | 4.4f, 1.8f, 4.3f, 1.7f, 4.1f, 1.4f, 4.0f, 1.3f, 3.9f, 1.1f, 3.8f, 1.0f, 3.6f, 0.9f, | ||
| 899 | 3.6f, 0.8f, 3.5f, 0.7f, 3.3f, 0.6f, 2.9f, 0.5f, 2.3f, 0.6f, 2.3f, 0.7f, 2.2f, 3.3f, | ||
| 900 | 1.0f, 3.2f, 1.0f, 3.1f, 1.0f, 0.0f, | ||
| 901 | |||
| 902 | 4.2f, -0.5f, 4.4f, -0.6f, 4.7f, -0.7f, 4.8f, -0.8f, 4.9f, -1.0f, 5.0f, -1.1f, 5.0f, -1.2f, | ||
| 903 | 4.9f, -1.7f, 4.9f, -1.8f, 4.8f, -1.9f, 4.8f, -2.0f, 4.6f, -2.1f, 4.3f, -2.2f, 2.3f, -2.1f, | ||
| 904 | 2.3f, -2.0f, 2.4f, -0.5f, 4.2f, -0.5f, 1.0f, 0.0f, | ||
| 905 | }; | ||
| 906 | |||
| 822 | constexpr std::array<float, 18 * 2> symbol_zl = { | 907 | constexpr std::array<float, 18 * 2> symbol_zl = { |
| 823 | -2.6f, -2.13f, -5.6f, -2.13f, -5.6f, -3.23f, -0.8f, -3.23f, -0.8f, -2.13f, -4.4f, 2.12f, | 908 | -2.6f, -2.13f, -5.6f, -2.13f, -5.6f, -3.23f, -0.8f, -3.23f, -0.8f, -2.13f, -4.4f, 2.12f, |
| 824 | -0.7f, 2.12f, -0.7f, 3.22f, -6.0f, 3.22f, -6.0f, 2.12f, 2.4f, -3.23f, 2.4f, 2.1f, | 909 | -0.7f, 2.12f, -0.7f, 3.22f, -6.0f, 3.22f, -6.0f, 2.12f, 2.4f, -3.23f, 2.4f, 2.1f, |
| @@ -895,6 +980,14 @@ constexpr std::array<float, 148 * 2> symbol_sr = { | |||
| 895 | 980 | ||
| 896 | }; | 981 | }; |
| 897 | 982 | ||
| 983 | constexpr std::array<float, 30 * 2> symbol_c = { | ||
| 984 | 2.86f, 7.57f, 0.99f, 7.94f, -0.91f, 7.87f, -2.73f, 7.31f, -4.23f, 6.14f, -5.2f, 4.51f, | ||
| 985 | -5.65f, 2.66f, -5.68f, 0.75f, -5.31f, -1.12f, -4.43f, -2.81f, -3.01f, -4.08f, -1.24f, -4.78f, | ||
| 986 | 0.66f, -4.94f, 2.54f, -4.67f, 4.33f, -4.0f, 4.63f, -2.27f, 3.37f, -2.7f, 1.6f, -3.4f, | ||
| 987 | -0.3f, -3.5f, -2.09f, -2.87f, -3.34f, -1.45f, -3.91f, 0.37f, -3.95f, 2.27f, -3.49f, 4.12f, | ||
| 988 | -2.37f, 5.64f, -0.65f, 6.44f, 1.25f, 6.47f, 3.06f, 5.89f, 4.63f, 4.92f, 4.63f, 6.83f, | ||
| 989 | }; | ||
| 990 | |||
| 898 | constexpr std::array<float, 12 * 2> house = { | 991 | constexpr std::array<float, 12 * 2> house = { |
| 899 | -1.3f, 0.0f, -0.93f, 0.0f, -0.93f, 1.15f, 0.93f, 1.15f, 0.93f, 0.0f, 1.3f, 0.0f, | 992 | -1.3f, 0.0f, -0.93f, 0.0f, -0.93f, 1.15f, 0.93f, 1.15f, 0.93f, 0.0f, 1.3f, 0.0f, |
| 900 | 0.0f, -1.2f, -1.3f, 0.0f, -0.43f, 0.0f, -0.43f, .73f, 0.43f, .73f, 0.43f, 0.0f, | 993 | 0.0f, -1.2f, -1.3f, 0.0f, -0.43f, 0.0f, -0.43f, .73f, 0.43f, .73f, 0.43f, 0.0f, |
| @@ -1030,6 +1123,132 @@ constexpr std::array<float, 245 * 2> pro_body = { | |||
| 1030 | -75.5f, 56.9f, -74.8f, 56.9f, -71.9f, 56.8f, -71.2f, 56.8f, 0.0f, 56.8f, | 1123 | -75.5f, 56.9f, -74.8f, 56.9f, -71.9f, 56.8f, -71.2f, 56.8f, 0.0f, 56.8f, |
| 1031 | }; | 1124 | }; |
| 1032 | 1125 | ||
| 1126 | constexpr std::array<float, 199 * 2> gc_body = { | ||
| 1127 | 0.0f, -138.03f, -4.91f, -138.01f, -8.02f, -137.94f, -11.14f, -137.82f, -14.25f, | ||
| 1128 | -137.67f, -17.37f, -137.48f, -20.48f, -137.25f, -23.59f, -137.0f, -26.69f, -136.72f, | ||
| 1129 | -29.8f, -136.41f, -32.9f, -136.07f, -35.99f, -135.71f, -39.09f, -135.32f, -42.18f, | ||
| 1130 | -134.91f, -45.27f, -134.48f, -48.35f, -134.03f, -51.43f, -133.55f, -54.51f, -133.05f, | ||
| 1131 | -57.59f, -132.52f, -60.66f, -131.98f, -63.72f, -131.41f, -66.78f, -130.81f, -69.84f, | ||
| 1132 | -130.2f, -72.89f, -129.56f, -75.94f, -128.89f, -78.98f, -128.21f, -82.02f, -127.49f, | ||
| 1133 | -85.05f, -126.75f, -88.07f, -125.99f, -91.09f, -125.19f, -94.1f, -124.37f, -97.1f, | ||
| 1134 | -123.52f, -100.09f, -122.64f, -103.07f, -121.72f, -106.04f, -120.77f, -109.0f, -119.79f, | ||
| 1135 | -111.95f, -118.77f, -114.88f, -117.71f, -117.8f, -116.61f, -120.7f, -115.46f, -123.58f, | ||
| 1136 | -114.27f, -126.44f, -113.03f, -129.27f, -111.73f, -132.08f, -110.38f, -134.86f, -108.96f, | ||
| 1137 | -137.6f, -107.47f, -140.3f, -105.91f, -142.95f, -104.27f, -145.55f, -102.54f, -148.07f, | ||
| 1138 | -100.71f, -150.51f, -98.77f, -152.86f, -96.71f, -155.09f, -94.54f, -157.23f, -92.27f, | ||
| 1139 | -159.26f, -89.9f, -161.2f, -87.46f, -163.04f, -84.94f, -164.78f, -82.35f, -166.42f, | ||
| 1140 | -79.7f, -167.97f, -77.0f, -169.43f, -74.24f, -170.8f, -71.44f, -172.09f, -68.6f, | ||
| 1141 | -173.29f, -65.72f, -174.41f, -62.81f, -175.45f, -59.87f, -176.42f, -56.91f, -177.31f, | ||
| 1142 | -53.92f, -178.14f, -50.91f, -178.9f, -47.89f, -179.6f, -44.85f, -180.24f, -41.8f, | ||
| 1143 | -180.82f, -38.73f, -181.34f, -35.66f, -181.8f, -32.57f, -182.21f, -29.48f, -182.57f, | ||
| 1144 | -26.38f, -182.88f, -23.28f, -183.15f, -20.17f, -183.36f, -17.06f, -183.54f, -13.95f, | ||
| 1145 | -183.71f, -10.84f, -184.0f, -7.73f, -184.23f, -4.62f, -184.44f, -1.51f, -184.62f, | ||
| 1146 | 1.6f, -184.79f, 4.72f, -184.95f, 7.83f, -185.11f, 10.95f, -185.25f, 14.06f, | ||
| 1147 | -185.38f, 17.18f, -185.51f, 20.29f, -185.63f, 23.41f, -185.74f, 26.53f, -185.85f, | ||
| 1148 | 29.64f, -185.95f, 32.76f, -186.04f, 35.88f, -186.12f, 39.0f, -186.19f, 42.11f, | ||
| 1149 | -186.26f, 45.23f, -186.32f, 48.35f, -186.37f, 51.47f, -186.41f, 54.59f, -186.44f, | ||
| 1150 | 57.7f, -186.46f, 60.82f, -186.46f, 63.94f, -186.44f, 70.18f, -186.41f, 73.3f, | ||
| 1151 | -186.36f, 76.42f, -186.3f, 79.53f, -186.22f, 82.65f, -186.12f, 85.77f, -185.99f, | ||
| 1152 | 88.88f, -185.84f, 92.0f, -185.66f, 95.11f, -185.44f, 98.22f, -185.17f, 101.33f, | ||
| 1153 | -184.85f, 104.43f, -184.46f, 107.53f, -183.97f, 110.61f, -183.37f, 113.67f, -182.65f, | ||
| 1154 | 116.7f, -181.77f, 119.69f, -180.71f, 122.62f, -179.43f, 125.47f, -177.89f, 128.18f, | ||
| 1155 | -176.05f, 130.69f, -173.88f, 132.92f, -171.36f, 134.75f, -168.55f, 136.1f, -165.55f, | ||
| 1156 | 136.93f, -162.45f, 137.29f, -156.23f, 137.03f, -153.18f, 136.41f, -150.46f, 134.9f, | ||
| 1157 | -148.14f, 132.83f, -146.14f, 130.43f, -144.39f, 127.85f, -142.83f, 125.16f, -141.41f, | ||
| 1158 | 122.38f, -140.11f, 119.54f, -138.9f, 116.67f, -137.77f, 113.76f, -136.7f, 110.84f, | ||
| 1159 | -135.68f, 107.89f, -134.71f, 104.93f, -133.77f, 101.95f, -132.86f, 98.97f, -131.97f, | ||
| 1160 | 95.98f, -131.09f, 92.99f, -130.23f, 89.99f, -129.36f, 86.99f, -128.49f, 84.0f, | ||
| 1161 | -127.63f, 81.0f, -126.76f, 78.01f, -125.9f, 75.01f, -124.17f, 69.02f, -123.31f, | ||
| 1162 | 66.02f, -121.59f, 60.03f, -120.72f, 57.03f, -119.86f, 54.03f, -118.13f, 48.04f, | ||
| 1163 | -117.27f, 45.04f, -115.55f, 39.05f, -114.68f, 36.05f, -113.82f, 33.05f, -112.96f, | ||
| 1164 | 30.06f, -110.4f, 28.29f, -107.81f, 26.55f, -105.23f, 24.8f, -97.48f, 19.55f, | ||
| 1165 | -94.9f, 17.81f, -92.32f, 16.06f, -87.15f, 12.56f, -84.57f, 10.81f, -81.99f, | ||
| 1166 | 9.07f, -79.4f, 7.32f, -76.82f, 5.57f, -69.07f, 0.33f, -66.49f, -1.42f, | ||
| 1167 | -58.74f, -6.66f, -56.16f, -8.41f, -48.4f, -13.64f, -45.72f, -15.22f, -42.93f, | ||
| 1168 | -16.62f, -40.07f, -17.86f, -37.15f, -18.96f, -34.19f, -19.94f, -31.19f, -20.79f, | ||
| 1169 | -28.16f, -21.55f, -25.12f, -22.21f, -22.05f, -22.79f, -18.97f, -23.28f, -15.88f, | ||
| 1170 | -23.7f, -12.78f, -24.05f, -9.68f, -24.33f, -6.57f, -24.55f, -3.45f, -24.69f, | ||
| 1171 | 0.0f, -24.69f, | ||
| 1172 | }; | ||
| 1173 | |||
| 1174 | constexpr std::array<float, 99 * 2> gc_left_body = { | ||
| 1175 | -74.59f, -97.22f, -70.17f, -94.19f, -65.95f, -90.89f, -62.06f, -87.21f, -58.58f, | ||
| 1176 | -83.14f, -55.58f, -78.7f, -53.08f, -73.97f, -51.05f, -69.01f, -49.46f, -63.89f, | ||
| 1177 | -48.24f, -58.67f, -47.36f, -53.39f, -46.59f, -48.09f, -45.7f, -42.8f, -44.69f, | ||
| 1178 | -37.54f, -43.54f, -32.31f, -42.25f, -27.11f, -40.8f, -21.95f, -39.19f, -16.84f, | ||
| 1179 | -37.38f, -11.8f, -35.34f, -6.84f, -33.04f, -2.0f, -30.39f, 2.65f, -27.26f, | ||
| 1180 | 7.0f, -23.84f, 11.11f, -21.19f, 15.76f, -19.18f, 20.73f, -17.73f, 25.88f, | ||
| 1181 | -16.82f, 31.16f, -16.46f, 36.5f, -16.7f, 41.85f, -17.63f, 47.13f, -19.31f, | ||
| 1182 | 52.21f, -21.8f, 56.95f, -24.91f, 61.3f, -28.41f, 65.36f, -32.28f, 69.06f, | ||
| 1183 | -36.51f, 72.35f, -41.09f, 75.13f, -45.97f, 77.32f, -51.1f, 78.86f, -56.39f, | ||
| 1184 | 79.7f, -61.74f, 79.84f, -67.07f, 79.3f, -72.3f, 78.15f, -77.39f, 76.48f, | ||
| 1185 | -82.29f, 74.31f, -86.76f, 71.37f, -90.7f, 67.75f, -94.16f, 63.66f, -97.27f, | ||
| 1186 | 59.3f, -100.21f, 54.81f, -103.09f, 50.3f, -106.03f, 45.82f, -109.11f, 41.44f, | ||
| 1187 | -112.37f, 37.19f, -115.85f, 33.11f, -119.54f, 29.22f, -123.45f, 25.56f, -127.55f, | ||
| 1188 | 22.11f, -131.77f, 18.81f, -136.04f, 15.57f, -140.34f, 12.37f, -144.62f, 9.15f, | ||
| 1189 | -148.86f, 5.88f, -153.03f, 2.51f, -157.05f, -1.03f, -160.83f, -4.83f, -164.12f, | ||
| 1190 | -9.05f, -166.71f, -13.73f, -168.91f, -18.62f, -170.77f, -23.64f, -172.3f, -28.78f, | ||
| 1191 | -173.49f, -34.0f, -174.3f, -39.3f, -174.72f, -44.64f, -174.72f, -49.99f, -174.28f, | ||
| 1192 | -55.33f, -173.37f, -60.61f, -172.0f, -65.79f, -170.17f, -70.82f, -167.79f, -75.62f, | ||
| 1193 | -164.84f, -80.09f, -161.43f, -84.22f, -157.67f, -88.03f, -153.63f, -91.55f, -149.37f, | ||
| 1194 | -94.81f, -144.94f, -97.82f, -140.37f, -100.61f, -135.65f, -103.16f, -130.73f, -105.26f, | ||
| 1195 | -125.62f, -106.86f, -120.37f, -107.95f, -115.05f, -108.56f, -109.7f, -108.69f, -104.35f, | ||
| 1196 | -108.36f, -99.05f, -107.6f, -93.82f, -106.41f, -88.72f, -104.79f, -83.78f, -102.7f, | ||
| 1197 | }; | ||
| 1198 | |||
| 1199 | constexpr std::array<float, 47 * 2> left_gc_trigger = { | ||
| 1200 | -99.69f, -125.04f, -101.81f, -126.51f, -104.02f, -127.85f, -106.3f, -129.06f, -108.65f, | ||
| 1201 | -130.12f, -111.08f, -130.99f, -113.58f, -131.62f, -116.14f, -131.97f, -121.26f, -131.55f, | ||
| 1202 | -123.74f, -130.84f, -126.17f, -129.95f, -128.53f, -128.9f, -130.82f, -127.71f, -133.03f, | ||
| 1203 | -126.38f, -135.15f, -124.92f, -137.18f, -123.32f, -139.11f, -121.6f, -140.91f, -119.75f, | ||
| 1204 | -142.55f, -117.77f, -144.0f, -115.63f, -145.18f, -113.34f, -146.17f, -110.95f, -147.05f, | ||
| 1205 | -108.53f, -147.87f, -106.08f, -148.64f, -103.61f, -149.37f, -101.14f, -149.16f, -100.12f, | ||
| 1206 | -147.12f, -101.71f, -144.99f, -103.16f, -142.8f, -104.53f, -140.57f, -105.83f, -138.31f, | ||
| 1207 | -107.08f, -136.02f, -108.27f, -133.71f, -109.42f, -131.38f, -110.53f, -129.04f, -111.61f, | ||
| 1208 | -126.68f, -112.66f, -124.31f, -113.68f, -121.92f, -114.67f, -119.53f, -115.64f, -117.13f, | ||
| 1209 | -116.58f, -114.72f, -117.51f, -112.3f, -118.41f, -109.87f, -119.29f, -107.44f, -120.16f, | ||
| 1210 | -105.0f, -121.0f, -100.11f, -122.65f, | ||
| 1211 | }; | ||
| 1212 | |||
| 1213 | constexpr std::array<float, 50 * 2> gc_button_x = { | ||
| 1214 | 142.1f, -50.67f, 142.44f, -48.65f, 142.69f, -46.62f, 142.8f, -44.57f, 143.0f, -42.54f, | ||
| 1215 | 143.56f, -40.57f, 144.42f, -38.71f, 145.59f, -37.04f, 147.08f, -35.64f, 148.86f, -34.65f, | ||
| 1216 | 150.84f, -34.11f, 152.88f, -34.03f, 154.89f, -34.38f, 156.79f, -35.14f, 158.49f, -36.28f, | ||
| 1217 | 159.92f, -37.74f, 161.04f, -39.45f, 161.85f, -41.33f, 162.4f, -43.3f, 162.72f, -45.32f, | ||
| 1218 | 162.85f, -47.37f, 162.82f, -49.41f, 162.67f, -51.46f, 162.39f, -53.48f, 162.0f, -55.5f, | ||
| 1219 | 161.51f, -57.48f, 160.9f, -59.44f, 160.17f, -61.35f, 159.25f, -63.18f, 158.19f, -64.93f, | ||
| 1220 | 157.01f, -66.61f, 155.72f, -68.2f, 154.31f, -69.68f, 152.78f, -71.04f, 151.09f, -72.2f, | ||
| 1221 | 149.23f, -73.04f, 147.22f, -73.36f, 145.19f, -73.11f, 143.26f, -72.42f, 141.51f, -71.37f, | ||
| 1222 | 140.0f, -69.99f, 138.82f, -68.32f, 138.13f, -66.4f, 138.09f, -64.36f, 138.39f, -62.34f, | ||
| 1223 | 139.05f, -60.41f, 139.91f, -58.55f, 140.62f, -56.63f, 141.21f, -54.67f, 141.67f, -52.67f, | ||
| 1224 | }; | ||
| 1225 | |||
| 1226 | constexpr std::array<float, 50 * 2> gc_button_y = { | ||
| 1227 | 104.02f, -75.23f, 106.01f, -75.74f, 108.01f, -76.15f, 110.04f, -76.42f, 112.05f, -76.78f, | ||
| 1228 | 113.97f, -77.49f, 115.76f, -78.49f, 117.33f, -79.79f, 118.6f, -81.39f, 119.46f, -83.25f, | ||
| 1229 | 119.84f, -85.26f, 119.76f, -87.3f, 119.24f, -89.28f, 118.33f, -91.11f, 117.06f, -92.71f, | ||
| 1230 | 115.49f, -94.02f, 113.7f, -95.01f, 111.77f, -95.67f, 109.76f, -96.05f, 107.71f, -96.21f, | ||
| 1231 | 105.67f, -96.18f, 103.63f, -95.99f, 101.61f, -95.67f, 99.61f, -95.24f, 97.63f, -94.69f, | ||
| 1232 | 95.69f, -94.04f, 93.79f, -93.28f, 91.94f, -92.4f, 90.19f, -91.34f, 88.53f, -90.14f, | ||
| 1233 | 86.95f, -88.84f, 85.47f, -87.42f, 84.1f, -85.9f, 82.87f, -84.26f, 81.85f, -82.49f, | ||
| 1234 | 81.15f, -80.57f, 81.0f, -78.54f, 81.41f, -76.54f, 82.24f, -74.67f, 83.43f, -73.01f, | ||
| 1235 | 84.92f, -71.61f, 86.68f, -70.57f, 88.65f, -70.03f, 90.69f, -70.15f, 92.68f, -70.61f, | ||
| 1236 | 94.56f, -71.42f, 96.34f, -72.43f, 98.2f, -73.29f, 100.11f, -74.03f, 102.06f, -74.65f, | ||
| 1237 | }; | ||
| 1238 | |||
| 1239 | constexpr std::array<float, 47 * 2> gc_button_z = { | ||
| 1240 | 95.74f, -126.41f, 98.34f, -126.38f, 100.94f, -126.24f, 103.53f, -126.01f, 106.11f, -125.7f, | ||
| 1241 | 108.69f, -125.32f, 111.25f, -124.87f, 113.8f, -124.34f, 116.33f, -123.73f, 118.84f, -123.05f, | ||
| 1242 | 121.33f, -122.3f, 123.79f, -121.47f, 126.23f, -120.56f, 128.64f, -119.58f, 131.02f, -118.51f, | ||
| 1243 | 133.35f, -117.37f, 135.65f, -116.14f, 137.9f, -114.84f, 140.1f, -113.46f, 142.25f, -111.99f, | ||
| 1244 | 144.35f, -110.45f, 146.38f, -108.82f, 148.35f, -107.13f, 150.25f, -105.35f, 151.89f, -103.38f, | ||
| 1245 | 151.43f, -100.86f, 149.15f, -100.15f, 146.73f, -101.06f, 144.36f, -102.12f, 141.98f, -103.18f, | ||
| 1246 | 139.6f, -104.23f, 137.22f, -105.29f, 134.85f, -106.35f, 132.47f, -107.41f, 127.72f, -109.53f, | ||
| 1247 | 125.34f, -110.58f, 122.96f, -111.64f, 120.59f, -112.7f, 118.21f, -113.76f, 113.46f, -115.88f, | ||
| 1248 | 111.08f, -116.93f, 108.7f, -117.99f, 106.33f, -119.05f, 103.95f, -120.11f, 99.2f, -122.23f, | ||
| 1249 | 96.82f, -123.29f, 94.44f, -124.34f, | ||
| 1250 | }; | ||
| 1251 | |||
| 1033 | constexpr std::array<float, 84 * 2> left_joycon_body = { | 1252 | constexpr std::array<float, 84 * 2> left_joycon_body = { |
| 1034 | -145.0f, -78.9f, -145.0f, -77.9f, -145.0f, 85.6f, -145.0f, 85.6f, -168.3f, 85.5f, | 1253 | -145.0f, -78.9f, -145.0f, -77.9f, -145.0f, 85.6f, -145.0f, 85.6f, -168.3f, 85.5f, |
| 1035 | -169.3f, 85.4f, -171.3f, 85.1f, -172.3f, 84.9f, -173.4f, 84.7f, -174.3f, 84.5f, | 1254 | -169.3f, 85.4f, -171.3f, 85.1f, -172.3f, 84.9f, -173.4f, 84.7f, -174.3f, 84.5f, |
| @@ -1268,6 +1487,57 @@ void PlayerControlPreview::DrawProBody(QPainter& p, const QPointF center) { | |||
| 1268 | p.drawEllipse(center + QPoint(51, 0), radius1, radius1); | 1487 | p.drawEllipse(center + QPoint(51, 0), radius1, radius1); |
| 1269 | } | 1488 | } |
| 1270 | 1489 | ||
| 1490 | void PlayerControlPreview::DrawGCBody(QPainter& p, const QPointF center) { | ||
| 1491 | std::array<QPointF, gc_left_body.size() / 2> qleft_handle; | ||
| 1492 | std::array<QPointF, gc_left_body.size() / 2> qright_handle; | ||
| 1493 | std::array<QPointF, gc_body.size()> qbody; | ||
| 1494 | std::array<QPointF, 8> left_hex; | ||
| 1495 | std::array<QPointF, 8> right_hex; | ||
| 1496 | constexpr float angle = 2 * 3.1415f / 8; | ||
| 1497 | |||
| 1498 | for (std::size_t point = 0; point < gc_left_body.size() / 2; ++point) { | ||
| 1499 | qleft_handle[point] = | ||
| 1500 | center + QPointF(gc_left_body[point * 2], gc_left_body[point * 2 + 1]); | ||
| 1501 | qright_handle[point] = | ||
| 1502 | center + QPointF(-gc_left_body[point * 2], gc_left_body[point * 2 + 1]); | ||
| 1503 | } | ||
| 1504 | for (std::size_t point = 0; point < gc_body.size() / 2; ++point) { | ||
| 1505 | qbody[point] = center + QPointF(gc_body[point * 2], gc_body[point * 2 + 1]); | ||
| 1506 | qbody[gc_body.size() - 1 - point] = | ||
| 1507 | center + QPointF(-gc_body[point * 2], gc_body[point * 2 + 1]); | ||
| 1508 | } | ||
| 1509 | for (std::size_t point = 0; point < 8; ++point) { | ||
| 1510 | left_hex[point] = | ||
| 1511 | center + QPointF(34 * std::cos(point * angle) - 111, 34 * std::sin(point * angle) - 44); | ||
| 1512 | right_hex[point] = | ||
| 1513 | center + QPointF(26 * std::cos(point * angle) + 61, 26 * std::sin(point * angle) + 37); | ||
| 1514 | } | ||
| 1515 | |||
| 1516 | // Draw body | ||
| 1517 | p.setPen(colors.outline); | ||
| 1518 | p.setBrush(colors.primary); | ||
| 1519 | DrawPolygon(p, qbody); | ||
| 1520 | |||
| 1521 | // Draw left handle body | ||
| 1522 | p.setBrush(colors.left); | ||
| 1523 | DrawPolygon(p, qleft_handle); | ||
| 1524 | |||
| 1525 | // Draw right handle body | ||
| 1526 | p.setBrush(colors.right); | ||
| 1527 | DrawPolygon(p, qright_handle); | ||
| 1528 | |||
| 1529 | DrawText(p, center + QPoint(0, -58), 4.7f, tr("START/PAUSE")); | ||
| 1530 | |||
| 1531 | // Draw right joystick body | ||
| 1532 | p.setBrush(colors.button); | ||
| 1533 | DrawCircle(p, center + QPointF(61, 37), 23.5f); | ||
| 1534 | |||
| 1535 | // Draw joystick details | ||
| 1536 | p.setBrush(colors.transparent); | ||
| 1537 | DrawPolygon(p, left_hex); | ||
| 1538 | DrawPolygon(p, right_hex); | ||
| 1539 | } | ||
| 1540 | |||
| 1271 | void PlayerControlPreview::DrawHandheldBody(QPainter& p, const QPointF center) { | 1541 | void PlayerControlPreview::DrawHandheldBody(QPainter& p, const QPointF center) { |
| 1272 | const std::size_t body_outline_end = handheld_body.size() / 2 - 6; | 1542 | const std::size_t body_outline_end = handheld_body.size() / 2 - 6; |
| 1273 | const std::size_t bezel_outline_end = handheld_bezel.size() / 2 - 6; | 1543 | const std::size_t bezel_outline_end = handheld_bezel.size() / 2 - 6; |
| @@ -1663,6 +1933,40 @@ void PlayerControlPreview::DrawProTriggers(QPainter& p, const QPointF center, bo | |||
| 1663 | DrawPolygon(p, qright_trigger); | 1933 | DrawPolygon(p, qright_trigger); |
| 1664 | } | 1934 | } |
| 1665 | 1935 | ||
| 1936 | void PlayerControlPreview::DrawGCTriggers(QPainter& p, const QPointF center, bool left_pressed, | ||
| 1937 | bool right_pressed) { | ||
| 1938 | std::array<QPointF, left_gc_trigger.size() / 2> qleft_trigger; | ||
| 1939 | std::array<QPointF, left_gc_trigger.size() / 2> qright_trigger; | ||
| 1940 | |||
| 1941 | for (std::size_t point = 0; point < left_gc_trigger.size() / 2; ++point) { | ||
| 1942 | qleft_trigger[point] = | ||
| 1943 | center + QPointF(left_gc_trigger[point * 2], | ||
| 1944 | left_gc_trigger[point * 2 + 1] + (left_pressed ? 10 : 0)); | ||
| 1945 | qright_trigger[point] = | ||
| 1946 | center + QPointF(-left_gc_trigger[point * 2], | ||
| 1947 | left_gc_trigger[point * 2 + 1] + (right_pressed ? 10 : 0)); | ||
| 1948 | } | ||
| 1949 | |||
| 1950 | // Left trigger | ||
| 1951 | p.setPen(colors.outline); | ||
| 1952 | p.setBrush(left_pressed ? colors.highlight : colors.button); | ||
| 1953 | DrawPolygon(p, qleft_trigger); | ||
| 1954 | |||
| 1955 | // Right trigger | ||
| 1956 | p.setBrush(right_pressed ? colors.highlight : colors.button); | ||
| 1957 | DrawPolygon(p, qright_trigger); | ||
| 1958 | |||
| 1959 | // Draw L text | ||
| 1960 | p.setPen(colors.transparent); | ||
| 1961 | p.setBrush(colors.font); | ||
| 1962 | DrawSymbol(p, center + QPointF(-132, -119 + (left_pressed ? 10 : 0)), Symbol::L, 1.7f); | ||
| 1963 | |||
| 1964 | // Draw R text | ||
| 1965 | p.setPen(colors.transparent); | ||
| 1966 | p.setBrush(colors.font); | ||
| 1967 | DrawSymbol(p, center + QPointF(121.5f, -119 + (right_pressed ? 10 : 0)), Symbol::R, 1.7f); | ||
| 1968 | } | ||
| 1969 | |||
| 1666 | void PlayerControlPreview::DrawHandheldTriggers(QPainter& p, const QPointF center, | 1970 | void PlayerControlPreview::DrawHandheldTriggers(QPainter& p, const QPointF center, |
| 1667 | bool left_pressed, bool right_pressed) { | 1971 | bool left_pressed, bool right_pressed) { |
| 1668 | std::array<QPointF, left_joycon_trigger.size() / 2> qleft_trigger; | 1972 | std::array<QPointF, left_joycon_trigger.size() / 2> qleft_trigger; |
| @@ -1734,23 +2038,15 @@ void PlayerControlPreview::DrawDualTriggersTopView(QPainter& p, const QPointF ce | |||
| 1734 | p.setBrush(right_pressed ? colors.highlight : colors.button); | 2038 | p.setBrush(right_pressed ? colors.highlight : colors.button); |
| 1735 | DrawPolygon(p, qright_trigger); | 2039 | DrawPolygon(p, qright_trigger); |
| 1736 | 2040 | ||
| 1737 | // Draw ZL text | 2041 | // Draw L text |
| 1738 | p.setPen(colors.transparent); | 2042 | p.setPen(colors.transparent); |
| 1739 | p.setBrush(colors.font2); | 2043 | p.setBrush(colors.font2); |
| 1740 | DrawSymbol(p, center + QPointF(-183, -84), Symbol::ZL, 1.0f); | 2044 | DrawSymbol(p, center + QPointF(-183, -84), Symbol::L, 1.0f); |
| 1741 | 2045 | ||
| 1742 | // Delete Z character | 2046 | // Draw R text |
| 1743 | p.setBrush(left_pressed ? colors.highlight : colors.button); | ||
| 1744 | DrawRectangle(p, center + QPointF(-186, -84), 6, 10); | ||
| 1745 | |||
| 1746 | // Draw ZR text | ||
| 1747 | p.setPen(colors.transparent); | 2047 | p.setPen(colors.transparent); |
| 1748 | p.setBrush(colors.font2); | 2048 | p.setBrush(colors.font2); |
| 1749 | DrawSymbol(p, center + QPointF(177, -84), Symbol::ZR, 1.0f); | 2049 | DrawSymbol(p, center + QPointF(177, -84), Symbol::R, 1.0f); |
| 1750 | |||
| 1751 | // Delete Z character | ||
| 1752 | p.setBrush(right_pressed ? colors.highlight : colors.button); | ||
| 1753 | DrawRectangle(p, center + QPointF(174, -84), 6, 10); | ||
| 1754 | } | 2050 | } |
| 1755 | 2051 | ||
| 1756 | void PlayerControlPreview::DrawDualZTriggersTopView(QPainter& p, const QPointF center, | 2052 | void PlayerControlPreview::DrawDualZTriggersTopView(QPainter& p, const QPointF center, |
| @@ -1834,14 +2130,10 @@ void PlayerControlPreview::DrawLeftTriggersTopView(QPainter& p, const QPointF ce | |||
| 1834 | p.setBrush(left_pressed ? colors.highlight : colors.button); | 2130 | p.setBrush(left_pressed ? colors.highlight : colors.button); |
| 1835 | DrawPolygon(p, qleft_trigger); | 2131 | DrawPolygon(p, qleft_trigger); |
| 1836 | 2132 | ||
| 1837 | // Draw ZL text | 2133 | // Draw L text |
| 1838 | p.setPen(colors.transparent); | 2134 | p.setPen(colors.transparent); |
| 1839 | p.setBrush(colors.font2); | 2135 | p.setBrush(colors.font2); |
| 1840 | DrawSymbol(p, center + QPointF(-143, -36), Symbol::ZL, 1.0f); | 2136 | DrawSymbol(p, center + QPointF(-143, -36), Symbol::L, 1.0f); |
| 1841 | |||
| 1842 | // Delete Z character | ||
| 1843 | p.setBrush(left_pressed ? colors.highlight : colors.button); | ||
| 1844 | DrawRectangle(p, center + QPointF(-146, -36), 6, 10); | ||
| 1845 | } | 2137 | } |
| 1846 | 2138 | ||
| 1847 | void PlayerControlPreview::DrawLeftZTriggersTopView(QPainter& p, const QPointF center, | 2139 | void PlayerControlPreview::DrawLeftZTriggersTopView(QPainter& p, const QPointF center, |
| @@ -1913,14 +2205,10 @@ void PlayerControlPreview::DrawRightTriggersTopView(QPainter& p, const QPointF c | |||
| 1913 | p.setBrush(right_pressed ? colors.highlight : colors.button); | 2205 | p.setBrush(right_pressed ? colors.highlight : colors.button); |
| 1914 | DrawPolygon(p, qright_trigger); | 2206 | DrawPolygon(p, qright_trigger); |
| 1915 | 2207 | ||
| 1916 | // Draw ZR text | 2208 | // Draw R text |
| 1917 | p.setPen(colors.transparent); | 2209 | p.setPen(colors.transparent); |
| 1918 | p.setBrush(colors.font2); | 2210 | p.setBrush(colors.font2); |
| 1919 | DrawSymbol(p, center + QPointF(137, -36), Symbol::ZR, 1.0f); | 2211 | DrawSymbol(p, center + QPointF(137, -36), Symbol::R, 1.0f); |
| 1920 | |||
| 1921 | // Delete Z character | ||
| 1922 | p.setBrush(right_pressed ? colors.highlight : colors.button); | ||
| 1923 | DrawRectangle(p, center + QPointF(134, -36), 6, 10); | ||
| 1924 | } | 2212 | } |
| 1925 | 2213 | ||
| 1926 | void PlayerControlPreview::DrawRightZTriggersTopView(QPainter& p, const QPointF center, | 2214 | void PlayerControlPreview::DrawRightZTriggersTopView(QPainter& p, const QPointF center, |
| @@ -1996,6 +2284,20 @@ void PlayerControlPreview::DrawProJoystick(QPainter& p, const QPointF center, bo | |||
| 1996 | DrawCircle(p, center, 17.0f); | 2284 | DrawCircle(p, center, 17.0f); |
| 1997 | } | 2285 | } |
| 1998 | 2286 | ||
| 2287 | void PlayerControlPreview::DrawGCJoystick(QPainter& p, const QPointF center, bool pressed) { | ||
| 2288 | // Outer circle | ||
| 2289 | p.setPen(colors.outline); | ||
| 2290 | p.setBrush(pressed ? colors.highlight : colors.button); | ||
| 2291 | DrawCircle(p, center, 26.0f); | ||
| 2292 | |||
| 2293 | // Inner circle | ||
| 2294 | p.setBrush(pressed ? colors.highlight2 : colors.button2); | ||
| 2295 | DrawCircle(p, center, 19.0f); | ||
| 2296 | p.setBrush(colors.transparent); | ||
| 2297 | DrawCircle(p, center, 13.5f); | ||
| 2298 | DrawCircle(p, center, 7.5f); | ||
| 2299 | } | ||
| 2300 | |||
| 1999 | void PlayerControlPreview::DrawRawJoystick(QPainter& p, const QPointF center, const QPointF value, | 2301 | void PlayerControlPreview::DrawRawJoystick(QPainter& p, const QPointF center, const QPointF value, |
| 2000 | const Input::AnalogProperties properties) { | 2302 | const Input::AnalogProperties properties) { |
| 2001 | constexpr float size = 45.0f; | 2303 | constexpr float size = 45.0f; |
| @@ -2069,6 +2371,43 @@ void PlayerControlPreview::DrawPlusButton(QPainter& p, const QPointF center, boo | |||
| 2069 | DrawRectangle(p, center, button_size / 3.0f, button_size); | 2371 | DrawRectangle(p, center, button_size / 3.0f, button_size); |
| 2070 | } | 2372 | } |
| 2071 | 2373 | ||
| 2374 | void PlayerControlPreview::DrawGCButtonX(QPainter& p, const QPointF center, bool pressed) { | ||
| 2375 | std::array<QPointF, gc_button_x.size() / 2> button_x; | ||
| 2376 | |||
| 2377 | for (std::size_t point = 0; point < gc_button_x.size() / 2; ++point) { | ||
| 2378 | button_x[point] = center + QPointF(gc_button_x[point * 2], gc_button_x[point * 2 + 1]); | ||
| 2379 | } | ||
| 2380 | |||
| 2381 | p.setPen(colors.outline); | ||
| 2382 | p.setBrush(pressed ? colors.highlight : colors.button); | ||
| 2383 | DrawPolygon(p, button_x); | ||
| 2384 | } | ||
| 2385 | |||
| 2386 | void PlayerControlPreview::DrawGCButtonY(QPainter& p, const QPointF center, bool pressed) { | ||
| 2387 | std::array<QPointF, gc_button_y.size() / 2> button_x; | ||
| 2388 | |||
| 2389 | for (std::size_t point = 0; point < gc_button_y.size() / 2; ++point) { | ||
| 2390 | button_x[point] = center + QPointF(gc_button_y[point * 2], gc_button_y[point * 2 + 1]); | ||
| 2391 | } | ||
| 2392 | |||
| 2393 | p.setPen(colors.outline); | ||
| 2394 | p.setBrush(pressed ? colors.highlight : colors.button); | ||
| 2395 | DrawPolygon(p, button_x); | ||
| 2396 | } | ||
| 2397 | |||
| 2398 | void PlayerControlPreview::DrawGCButtonZ(QPainter& p, const QPointF center, bool pressed) { | ||
| 2399 | std::array<QPointF, gc_button_z.size() / 2> button_x; | ||
| 2400 | |||
| 2401 | for (std::size_t point = 0; point < gc_button_z.size() / 2; ++point) { | ||
| 2402 | button_x[point] = center + QPointF(gc_button_z[point * 2], | ||
| 2403 | gc_button_z[point * 2 + 1] + (pressed ? 1 : 0)); | ||
| 2404 | } | ||
| 2405 | |||
| 2406 | p.setPen(colors.outline); | ||
| 2407 | p.setBrush(pressed ? colors.highlight : colors.button2); | ||
| 2408 | DrawPolygon(p, button_x); | ||
| 2409 | } | ||
| 2410 | |||
| 2072 | void PlayerControlPreview::DrawCircleButton(QPainter& p, const QPointF center, bool pressed, | 2411 | void PlayerControlPreview::DrawCircleButton(QPainter& p, const QPointF center, bool pressed, |
| 2073 | float button_size) { | 2412 | float button_size) { |
| 2074 | p.setBrush(button_color); | 2413 | p.setBrush(button_color); |
| @@ -2078,19 +2417,22 @@ void PlayerControlPreview::DrawCircleButton(QPainter& p, const QPointF center, b | |||
| 2078 | p.drawEllipse(center, button_size, button_size); | 2417 | p.drawEllipse(center, button_size, button_size); |
| 2079 | } | 2418 | } |
| 2080 | 2419 | ||
| 2081 | void PlayerControlPreview::DrawArrowButtonOutline(QPainter& p, const QPointF center) { | 2420 | void PlayerControlPreview::DrawArrowButtonOutline(QPainter& p, const QPointF center, float size) { |
| 2082 | const std::size_t arrow_points = up_arrow_button.size() / 2; | 2421 | const std::size_t arrow_points = up_arrow_button.size() / 2; |
| 2083 | std::array<QPointF, (arrow_points - 1) * 4> arrow_button_outline; | 2422 | std::array<QPointF, (arrow_points - 1) * 4> arrow_button_outline; |
| 2084 | 2423 | ||
| 2085 | for (std::size_t point = 0; point < arrow_points - 1; ++point) { | 2424 | for (std::size_t point = 0; point < arrow_points - 1; ++point) { |
| 2086 | arrow_button_outline[point] = | 2425 | arrow_button_outline[point] = center + QPointF(up_arrow_button[point * 2] * size, |
| 2087 | center + QPointF(up_arrow_button[point * 2], up_arrow_button[point * 2 + 1]); | 2426 | up_arrow_button[point * 2 + 1] * size); |
| 2088 | arrow_button_outline[(arrow_points - 1) * 2 - point - 1] = | 2427 | arrow_button_outline[(arrow_points - 1) * 2 - point - 1] = |
| 2089 | center + QPointF(up_arrow_button[point * 2 + 1], up_arrow_button[point * 2]); | 2428 | center + |
| 2429 | QPointF(up_arrow_button[point * 2 + 1] * size, up_arrow_button[point * 2] * size); | ||
| 2090 | arrow_button_outline[(arrow_points - 1) * 2 + point] = | 2430 | arrow_button_outline[(arrow_points - 1) * 2 + point] = |
| 2091 | center + QPointF(-up_arrow_button[point * 2], -up_arrow_button[point * 2 + 1]); | 2431 | center + |
| 2432 | QPointF(-up_arrow_button[point * 2] * size, -up_arrow_button[point * 2 + 1] * size); | ||
| 2092 | arrow_button_outline[(arrow_points - 1) * 4 - point - 1] = | 2433 | arrow_button_outline[(arrow_points - 1) * 4 - point - 1] = |
| 2093 | center + QPointF(-up_arrow_button[point * 2 + 1], -up_arrow_button[point * 2]); | 2434 | center + |
| 2435 | QPointF(-up_arrow_button[point * 2 + 1] * size, -up_arrow_button[point * 2] * size); | ||
| 2094 | } | 2436 | } |
| 2095 | // Draw arrow button outline | 2437 | // Draw arrow button outline |
| 2096 | p.setPen(colors.outline); | 2438 | p.setPen(colors.outline); |
| @@ -2099,27 +2441,27 @@ void PlayerControlPreview::DrawArrowButtonOutline(QPainter& p, const QPointF cen | |||
| 2099 | } | 2441 | } |
| 2100 | 2442 | ||
| 2101 | void PlayerControlPreview::DrawArrowButton(QPainter& p, const QPointF center, | 2443 | void PlayerControlPreview::DrawArrowButton(QPainter& p, const QPointF center, |
| 2102 | const Direction direction, bool pressed) { | 2444 | const Direction direction, bool pressed, float size) { |
| 2103 | std::array<QPointF, up_arrow_button.size() / 2> arrow_button; | 2445 | std::array<QPointF, up_arrow_button.size() / 2> arrow_button; |
| 2104 | QPoint offset; | 2446 | QPoint offset; |
| 2105 | 2447 | ||
| 2106 | for (std::size_t point = 0; point < up_arrow_button.size() / 2; ++point) { | 2448 | for (std::size_t point = 0; point < up_arrow_button.size() / 2; ++point) { |
| 2107 | switch (direction) { | 2449 | switch (direction) { |
| 2108 | case Direction::Up: | 2450 | case Direction::Up: |
| 2109 | arrow_button[point] = | 2451 | arrow_button[point] = center + QPointF(up_arrow_button[point * 2] * size, |
| 2110 | center + QPointF(up_arrow_button[point * 2], up_arrow_button[point * 2 + 1]); | 2452 | up_arrow_button[point * 2 + 1] * size); |
| 2111 | break; | 2453 | break; |
| 2112 | case Direction::Left: | 2454 | case Direction::Left: |
| 2113 | arrow_button[point] = | 2455 | arrow_button[point] = center + QPointF(up_arrow_button[point * 2 + 1] * size, |
| 2114 | center + QPointF(up_arrow_button[point * 2 + 1], up_arrow_button[point * 2]); | 2456 | up_arrow_button[point * 2] * size); |
| 2115 | break; | 2457 | break; |
| 2116 | case Direction::Right: | 2458 | case Direction::Right: |
| 2117 | arrow_button[point] = | 2459 | arrow_button[point] = center + QPointF(-up_arrow_button[point * 2 + 1] * size, |
| 2118 | center + QPointF(-up_arrow_button[point * 2 + 1], up_arrow_button[point * 2]); | 2460 | up_arrow_button[point * 2] * size); |
| 2119 | break; | 2461 | break; |
| 2120 | case Direction::Down: | 2462 | case Direction::Down: |
| 2121 | arrow_button[point] = | 2463 | arrow_button[point] = center + QPointF(up_arrow_button[point * 2] * size, |
| 2122 | center + QPointF(up_arrow_button[point * 2], -up_arrow_button[point * 2 + 1]); | 2464 | -up_arrow_button[point * 2 + 1] * size); |
| 2123 | break; | 2465 | break; |
| 2124 | case Direction::None: | 2466 | case Direction::None: |
| 2125 | break; | 2467 | break; |
| @@ -2133,16 +2475,16 @@ void PlayerControlPreview::DrawArrowButton(QPainter& p, const QPointF center, | |||
| 2133 | 2475 | ||
| 2134 | switch (direction) { | 2476 | switch (direction) { |
| 2135 | case Direction::Up: | 2477 | case Direction::Up: |
| 2136 | offset = QPoint(0, -20); | 2478 | offset = QPoint(0, -20 * size); |
| 2137 | break; | 2479 | break; |
| 2138 | case Direction::Left: | 2480 | case Direction::Left: |
| 2139 | offset = QPoint(-20, 0); | 2481 | offset = QPoint(-20 * size, 0); |
| 2140 | break; | 2482 | break; |
| 2141 | case Direction::Right: | 2483 | case Direction::Right: |
| 2142 | offset = QPoint(20, 0); | 2484 | offset = QPoint(20 * size, 0); |
| 2143 | break; | 2485 | break; |
| 2144 | case Direction::Down: | 2486 | case Direction::Down: |
| 2145 | offset = QPoint(0, 20); | 2487 | offset = QPoint(0, 20 * size); |
| 2146 | break; | 2488 | break; |
| 2147 | case Direction::None: | 2489 | case Direction::None: |
| 2148 | offset = QPoint(0, 0); | 2490 | offset = QPoint(0, 0); |
| @@ -2152,7 +2494,7 @@ void PlayerControlPreview::DrawArrowButton(QPainter& p, const QPointF center, | |||
| 2152 | // Draw arrow icon | 2494 | // Draw arrow icon |
| 2153 | p.setPen(colors.font2); | 2495 | p.setPen(colors.font2); |
| 2154 | p.setBrush(colors.font2); | 2496 | p.setBrush(colors.font2); |
| 2155 | DrawArrow(p, center + offset, direction, 1.0f); | 2497 | DrawArrow(p, center + offset, direction, size); |
| 2156 | } | 2498 | } |
| 2157 | 2499 | ||
| 2158 | void PlayerControlPreview::DrawTriggerButton(QPainter& p, const QPointF center, | 2500 | void PlayerControlPreview::DrawTriggerButton(QPainter& p, const QPointF center, |
| @@ -2190,6 +2532,9 @@ void PlayerControlPreview::DrawSymbol(QPainter& p, const QPointF center, Symbol | |||
| 2190 | std::array<QPointF, symbol_b.size() / 2> b_icon; | 2532 | std::array<QPointF, symbol_b.size() / 2> b_icon; |
| 2191 | std::array<QPointF, symbol_x.size() / 2> x_icon; | 2533 | std::array<QPointF, symbol_x.size() / 2> x_icon; |
| 2192 | std::array<QPointF, symbol_y.size() / 2> y_icon; | 2534 | std::array<QPointF, symbol_y.size() / 2> y_icon; |
| 2535 | std::array<QPointF, symbol_l.size() / 2> l_icon; | ||
| 2536 | std::array<QPointF, symbol_r.size() / 2> r_icon; | ||
| 2537 | std::array<QPointF, symbol_c.size() / 2> c_icon; | ||
| 2193 | std::array<QPointF, symbol_zl.size() / 2> zl_icon; | 2538 | std::array<QPointF, symbol_zl.size() / 2> zl_icon; |
| 2194 | std::array<QPointF, symbol_sl.size() / 2> sl_icon; | 2539 | std::array<QPointF, symbol_sl.size() / 2> sl_icon; |
| 2195 | std::array<QPointF, symbol_zr.size() / 2> zr_icon; | 2540 | std::array<QPointF, symbol_zr.size() / 2> zr_icon; |
| @@ -2230,6 +2575,27 @@ void PlayerControlPreview::DrawSymbol(QPainter& p, const QPointF center, Symbol | |||
| 2230 | } | 2575 | } |
| 2231 | p.drawPolygon(y_icon.data(), static_cast<int>(y_icon.size())); | 2576 | p.drawPolygon(y_icon.data(), static_cast<int>(y_icon.size())); |
| 2232 | break; | 2577 | break; |
| 2578 | case Symbol::L: | ||
| 2579 | for (std::size_t point = 0; point < symbol_l.size() / 2; ++point) { | ||
| 2580 | l_icon[point] = center + QPointF(symbol_l[point * 2] * icon_size, | ||
| 2581 | (symbol_l[point * 2 + 1] - 1.0f) * icon_size); | ||
| 2582 | } | ||
| 2583 | p.drawPolygon(l_icon.data(), static_cast<int>(l_icon.size())); | ||
| 2584 | break; | ||
| 2585 | case Symbol::R: | ||
| 2586 | for (std::size_t point = 0; point < symbol_r.size() / 2; ++point) { | ||
| 2587 | r_icon[point] = center + QPointF(symbol_r[point * 2] * icon_size, | ||
| 2588 | (symbol_r[point * 2 + 1] - 1.0f) * icon_size); | ||
| 2589 | } | ||
| 2590 | p.drawPolygon(r_icon.data(), static_cast<int>(r_icon.size())); | ||
| 2591 | break; | ||
| 2592 | case Symbol::C: | ||
| 2593 | for (std::size_t point = 0; point < symbol_c.size() / 2; ++point) { | ||
| 2594 | c_icon[point] = center + QPointF(symbol_c[point * 2] * icon_size, | ||
| 2595 | (symbol_c[point * 2 + 1] - 1.0f) * icon_size); | ||
| 2596 | } | ||
| 2597 | p.drawPolygon(c_icon.data(), static_cast<int>(c_icon.size())); | ||
| 2598 | break; | ||
| 2233 | case Symbol::ZL: | 2599 | case Symbol::ZL: |
| 2234 | for (std::size_t point = 0; point < symbol_zl.size() / 2; ++point) { | 2600 | for (std::size_t point = 0; point < symbol_zl.size() / 2; ++point) { |
| 2235 | zl_icon[point] = center + QPointF(symbol_zl[point * 2] * icon_size, | 2601 | zl_icon[point] = center + QPointF(symbol_zl[point * 2] * icon_size, |
| @@ -2316,7 +2682,7 @@ void PlayerControlPreview::DrawText(QPainter& p, const QPointF center, float tex | |||
| 2316 | const QString& text) { | 2682 | const QString& text) { |
| 2317 | SetTextFont(p, text_size); | 2683 | SetTextFont(p, text_size); |
| 2318 | const QFontMetrics fm(p.font()); | 2684 | const QFontMetrics fm(p.font()); |
| 2319 | const QPointF offset = {fm.width(text) / 2.0f, -text_size / 2.0f}; | 2685 | const QPointF offset = {fm.horizontalAdvance(text) / 2.0f, -text_size / 2.0f}; |
| 2320 | p.drawText(center - offset, text); | 2686 | p.drawText(center - offset, text); |
| 2321 | } | 2687 | } |
| 2322 | 2688 | ||
diff --git a/src/yuzu/configuration/configure_input_player_widget.h b/src/yuzu/configuration/configure_input_player_widget.h index 33a5482ba..39565f795 100644 --- a/src/yuzu/configuration/configure_input_player_widget.h +++ b/src/yuzu/configuration/configure_input_player_widget.h | |||
| @@ -52,6 +52,9 @@ private: | |||
| 52 | B, | 52 | B, |
| 53 | X, | 53 | X, |
| 54 | Y, | 54 | Y, |
| 55 | L, | ||
| 56 | R, | ||
| 57 | C, | ||
| 55 | SL, | 58 | SL, |
| 56 | ZL, | 59 | ZL, |
| 57 | ZR, | 60 | ZR, |
| @@ -104,6 +107,7 @@ private: | |||
| 104 | void DrawLeftController(QPainter& p, QPointF center); | 107 | void DrawLeftController(QPainter& p, QPointF center); |
| 105 | void DrawRightController(QPainter& p, QPointF center); | 108 | void DrawRightController(QPainter& p, QPointF center); |
| 106 | void DrawProController(QPainter& p, QPointF center); | 109 | void DrawProController(QPainter& p, QPointF center); |
| 110 | void DrawGCController(QPainter& p, QPointF center); | ||
| 107 | 111 | ||
| 108 | // Draw body functions | 112 | // Draw body functions |
| 109 | void DrawHandheldBody(QPainter& p, QPointF center); | 113 | void DrawHandheldBody(QPainter& p, QPointF center); |
| @@ -111,9 +115,11 @@ private: | |||
| 111 | void DrawLeftBody(QPainter& p, QPointF center); | 115 | void DrawLeftBody(QPainter& p, QPointF center); |
| 112 | void DrawRightBody(QPainter& p, QPointF center); | 116 | void DrawRightBody(QPainter& p, QPointF center); |
| 113 | void DrawProBody(QPainter& p, QPointF center); | 117 | void DrawProBody(QPainter& p, QPointF center); |
| 118 | void DrawGCBody(QPainter& p, QPointF center); | ||
| 114 | 119 | ||
| 115 | // Draw triggers functions | 120 | // Draw triggers functions |
| 116 | void DrawProTriggers(QPainter& p, QPointF center, bool left_pressed, bool right_pressed); | 121 | void DrawProTriggers(QPainter& p, QPointF center, bool left_pressed, bool right_pressed); |
| 122 | void DrawGCTriggers(QPainter& p, QPointF center, bool left_pressed, bool right_pressed); | ||
| 117 | void DrawHandheldTriggers(QPainter& p, QPointF center, bool left_pressed, bool right_pressed); | 123 | void DrawHandheldTriggers(QPainter& p, QPointF center, bool left_pressed, bool right_pressed); |
| 118 | void DrawDualTriggers(QPainter& p, QPointF center, bool left_pressed, bool right_pressed); | 124 | void DrawDualTriggers(QPainter& p, QPointF center, bool left_pressed, bool right_pressed); |
| 119 | void DrawDualTriggersTopView(QPainter& p, QPointF center, bool left_pressed, | 125 | void DrawDualTriggersTopView(QPainter& p, QPointF center, bool left_pressed, |
| @@ -135,6 +141,7 @@ private: | |||
| 135 | void DrawRawJoystick(QPainter& p, QPointF center, const QPointF value, | 141 | void DrawRawJoystick(QPainter& p, QPointF center, const QPointF value, |
| 136 | const Input::AnalogProperties properties); | 142 | const Input::AnalogProperties properties); |
| 137 | void DrawProJoystick(QPainter& p, QPointF center, bool pressed); | 143 | void DrawProJoystick(QPainter& p, QPointF center, bool pressed); |
| 144 | void DrawGCJoystick(QPainter& p, QPointF center, bool pressed); | ||
| 138 | 145 | ||
| 139 | // Draw button functions | 146 | // Draw button functions |
| 140 | void DrawCircleButton(QPainter& p, QPointF center, bool pressed, float button_size); | 147 | void DrawCircleButton(QPainter& p, QPointF center, bool pressed, float button_size); |
| @@ -142,8 +149,12 @@ private: | |||
| 142 | Direction direction = Direction::None, float radius = 2); | 149 | Direction direction = Direction::None, float radius = 2); |
| 143 | void DrawMinusButton(QPainter& p, QPointF center, bool pressed, int button_size); | 150 | void DrawMinusButton(QPainter& p, QPointF center, bool pressed, int button_size); |
| 144 | void DrawPlusButton(QPainter& p, QPointF center, bool pressed, int button_size); | 151 | void DrawPlusButton(QPainter& p, QPointF center, bool pressed, int button_size); |
| 145 | void DrawArrowButtonOutline(QPainter& p, const QPointF center); | 152 | void DrawGCButtonX(QPainter& p, QPointF center, bool pressed); |
| 146 | void DrawArrowButton(QPainter& p, QPointF center, Direction direction, bool pressed); | 153 | void DrawGCButtonY(QPainter& p, QPointF center, bool pressed); |
| 154 | void DrawGCButtonZ(QPainter& p, QPointF center, bool pressed); | ||
| 155 | void DrawArrowButtonOutline(QPainter& p, const QPointF center, float size = 1.0f); | ||
| 156 | void DrawArrowButton(QPainter& p, QPointF center, Direction direction, bool pressed, | ||
| 157 | float size = 1.0f); | ||
| 147 | void DrawTriggerButton(QPainter& p, QPointF center, Direction direction, bool pressed); | 158 | void DrawTriggerButton(QPainter& p, QPointF center, Direction direction, bool pressed); |
| 148 | 159 | ||
| 149 | // Draw icon functions | 160 | // Draw icon functions |