| 286 | } |
| 287 | |
| 288 | void UMjSimulateWidget::NativeTick(const FGeometry& MyGeometry, float InDeltaTime) |
| 289 | { |
| 290 | Super::NativeTick(MyGeometry, InDeltaTime); |
| 291 | |
| 292 | if (!ManagerRef) |
| 293 | { |
| 294 | SetupDashboard(AAMjManager::GetManager()); |
| 295 | if (!ManagerRef) |
| 296 | return; |
| 297 | |
| 298 | // Start with UI hidden — user presses Tab to show |
| 299 | if (!bIsMouseEnabled) |
| 300 | { |
| 301 | if (UWidget* RootCanvas = Cast<UWidget>(GetRootWidget())) |
| 302 | { |
| 303 | RootCanvas->SetVisibility(ESlateVisibility::Hidden); |
| 304 | } |
| 305 | if (APlayerController* PC = GetOwningPlayer()) |
| 306 | { |
| 307 | PC->bShowMouseCursor = false; |
| 308 | PC->SetInputMode(FInputModeGameOnly()); |
| 309 | } |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | if (TimeText) |
| 314 | { |
| 315 | // Read active step mode from the dispatcher (if present). Surfaces |
| 316 | // live / direct / puppet in packaged builds where the editor |
| 317 | // toolbar pill (SMjStepModeIndicator) isn't visible. |
| 318 | FString ModeStr; |
| 319 | if (FURLabRpcDispatcher* Disp = ManagerRef->GetStepDispatcher()) |
| 320 | { |
| 321 | switch (Disp->GetActiveStepMode()) |
| 322 | { |
| 323 | case EStepMode::Live: |
| 324 | ModeStr = TEXT("live"); |
| 325 | break; |
| 326 | case EStepMode::Direct: |
| 327 | ModeStr = TEXT("direct"); |
| 328 | break; |
| 329 | case EStepMode::Puppet: |
| 330 | ModeStr = TEXT("puppet"); |
| 331 | break; |
| 332 | case EStepMode::Auto: |
| 333 | ModeStr = TEXT("auto"); |
| 334 | break; |
| 335 | } |
| 336 | } |
| 337 | const FString ModeSuffix = ModeStr.IsEmpty() |
| 338 | ? FString() |
| 339 | : FString::Printf(TEXT(" [%s]"), *ModeStr); |
| 340 | |
| 341 | // Show replay time if replaying, otherwise sim time |
| 342 | AMjReplayManager* ReplayMgr = Cast<AMjReplayManager>( |
| 343 | UGameplayStatics::GetActorOfClass(GetWorld(), AMjReplayManager::StaticClass())); |
| 344 | if (ReplayMgr && ReplayMgr->bIsReplaying) |
| 345 | { |
nothing calls this directly
no test coverage detected