static TSharedRef<FExtender> OnExtendLevelEditorMenu(const TSharedRef<FUICommandList> CommandList, TArray<AActor*> SelectedActors) { TSharedRef<FExtender> Extender(new FExtender()); // Run through the actors to determine if any meet our criteria bool bCanAssignLODGroup = false; for (AActor* Actor : SelectedActors) { TInlineComponentArray<UActorComponent*> ActorComponents; Actor->GetComponents(ActorComponents); for (UActorComponent* Component : ActorComponents) { if (Component->IsA(UStaticMeshComponent::StaticClass())) { bCanAssignLODGroup = true; } } } if (bCanAssignLODGroup) { // Add the sprite actions sub-menu extender Extender->AddMenuExtension( "ActorType", EExtensionHook::Before, nullptr, FMenuExtensionDelegate::CreateStatic(&FSimplygonLevelEditorMenuExtensions_Impl::CreateLODGroupActionsMenuEntries)); } return Extender; }
/** Insere um novo elemento na fila. Para uma fila criada * a função irá inserir o elemento passado * considerando a ocupação da fila. o retorno indica se a * operação foi realizada com sucesso. * * Pré-cond: fila criada, e elemento a ser inserido. * * Pós-Cond: elemento inserido na fila, se houver espaço. */ static short Enfileirar(TFila *f, int elemento) { short status = 1; // verdade (vai dar tudo certo) TDado *d = (TDado *)f->dado; if (d->cont == d->tam) { Extender(f); } d->ultimo = (d->ultimo + 1) % d->tam; d->fila[d->ultimo] = elemento; d->cont += status; return status; }
TSharedRef<FExtender> FGameplayDebugger::OnExtendLevelEditorViewMenu(const TSharedRef<FUICommandList> CommandList) { #if !(UE_BUILD_SHIPPING || UE_BUILD_TEST) && WITH_EDITOR TSharedRef<FExtender> Extender(new FExtender()); if (GEditor && GEditor->bIsSimulatingInEditor) { Extender->AddMenuExtension( "LevelViewportLayouts", EExtensionHook::After, NULL, FMenuExtensionDelegate::CreateRaw(this, &FGameplayDebugger::CreateSnappingOptionsMenu)); } #endif return Extender; }
TSharedRef<FExtender> FIntroTutorials::AddSummonBlueprintTutorialsMenuExtender(const TSharedRef<FUICommandList> CommandList, const TArray<UObject*> EditingObjects) const { UObject* PrimaryObject = nullptr; if(EditingObjects.Num() > 0) { PrimaryObject = EditingObjects[0]; } TSharedRef<FExtender> Extender(new FExtender()); Extender->AddMenuExtension( "HelpBrowse", EExtensionHook::After, CommandList, FMenuExtensionDelegate::CreateRaw(this, &FIntroTutorials::AddSummonBlueprintTutorialsMenuExtension, PrimaryObject)); return Extender; }
static TSharedRef<FExtender> OnExtendContentBrowserAssetSelectionMenu(const TArray<FAssetData>& SelectedAssets) { TSharedRef<FExtender> Extender(new FExtender()); // Run through the assets to determine if any meet our criteria bool bAnyStaticMesh = false; for (auto AssetIt = SelectedAssets.CreateConstIterator(); AssetIt; ++AssetIt) { const FAssetData& Asset = *AssetIt; bAnyStaticMesh = bAnyStaticMesh || (Asset.AssetClass == UStaticMesh::StaticClass()->GetFName()); } if (bAnyStaticMesh) { // Add the sprite actions sub-menu extender Extender->AddMenuExtension( "GetAssetActions", EExtensionHook::After, nullptr, FMenuExtensionDelegate::CreateStatic(&FSimplygonGUIContentBrowserExtensions_Impl::CreateLODGroupActionsSubMenu, SelectedAssets)); } return Extender; }