bool UParticleModuleOrbit::IsValidForLODLevel(UParticleLODLevel* LODLevel, FString& OutErrorString) { if (LODLevel->TypeDataModule && LODLevel->TypeDataModule->IsA(UParticleModuleTypeDataGpu::StaticClass())) { if(!IsDistributionAllowedOnGPU(OffsetAmount.Distribution)) { OutErrorString = GetDistributionNotAllowedOnGPUText(StaticClass()->GetName(), "OffsetAmount" ).ToString(); return false; } if(!IsDistributionAllowedOnGPU(RotationAmount.Distribution)) { OutErrorString = GetDistributionNotAllowedOnGPUText(StaticClass()->GetName(), "RotationAmount" ).ToString(); return false; } if(!IsDistributionAllowedOnGPU(RotationRateAmount.Distribution)) { OutErrorString = GetDistributionNotAllowedOnGPUText(StaticClass()->GetName(), "RotationRateAmount" ).ToString(); return false; } } return true; }
void USkookumScriptListener::add_dynamic_function(FName callback_name, UClass * callback_owner_class_p, FNativeFuncPtr exec_p) { // Find the function UFunction * function_p = StaticClass()->FindFunctionByName(callback_name, EIncludeSuperFlag::ExcludeSuper); if (!function_p) { // Duplicate the signature function object // Find callback event object on owner class UMulticastDelegateProperty * event_property_p = CastChecked<UMulticastDelegateProperty>(callback_owner_class_p->FindPropertyByName(callback_name)); // Duplicate it FObjectDuplicationParameters dupe_parameters(event_property_p->SignatureFunction, StaticClass()); //Parameters.CreatedObjects = &DuplicatedObjectList; dupe_parameters.DestName = callback_name; function_p = Cast<UFunction>(StaticDuplicateObjectEx(dupe_parameters)); // Adjust parameters function_p->FunctionFlags |= FUNC_Public | FUNC_BlueprintCallable | FUNC_Native; function_p->SetNativeFunc(exec_p); function_p->StaticLink(true); for (TFieldIterator<UProperty> param_it(function_p); param_it; ++param_it) { // Callback parameters are always inputs (*param_it)->PropertyFlags &= ~CPF_OutParm; } // Make method known to its class function_p->Next = StaticClass()->Children; StaticClass()->Children = function_p; StaticClass()->AddFunctionToFunctionMap(function_p, function_p->GetFName()); } }
UObjectiveQuestReward* UObjectiveQuestReward::CreateObjectiveQuestReward(UQuestObjective* inObjective, UQuest* inQuestChain) { UObjectiveQuestReward* reward = NewObject<UObjectiveQuestReward>(StaticClass()); reward->SetObjective(inObjective); reward->SetQuestToGive(inQuestChain); return reward; }
UDamageSpawnTrigger* UDamageSpawnTrigger::CreateDamageSpawnTrigger(ABoss* inBoss, int inAmount, float inPercent) { UDamageSpawnTrigger* tempTrigger = NewObject<UDamageSpawnTrigger>(StaticClass()); tempTrigger->SetBoss(inBoss); tempTrigger->SetAmount(inAmount); tempTrigger->percent = inPercent; return tempTrigger; }
UImmobilise* UImmobilise::CreateAbility(float cooldown, AMech_RPGCharacter* owner, float duration) { UImmobilise* ability = NewObject<UImmobilise>(StaticClass()); ability->SetCooldown(cooldown); ability->duration = duration; ability->owner = owner; ability->AddTag(debuffTag, duration); return ability; }
UModifierTimer* UModifierTimer::CreateEffectTimer(class AMech_RPGCharacter* inTarget, float inDuration, TMap<ModifierEnums::ModifierType, float> inModifers) { UModifierTimer* timer = NewObject<UModifierTimer>(StaticClass()); timer->modifers = inModifers; timer->target = inTarget; timer->duration = inDuration; timer->Activate(); return timer; }
UDefenceBoost* UDefenceBoost::CreateAbility(float cooldown, AMech_RPGCharacter* owner, float inDefenceMultiplier) { UDefenceBoost* ability = NewObject<UDefenceBoost>(StaticClass()); ability->SetCooldown(cooldown); ability->DefenceModifier = inDefenceMultiplier; ability->owner = owner; ability->affectedTeam = AOEEnums::Ally; ability->AddTag(buffTag, inDefenceMultiplier); ability->AddTag(needsTargetTag, 0); return ability; }
UAoEHeal* UAoEHeal::CreateAbility(float cooldown, AMech_RPGCharacter* owner, float inHealAmount) { UAoEHeal* ability = NewObject<UAoEHeal>(StaticClass()); ability->SetCooldown(cooldown); ability->healAmount = inHealAmount; ability->affectedTeam = AOEEnums::Ally; ability->owner = owner; ability->AddTag(healTag, inHealAmount); ability->AddTag(aoeTag, 700); return ability; }
UCritBoost * UCritBoost::CreateCritBoost(float cooldown, AMech_RPGCharacter * owner, float inCritMultiplier) { UCritBoost* ability = NewObject<UCritBoost>(StaticClass()); ability->SetCooldown(cooldown); ability->critMultiplier = inCritMultiplier; ability->owner = owner; ability->AddTag(buffTag, inCritMultiplier); ability->AddTag(needsTargetTag, 0); return ability; }
/* Activates an ability at the end of a set duration, providing that: 1. The owner is still alive 2. The owner can cast and channelling is TRUE 3. If inUsesTrace is true and the line trace detects a viable target Note: inUsesLocation will cause this to fixate on the original location that was passed in, i.e. the cursor location. */ UChannelledAbility* UChannelledAbility::CreateChannelledAbility(AMech_RPGCharacter* inOwner, UAbility* inAbilityToActivate, float inChannelDuration, bool inUsesLocation, bool inUsesTrace) { UChannelledAbility* ability = NewObject<UChannelledAbility>(StaticClass()); ability->objectCollision.AddObjectTypesToQuery(mWorldCollision); ability->objectCollision.AddObjectTypesToQuery(mCharacterCollision); ability->owner = inOwner; ability->abilityToActivate = inAbilityToActivate; ability->channelDuration = inChannelDuration; ability->usesLocation = inUsesLocation; ability->usesTrace = inUsesTrace; return ability; }
void UK2Node_Helios::GetMenuActions(FBlueprintActionDatabaseRegistrar& ActionRegistrar) const { TArray<HeliosNodeProperties> NodeProperties = *HeliosJsonParser::getVariableNames(); FName ServerUrl = HeliosJsonParser::getServerUrl(); auto CustomizeHeliosNodeLambda = [](UEdGraphNode* NewNode, bool bIsTemplateNode, FName HeliosClass, FName ServerUrl, ERequestVerb RequestVerb, EHeliosClassType HeliosClassType) { UK2Node_Helios* HeliosNode = CastChecked<UK2Node_Helios>(NewNode); HeliosNode->Initialize(HeliosClass, ServerUrl, RequestVerb, HeliosClassType); }; // actions get registered under specific object-keys; the idea is that // actions might have to be updated (or deleted) if their object-key is // mutated (or removed)... here we use the node's class (so if the node // type disappears, then the action should go with it) UClass* ActionKey = GetClass(); // to keep from needlessly instantiating a UBlueprintNodeSpawner, first // check to make sure that the registrar is looking for actions of this type // (could be regenerating actions for a specific asset, and therefore the // registrar would only accept actions corresponding to that asset) if (ActionRegistrar.IsOpenForRegistration(ActionKey)) { auto RefreshClassActions = []() { FBlueprintActionDatabase::Get().RefreshClassActions(StaticClass()); }; static bool bRegisterOnce = true; if (bRegisterOnce) { bRegisterOnce = false; FEditorDelegates::OnActionAxisMappingsChanged.AddStatic(RefreshClassActions); } for (HeliosNodeProperties const NodeProperty : NodeProperties) { // Getter UBlueprintNodeSpawner* GetterNodeSpawner = UBlueprintNodeSpawner::Create(GetClass()); check(GetterNodeSpawner != nullptr); GetterNodeSpawner->CustomizeNodeDelegate = UBlueprintNodeSpawner::FCustomizeNodeDelegate::CreateStatic(CustomizeHeliosNodeLambda, NodeProperty.name, ServerUrl, ERequestVerb::Get, NodeProperty.type); ActionRegistrar.AddBlueprintAction(ActionKey, GetterNodeSpawner); // Setter UBlueprintNodeSpawner* SetterNodeSpawner = UBlueprintNodeSpawner::Create(GetClass()); check(SetterNodeSpawner != nullptr); SetterNodeSpawner->CustomizeNodeDelegate = UBlueprintNodeSpawner::FCustomizeNodeDelegate::CreateStatic(CustomizeHeliosNodeLambda, NodeProperty.name, ServerUrl, ERequestVerb::Post, NodeProperty.type); ActionRegistrar.AddBlueprintAction(ActionKey, SetterNodeSpawner); } } }
bool UParticleModuleSizeMultiplyLife::IsValidForLODLevel(UParticleLODLevel* LODLevel, FString& OutErrorString) { if (LODLevel->TypeDataModule && LODLevel->TypeDataModule->IsA(UParticleModuleTypeDataGpu::StaticClass())) { if(!IsDistributionAllowedOnGPU(LifeMultiplier.Distribution)) { OutErrorString = GetDistributionNotAllowedOnGPUText(StaticClass()->GetName(), "LifeMultiplier" ).ToString(); return false; } } return true; }
void USkookumScriptListener::remove_dynamic_function(FName callback_name) { // Find the function UFunction * function_p = StaticClass()->FindFunctionByName(callback_name, EIncludeSuperFlag::ExcludeSuper); if (function_p) { // Unlink it from class StaticClass()->RemoveFunctionFromFunctionMap(function_p); UField ** prev_field_pp = &StaticClass()->Children; for (UField * field_p = *prev_field_pp; field_p; prev_field_pp = &field_p->Next, field_p = *prev_field_pp) { if (field_p == function_p) { *prev_field_pp = field_p->Next; break; } } // Destroy the function along with its attached properties function_p->MarkPendingKill(); } }
bool UParticleModuleVectorFieldScale::IsValidForLODLevel(UParticleLODLevel* LODLevel, FString& OutErrorString) { if (LODLevel->TypeDataModule && LODLevel->TypeDataModule->IsA(UParticleModuleTypeDataGpu::StaticClass())) { if(!IsDistributionAllowedOnGPU(VectorFieldScale)) { OutErrorString = GetDistributionNotAllowedOnGPUText(StaticClass()->GetName(), "VectorFieldScale" ).ToString(); return false; } } return true; }
bool UParticleModuleCollisionGPU::IsValidForLODLevel(UParticleLODLevel* LODLevel, FString& OutErrorString) { UMaterialInterface* Material = NULL; if (LODLevel && LODLevel->RequiredModule) { Material = LODLevel->RequiredModule->Material; } if (Material == NULL) { Material = UMaterial::GetDefaultMaterial(MD_Surface); } check(Material); EBlendMode BlendMode = BLEND_Opaque; const FMaterialResource* MaterialResource = Material->GetMaterialResource(GetWorld() ? GetWorld()->FeatureLevel : GMaxRHIFeatureLevel); if(MaterialResource) { BlendMode = MaterialResource->GetBlendMode(); } if (CollisionMode == EParticleCollisionMode::SceneDepth && (BlendMode == BLEND_Opaque || BlendMode == BLEND_Masked)) { OutErrorString = NSLOCTEXT("UnrealEd", "CollisionOnOpaqueEmitter", "Scene depth collision cannot be used on emitters with an opaque material.").ToString(); return false; } if (CollisionMode == EParticleCollisionMode::DistanceField) { static const auto CVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.GenerateMeshDistanceFields")); if (CVar->GetValueOnGameThread() == 0) { OutErrorString = NSLOCTEXT("UnrealEd", "CollisionWithoutDistanceField", "Distance Field collision requires the 'Generate Mesh Distance Fields' Renderer project setting to be enabled.").ToString(); return false; } } if (LODLevel->TypeDataModule && LODLevel->TypeDataModule->IsA(UParticleModuleTypeDataGpu::StaticClass())) { if(!IsDistributionAllowedOnGPU(ResilienceScaleOverLife.Distribution)) { OutErrorString = GetDistributionNotAllowedOnGPUText(StaticClass()->GetName(), "ResilienceScaleOverLife" ).ToString(); return false; } } return true; }
void UK2Node_InputAction::GetMenuActions(FBlueprintActionDatabaseRegistrar& ActionRegistrar) const { TArray<FName> ActionNames; GetDefault<UInputSettings>()->GetActionNames(ActionNames); auto CustomizeInputNodeLambda = [](UEdGraphNode* NewNode, bool bIsTemplateNode, FName ActionName) { UK2Node_InputAction* InputNode = CastChecked<UK2Node_InputAction>(NewNode); InputNode->InputActionName = ActionName; }; // actions get registered under specific object-keys; the idea is that // actions might have to be updated (or deleted) if their object-key is // mutated (or removed)... here we use the node's class (so if the node // type disappears, then the action should go with it) UClass* ActionKey = GetClass(); // to keep from needlessly instantiating a UBlueprintNodeSpawner, first // check to make sure that the registrar is looking for actions of this type // (could be regenerating actions for a specific asset, and therefore the // registrar would only accept actions corresponding to that asset) if (ActionRegistrar.IsOpenForRegistration(ActionKey)) { auto RefreshClassActions = []() { FBlueprintActionDatabase::Get().RefreshClassActions(StaticClass()); }; static bool bRegisterOnce = true; if(bRegisterOnce) { bRegisterOnce = false; FEditorDelegates::OnActionAxisMappingsChanged.AddStatic(RefreshClassActions); } for (FName const ActionName : ActionNames) { UBlueprintNodeSpawner* NodeSpawner = UBlueprintNodeSpawner::Create(GetClass()); check(NodeSpawner != nullptr); NodeSpawner->CustomizeNodeDelegate = UBlueprintNodeSpawner::FCustomizeNodeDelegate::CreateStatic(CustomizeInputNodeLambda, ActionName); ActionRegistrar.AddBlueprintAction(ActionKey, NodeSpawner); } } }
bool UParticleModuleCollisionGPU::IsValidForLODLevel(UParticleLODLevel* LODLevel, FString& OutErrorString) { UMaterialInterface* Material = NULL; if (LODLevel && LODLevel->RequiredModule) { Material = LODLevel->RequiredModule->Material; } if (Material == NULL) { Material = UMaterial::GetDefaultMaterial(MD_Surface); } check(Material); EBlendMode BlendMode = BLEND_Opaque; const FMaterialResource* MaterialResource = Material->GetMaterialResource(GetWorld() ? GetWorld()->FeatureLevel : GMaxRHIFeatureLevel); if(MaterialResource) { BlendMode = MaterialResource->GetBlendMode(); } if (BlendMode == BLEND_Opaque || BlendMode == BLEND_Masked) { OutErrorString = NSLOCTEXT("UnrealEd", "CollisionOnOpaqueEmitter", "Scene depth collision cannot be used on emitters with an opaque material.").ToString(); return false; } if (LODLevel->TypeDataModule && LODLevel->TypeDataModule->IsA(UParticleModuleTypeDataGpu::StaticClass())) { if(!IsDistributionAllowedOnGPU(ResilienceScaleOverLife.Distribution)) { OutErrorString = GetDistributionNotAllowedOnGPUText(StaticClass()->GetName(), "ResilienceScaleOverLife" ).ToString(); return false; } } return true; }
UTutorialSaveGame* UTutorialSaveGame::CreateSaveInstance(){ return Cast<UTutorialSaveGame>( UGameplayStatics::CreateSaveGameObject(StaticClass()) ); }
//----------------------------------------------------------------------// // AEQSTestingPawn //----------------------------------------------------------------------// AEQSTestingPawn::AEQSTestingPawn(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) , TimeLimitPerStep(-1) , StepToDebugDraw(0) , bDrawLabels(true) , bDrawFailedItems(true) , bReRunQueryOnlyOnFinishedMove(true) , QueryingMode(EEnvQueryRunMode::AllMatching) { static FName CollisionProfileName(TEXT("NoCollision")); GetCapsuleComponent()->SetCollisionProfileName(CollisionProfileName); #if WITH_EDITORONLY_DATA EdRenderComp = CreateEditorOnlyDefaultSubobject<UEQSRenderingComponent>(TEXT("EQSRender")); if (HasAnyFlags(RF_ClassDefaultObject) == false) { UArrowComponent* ArrowComponent = FindComponentByClass<UArrowComponent>(); if (ArrowComponent != NULL) { ArrowComponent->SetRelativeScale3D(FVector(2, 2, 2)); ArrowComponent->bIsScreenSizeScaled = true; } UBillboardComponent* SpriteComponent = CreateEditorOnlyDefaultSubobject<UBillboardComponent>(TEXT("Sprite")); if (!IsRunningCommandlet() && (SpriteComponent != nullptr)) { struct FConstructorStatics { ConstructorHelpers::FObjectFinderOptional<UTexture2D> TextureObject; FName ID_Misc; FText NAME_Misc; FConstructorStatics() : TextureObject(TEXT("/Engine/EditorResources/S_Pawn")) , ID_Misc(TEXT("Misc")) , NAME_Misc(NSLOCTEXT("SpriteCategory", "Misc", "Misc")) { } }; static FConstructorStatics ConstructorStatics; SpriteComponent->Sprite = ConstructorStatics.TextureObject.Get(); SpriteComponent->RelativeScale3D = FVector(1, 1, 1); SpriteComponent->bHiddenInGame = true; //SpriteComponent->Mobility = EComponentMobility::Static; SpriteComponent->SpriteInfo.Category = ConstructorStatics.ID_Misc; SpriteComponent->SpriteInfo.DisplayName = ConstructorStatics.NAME_Misc; SpriteComponent->AttachParent = RootComponent; SpriteComponent->bIsScreenSizeScaled = true; } } #endif // WITH_EDITORONLY_DATA // Default to no tick function, but if we set 'never ticks' to false (so there is a tick function) it is enabled by default PrimaryActorTick.bCanEverTick = true; PrimaryActorTick.bStartWithTickEnabled = true; #if WITH_EDITOR if (HasAnyFlags(RF_ClassDefaultObject) && GetClass() == StaticClass()) { USelection::SelectObjectEvent.AddStatic(&AEQSTestingPawn::OnEditorSelectionChanged); } #endif // WITH_EDITOR }