Fix mouse input handling

This commit is contained in:
Oleg Petruny 2024-09-30 08:41:34 +02:00
parent 4c98117a4c
commit 77b55963fa
37 changed files with 48 additions and 24 deletions

Binary file not shown.

BIN
Content/Blueprints/BP_PlayerController.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Input/Actions/IA_OpenMenu.uasset (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Levels/Level_4/L_Level4.umap (Stored with Git LFS)

Binary file not shown.

View File

@ -156,6 +156,9 @@ void UCutsceneManager::OnSequenceEnd()
_lastPlayer = nullptr;
}
_lastlySkipped = false;
_holding = false;
}
void UCutsceneManager::OnInputHold()

View File

@ -3,6 +3,9 @@
#include "FishingManager.h"
#include "EnhancedInputComponent.h"
#include "InputMappingContext.h"
#include "MainGameModeBase.h"
#include "PlayerBase.h"
@ -20,10 +23,17 @@ void AFishingManager::Start(APlayerBase* playerPawn, FMinigameEndCallback delega
AMinigame::Start(playerPawn, delegate);
player->LockPlayer(FPlayerLock::All());
auto& mapping = input.LoadSynchronous()->GetMapping(0);
handler1 = player->inputComponent->BindAction(mapping.Action, ETriggerEvent::Started, this, &AFishingManager::OnInputHold).GetHandle();
handler2 = player->inputComponent->BindAction(mapping.Action, ETriggerEvent::Completed, this, &AFishingManager::OnInputUnhold).GetHandle();
}
void AFishingManager::End()
{
player->inputComponent->RemoveBindingByHandle(handler1);
player->inputComponent->RemoveBindingByHandle(handler2);
player->UnlockPlayer(FPlayerLock::All());
AMinigame::End();

View File

@ -43,4 +43,12 @@ public:
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
void CatchFailed();
protected:
UFUNCTION(BlueprintImplementableEvent)
void OnInputHold();
UFUNCTION(BlueprintImplementableEvent)
void OnInputUnhold();
int32 handler1, handler2;
};