本文整理汇总了C++中FLevelModelList::Add方法的典型用法代码示例。如果您正苦于以下问题:C++ FLevelModelList::Add方法的具体用法?C++ FLevelModelList::Add怎么用?C++ FLevelModelList::Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FLevelModelList
的用法示例。
在下文中一共展示了FLevelModelList::Add方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeLevelCurrent
void FLevelModel::MakeLevelCurrent()
{
if (LevelCollectionModel.IsReadOnly())
{
return;
}
if (!IsLoaded())
{
// Load level from disk
FLevelModelList LevelsList; LevelsList.Add(this->AsShared());
LevelCollectionModel.LoadLevels(LevelsList);
}
ULevel* Level = GetLevelObject();
if (Level == NULL)
{
return;
}
// Locked levels can't be made current.
if (!FLevelUtils::IsLevelLocked(Level))
{
// Make current.
if (LevelCollectionModel.GetWorld()->SetCurrentLevel(Level))
{
FEditorDelegates::NewCurrentLevel.Broadcast();
// Deselect all selected builder brushes.
bool bDeselectedSomething = false;
for (FSelectionIterator It(Editor->GetSelectedActorIterator()); It; ++It)
{
AActor* Actor = static_cast<AActor*>(*It);
checkSlow(Actor->IsA(AActor::StaticClass()));
ABrush* Brush = Cast< ABrush >( Actor );
if (Brush && FActorEditorUtils::IsABuilderBrush(Brush))
{
Editor->SelectActor(Actor, /*bInSelected=*/ false, /*bNotify=*/ false);
bDeselectedSomething = true;
}
}
// Send a selection change callback if necessary.
if (bDeselectedSomething)
{
Editor->NoteSelectionChange();
}
}
// Force the current level to be visible.
SetVisible(true);
}
else
{
FMessageDialog::Open(EAppMsgType::Ok, NSLOCTEXT("UnrealEd", "Error_OperationDisallowedOnLockedLevelMakeLevelCurrent", "MakeLevelCurrent: The requested operation could not be completed because the level is locked."));
}
Update();
}
示例2: OnSave
FReply SWorldHierarchyItem::OnSave()
{
FLevelModelList LevelList;
LevelList.Add(LevelModel);
WorldModel->SaveLevels(LevelList);
return FReply::Handled();
}
示例3: GetLoadedLevels
FLevelModelList FLevelCollectionModel::GetLoadedLevels(const FLevelModelList& InList)
{
FLevelModelList ResultList;
for (auto It = InList.CreateConstIterator(); It; ++It)
{
if ((*It)->IsLoaded())
{
ResultList.Add(*It);
}
}
return ResultList;
}
示例4: InvertSelection_Executed
void FLevelCollectionModel::InvertSelection_Executed()
{
FLevelModelList InvertedLevels;
for (auto It = FilteredLevelsList.CreateIterator(); It; ++It)
{
if (!SelectedLevelsList.Contains(*It))
{
InvertedLevels.Add(*It);
}
}
SetSelectedLevels(InvertedLevels);
}
示例5: SetSelectedLevelsFromWorld
void FLevelCollectionModel::SetSelectedLevelsFromWorld()
{
TArray<ULevel*>& SelectedLevelObjects = CurrentWorld->GetSelectedLevels();
FLevelModelList LevelsToSelect;
for (ULevel* LevelObject : SelectedLevelObjects)
{
TSharedPtr<FLevelModel> LevelModel = FindLevelModel(LevelObject);
if (LevelModel.IsValid())
{
LevelsToSelect.Add(LevelModel);
}
}
SetSelectedLevels(LevelsToSelect);
}
示例6: OnToggleLock
FReply SWorldHierarchyItem::OnToggleLock()
{
FLevelModelList LevelList;
LevelList.Add(LevelModel);
if (LevelModel->IsLocked())
{
WorldModel->UnlockLevels(LevelList);
}
else
{
WorldModel->LockLevels(LevelList);
}
return FReply::Handled();
}
示例7: OnToggleVisibility
FReply SWorldHierarchyItem::OnToggleVisibility()
{
FLevelModelList LevelList;
LevelList.Add(LevelModel);
if (LevelModel->IsVisible())
{
WorldModel->HideLevels(LevelList);
}
else
{
WorldModel->ShowLevels(LevelList);
}
return FReply::Handled();
}
示例8: OnDrop
void FWorldTileModel::OnDrop(const TSharedPtr<FLevelDragDropOp>& Op)
{
FLevelModelList LevelModelList;
for (auto It = Op->LevelsToDrop.CreateConstIterator(); It; ++It)
{
ULevel* Level = (*It).Get();
TSharedPtr<FLevelModel> LevelModel = LevelCollectionModel.FindLevelModel(Level);
if (LevelModel.IsValid())
{
LevelModelList.Add(LevelModel);
}
}
if (LevelModelList.Num())
{
LevelCollectionModel.AssignParent(LevelModelList, this->AsShared());
}
}
示例9: OnParentPackageNamePropertyChanged
void FWorldTileModel::OnParentPackageNamePropertyChanged()
{
if (GetLevelObject() && !TileDetails->bAlwaysLoaded)
{
TSharedPtr<FLevelModel> NewParent = LevelCollectionModel.FindLevelModel(TileDetails->ParentPackageName);
// Assign to a root level if new parent is not found
if (!NewParent.IsValid())
{
NewParent = static_cast<FWorldTileCollectionModel&>(LevelCollectionModel).GetWorldRootModel();
}
FLevelModelList LevelList; LevelList.Add(this->AsShared());
LevelCollectionModel.AssignParent(LevelList, NewParent);
return;
}
// Restore original parent
FWorldTileInfo Info = LevelCollectionModel.GetWorld()->WorldComposition->GetTileInfo(TileDetails->PackageName);
TileDetails->ParentPackageName = FName(*Info.ParentTilePackageName);
}
示例10: OnPositionPropertyChanged
void FWorldTileModel::OnPositionPropertyChanged()
{
FWorldTileInfo Info = LevelCollectionModel.GetWorld()->WorldComposition->GetTileInfo(TileDetails->PackageName);
if (GetLevelObject())
{
// Get the delta
FIntPoint Delta = TileDetails->Position - Info.Position;
// Snap the delta
FLevelModelList LevelsList; LevelsList.Add(this->AsShared());
FVector2D SnappedDelta = LevelCollectionModel.SnapTranslationDelta(LevelsList, FVector2D(Delta), 0.f);
// Set new level position
SetLevelPosition(Info.AbsolutePosition + FIntPoint(SnappedDelta.X, SnappedDelta.Y));
return;
}
// Restore original value
TileDetails->Position = Info.Position;
}
示例11: UpdateTranslationDelta
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);
}
}
示例12: SaveLevels
void FLevelCollectionModel::SaveLevels(const FLevelModelList& InLevelList)
{
if (IsReadOnly())
{
return;
}
FLevelModelList LevelModelsToSave;
TArray<ULevel*> LevelsToSave;
for (auto It = InLevelList.CreateConstIterator(); It; ++It)
{
if ((*It)->GetLevelObject())
{
if (!(*It)->IsVisible())
{
FMessageDialog::Open( EAppMsgType::Ok, NSLOCTEXT("UnrealEd", "UnableToSaveInvisibleLevels", "Save aborted. Levels must be made visible before they can be saved.") );
return;
}
else if ((*It)->IsLocked())
{
FMessageDialog::Open( EAppMsgType::Ok, NSLOCTEXT("UnrealEd", "UnableToSaveLockedLevels", "Save aborted. Level must be unlocked before it can be saved.") );
return;
}
LevelModelsToSave.Add(*It);
LevelsToSave.Add((*It)->GetLevelObject());
}
}
TArray< UPackage* > PackagesNotNeedingCheckout;
// Prompt the user to check out the levels from source control before saving
if (FEditorFileUtils::PromptToCheckoutLevels(false, LevelsToSave, &PackagesNotNeedingCheckout))
{
for (auto It = LevelsToSave.CreateIterator(); It; ++It)
{
FEditorFileUtils::SaveLevel(*It);
}
}
else if (PackagesNotNeedingCheckout.Num() > 0)
{
// The user canceled the checkout dialog but some packages didn't need to be checked out in order to save
// For each selected level if the package its in didn't need to be saved, save the level!
for (int32 LevelIdx = 0; LevelIdx < LevelsToSave.Num(); ++LevelIdx)
{
ULevel* Level = LevelsToSave[LevelIdx];
if (PackagesNotNeedingCheckout.Contains(Level->GetOutermost()))
{
FEditorFileUtils::SaveLevel(Level);
}
else
{
//remove it from the list, so that only successfully saved levels are highlighted when saving is complete
LevelModelsToSave.RemoveAt(LevelIdx);
LevelsToSave.RemoveAt(LevelIdx);
}
}
}
// Select tiles that were saved successfully
SetSelectedLevels(LevelModelsToSave);
}