void UMaterialGraphSchema::GetCommentAction(FGraphActionMenuBuilder& ActionMenuBuilder, const UEdGraph* CurrentGraph) const
{
	if (!ActionMenuBuilder.FromPin)
	{
		const bool bIsManyNodesSelected = CurrentGraph ? (FMaterialEditorUtilities::GetNumberOfSelectedNodes(CurrentGraph) > 0) : false;
		const FText CommentDesc = LOCTEXT("CommentDesc", "New Comment");
		const FText MultiCommentDesc = LOCTEXT("MultiCommentDesc", "Create Comment from Selection");
		const FText CommentToolTip = LOCTEXT("CommentToolTip", "Creates a comment.");
		const FText MenuDescription = bIsManyNodesSelected ? MultiCommentDesc : CommentDesc;
		TSharedPtr<FMaterialGraphSchemaAction_NewComment> NewAction(new FMaterialGraphSchemaAction_NewComment(TEXT(""), MenuDescription.ToString(), CommentToolTip.ToString(), 0));
		ActionMenuBuilder.AddAction( NewAction );
	}
}
void UAnimGraphNode_SequencePlayer::GetMenuEntries(FGraphContextMenuBuilder& ContextMenuBuilder) const
{
	if ((ContextMenuBuilder.FromPin == NULL) || (UAnimationGraphSchema::IsPosePin(ContextMenuBuilder.FromPin->PinType) && (ContextMenuBuilder.FromPin->Direction == EGPD_Input)))
	{
		UBlueprint* Blueprint = FBlueprintEditorUtils::FindBlueprintForGraphChecked(ContextMenuBuilder.CurrentGraph);

		if (UAnimBlueprint* AnimBlueprint = Cast<UAnimBlueprint>(Blueprint))
		{
			// Load the asset registry module
			FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));

			FARFilter Filter;
			Filter.ClassNames.Add(UAnimSequence::StaticClass()->GetFName());
			Filter.bRecursiveClasses = true;

			// Filter by skeleton
			FAssetData SkeletonData(AnimBlueprint->TargetSkeleton);
			Filter.TagsAndValues.Add(TEXT("Skeleton"), SkeletonData.GetExportTextName());

			// Find matching assets and add an entry for each one
			TArray<FAssetData> SequenceList;
			AssetRegistryModule.Get().GetAssets(Filter, /*out*/ SequenceList);

			for (auto AssetIt = SequenceList.CreateConstIterator(); AssetIt; ++AssetIt)
			{
				const FAssetData& Asset = *AssetIt;

				// Try to determine if the asset is additive (can't do it right now if the asset is unloaded)
				bool bAdditive = false;
				if (Asset.IsAssetLoaded())
				{
					if (UAnimSequence* Sequence = Cast<UAnimSequence>(Asset.GetAsset()))
					{
						bAdditive = Sequence->IsValidAdditive();
					}
				}

				// Create the menu item
				const FText Title = UAnimGraphNode_SequencePlayer::GetTitleGivenAssetInfo(FText::FromName(Asset.AssetName), bAdditive);
				TSharedPtr<FNewSequencePlayerAction> NewAction(new FNewSequencePlayerAction(Asset, Title));
				ContextMenuBuilder.AddAction( NewAction );
			}
		}
	}
}
Example #3
0
void GegnerBigFish::DoKI(void)
{
	static bool IsKugel = false;

	KugelCount -= 1.0f SYNC;

	if (KugelCount <= 0.0f)
	{
		int LeftOrRight = 1;
		int Art = 2;
		KugelCount = 80.0f;

		if (Energy > 500)
			Art = 1;

		if (Energy > 1500)
			Art = 0;

		if (rand()%2 == 0)
			LeftOrRight *= -1;

		if (IsKugel)
			pGegner->PushGegner((float)pTileEngine->XOffset + 300.0f + 300 * LeftOrRight,
								(float)pTileEngine->YOffset + 200, KUGELKLEIN + Art, 5, 0, false);
		else
			pGegner->PushGegner((float)pTileEngine->XOffset + 300.0f + 320 * LeftOrRight,
								(float)pTileEngine->YOffset + 350, SWIMWALKER, 5, 0, false);
		IsKugel = !IsKugel;

	}

	// Schwimmbewegung
	SinOff += 0.2f SYNC;

	if (SinOff > 2*PI)
		SinOff = 0.0f;

	// Energie anzeigen
	if (Handlung != GEGNER_INIT && Handlung != GEGNER_EXPLODIEREN)
		pHUD->ShowBossHUD(2000, Energy);

	// Levelausschnitt auf den Boss zentrieren, sobald dieser sichtbar wird
	if (Active == true &&
		Handlung != GEGNER_EXPLODIEREN &&
		pTileEngine->Zustand == ZUSTAND_SCROLLBAR &&
		Energy > 0.0f)
	{
		pTileEngine->ScrollLevel((float)Value1,
								 (float)Value2, ZUSTAND_SCROLLTOLOCK);		// Level auf die Faust zentrieren
		pSoundManager->FadeSong(MUSIC_STAGEMUSIC, -2.0f, 0, true);  // Ausfaden und pausieren
		xPos  += 400;
	}

	// Zwischenboss blinkt nicht so lange wie die restlichen Gegner
	if (DamageTaken > 0.0f)
		DamageTaken -= 100 SYNC;				// Rotwerden langsam ausfaden lassen
	else
		DamageTaken = 0.0f;						// oder ganz anhalten

	// Schon schwer angeschlagen ? Dann blutet der Fish
	if (Energy < 1000 &&
		rand()%20 == 0)
		pPartikelSystem->PushPartikel(xPos + rand()%200+40, yPos + 50 + rand()%100, PIRANHABLUT);

	// Hat der Boss keine Energie mehr ? Dann explodiert er
	if (Energy <= 100.0f && Handlung != GEGNER_EXPLODIEREN)
	{
		// Endboss-Musik ausfaden und abschalten
		pSoundManager->FadeSong(MUSIC_BOSS, -2.0f, 0, false);

		// zum Spieler scrollen
		ScrolltoPlayeAfterBoss();

		Handlung  = GEGNER_EXPLODIEREN;
		xSpeed    = 0.0f;
		ySpeed    = 2.0f;
		xAcc      = 0.0f;
		yAcc      = 1.0f;
		AnimCount = 50.0f;

		Moving = false;
	}

	// Je nach Handlung richtig verhalten
	if (Moving == true)
		DoMove();
	else
	switch (Handlung)
	{
		case GEGNER_NOTVISIBLE:			// Warten bis der Screen zentriert wurde
		{
			if (pTileEngine->Zustand == ZUSTAND_LOCKED)
			{
				// Zwischenboss-Musik abspielen, sofern diese noch nicht gespielt wird
				if (MUSIC_IsPlaying(pSoundManager->its_Songs[MUSIC_BOSS]->SongData) == false)
					pSoundManager->PlaySong(MUSIC_BOSS, false);

				// Und Boss erscheinen lassen
				Handlung = GEGNER_EINFLIEGEN;
			}
		} break;

		case GEGNER_EINFLIEGEN:		// Gegner kommt DAS ERSTE MAL in den Screen geflogen
		{
			Energy = 2000;
			DamageTaken = 0.0f;

			NewAction();
			MoveTo((float)Value1 + 450, yPos);
		} break;

		case GEGNER_LAUFEN:
		{
			MoveTo((float)Value1 + 50 + rand()%300, (float)Value2 + 50 + rand()%200);
			ShotCount--;

			if (ShotCount <= 0)
				NewAction();
		} break;

		// einzelne Fische ausspucken
		case GEGNER_SCHIESSEN:
		{
			static bool shot = false;

			// und Maulbewegung
			MaulWinkel += 0.6f SYNC;

			if (MaulWinkel > PI &&
				shot == false)
			{
				shot = true;
				pGegner->PushGegner(xPos + 80.0f, yPos + 90.0f, PIRANHA, 99, 1, true);
				ShotCount--;
			}

			if (MaulWinkel > 2*PI)
			{
				shot = false;
				MaulWinkel = 0.0f;
				pSoundManager->PlayWave(50, 128, 6000 + rand()%500, SOUND_KLONG);

				if (ShotCount <= 0)
					NewAction();
			}

		} break;

		// mehrere Fische ausspucken
		case GEGNER_SPECIAL:
		{
			static bool shot = false;

			// und Maulbewegung
			MaulWinkel += 0.1f SYNC;

			if (MaulWinkel > PI &&
				shot == false)
			{
				shot = true;

				for (int i = 0; i < 9; i++)
					pGegner->PushGegner(xPos + 80.0f, yPos + 90.0f, PIRANHA, 98, i-4, true);

				ShotCount--;
			}

			if (MaulWinkel > 2*PI)
			{
				shot = false;
				MaulWinkel = 0.0f;
				pSoundManager->PlayWave(50, 128, 6000 + rand()%500, SOUND_KLONG);

				if (ShotCount <= 0)
					NewAction();
			}

		} break;

		// Boss fliegt in die Luft
		case GEGNER_EXPLODIEREN:
		{
			Energy = 100;
			if (yPos > Value2 + 300.0f)
				Energy = 0.0f;
		} break;

		default : break;
	} // switch

	// Testen, ob der Fisch den Spieler berührt hat
	GegnerRect[BIGFISH].left   = 60;
	GegnerRect[BIGFISH].right  = 280;
	GegnerRect[BIGFISH].top    = 28   + (int)(sin(SinOff) * 5.0f);
	GegnerRect[BIGFISH].bottom = 156 + (int)(sin(SinOff) * 5.0f);

	TestDamagePlayers(8.0f SYNC);

	// Normales Cliprect setzen
	GegnerRect[BIGFISH].left   = 0;
	GegnerRect[BIGFISH].right  = 17;
	GegnerRect[BIGFISH].top    = 28 + (int)(sin(SinOff) * 5.0f);
	GegnerRect[BIGFISH].bottom = 50 + (int)(sin(SinOff) * 5.0f);
}