| 127 | } |
| 128 | |
| 129 | void UMjPropertyRow::SetValue(float NewValue) |
| 130 | { |
| 131 | if (PropertyType == EMjPropertyType::Slider && PropertySlider) |
| 132 | { |
| 133 | PropertySlider->SetValue(NewValue); |
| 134 | } |
| 135 | else if (PropertyType == EMjPropertyType::Toggle && PropertyToggle) |
| 136 | { |
| 137 | PropertyToggle->SetCheckedState(NewValue > 0.5f ? ECheckBoxState::Checked : ECheckBoxState::Unchecked); |
| 138 | } |
| 139 | |
| 140 | if (ValueDisplay) |
| 141 | { |
| 142 | if (PropertyType == EMjPropertyType::Toggle) |
| 143 | { |
| 144 | ValueDisplay->SetText(FText::FromString(NewValue > 0.5f ? TEXT("ON") : TEXT("OFF"))); |
| 145 | } |
| 146 | else if (PropertyType != EMjPropertyType::Header) |
| 147 | { |
| 148 | ValueDisplay->SetText(FText::FromString(FString::Printf(TEXT("%8.3f"), NewValue))); |
| 149 | } |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | void UMjPropertyRow::HandleSliderChanged(float Value) |
| 154 | { |