Skip to content

Commit e3ff15e

Browse files
committed
Fixed a bug related to mouse based games. Apparently GameOnly swallows mouse down
1 parent 2525549 commit e3ff15e

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

Script/DemoScripts/FeatherDemoPlayerController.as

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ class AFeatherDemoPlayerPawn : APawn
2222
{
2323
if(DebugInterface.IsRootVisible())
2424
{
25-
DebugInterface.SetRootVisibility(EFeatherRootVisibility::Disabled);
25+
DebugInterface.SetRootVisibility(false);
2626
}
2727
else
2828
{
29-
DebugInterface.SetRootVisibility(EFeatherRootVisibility::EnabledWithGame);
29+
DebugInterface.SetRootVisibility(true);
3030
}
3131
}
3232
}
@@ -45,7 +45,7 @@ class AFeatherDemoPlayerPawn : APawn
4545
#if !RELEASE
4646
ensure(DebugInterfaceType.IsValid(), "Cannot find Debug Interface!");
4747
DebugInterface = Feather::CreateFeatherRoot(Cast<APlayerController>(GetController()), DebugInterfaceType);
48-
DebugInterface.SetRootVisibility(EFeatherRootVisibility::EnabledWithGame);
48+
DebugInterface.SetRootVisibility(true);
4949

5050
ScriptInputComponent.BindAction(n"ToggleDebugInterface", EInputEvent::IE_Pressed, FInputActionHandlerDynamicSignature(this, n"ToggleDebugInterface"));
5151
#endif // RELEASE

Script/Feather/DebugInterface/FeatherDebugInterfaceRoot.as

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class UFeatherDebugInterfaceRoot : UFeatherRoot
127127
UFUNCTION()
128128
void MainWindowClosed()
129129
{
130-
SetRootVisibility(EFeatherRootVisibility::Disabled);
130+
SetRootVisibility(false);
131131
}
132132

133133
UFUNCTION()
@@ -148,10 +148,10 @@ class UFeatherDebugInterfaceRoot : UFeatherRoot
148148
}
149149

150150
UFUNCTION(BlueprintOverride)
151-
void SetRootVisibility(EFeatherRootVisibility NewRootVisibility, bool bAffectMouseCursor)
151+
void SetRootVisibility(bool bNewVisibility, EFeatherInputType InputType, bool bAffectMouseCursor)
152152
{
153-
Super::SetRootVisibility(NewRootVisibility, bAffectMouseCursor);
154-
SetWindowVisibility(NewRootVisibility != EFeatherRootVisibility::Disabled);
153+
Super::SetRootVisibility(bNewVisibility, InputType, bAffectMouseCursor);
154+
SetWindowVisibility(bNewVisibility);
155155
}
156156

157157
UFUNCTION(BlueprintOverride)

Script/Feather/FeatherRoot.as

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
import Feather.FeatherConfig;
77
import Feather.FeatherWidget;
88

9-
enum EFeatherRootVisibility
9+
enum EFeatherInputType
1010
{
11-
Disabled,
12-
EnabledWithGame,
13-
EnabledUIOnly
11+
GameOnly,
12+
GameAndUI,
13+
UIOnly
1414
};
1515

1616
namespace Feather
@@ -45,22 +45,22 @@ class UFeatherRoot : UFeatherWidget
4545
}
4646

4747
UFUNCTION(Category = "Feather", BlueprintEvent, BlueprintCallable)
48-
void SetRootVisibility(EFeatherRootVisibility NewRootVisibility, bool bAffectMouseCursor = true)
48+
void SetRootVisibility(bool bNewVisibility, EFeatherInputType InputType = EFeatherInputType::GameAndUI, bool bAffectMouseCursor = true)
4949
{
5050
if(bAffectMouseCursor)
5151
{
52-
OwningPlayer.SetbShowMouseCursor(NewRootVisibility != EFeatherRootVisibility::Disabled);
52+
OwningPlayer.SetbShowMouseCursor(bNewVisibility);
5353
}
5454

55-
switch(NewRootVisibility)
55+
switch(InputType)
5656
{
57-
case EFeatherRootVisibility::EnabledWithGame:
57+
case EFeatherInputType::GameAndUI:
5858
{
5959
WidgetBlueprint::SetInputMode_GameAndUIEx(OwningPlayer, bHideCursorDuringCapture = false);
6060
break;
6161
}
6262

63-
case EFeatherRootVisibility::EnabledUIOnly:
63+
case EFeatherInputType::UIOnly:
6464
{
6565
WidgetBlueprint::SetInputMode_UIOnlyEx(OwningPlayer);
6666
break;

Script/Feather/FeatherWindow.as

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,21 @@ class UFeatherWindow : UFeatherWidget
126126
{
127127
const FVector2D NewWindowPosition = ScaledDeltaMousePosPx + CachedStartPosition;
128128
SetWindowPosition(NewWindowPosition);
129-
break;
129+
return FEventReply::Handled();
130130
}
131131
case EFeatherWindowTransformState::IsBeingResized:
132132
{
133133
const FVector2D NewWindowSize = ScaledDeltaMousePosPx + CachedStartSize;
134134
SetWindowSize(NewWindowSize);
135-
break;
135+
return FEventReply::Handled();
136136
}
137137
default:
138138
{
139139
return FEventReply::Unhandled();
140140
}
141141
}
142142

143-
return FEventReply::Handled();
143+
return FEventReply::Unhandled();
144144
}
145145

146146
UFUNCTION(BlueprintOverride)

0 commit comments

Comments
 (0)