| 692 | } |
| 693 | |
| 694 | void AlienImGui::InputColorTransition(InputColorTransitionParameters const& parameters, int sourceColor, int& targetColor, int& transitionAge) |
| 695 | { |
| 696 | if (!matchWithFilter(parameters._name)) { |
| 697 | return; |
| 698 | } |
| 699 | |
| 700 | //source color field |
| 701 | ImGui::PushID(sourceColor); |
| 702 | AlienImGui::ColorField(Const::IndividualCellColors[sourceColor]); |
| 703 | ImGui::SameLine(); |
| 704 | |
| 705 | //combo for target color |
| 706 | AlienImGui::Text(ICON_FA_LONG_ARROW_ALT_RIGHT); |
| 707 | ImGui::SameLine(); |
| 708 | ImGui::PushID("color"); |
| 709 | AlienImGui::ComboColor(AlienImGui::ComboColorParameters().width(70.0f).textWidth(0), targetColor); |
| 710 | ImGui::PopID(); |
| 711 | |
| 712 | |
| 713 | //slider for transition age |
| 714 | ImGui::PushID(2); |
| 715 | |
| 716 | ImGui::SameLine(); |
| 717 | auto width = scale(parameters._textWidth); |
| 718 | ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x - width); |
| 719 | std::string format = "%d"; |
| 720 | if (parameters._infinity && transitionAge == Infinity<int>::value) { |
| 721 | format = "infinity"; |
| 722 | transitionAge = parameters._max; |
| 723 | } |
| 724 | ImGui::SliderInt( |
| 725 | ("##" + parameters._name).c_str(), |
| 726 | &transitionAge, |
| 727 | parameters._min, |
| 728 | parameters._max, |
| 729 | format.c_str(), |
| 730 | parameters._logarithmic ? ImGuiSliderFlags_Logarithmic : 0); |
| 731 | if (parameters._infinity && transitionAge == parameters._max) { |
| 732 | format = "infinity"; |
| 733 | transitionAge = Infinity<int>::value; |
| 734 | } |
| 735 | if (parameters._defaultTransitionAge && parameters._defaultTargetColor) { |
| 736 | ImGui::SameLine(); |
| 737 | ImGui::BeginDisabled(transitionAge == *parameters._defaultTransitionAge && targetColor == *parameters._defaultTargetColor); |
| 738 | if (RevertButton(parameters._name)) { |
| 739 | transitionAge = *parameters._defaultTransitionAge; |
| 740 | targetColor = *parameters._defaultTargetColor; |
| 741 | } |
| 742 | ImGui::EndDisabled(); |
| 743 | } |
| 744 | ImGui::SameLine(); |
| 745 | AlienImGui::Text(parameters._name.c_str()); |
| 746 | |
| 747 | if (parameters._tooltip) { |
| 748 | AlienImGui::HelpMarker(*parameters._tooltip); |
| 749 | } |
| 750 | ImGui::PopID(); |
| 751 | ImGui::PopID(); |
nothing calls this directly
no test coverage detected