void FStreamingLevelCollectionModel::SetStreamingLevelsClass_Executed(UClass* InClass) { // First prompt to save the selected levels, as changing the streaming method will unload/reload them SaveSelectedLevels_Executed(); // Stash off a copy of the original array, as changing the streaming method can destroy the selection FLevelModelList SelectedLevelsCopy = GetSelectedLevels(); // Apply the new streaming method to the selected levels for (auto It = SelectedLevelsCopy.CreateIterator(); It; ++It) { TSharedPtr<FStreamingLevelModel> TargetModel = StaticCastSharedPtr<FStreamingLevelModel>(*It); TargetModel->SetStreamingClass(InClass); } SetSelectedLevels(SelectedLevelsCopy); // Force a cached level list rebuild PopulateLevelsList(); }
void FLevelCollectionModel::UpdateTranslationDelta(const FLevelModelList& InLevelList, FVector2D InTranslationDelta, bool bBoundsSnapping, float InSnappingValue) { FLevelModelList EditableLevels; // Only editable levels could be moved for (auto It = InLevelList.CreateConstIterator(); It; ++It) { if ((*It)->IsEditable()) { EditableLevels.Add(*It); } } // Snap translation delta if (InTranslationDelta != FVector2D::ZeroVector) { InTranslationDelta = SnapTranslationDelta(EditableLevels, InTranslationDelta, bBoundsSnapping, InSnappingValue); } for (auto It = EditableLevels.CreateIterator(); It; ++It) { (*It)->SetLevelTranslationDelta(InTranslationDelta); } }