Skip to content

Commit 3d76d26

Browse files
Merge branch '5.4' into 5.5_dev
2 parents 1a97695 + 658cd5c commit 3d76d26

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

Source/MounteaDialogueSystem/Private/WBP/MounteaDialogueOption.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,15 @@ void UMounteaDialogueOption::InitializeDialogueOption_Implementation()
5252
// ...
5353
}
5454

55+
void UMounteaDialogueOption::EnableFocus_Implementation(const bool bIsWidgetEnabled)
56+
{
57+
SetIsFocusable(bIsWidgetEnabled) ;
58+
}
59+
5560
void UMounteaDialogueOption::SetFocusState_Implementation(const bool IsSelected)
5661
{
62+
if (!IsFocusable()) return;
63+
5764
DialogueOptionState = IsSelected ? EDialogueOptionState::EDOS_Focused : EDialogueOptionState::EDOS_Unfocused;
5865

5966
OnOptionFocusChanged.Broadcast(this, IsSelected);

Source/MounteaDialogueSystem/Private/WBP/MounteaDialogueOptionsContainer.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ void UMounteaDialogueOptionsContainer::NativeTick(const FGeometry& MyGeometry, f
3636
focusableWidget = dialogueOptions[LastFocusedOption];
3737
else
3838
focusableWidget = nullptr;
39-
40-
if (focusableWidget != nullptr)
41-
{
39+
40+
if (focusableWidget != nullptr && IMounteaFocusableWidgetInterface::Execute_IsFocusEnabled(focusableWidget))
4241
IMounteaFocusableWidgetInterface::Execute_SetFocusState(focusableWidget, true);
43-
}
4442
}
4543
}
4644
}

Source/MounteaDialogueSystem/Public/Interfaces/UMG/MounteaFocusableWidgetInterface.h

+8
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ class MOUNTEADIALOGUESYSTEM_API IMounteaFocusableWidgetInterface
3232
GENERATED_BODY()
3333

3434
public:
35+
36+
UFUNCTION(BlueprintNativeEvent, Category="Mountea|Dialogue|UserInterface|Focus")
37+
bool IsFocusEnabled() const;
38+
virtual bool IsFocusEnabled_Implementation() const = 0;
39+
40+
UFUNCTION(BlueprintNativeEvent, Category="Mountea|Dialogue|UserInterface|Focus")
41+
void EnableFocus(const bool bIsWidgetEnabled = true);
42+
virtual void EnableFocus_Implementation(const bool bIsWidgetEnabled = true) = 0;
3543

3644
UFUNCTION(BlueprintNativeEvent, Category="Mountea|Dialogue|UserInterface|Focus")
3745
EDialogueOptionState GetFocusState() const;

Source/MounteaDialogueSystem/Public/WBP/MounteaDialogueOption.h

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ class MOUNTEADIALOGUESYSTEM_API UMounteaDialogueOption : public UUserWidget, pub
4444

4545
public:
4646

47+
virtual bool IsFocusEnabled_Implementation() const override
48+
{return IsFocusable(); };
49+
virtual void EnableFocus_Implementation(const bool bIsWidgetEnabled = true) override;
50+
4751
virtual EDialogueOptionState GetFocusState_Implementation() const override
4852
{ return DialogueOptionState; };
4953
virtual void SetFocusState_Implementation(const bool IsSelected) override;

0 commit comments

Comments
 (0)