mirror of
https://github.com/Ed94/Cog.git
synced 2026-06-13 08:02:23 -07:00
CogEngine: Fix and improve Plot window
CogEngine: Fix and improve the Plot window - Fix ImPlot assert - Improve UI CogSample: - Add Inputs and AnimNotify plot events - Fix ability system warning
This commit is contained in:
@@ -370,8 +370,18 @@ void ACogSampleCharacter::SetupPlayerInputComponent(class UInputComponent* Playe
|
||||
int32 AbilityIndex = 0;
|
||||
for (const FActiveAbilityInfo& AbilityInfo : ActiveAbilities)
|
||||
{
|
||||
EnhancedInputComponent->BindAction(AbilityInfo.InputAction, ETriggerEvent::Started, this, &ACogSampleCharacter::OnAbilityInputStarted, AbilityIndex);
|
||||
EnhancedInputComponent->BindAction(AbilityInfo.InputAction, ETriggerEvent::Completed, this, &ACogSampleCharacter::OnAbilityInputCompleted, AbilityIndex);
|
||||
EnhancedInputComponent->BindActionValueLambda(AbilityInfo.InputAction, ETriggerEvent::Started,
|
||||
[this, &AbilityInfo, AbilityIndex](const FInputActionValue& InputActionValue)
|
||||
{
|
||||
OnAbilityInputStarted(AbilityInfo.InputAction, InputActionValue, AbilityIndex);
|
||||
});
|
||||
|
||||
EnhancedInputComponent->BindActionValueLambda(AbilityInfo.InputAction, ETriggerEvent::Completed,
|
||||
[this, &AbilityInfo, AbilityIndex](const FInputActionValue& InputActionValue)
|
||||
{
|
||||
OnAbilityInputCompleted(AbilityInfo.InputAction, InputActionValue, AbilityIndex);
|
||||
});
|
||||
|
||||
AbilityIndex++;
|
||||
}
|
||||
|
||||
@@ -385,10 +395,14 @@ void ACogSampleCharacter::SetupPlayerInputComponent(class UInputComponent* Playe
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void ACogSampleCharacter::OnAbilityInputStarted(const FInputActionValue& Value, int32 Index)
|
||||
void ACogSampleCharacter::OnAbilityInputStarted(const UInputAction* InputAction, const FInputActionValue& Value, int32 Index)
|
||||
{
|
||||
COG_LOG_OBJECT(LogCogInput, ELogVerbosity::Verbose, this, TEXT("%d"), Index);
|
||||
|
||||
#if ENABLE_COG
|
||||
FCogDebugPlot::PlotEventStart(this, "Input", InputAction->GetFName());
|
||||
#endif
|
||||
|
||||
if (ActiveAbilityHandles.IsValidIndex(Index) == false)
|
||||
{
|
||||
return;
|
||||
@@ -429,10 +443,14 @@ void ACogSampleCharacter::OnAbilityInputStarted(const FInputActionValue& Value,
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void ACogSampleCharacter::OnAbilityInputCompleted(const FInputActionValue& Value, int32 Index)
|
||||
void ACogSampleCharacter::OnAbilityInputCompleted(const UInputAction* InputAction, const FInputActionValue& Value, int32 Index)
|
||||
{
|
||||
COG_LOG_OBJECT(LogCogInput, ELogVerbosity::Verbose, this, TEXT("%d"), Index);
|
||||
|
||||
#if ENABLE_COG
|
||||
FCogDebugPlot::PlotEventStop(this, "Input", InputAction->GetFName());
|
||||
#endif
|
||||
|
||||
if (ActiveAbilityHandles.IsValidIndex(Index) == false)
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user