diff options
| -rw-r--r-- | src/yuzu/configuration/configure_input_player_widget.cpp | 369 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player_widget.h | 14 |
2 files changed, 306 insertions, 77 deletions
diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp index 016066533..ac522fc68 100644 --- a/src/yuzu/configuration/configure_input_player_widget.cpp +++ b/src/yuzu/configuration/configure_input_player_widget.cpp | |||
| @@ -250,9 +250,9 @@ void PlayerControlPreview::DrawLeftController(QPainter& p, const QPointF center) | |||
| 250 | 250 | ||
| 251 | // D-pad constants | 251 | // D-pad constants |
| 252 | const QPointF dpad_center = center + QPoint(9, 14); | 252 | const QPointF dpad_center = center + QPoint(9, 14); |
| 253 | const int dpad_distance = 23; | 253 | constexpr int dpad_distance = 23; |
| 254 | const int dpad_radius = 11; | 254 | constexpr int dpad_radius = 11; |
| 255 | const float dpad_arrow_size = 1.2f; | 255 | constexpr float dpad_arrow_size = 1.2f; |
| 256 | 256 | ||
| 257 | // D-pad buttons | 257 | // D-pad buttons |
| 258 | p.setPen(colors.outline); | 258 | p.setPen(colors.outline); |
| @@ -344,8 +344,9 @@ void PlayerControlPreview::DrawRightController(QPainter& p, const QPointF center | |||
| 344 | 344 | ||
| 345 | // Face buttons constants | 345 | // Face buttons constants |
| 346 | const QPointF face_center = center + QPoint(-9, -73); | 346 | const QPointF face_center = center + QPoint(-9, -73); |
| 347 | const int face_distance = 23; | 347 | constexpr int face_distance = 23; |
| 348 | const int face_radius = 11; | 348 | constexpr int face_radius = 11; |
| 349 | constexpr float text_size = 1.1f; | ||
| 349 | 350 | ||
| 350 | // Face buttons | 351 | // Face buttons |
| 351 | p.setPen(colors.outline); | 352 | p.setPen(colors.outline); |
| @@ -356,11 +357,12 @@ void PlayerControlPreview::DrawRightController(QPainter& p, const QPointF center | |||
| 356 | DrawCircleButton(p, face_center + QPoint(-face_distance, 0), button_values[Y], face_radius); | 357 | DrawCircleButton(p, face_center + QPoint(-face_distance, 0), button_values[Y], face_radius); |
| 357 | 358 | ||
| 358 | // Face buttons text | 359 | // Face buttons text |
| 359 | p.setPen(colors.font); | 360 | p.setPen(colors.transparent); |
| 360 | DrawText(p, face_center + QPoint(face_distance, 0), 10, QStringLiteral("A")); | 361 | p.setBrush(colors.font); |
| 361 | DrawText(p, face_center + QPoint(0, face_distance), 10, QStringLiteral("B")); | 362 | DrawSymbol(p, face_center + QPoint(face_distance, 0), Symbol::A, text_size); |
| 362 | DrawText(p, face_center + QPoint(0, -face_distance), 10, QStringLiteral("X")); | 363 | DrawSymbol(p, face_center + QPoint(0, face_distance), Symbol::B, text_size); |
| 363 | DrawText(p, face_center + QPoint(-face_distance + 1, 1), 10, QStringLiteral("Y")); | 364 | DrawSymbol(p, face_center + QPoint(0, -face_distance), Symbol::X, text_size); |
| 365 | DrawSymbol(p, face_center + QPoint(-face_distance, 1), Symbol::Y, text_size); | ||
| 364 | 366 | ||
| 365 | // SR and SL buttons | 367 | // SR and SL buttons |
| 366 | p.setPen(colors.outline); | 368 | p.setPen(colors.outline); |
| @@ -385,7 +387,9 @@ void PlayerControlPreview::DrawRightController(QPainter& p, const QPointF center | |||
| 385 | DrawCircleButton(p, center + QPoint(-26, 66), button_values[Home], 12); | 387 | DrawCircleButton(p, center + QPoint(-26, 66), button_values[Home], 12); |
| 386 | button_color = colors.button; | 388 | button_color = colors.button; |
| 387 | DrawCircleButton(p, center + QPoint(-26, 66), button_values[Home], 9); | 389 | DrawCircleButton(p, center + QPoint(-26, 66), button_values[Home], 9); |
| 388 | DrawHouseIcon(p, center + QPoint(-26, 66), 5); | 390 | p.setPen(colors.transparent); |
| 391 | p.setBrush(colors.font2); | ||
| 392 | DrawSymbol(p, center + QPoint(-26, 66), Symbol::House, 5); | ||
| 389 | } | 393 | } |
| 390 | 394 | ||
| 391 | void PlayerControlPreview::DrawDualController(QPainter& p, const QPointF center) { | 395 | void PlayerControlPreview::DrawDualController(QPainter& p, const QPointF center) { |
| @@ -457,9 +461,9 @@ void PlayerControlPreview::DrawDualController(QPainter& p, const QPointF center) | |||
| 457 | 461 | ||
| 458 | // Face buttons constants | 462 | // Face buttons constants |
| 459 | const QPointF face_center = center + QPoint(65, -65); | 463 | const QPointF face_center = center + QPoint(65, -65); |
| 460 | const int face_distance = 20; | 464 | constexpr int face_distance = 20; |
| 461 | const int face_radius = 10; | 465 | constexpr int face_radius = 10; |
| 462 | const int text_size = 10; | 466 | constexpr float text_size = 1.0f; |
| 463 | 467 | ||
| 464 | // Face buttons | 468 | // Face buttons |
| 465 | p.setPen(colors.outline); | 469 | p.setPen(colors.outline); |
| @@ -470,17 +474,18 @@ void PlayerControlPreview::DrawDualController(QPainter& p, const QPointF center) | |||
| 470 | DrawCircleButton(p, face_center + QPoint(-face_distance, 0), button_values[Y], face_radius); | 474 | DrawCircleButton(p, face_center + QPoint(-face_distance, 0), button_values[Y], face_radius); |
| 471 | 475 | ||
| 472 | // Face buttons text | 476 | // Face buttons text |
| 473 | p.setPen(colors.font); | 477 | p.setPen(colors.transparent); |
| 474 | DrawText(p, face_center + QPoint(face_distance, 0), text_size, QStringLiteral("A")); | 478 | p.setBrush(colors.font); |
| 475 | DrawText(p, face_center + QPoint(0, face_distance), text_size, QStringLiteral("B")); | 479 | DrawSymbol(p, face_center + QPoint(face_distance, 0), Symbol::A, text_size); |
| 476 | DrawText(p, face_center + QPoint(0, -face_distance), text_size, QStringLiteral("X")); | 480 | DrawSymbol(p, face_center + QPoint(0, face_distance), Symbol::B, text_size); |
| 477 | DrawText(p, face_center + QPointF(-face_distance + 0.5f, 1), text_size, QStringLiteral("Y")); | 481 | DrawSymbol(p, face_center + QPoint(0, -face_distance), Symbol::X, text_size); |
| 482 | DrawSymbol(p, face_center + QPoint(-face_distance, 1), Symbol::Y, text_size); | ||
| 478 | 483 | ||
| 479 | // D-pad constants | 484 | // D-pad constants |
| 480 | const QPointF dpad_center = center + QPoint(-65, 12); | 485 | const QPointF dpad_center = center + QPoint(-65, 12); |
| 481 | const int dpad_distance = 20; | 486 | constexpr int dpad_distance = 20; |
| 482 | const int dpad_radius = 10; | 487 | constexpr int dpad_radius = 10; |
| 483 | const float dpad_arrow_size = 1.1f; | 488 | constexpr float dpad_arrow_size = 1.1f; |
| 484 | 489 | ||
| 485 | // D-pad buttons | 490 | // D-pad buttons |
| 486 | p.setPen(colors.outline); | 491 | p.setPen(colors.outline); |
| @@ -516,7 +521,9 @@ void PlayerControlPreview::DrawDualController(QPainter& p, const QPointF center) | |||
| 516 | DrawCircleButton(p, center + QPoint(50, 60), button_values[Home], 11); | 521 | DrawCircleButton(p, center + QPoint(50, 60), button_values[Home], 11); |
| 517 | button_color = colors.button; | 522 | button_color = colors.button; |
| 518 | DrawCircleButton(p, center + QPoint(50, 60), button_values[Home], 8.5f); | 523 | DrawCircleButton(p, center + QPoint(50, 60), button_values[Home], 8.5f); |
| 519 | DrawHouseIcon(p, center + QPoint(50, 60), 4.2f); | 524 | p.setPen(colors.transparent); |
| 525 | p.setBrush(colors.font2); | ||
| 526 | DrawSymbol(p, center + QPoint(50, 60), Symbol::House, 4.2f); | ||
| 520 | } | 527 | } |
| 521 | 528 | ||
| 522 | void PlayerControlPreview::DrawHandheldController(QPainter& p, const QPointF center) { | 529 | void PlayerControlPreview::DrawHandheldController(QPainter& p, const QPointF center) { |
| @@ -539,9 +546,9 @@ void PlayerControlPreview::DrawHandheldController(QPainter& p, const QPointF cen | |||
| 539 | 546 | ||
| 540 | // Face buttons constants | 547 | // Face buttons constants |
| 541 | const QPointF face_center = center + QPoint(171, -41); | 548 | const QPointF face_center = center + QPoint(171, -41); |
| 542 | const int face_distance = 12; | 549 | constexpr int face_distance = 12; |
| 543 | const int face_radius = 6; | 550 | constexpr int face_radius = 6; |
| 544 | const float text_size = 5.5f; | 551 | constexpr float text_size = 0.6f; |
| 545 | 552 | ||
| 546 | // Face buttons | 553 | // Face buttons |
| 547 | p.setPen(colors.outline); | 554 | p.setPen(colors.outline); |
| @@ -552,17 +559,18 @@ void PlayerControlPreview::DrawHandheldController(QPainter& p, const QPointF cen | |||
| 552 | DrawCircleButton(p, face_center + QPoint(-face_distance, 0), button_values[Y], face_radius); | 559 | DrawCircleButton(p, face_center + QPoint(-face_distance, 0), button_values[Y], face_radius); |
| 553 | 560 | ||
| 554 | // Face buttons text | 561 | // Face buttons text |
| 555 | p.setPen(colors.font); | 562 | p.setPen(colors.transparent); |
| 556 | DrawText(p, face_center + QPointF(face_distance + 0.2f, 0), text_size, QStringLiteral("A")); | 563 | p.setBrush(colors.font); |
| 557 | DrawText(p, face_center + QPoint(0, face_distance), text_size, QStringLiteral("B")); | 564 | DrawSymbol(p, face_center + QPoint(face_distance, 0), Symbol::A, text_size); |
| 558 | DrawText(p, face_center + QPoint(0, -face_distance), text_size, QStringLiteral("X")); | 565 | DrawSymbol(p, face_center + QPoint(0, face_distance), Symbol::B, text_size); |
| 559 | DrawText(p, face_center + QPointF(-face_distance + 0.2f, 0), text_size, QStringLiteral("Y")); | 566 | DrawSymbol(p, face_center + QPoint(0, -face_distance), Symbol::X, text_size); |
| 567 | DrawSymbol(p, face_center + QPoint(-face_distance, 1), Symbol::Y, text_size); | ||
| 560 | 568 | ||
| 561 | // D-pad constants | 569 | // D-pad constants |
| 562 | const QPointF dpad_center = center + QPoint(-171, 8); | 570 | const QPointF dpad_center = center + QPoint(-171, 8); |
| 563 | const int dpad_distance = 12; | 571 | constexpr int dpad_distance = 12; |
| 564 | const int dpad_radius = 6; | 572 | constexpr int dpad_radius = 6; |
| 565 | const float dpad_arrow_size = 0.68f; | 573 | constexpr float dpad_arrow_size = 0.68f; |
| 566 | 574 | ||
| 567 | // D-pad buttons | 575 | // D-pad buttons |
| 568 | p.setPen(colors.outline); | 576 | p.setPen(colors.outline); |
| @@ -582,11 +590,12 @@ void PlayerControlPreview::DrawHandheldController(QPainter& p, const QPointF cen | |||
| 582 | 590 | ||
| 583 | // ZL and ZR buttons | 591 | // ZL and ZR buttons |
| 584 | p.setPen(colors.outline); | 592 | p.setPen(colors.outline); |
| 585 | DrawCircleButton(p, center + QPoint(-175, -120), button_values[ZL], 15); | 593 | DrawTriggerButton(p, center + QPoint(-210, -130), Direction::Left, button_values[ZL]); |
| 586 | DrawCircleButton(p, center + QPoint(175, -120), button_values[ZR], 15); | 594 | DrawTriggerButton(p, center + QPoint(210, -130), Direction::Right, button_values[ZR]); |
| 587 | p.setPen(colors.font); | 595 | p.setPen(colors.transparent); |
| 588 | DrawText(p, center + QPoint(-175, -120), 9, QStringLiteral("ZL")); | 596 | p.setBrush(colors.font); |
| 589 | DrawText(p, center + QPoint(175, -120), 9, QStringLiteral("ZR")); | 597 | DrawSymbol(p, center + QPoint(-210, -130), Symbol::ZL, 1.5f); |
| 598 | DrawSymbol(p, center + QPoint(210, -130), Symbol::ZR, 1.5f); | ||
| 590 | 599 | ||
| 591 | // Minus and Plus button | 600 | // Minus and Plus button |
| 592 | p.setPen(colors.outline); | 601 | p.setPen(colors.outline); |
| @@ -607,7 +616,9 @@ void PlayerControlPreview::DrawHandheldController(QPainter& p, const QPointF cen | |||
| 607 | DrawCircleButton(p, center + QPoint(161, 37), button_values[Home], 7); | 616 | DrawCircleButton(p, center + QPoint(161, 37), button_values[Home], 7); |
| 608 | button_color = colors.button; | 617 | button_color = colors.button; |
| 609 | DrawCircleButton(p, center + QPoint(161, 37), button_values[Home], 5); | 618 | DrawCircleButton(p, center + QPoint(161, 37), button_values[Home], 5); |
| 610 | DrawHouseIcon(p, center + QPoint(161, 37), 2.75f); | 619 | p.setPen(colors.transparent); |
| 620 | p.setBrush(colors.font2); | ||
| 621 | DrawSymbol(p, center + QPoint(161, 37), Symbol::House, 2.75f); | ||
| 611 | } | 622 | } |
| 612 | 623 | ||
| 613 | void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center) { | 624 | void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center) { |
| @@ -630,9 +641,9 @@ void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center) | |||
| 630 | 641 | ||
| 631 | // Face buttons constants | 642 | // Face buttons constants |
| 632 | const QPointF face_center = center + QPoint(105, -56); | 643 | const QPointF face_center = center + QPoint(105, -56); |
| 633 | const int face_distance = 31; | 644 | constexpr int face_distance = 31; |
| 634 | const int face_radius = 15; | 645 | constexpr int face_radius = 15; |
| 635 | const int text_size = 13; | 646 | constexpr float text_size = 1.5f; |
| 636 | 647 | ||
| 637 | // Face buttons | 648 | // Face buttons |
| 638 | p.setPen(colors.outline); | 649 | p.setPen(colors.outline); |
| @@ -643,11 +654,12 @@ void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center) | |||
| 643 | DrawCircleButton(p, face_center + QPoint(-face_distance, 0), button_values[Y], face_radius); | 654 | DrawCircleButton(p, face_center + QPoint(-face_distance, 0), button_values[Y], face_radius); |
| 644 | 655 | ||
| 645 | // Face buttons text | 656 | // Face buttons text |
| 646 | p.setPen(colors.font); | 657 | p.setPen(colors.transparent); |
| 647 | DrawText(p, face_center + QPoint(face_distance, 0), text_size, QStringLiteral("A")); | 658 | p.setBrush(colors.font); |
| 648 | DrawText(p, face_center + QPoint(0, face_distance), text_size, QStringLiteral("B")); | 659 | DrawSymbol(p, face_center + QPoint(face_distance, 0), Symbol::A, text_size); |
| 649 | DrawText(p, face_center + QPoint(0, -face_distance), text_size, QStringLiteral("X")); | 660 | DrawSymbol(p, face_center + QPoint(0, face_distance), Symbol::B, text_size); |
| 650 | DrawText(p, face_center + QPoint(-face_distance, 1), text_size, QStringLiteral("Y")); | 661 | DrawSymbol(p, face_center + QPoint(0, -face_distance), Symbol::X, text_size); |
| 662 | DrawSymbol(p, face_center + QPoint(-face_distance, 1), Symbol::Y, text_size); | ||
| 651 | 663 | ||
| 652 | // D-pad buttons | 664 | // D-pad buttons |
| 653 | const QPointF dpad_postion = center + QPoint(-61, 0); | 665 | const QPointF dpad_postion = center + QPoint(-61, 0); |
| @@ -655,23 +667,28 @@ void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center) | |||
| 655 | DrawArrowButton(p, dpad_postion, Direction::Left, button_values[DLeft]); | 667 | DrawArrowButton(p, dpad_postion, Direction::Left, button_values[DLeft]); |
| 656 | DrawArrowButton(p, dpad_postion, Direction::Right, button_values[DRight]); | 668 | DrawArrowButton(p, dpad_postion, Direction::Right, button_values[DRight]); |
| 657 | DrawArrowButton(p, dpad_postion, Direction::Down, button_values[DDown]); | 669 | DrawArrowButton(p, dpad_postion, Direction::Down, button_values[DDown]); |
| 670 | DrawArrowButtonOutline(p, dpad_postion); | ||
| 658 | 671 | ||
| 659 | // ZL and ZR buttons | 672 | // ZL and ZR buttons |
| 660 | p.setPen(colors.outline); | 673 | p.setPen(colors.outline); |
| 661 | DrawCircleButton(p, center + QPoint(-175, -120), button_values[ZL], 15); | 674 | DrawTriggerButton(p, center + QPoint(-210, -130), Direction::Left, button_values[ZL]); |
| 662 | DrawCircleButton(p, center + QPoint(175, -120), button_values[ZR], 15); | 675 | DrawTriggerButton(p, center + QPoint(210, -130), Direction::Right, button_values[ZR]); |
| 663 | p.setPen(colors.font); | 676 | p.setPen(colors.transparent); |
| 664 | DrawText(p, center + QPoint(-175, -120), 9, QStringLiteral("ZL")); | 677 | p.setBrush(colors.font); |
| 665 | DrawText(p, center + QPoint(175, -120), 9, QStringLiteral("ZR")); | 678 | DrawSymbol(p, center + QPoint(-210, -130), Symbol::ZL, 1.5f); |
| 679 | DrawSymbol(p, center + QPoint(210, -130), Symbol::ZR, 1.5f); | ||
| 666 | 680 | ||
| 667 | // Minus and Plus buttons | 681 | // Minus and Plus buttons |
| 668 | p.setPen(colors.outline); | 682 | p.setPen(colors.outline); |
| 669 | DrawCircleButton(p, center + QPoint(-50, -86), button_values[Minus], 9); | 683 | DrawCircleButton(p, center + QPoint(-50, -86), button_values[Minus], 9); |
| 670 | DrawCircleButton(p, center + QPoint(49, -86), button_values[Plus], 9); | 684 | DrawCircleButton(p, center + QPoint(50, -86), button_values[Plus], 9); |
| 685 | |||
| 686 | // Minus and Plus symbols | ||
| 671 | p.setPen(colors.font2); | 687 | p.setPen(colors.font2); |
| 672 | p.setBrush(colors.font2); | 688 | p.setBrush(colors.font2); |
| 673 | DrawRectangle(p, center + QPoint(-50, -86), 8, 2); | 689 | DrawRectangle(p, center + QPoint(-50, -86), 9, 1.5f); |
| 674 | DrawText(p, center + QPointF(49.5f, -86), 12, QStringLiteral("+")); | 690 | DrawRectangle(p, center + QPoint(50, -86), 9, 1.5f); |
| 691 | DrawRectangle(p, center + QPoint(50, -86), 1.5f, 9); | ||
| 675 | 692 | ||
| 676 | // Screenshot button | 693 | // Screenshot button |
| 677 | p.setPen(colors.outline); | 694 | p.setPen(colors.outline); |
| @@ -683,21 +700,96 @@ void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center) | |||
| 683 | // Home Button | 700 | // Home Button |
| 684 | p.setPen(colors.outline); | 701 | p.setPen(colors.outline); |
| 685 | button_color = colors.slider_button; | 702 | button_color = colors.slider_button; |
| 686 | DrawCircleButton(p, center + QPoint(29, -56), button_values[Home], 9); | 703 | DrawCircleButton(p, center + QPoint(29, -56), button_values[Home], 10.0f); |
| 687 | button_color = colors.button; | 704 | button_color = colors.button; |
| 688 | DrawCircleButton(p, center + QPoint(29, -56), button_values[Home], 7.1f); | 705 | DrawCircleButton(p, center + QPoint(29, -56), button_values[Home], 7.1f); |
| 689 | DrawHouseIcon(p, center + QPoint(29, -56), 3.9f); | 706 | p.setPen(colors.transparent); |
| 707 | p.setBrush(colors.font2); | ||
| 708 | DrawSymbol(p, center + QPoint(29, -56), Symbol::House, 3.9f); | ||
| 690 | } | 709 | } |
| 691 | 710 | ||
| 711 | constexpr std::array<float, 13 * 2> symbol_a = { | ||
| 712 | -1.085f, -5.2f, 1.085f, -5.2f, 5.085f, 5.0f, 2.785f, 5.0f, 1.785f, | ||
| 713 | 2.65f, -1.785f, 2.65f, -2.785f, 5.0f, -5.085f, 5.0f, -1.4f, 1.0f, | ||
| 714 | 0.0f, -2.8f, 1.4f, 1.0f, -1.4f, 1.0f, -5.085f, 5.0f, | ||
| 715 | }; | ||
| 716 | constexpr std::array<float, 134 * 2> symbol_b = { | ||
| 717 | -4.0f, 0.0f, -4.0f, 0.0f, -4.0f, -0.1f, -3.8f, -5.1f, 1.8f, -5.0f, 2.3f, -4.9f, 2.6f, | ||
| 718 | -4.8f, 2.8f, -4.7f, 2.9f, -4.6f, 3.1f, -4.5f, 3.2f, -4.4f, 3.4f, -4.3f, 3.4f, -4.2f, | ||
| 719 | 3.5f, -4.1f, 3.7f, -4.0f, 3.7f, -3.9f, 3.8f, -3.8f, 3.8f, -3.7f, 3.9f, -3.6f, 3.9f, | ||
| 720 | -3.5f, 4.0f, -3.4f, 4.0f, -3.3f, 4.1f, -3.1f, 4.1f, -3.0f, 4.0f, -2.0f, 4.0f, -1.9f, | ||
| 721 | 3.9f, -1.7f, 3.9f, -1.6f, 3.8f, -1.5f, 3.8f, -1.4f, 3.7f, -1.3f, 3.7f, -1.2f, 3.6f, | ||
| 722 | -1.1f, 3.6f, -1.0f, 3.5f, -0.9f, 3.3f, -0.8f, 3.3f, -0.7f, 3.2f, -0.6f, 3.0f, -0.5f, | ||
| 723 | 2.9f, -0.4f, 2.7f, -0.3f, 2.9f, -0.2f, 3.2f, -0.1f, 3.3f, 0.0f, 3.5f, 0.1f, 3.6f, | ||
| 724 | 0.2f, 3.8f, 0.3f, 3.9f, 0.4f, 4.0f, 0.6f, 4.1f, 0.7f, 4.3f, 0.8f, 4.3f, 0.9f, | ||
| 725 | 4.4f, 1.0f, 4.4f, 1.1f, 4.5f, 1.3f, 4.5f, 1.4f, 4.6f, 1.6f, 4.6f, 1.7f, 4.5f, | ||
| 726 | 2.8f, 4.5f, 2.9f, 4.4f, 3.1f, 4.4f, 3.2f, 4.3f, 3.4f, 4.3f, 3.5f, 4.2f, 3.6f, | ||
| 727 | 4.2f, 3.7f, 4.1f, 3.8f, 4.1f, 3.9f, 4.0f, 4.0f, 3.9f, 4.2f, 3.8f, 4.3f, 3.6f, | ||
| 728 | 4.4f, 3.6f, 4.5f, 3.4f, 4.6f, 3.3f, 4.7f, 3.1f, 4.8f, 2.8f, 4.9f, 2.6f, 5.0f, | ||
| 729 | 2.1f, 5.1f, -4.0f, 5.0f, -4.0f, 4.9f, | ||
| 730 | |||
| 731 | -4.0f, 0.0f, 1.1f, 3.4f, 1.1f, 3.4f, 1.5f, 3.3f, 1.8f, 3.2f, 2.0f, 3.1f, 2.1f, | ||
| 732 | 3.0f, 2.3f, 2.9f, 2.3f, 2.8f, 2.4f, 2.7f, 2.4f, 2.6f, 2.5f, 2.3f, 2.5f, 2.2f, | ||
| 733 | 2.4f, 1.7f, 2.4f, 1.6f, 2.3f, 1.4f, 2.3f, 1.3f, 2.2f, 1.2f, 2.2f, 1.1f, 2.1f, | ||
| 734 | 1.0f, 1.9f, 0.9f, 1.6f, 0.8f, 1.4f, 0.7f, -1.9f, 0.6f, -1.9f, 0.7f, -1.8f, 3.4f, | ||
| 735 | 1.1f, 3.4f, -4.0f, 0.0f, | ||
| 736 | |||
| 737 | 0.3f, -1.1f, 0.3f, -1.1f, 1.3f, -1.2f, 1.5f, -1.3f, 1.8f, -1.4f, 1.8f, -1.5f, 1.9f, | ||
| 738 | -1.6f, 2.0f, -1.8f, 2.0f, -1.9f, 2.1f, -2.0f, 2.1f, -2.1f, 2.0f, -2.7f, 2.0f, -2.8f, | ||
| 739 | 1.9f, -2.9f, 1.9f, -3.0f, 1.8f, -3.1f, 1.6f, -3.2f, 1.6f, -3.3f, 1.3f, -3.4f, -1.9f, | ||
| 740 | -3.3f, -1.9f, -3.2f, -1.8f, -1.0f, 0.2f, -1.1f, 0.3f, -1.1f, -4.0f, 0.0f, | ||
| 741 | }; | ||
| 742 | |||
| 743 | constexpr std::array<float, 9 * 2> symbol_y = { | ||
| 744 | -4.79f, -4.9f, -2.44f, -4.9f, 0.0f, -0.9f, 2.44f, -4.9f, 4.79f, | ||
| 745 | -4.9f, 1.05f, 1.0f, 1.05f, 5.31f, -1.05f, 5.31f, -1.05f, 1.0f, | ||
| 746 | |||
| 747 | }; | ||
| 748 | |||
| 749 | constexpr std::array<float, 12 * 2> symbol_x = { | ||
| 750 | -4.4f, -5.0f, -2.0f, -5.0f, 0.0f, -1.7f, 2.0f, -5.0f, 4.4f, -5.0f, 1.2f, 0.0f, | ||
| 751 | 4.4f, 5.0f, 2.0f, 5.0f, 0.0f, 1.7f, -2.0f, 5.0f, -4.4f, 5.0f, -1.2f, 0.0f, | ||
| 752 | |||
| 753 | }; | ||
| 754 | |||
| 755 | constexpr std::array<float, 18 * 2> symbol_zl = { | ||
| 756 | -2.6f, -2.13f, -5.6f, -2.13f, -5.6f, -3.23f, -0.8f, -3.23f, -0.8f, -2.13f, -4.4f, 2.12f, | ||
| 757 | -0.7f, 2.12f, -0.7f, 3.22f, -6.0f, 3.22f, -6.0f, 2.12f, 2.4f, -3.23f, 2.4f, 2.1f, | ||
| 758 | 5.43f, 2.1f, 5.43f, 3.22f, 0.98f, 3.22f, 0.98f, -3.23f, 2.4f, -3.23f, -6.0f, 2.12f, | ||
| 759 | }; | ||
| 760 | |||
| 761 | constexpr std::array<float, 110 * 2> symbol_zr = { | ||
| 762 | -2.6f, -2.13f, -5.6f, -2.13f, -5.6f, -3.23f, -0.8f, -3.23f, -0.8f, -2.13f, -4.4f, 2.12f, -0.7f, | ||
| 763 | 2.12f, -0.7f, 3.22f, -6.0f, 3.22f, -6.0f, 2.12f, | ||
| 764 | |||
| 765 | 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, | ||
| 766 | -2.9f, 5.7f, -2.8f, 5.9f, -2.7f, 5.9f, -2.6f, 6.0f, -2.5f, 6.1f, -2.3f, 6.2f, -2.2f, | ||
| 767 | 6.2f, -2.1f, 6.3f, -2.0f, 6.3f, -1.9f, 6.2f, -0.8f, 6.2f, -0.7f, 6.1f, -0.6f, 6.1f, | ||
| 768 | -0.5f, 6.0f, -0.4f, 6.0f, -0.3f, 5.9f, -0.2f, 5.7f, -0.1f, 5.7f, 0.0f, 5.6f, 0.1f, | ||
| 769 | 5.4f, 0.2f, 5.1f, 0.3f, 4.7f, 0.4f, 4.7f, 0.5f, 4.9f, 0.6f, 5.0f, 0.7f, 5.2f, | ||
| 770 | 0.8f, 5.2f, 0.9f, 5.3f, 1.0f, 5.5f, 1.1f, 5.5f, 1.2f, 5.6f, 1.3f, 5.7f, 1.5f, | ||
| 771 | 5.8f, 1.6f, 5.9f, 1.8f, 6.0f, 1.9f, 6.1f, 2.1f, 6.2f, 2.2f, 6.2f, 2.3f, 6.3f, | ||
| 772 | 2.4f, 6.4f, 2.6f, 6.5f, 2.7f, 6.6f, 2.9f, 6.7f, 3.0f, 6.7f, 3.1f, 6.8f, 3.2f, | ||
| 773 | 6.8f, 3.3f, 5.3f, 3.2f, 5.2f, 3.1f, 5.2f, 3.0f, 5.1f, 2.9f, 5.0f, 2.7f, 4.9f, | ||
| 774 | 2.6f, 4.8f, 2.4f, 4.7f, 2.3f, 4.6f, 2.1f, 4.5f, 2.0f, 4.4f, 1.8f, 4.3f, 1.7f, | ||
| 775 | 4.1f, 1.4f, 4.0f, 1.3f, 3.9f, 1.1f, 3.8f, 1.0f, 3.6f, 0.9f, 3.6f, 0.8f, 3.5f, | ||
| 776 | 0.7f, 3.3f, 0.6f, 2.9f, 0.5f, 2.3f, 0.6f, 2.3f, 0.7f, 2.2f, 3.3f, 1.0f, 3.2f, | ||
| 777 | 1.0f, 3.1f, 1.0f, 0.0f, | ||
| 778 | |||
| 779 | 4.2f, -0.5f, 4.2f, -0.5f, 4.4f, -0.6f, 4.7f, -0.7f, 4.8f, -0.8f, 4.9f, -1.0f, 5.0f, | ||
| 780 | -1.1f, 5.0f, -1.2f, 4.9f, -1.7f, 4.9f, -1.8f, 4.8f, -1.9f, 4.8f, -2.0f, 4.6f, -2.1f, | ||
| 781 | 4.3f, -2.2f, 2.3f, -2.1f, 2.3f, -2.0f, 2.4f, -0.5f, 4.2f, -0.5f, 1.0f, 0.0f, -6.0f, | ||
| 782 | 2.12f, | ||
| 783 | }; | ||
| 784 | |||
| 692 | constexpr std::array<float, 12 * 2> house = { | 785 | constexpr std::array<float, 12 * 2> house = { |
| 693 | -1.3f, 0.0f, -0.93f, 0.0f, -0.93f, 1.15f, 0.93f, 1.15f, 0.93f, 0.0f, 1.3f, 0.0f, | 786 | -1.3f, 0.0f, -0.93f, 0.0f, -0.93f, 1.15f, 0.93f, 1.15f, 0.93f, 0.0f, 1.3f, 0.0f, |
| 694 | 0.0f, -1.2f, -1.3f, 0.0f, -0.43f, 0.0f, -0.43f, .73f, 0.43f, .73f, 0.43f, 0.0f, | 787 | 0.0f, -1.2f, -1.3f, 0.0f, -0.43f, 0.0f, -0.43f, .73f, 0.43f, .73f, 0.43f, 0.0f, |
| 695 | }; | 788 | }; |
| 696 | 789 | ||
| 697 | constexpr std::array<float, 15 * 2> up_arrow_button = { | 790 | constexpr std::array<float, 11 * 2> up_arrow_button = { |
| 698 | -8.6f, -30.0f, -9.0f, -29.8f, -9.3f, -29.5f, -9.5f, -29.1f, -9.5f, -28.7f, | 791 | 9.1f, -9.1f, 9.1f, -30.0f, 8.1f, -30.1f, 7.7f, -30.1f, -8.6f, -30.0f, -9.0f, |
| 699 | -9.1f, -9.1f, -8.8f, -8.8f, 0.3f, -0.3f, 0.6f, -0.6f, 9.4f, -9.8f, | 792 | -29.8f, -9.3f, -29.5f, -9.5f, -29.1f, -9.1f, -28.7f, -9.1f, -9.1f, 0.0f, 0.6f, |
| 700 | 9.4f, -10.2f, 8.9f, -29.8f, 8.5f, -30.0f, 8.1f, -30.1f, 7.7f, -30.1f, | ||
| 701 | }; | 793 | }; |
| 702 | 794 | ||
| 703 | constexpr std::array<float, 3 * 2> up_arrow_symbol = { | 795 | constexpr std::array<float, 3 * 2> up_arrow_symbol = { |
| @@ -710,6 +802,20 @@ constexpr std::array<float, 13 * 2> up_arrow = { | |||
| 710 | -9.5f, -29.1f, -9.5f, -28.7f, -9.1f, -9.1f, -8.8f, -8.8f, | 802 | -9.5f, -29.1f, -9.5f, -28.7f, -9.1f, -9.1f, -8.8f, -8.8f, |
| 711 | }; | 803 | }; |
| 712 | 804 | ||
| 805 | constexpr std::array<float, 64 * 2> trigger_button = { | ||
| 806 | 5.5f, -12.6f, 5.8f, -12.6f, 6.7f, -12.5f, 8.1f, -12.3f, 8.6f, -12.2f, 9.2f, -12.0f, | ||
| 807 | 9.5f, -11.9f, 9.9f, -11.8f, 10.6f, -11.5f, 11.0f, -11.3f, 11.2f, -11.2f, 11.4f, -11.1f, | ||
| 808 | 11.8f, -10.9f, 12.0f, -10.8f, 12.2f, -10.7f, 12.4f, -10.5f, 12.6f, -10.4f, 12.8f, -10.3f, | ||
| 809 | 13.6f, -9.7f, 13.8f, -9.6f, 13.9f, -9.4f, 14.1f, -9.3f, 14.8f, -8.6f, 15.0f, -8.5f, | ||
| 810 | 15.1f, -8.3f, 15.6f, -7.8f, 15.7f, -7.6f, 16.1f, -7.0f, 16.3f, -6.8f, 16.4f, -6.6f, | ||
| 811 | 16.5f, -6.4f, 16.8f, -6.0f, 16.9f, -5.8f, 17.0f, -5.6f, 17.1f, -5.4f, 17.2f, -5.2f, | ||
| 812 | 17.3f, -5.0f, 17.4f, -4.8f, 17.5f, -4.6f, 17.6f, -4.4f, 17.7f, -4.1f, 17.8f, -3.9f, | ||
| 813 | 17.9f, -3.5f, 18.0f, -3.3f, 18.1f, -3.0f, 18.2f, -2.6f, 18.2f, -2.3f, 18.3f, -2.1f, | ||
| 814 | 18.3f, -1.9f, 18.4f, -1.4f, 18.5f, -1.2f, 18.6f, -0.3f, 18.6f, 0.0f, 18.3f, 13.9f, | ||
| 815 | -17.0f, 13.8f, -17.0f, 13.6f, -16.4f, -11.4f, -16.3f, -11.6f, -16.1f, -11.8f, -15.7f, -12.0f, | ||
| 816 | -15.5f, -12.1f, -15.1f, -12.3f, -14.6f, -12.4f, -13.4f, -12.5f, | ||
| 817 | }; | ||
| 818 | |||
| 713 | constexpr std::array<float, 36 * 2> pro_left_trigger = { | 819 | constexpr std::array<float, 36 * 2> pro_left_trigger = { |
| 714 | -65.2f, -132.6f, -68.2f, -134.1f, -71.3f, -135.5f, -74.4f, -136.7f, -77.6f, | 820 | -65.2f, -132.6f, -68.2f, -134.1f, -71.3f, -135.5f, -74.4f, -136.7f, -77.6f, |
| 715 | -137.6f, -80.9f, -138.1f, -84.3f, -138.3f, -87.6f, -138.3f, -91.0f, -138.1f, | 821 | -137.6f, -80.9f, -138.1f, -84.3f, -138.3f, -87.6f, -138.3f, -91.0f, -138.1f, |
| @@ -1660,9 +1766,29 @@ void PlayerControlPreview::DrawCircleButton(QPainter& p, const QPointF center, b | |||
| 1660 | } | 1766 | } |
| 1661 | p.drawEllipse(center, button_size, button_size); | 1767 | p.drawEllipse(center, button_size, button_size); |
| 1662 | } | 1768 | } |
| 1769 | |||
| 1770 | void PlayerControlPreview::DrawArrowButtonOutline(QPainter& p, const QPointF center) { | ||
| 1771 | const std::size_t arrow_points = up_arrow_button.size() / 2; | ||
| 1772 | std::array<QPointF, (arrow_points - 1) * 4> arrow_button_outline; | ||
| 1773 | |||
| 1774 | for (std::size_t point = 0; point < arrow_points - 1; ++point) { | ||
| 1775 | arrow_button_outline[point] = | ||
| 1776 | center + QPointF(up_arrow_button[point * 2], up_arrow_button[point * 2 + 1]); | ||
| 1777 | arrow_button_outline[(arrow_points - 1) * 2 - point - 1] = | ||
| 1778 | center + QPointF(up_arrow_button[point * 2 + 1], up_arrow_button[point * 2]); | ||
| 1779 | arrow_button_outline[(arrow_points - 1) * 2 + point] = | ||
| 1780 | center + QPointF(-up_arrow_button[point * 2], -up_arrow_button[point * 2 + 1]); | ||
| 1781 | arrow_button_outline[(arrow_points - 1) * 4 - point - 1] = | ||
| 1782 | center + QPointF(-up_arrow_button[point * 2 + 1], -up_arrow_button[point * 2]); | ||
| 1783 | } | ||
| 1784 | // Draw arrow button outline | ||
| 1785 | p.setPen(colors.outline); | ||
| 1786 | p.setBrush(colors.transparent); | ||
| 1787 | DrawPolygon(p, arrow_button_outline); | ||
| 1788 | } | ||
| 1789 | |||
| 1663 | void PlayerControlPreview::DrawArrowButton(QPainter& p, const QPointF center, | 1790 | void PlayerControlPreview::DrawArrowButton(QPainter& p, const QPointF center, |
| 1664 | const Direction direction, bool pressed) { | 1791 | const Direction direction, bool pressed) { |
| 1665 | |||
| 1666 | std::array<QPointF, up_arrow_button.size() / 2> arrow_button; | 1792 | std::array<QPointF, up_arrow_button.size() / 2> arrow_button; |
| 1667 | QPoint offset; | 1793 | QPoint offset; |
| 1668 | 1794 | ||
| @@ -1671,22 +1797,18 @@ void PlayerControlPreview::DrawArrowButton(QPainter& p, const QPointF center, | |||
| 1671 | case Direction::Up: | 1797 | case Direction::Up: |
| 1672 | arrow_button[point] = | 1798 | arrow_button[point] = |
| 1673 | center + QPointF(up_arrow_button[point * 2], up_arrow_button[point * 2 + 1]); | 1799 | center + QPointF(up_arrow_button[point * 2], up_arrow_button[point * 2 + 1]); |
| 1674 | offset = QPoint(0, -20); | ||
| 1675 | break; | 1800 | break; |
| 1676 | case Direction::Left: | 1801 | case Direction::Left: |
| 1677 | arrow_button[point] = | 1802 | arrow_button[point] = |
| 1678 | center + QPointF(up_arrow_button[point * 2 + 1], up_arrow_button[point * 2]); | 1803 | center + QPointF(up_arrow_button[point * 2 + 1], up_arrow_button[point * 2]); |
| 1679 | offset = QPoint(-20, 0); | ||
| 1680 | break; | 1804 | break; |
| 1681 | case Direction::Right: | 1805 | case Direction::Right: |
| 1682 | arrow_button[point] = | 1806 | arrow_button[point] = |
| 1683 | center + QPointF(-up_arrow_button[point * 2 + 1], up_arrow_button[point * 2]); | 1807 | center + QPointF(-up_arrow_button[point * 2 + 1], up_arrow_button[point * 2]); |
| 1684 | offset = QPoint(20, 0); | ||
| 1685 | break; | 1808 | break; |
| 1686 | case Direction::Down: | 1809 | case Direction::Down: |
| 1687 | arrow_button[point] = | 1810 | arrow_button[point] = |
| 1688 | center + QPointF(up_arrow_button[point * 2], -up_arrow_button[point * 2 + 1]); | 1811 | center + QPointF(up_arrow_button[point * 2], -up_arrow_button[point * 2 + 1]); |
| 1689 | offset = QPoint(0, 20); | ||
| 1690 | break; | 1812 | break; |
| 1691 | case Direction::None: | 1813 | case Direction::None: |
| 1692 | break; | 1814 | break; |
| @@ -1694,27 +1816,122 @@ void PlayerControlPreview::DrawArrowButton(QPainter& p, const QPointF center, | |||
| 1694 | } | 1816 | } |
| 1695 | 1817 | ||
| 1696 | // Draw arrow button | 1818 | // Draw arrow button |
| 1697 | p.setPen(colors.outline); | 1819 | p.setPen(pressed ? colors.highlight : colors.button); |
| 1698 | p.setBrush(pressed ? colors.highlight : colors.button); | 1820 | p.setBrush(pressed ? colors.highlight : colors.button); |
| 1699 | DrawPolygon(p, arrow_button); | 1821 | DrawPolygon(p, arrow_button); |
| 1700 | 1822 | ||
| 1823 | switch (direction) { | ||
| 1824 | case Direction::Up: | ||
| 1825 | offset = QPoint(0, -20); | ||
| 1826 | break; | ||
| 1827 | case Direction::Left: | ||
| 1828 | offset = QPoint(-20, 0); | ||
| 1829 | break; | ||
| 1830 | case Direction::Right: | ||
| 1831 | offset = QPoint(20, 0); | ||
| 1832 | break; | ||
| 1833 | case Direction::Down: | ||
| 1834 | offset = QPoint(0, 20); | ||
| 1835 | break; | ||
| 1836 | case Direction::None: | ||
| 1837 | offset = QPoint(0, 0); | ||
| 1838 | break; | ||
| 1839 | } | ||
| 1840 | |||
| 1701 | // Draw arrow icon | 1841 | // Draw arrow icon |
| 1702 | p.setPen(colors.font2); | 1842 | p.setPen(colors.font2); |
| 1703 | p.setBrush(colors.font2); | 1843 | p.setBrush(colors.font2); |
| 1704 | DrawArrow(p, center + offset, direction, 1.0f); | 1844 | DrawArrow(p, center + offset, direction, 1.0f); |
| 1705 | } | 1845 | } |
| 1706 | 1846 | ||
| 1707 | void PlayerControlPreview::DrawHouseIcon(QPainter& p, const QPointF center, float icon_size) { | 1847 | void PlayerControlPreview::DrawTriggerButton(QPainter& p, const QPointF center, |
| 1708 | std::array<QPointF, house.size() / 2> house_icon; | 1848 | const Direction direction, bool pressed) { |
| 1849 | std::array<QPointF, trigger_button.size() / 2> qtrigger_button; | ||
| 1850 | QPoint offset; | ||
| 1709 | 1851 | ||
| 1710 | for (std::size_t point = 0; point < house.size() / 2; ++point) { | 1852 | for (std::size_t point = 0; point < trigger_button.size() / 2; ++point) { |
| 1711 | house_icon[point] = center + QPointF(house[point * 2] * icon_size, | 1853 | switch (direction) { |
| 1712 | (house[point * 2 + 1] - 0.025f) * icon_size); | 1854 | case Direction::Left: |
| 1855 | qtrigger_button[point] = | ||
| 1856 | center + QPointF(-trigger_button[point * 2], trigger_button[point * 2 + 1]); | ||
| 1857 | break; | ||
| 1858 | case Direction::Right: | ||
| 1859 | qtrigger_button[point] = | ||
| 1860 | center + QPointF(trigger_button[point * 2], trigger_button[point * 2 + 1]); | ||
| 1861 | break; | ||
| 1862 | case Direction::Up: | ||
| 1863 | case Direction::Down: | ||
| 1864 | case Direction::None: | ||
| 1865 | break; | ||
| 1866 | } | ||
| 1713 | } | 1867 | } |
| 1714 | 1868 | ||
| 1715 | p.setPen(colors.transparent); | 1869 | // Draw arrow button |
| 1716 | p.setBrush(colors.font2); | 1870 | p.setPen(colors.outline); |
| 1717 | p.drawPolygon(house_icon.data(), static_cast<int>(house_icon.size())); | 1871 | p.setBrush(pressed ? colors.highlight : colors.button); |
| 1872 | DrawPolygon(p, qtrigger_button); | ||
| 1873 | } | ||
| 1874 | |||
| 1875 | void PlayerControlPreview::DrawSymbol(QPainter& p, const QPointF center, Symbol symbol, | ||
| 1876 | float icon_size) { | ||
| 1877 | std::array<QPointF, house.size() / 2> house_icon; | ||
| 1878 | std::array<QPointF, symbol_a.size() / 2> a_icon; | ||
| 1879 | std::array<QPointF, symbol_b.size() / 2> b_icon; | ||
| 1880 | std::array<QPointF, symbol_x.size() / 2> x_icon; | ||
| 1881 | std::array<QPointF, symbol_y.size() / 2> y_icon; | ||
| 1882 | std::array<QPointF, symbol_zl.size() / 2> zl_icon; | ||
| 1883 | std::array<QPointF, symbol_zr.size() / 2> zr_icon; | ||
| 1884 | switch (symbol) { | ||
| 1885 | case Symbol::House: | ||
| 1886 | for (std::size_t point = 0; point < house.size() / 2; ++point) { | ||
| 1887 | house_icon[point] = center + QPointF(house[point * 2] * icon_size, | ||
| 1888 | (house[point * 2 + 1] - 0.025f) * icon_size); | ||
| 1889 | } | ||
| 1890 | p.drawPolygon(house_icon.data(), static_cast<int>(house_icon.size())); | ||
| 1891 | break; | ||
| 1892 | case Symbol::A: | ||
| 1893 | for (std::size_t point = 0; point < symbol_a.size() / 2; ++point) { | ||
| 1894 | a_icon[point] = center + QPointF(symbol_a[point * 2] * icon_size, | ||
| 1895 | symbol_a[point * 2 + 1] * icon_size); | ||
| 1896 | } | ||
| 1897 | p.drawPolygon(a_icon.data(), static_cast<int>(a_icon.size())); | ||
| 1898 | break; | ||
| 1899 | case Symbol::B: | ||
| 1900 | for (std::size_t point = 0; point < symbol_b.size() / 2; ++point) { | ||
| 1901 | b_icon[point] = center + QPointF(symbol_b[point * 2] * icon_size, | ||
| 1902 | symbol_b[point * 2 + 1] * icon_size); | ||
| 1903 | } | ||
| 1904 | p.drawPolygon(b_icon.data(), static_cast<int>(b_icon.size())); | ||
| 1905 | break; | ||
| 1906 | case Symbol::X: | ||
| 1907 | for (std::size_t point = 0; point < symbol_x.size() / 2; ++point) { | ||
| 1908 | x_icon[point] = center + QPointF(symbol_x[point * 2] * icon_size, | ||
| 1909 | symbol_x[point * 2 + 1] * icon_size); | ||
| 1910 | } | ||
| 1911 | p.drawPolygon(x_icon.data(), static_cast<int>(x_icon.size())); | ||
| 1912 | break; | ||
| 1913 | case Symbol::Y: | ||
| 1914 | for (std::size_t point = 0; point < symbol_y.size() / 2; ++point) { | ||
| 1915 | y_icon[point] = center + QPointF(symbol_y[point * 2] * icon_size, | ||
| 1916 | (symbol_y[point * 2 + 1] - 1.0f) * icon_size); | ||
| 1917 | } | ||
| 1918 | p.drawPolygon(y_icon.data(), static_cast<int>(y_icon.size())); | ||
| 1919 | break; | ||
| 1920 | case Symbol::ZL: | ||
| 1921 | for (std::size_t point = 0; point < symbol_zl.size() / 2; ++point) { | ||
| 1922 | zl_icon[point] = center + QPointF(symbol_zl[point * 2] * icon_size, | ||
| 1923 | symbol_zl[point * 2 + 1] * icon_size); | ||
| 1924 | } | ||
| 1925 | p.drawPolygon(zl_icon.data(), static_cast<int>(zl_icon.size())); | ||
| 1926 | break; | ||
| 1927 | case Symbol::ZR: | ||
| 1928 | for (std::size_t point = 0; point < symbol_zr.size() / 2; ++point) { | ||
| 1929 | zr_icon[point] = center + QPointF(symbol_zr[point * 2] * icon_size, | ||
| 1930 | symbol_zr[point * 2 + 1] * icon_size); | ||
| 1931 | } | ||
| 1932 | p.drawPolygon(zr_icon.data(), static_cast<int>(zr_icon.size())); | ||
| 1933 | break; | ||
| 1934 | } | ||
| 1718 | } | 1935 | } |
| 1719 | 1936 | ||
| 1720 | void PlayerControlPreview::DrawArrow(QPainter& p, const QPointF center, const Direction direction, | 1937 | void PlayerControlPreview::DrawArrow(QPainter& p, const QPointF center, const Direction direction, |
diff --git a/src/yuzu/configuration/configure_input_player_widget.h b/src/yuzu/configuration/configure_input_player_widget.h index 4122e3abd..785d37924 100644 --- a/src/yuzu/configuration/configure_input_player_widget.h +++ b/src/yuzu/configuration/configure_input_player_widget.h | |||
| @@ -43,6 +43,16 @@ private: | |||
| 43 | Left, | 43 | Left, |
| 44 | }; | 44 | }; |
| 45 | 45 | ||
| 46 | enum class Symbol { | ||
| 47 | House, | ||
| 48 | A, | ||
| 49 | B, | ||
| 50 | X, | ||
| 51 | Y, | ||
| 52 | ZL, | ||
| 53 | ZR, | ||
| 54 | }; | ||
| 55 | |||
| 46 | struct AxisValue { | 56 | struct AxisValue { |
| 47 | QPointF value{}; | 57 | QPointF value{}; |
| 48 | QPointF raw_value{}; | 58 | QPointF raw_value{}; |
| @@ -120,10 +130,12 @@ private: | |||
| 120 | Direction direction = Direction::None, float radius = 2); | 130 | Direction direction = Direction::None, float radius = 2); |
| 121 | void DrawMinusButton(QPainter& p, QPointF center, bool pressed, int button_size); | 131 | void DrawMinusButton(QPainter& p, QPointF center, bool pressed, int button_size); |
| 122 | void DrawPlusButton(QPainter& p, QPointF center, bool pressed, int button_size); | 132 | void DrawPlusButton(QPainter& p, QPointF center, bool pressed, int button_size); |
| 133 | void DrawArrowButtonOutline(QPainter& p, const QPointF center); | ||
| 123 | void DrawArrowButton(QPainter& p, QPointF center, Direction direction, bool pressed); | 134 | void DrawArrowButton(QPainter& p, QPointF center, Direction direction, bool pressed); |
| 135 | void DrawTriggerButton(QPainter& p, QPointF center, Direction direction, bool pressed); | ||
| 124 | 136 | ||
| 125 | // Draw icon functions | 137 | // Draw icon functions |
| 126 | void DrawHouseIcon(QPainter& p, QPointF center, float icon_size); | 138 | void DrawSymbol(QPainter& p, QPointF center, Symbol symbol, float icon_size); |
| 127 | void DrawArrow(QPainter& p, QPointF center, Direction direction, float size); | 139 | void DrawArrow(QPainter& p, QPointF center, Direction direction, float size); |
| 128 | 140 | ||
| 129 | // Draw primitive types | 141 | // Draw primitive types |