Skip to content

Commit 093d529

Browse files
suluvaibphelan
andauthored
DX-2278: Feat/ue4 bl UI (#3)
* Set up plugin to work with BLUI in UE4 and WebBrowser in UE5 * DX-2278: Blui for UE4 intergration * Removed commenetd out code * Fix for compile errors on UE5 * DX-2298: Fixes for plugin to work with UE4.26 (#4) * feat: UE4.26 support * Temporary fix for broken game-bridge build * feat: Backported sample content to UE4.26 * feat: Switch to UAsset index for UE5 * Default load the webbrowserwidget and added warn for UE4 users to disable it * Updated readme * DX-2326: Feat/bl UI data asset (#5) * feat: Attempt to load BLUI data asset * A working solution * Now able to load the html file as an uasset. It loads in 2 parts html + js code * Removed unused debug code * Code format * Typo fix * feat: Attempt to load BLUI data asset * A working solution * Now able to load the html file as an uasset. It loads in 2 parts html + js code * Removed unused debug code * Code format * Typo fix * Update index.uasset in 4.26 for the split file * Update warning to an error * Unified asset import solution for both UE5 and UE4 * Update index.uasset in UE4.26 * docs: Explained current state of BLUI use * fix: Resolve deprecation warning * fix: Resolve deprecation warning --------- Co-authored-by: Ben <[email protected]> --------- Co-authored-by: Ben <[email protected]> * Fixed bug in import asset file format --------- Co-authored-by: Ben <[email protected]>
1 parent 8beb15a commit 093d529

27 files changed

+451
-123
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
489 KB
Binary file not shown.

Content/PassportBlueprintSample.umap

2.88 KB
Binary file not shown.

Immutable.uplugin

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
{
3232
"Name": "WebBrowserWidget",
3333
"Enabled": true
34+
},
35+
{
36+
"Name": "BLUI",
37+
"Enabled": true,
38+
"Optional": true
3439
}
3540
]
3641
}

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@
2020
### Supported Unreal Engine Versions
2121

2222
- Unreal Engine 5.0 and above
23-
24-
> [!NOTE]
25-
> Support for Unreal Engine 4.27 work is currently underway.
23+
- Unreal Engine 4.26 and above
2624

2725
### Installation
2826

2927
To install the plugin download it into your project's `Plugins` folder, e.g.: `MyGame/Plugins/unreal-immutable-sdk`.
3028

29+
> [!NOTE]
30+
> For Unreal Engine 4.26 and above we use Blui as a browser instead of inbuilt browser. Please update `immutable.uplugin->Plugins->WebBrowserWidget` to false and restart your UE4 editor.
31+
3132
### Setup
3233

3334
#### Blueprint

Source/Immutable/Immutable.Build.cs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
// Copyright Epic Games, Inc. All Rights Reserved.
22

3+
using System;
34
using UnrealBuildTool;
45

56
public class Immutable : ModuleRules
67
{
78
public Immutable(ReadOnlyTargetRules Target) : base(Target)
89
{
910
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
11+
12+
#if UE_5_1_OR_LATER
13+
IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
14+
#endif
1015

1116
PublicIncludePaths.AddRange(
1217
new string[]
@@ -28,7 +33,6 @@ public Immutable(ReadOnlyTargetRules Target) : base(Target)
2833
new string[]
2934
{
3035
"Core",
31-
"WebBrowserWidget",
3236
// ... add other public dependencies that you statically link with here ...
3337
}
3438
);
@@ -43,13 +47,22 @@ public Immutable(ReadOnlyTargetRules Target) : base(Target)
4347
"SlateCore",
4448
"Json",
4549
"JsonUtilities",
46-
"WebBrowser",
4750
"UMG",
48-
"Projects",
51+
"Projects",
4952
// ... add private dependencies that you statically link with here ...
5053
}
5154
);
52-
55+
56+
#if UE_5_0_OR_LATER
57+
PublicDependencyModuleNames.Add("WebBrowserWidget");
58+
PrivateDependencyModuleNames.Add("WebBrowser");
59+
PublicDefinitions.Add("USING_BUNDLED_CEF=1");
60+
PublicDefinitions.Add("USING_BLUI_CEF=0");
61+
#else
62+
PrivateDependencyModuleNames.Add("Blu");
63+
PublicDefinitions.Add("USING_BUNDLED_CEF=0");
64+
PublicDefinitions.Add("USING_BLUI_CEF=1");
65+
#endif
5366

5467
DynamicallyLoadedModuleNames.AddRange(
5568
new string[]

Source/Immutable/Private/Immutable/Actions/ImtblPassportInitializationAsyncAction.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
#include "Immutable/Misc/ImtblLogging.h"
99

1010

11-
UImtblPassportInitializationAsyncAction* UImtblPassportInitializationAsyncAction::InitializePassport(UObject* WorldContextObject, const FString& ClientID)
11+
UImtblPassportInitializationAsyncAction* UImtblPassportInitializationAsyncAction::InitializePassport(UObject* WorldContextObject, const FString& ClientID, const FString& RedirectUri, const FString& Environment)
1212
{
1313
UImtblPassportInitializationAsyncAction* PassportInitBlueprintNode = NewObject<UImtblPassportInitializationAsyncAction>();
1414
PassportInitBlueprintNode->ClientId = ClientID;
15+
PassportInitBlueprintNode->RedirectUri = RedirectUri;
16+
PassportInitBlueprintNode->Environment = Environment;
1517
PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
1618
return PassportInitBlueprintNode;
1719
}
@@ -28,13 +30,12 @@ void UImtblPassportInitializationAsyncAction::Activate()
2830
GetSubsystem()->WhenReady(this, &UImtblPassportInitializationAsyncAction::DoInit);//, /* timoutSec */ 15.0f);
2931
}
3032

31-
3233
void UImtblPassportInitializationAsyncAction::DoInit(TWeakObjectPtr<UImtblJSConnector> JSConnector)
3334
{
3435
// Get Passport
3536
auto Passport = GetSubsystem()->GetPassport();
3637
// Run Initialize
37-
Passport->Initialize(ClientId, UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImtblPassportInitializationAsyncAction::OnInitialized));
38+
Passport->Initialize(FImmutablePassportInitData{ClientId, RedirectUri, Environment}, UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImtblPassportInitializationAsyncAction::OnInitialized));
3839
}
3940

4041

0 commit comments

Comments
 (0)