Code fixes for packaging

This commit is contained in:
Oleg Petruny 2024-09-30 12:48:25 +02:00
parent 77b55963fa
commit cba7ff8a6f
11 changed files with 30 additions and 18 deletions

View File

@ -62,7 +62,7 @@ InternationalizationPreset=English
-CulturesToStage=en
+CulturesToStage=en
LocalizationTargetCatchAllChunkId=0
bCookAll=True
bCookAll=False
bCookMapsOnly=False
bSkipEditorContent=True
bSkipMovies=False

Binary file not shown.

View File

@ -19,11 +19,10 @@ public:
protected:
virtual void OnRegister() override;
void Scan();
virtual void Scan_Implementation() override;
UFUNCTION(BlueprintNativeEvent, BlueprintCallable)
void NewSeenInteractable(class AInteractable* interactable);
LOST_EDGE_API void NewSeenInteractable(class AInteractable* interactable);
virtual void NewSeenInteractable_Implementation(class AInteractable* interactable);
private:

View File

@ -49,7 +49,7 @@ void UInteractableActivator::TickComponent(float DeltaTime, enum ELevelTick Tick
case ELevelTick::LEVELTICK_ViewportsOnly:
case ELevelTick::LEVELTICK_All:
USceneComponent::TickComponent(DeltaTime, TickType, ThisTickFunction);
Scan_Implementation();
Scan();
break;
default:
break;

View File

@ -21,13 +21,17 @@ public:
UInteractableActivator(const FObjectInitializer& ObjectInitializer);
virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
UFUNCTION(BlueprintNativeEvent, BlueprintCallable)
LOST_EDGE_API void Rescan();
virtual void Rescan_Implementation() {}
FInteractableActivated interactableActivatedDelegate;
FInteractableActivated interactableDeactivatedDelegate;
protected:
UFUNCTION(BlueprintNativeEvent, BlueprintCallable)
inline void Scan();
inline virtual void Scan_Implementation() PURE_VIRTUAL(UInteractableActivator::Scan_Implementation, );
LOST_EDGE_API void Scan();
virtual void Scan_Implementation() PURE_VIRTUAL(UInteractableActivator::Scan_Implementation, );
UPROPERTY(EditDefaultsOnly)
EActivatorType activatorType;

View File

@ -12,6 +12,11 @@ URaycastInteractableActivator::URaycastInteractableActivator(const FObjectInitia
activatorType = EActivatorType::Use;
}
void URaycastInteractableActivator::Rescan_Implementation()
{
_last = nullptr;
}
void URaycastInteractableActivator::Scan_Implementation()
{
FHitResult result{};
@ -48,7 +53,7 @@ void URaycastInteractableActivator::Scan_Implementation()
#ifdef INTERACTABLE_ACTIVATOR_DEBUG
DrawDebugLine(GetWorld(), startLocation, endLocation, FColor::Green, false, PrimaryComponentTick.TickInterval, 0, 0.1f);
#endif // INTERACTABLE_ACTIVATOR_DEBUG
}
}
else
{
if(_activated)
@ -64,5 +69,5 @@ void URaycastInteractableActivator::Scan_Implementation()
#ifdef INTERACTABLE_ACTIVATOR_DEBUG
DrawDebugLine(GetWorld(), startLocation, endLocation, FColor::Red, false, PrimaryComponentTick.TickInterval, 10, 0.1f);
#endif // INTERACTABLE_ACTIVATOR_DEBUG
}
}
}

View File

@ -15,8 +15,9 @@ class URaycastInteractableActivator : public UInteractableActivator
public:
URaycastInteractableActivator(const FObjectInitializer& ObjectInitializer);
virtual void Rescan_Implementation() override;
protected:
void Scan();
virtual void Scan_Implementation() override;
private:

View File

@ -12,7 +12,6 @@
#include "Kismet/GameplayStatics.h"
#include "Kismet/KismetMathLibrary.h"
#include "CustomGameInstanceBase.h"
#include "CustomGameUserSettings.h"
#include "Interactable/Activators/InteractableActivator.h"
@ -154,6 +153,9 @@ void APlayerBase::UnlockPlayer(FPlayerLock lock)
interactionLocked -= lock.interaction;
cameraLocked -= lock.camera;
inventoryLocked -= lock.inventory;
if(!interactionLocked)
ResetIntractions();
}
void APlayerBase::FlyMode(bool on)
@ -164,6 +166,8 @@ void APlayerBase::FlyMode(bool on)
void APlayerBase::ResetIntractions()
{
InteractableDeactivated(lastInteractable, static_cast<EActivatorType>(0xFF));
for(auto activator : interactableActivators)
activator->Rescan();
}
FVector APlayerBase::GetCameraDirection()
@ -267,6 +271,7 @@ void APlayerBase::LoadInteractablesActivators()
component->interactableDeactivatedDelegate.BindUObject(this, &APlayerBase::InteractableDeactivated);
component->SetupAttachment(camera);
component->RegisterComponent();
interactableActivators.Add(component);
}
}
}
@ -290,9 +295,6 @@ void APlayerBase::InteractableDeactivated(AInteractable* interactable, EActivato
if(!interactable)
return;
if(interactionLocked)
return;
interactable->_Deactivate(type);
if(interactable->GetActivatedFlags() == 0)

View File

@ -136,6 +136,7 @@ protected:
bool bIsMoving = false;
class AInteractable* lastInteractable = nullptr;
TArray<class UInteractableActivator*> interactableActivators;
UPROPERTY()
class USpringArmComponent* itemDropSpringArm;