Skip to content

Commit 9aeda95

Browse files
committed
Merge branch 'master' into feature-UE5.0
2 parents 509aa1d + b7ae842 commit 9aeda95

29 files changed

+884
-718
lines changed

BLUI.uplugin

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
{
2-
"FileVersion": 3,
3-
"FriendlyName": "BLUI",
4-
"Version": 3,
5-
"VersionName": "3.2.4",
6-
"Description": "Chromium Embedded Framework (CEF) powered HTML UI and HUD for Unreal Engine 4",
7-
"Category": "UI",
8-
"CreatedBy": "Aaron M. Shea",
9-
"CreatedByURL": "http://aaronshea.me",
10-
"DocsURL": "https://github.com/getnamo/BLUI",
11-
"EnabledByDefault" : true,
12-
"CanContainContent": "true",
13-
"Modules":
14-
[
15-
{
16-
"Name" : "BluLoader",
17-
"Type" : "Runtime",
18-
"LoadingPhase" : "PreDefault",
19-
"BlacklistPlatforms" : [ "HTML5", "Android", "iOS"]
20-
},
21-
{
22-
"Name": "Blu",
23-
"Type": "Runtime",
24-
"LoadingPhase": "PreDefault",
25-
"BlacklistPlatforms": [ "HTML5", "Android", "iOS" ]
26-
}
27-
]
2+
"FileVersion": 3,
3+
"FriendlyName": "BLUI",
4+
"Version": 3,
5+
"VersionName": "4.2.0",
6+
"Description": "Chromium Embedded Framework (CEF) powered HTML UI and HUD for Unreal Engine 4",
7+
"Category": "UI",
8+
"CreatedBy": "Aaron M. Shea, Getnamo, & Contributors",
9+
"CreatedByURL": "github.com/aaronShea",
10+
"DocsURL": "https://github.com/getnamo/BLUI",
11+
"EnabledByDefault" : true,
12+
"CanContainContent": "true",
13+
"Modules":
14+
[
15+
{
16+
"Name" : "BluLoader",
17+
"Type" : "Runtime",
18+
"LoadingPhase" : "PreDefault",
19+
"BlacklistPlatforms" : ["Android", "iOS"]
20+
},
21+
{
22+
"Name": "Blu",
23+
"Type": "Runtime",
24+
"LoadingPhase": "PreDefault",
25+
"BlacklistPlatforms": ["Android", "iOS" ]
26+
}
27+
]
2828
}

Content/BluTickActor.uasset

-24.6 KB
Binary file not shown.

Content/BluiWidget.uasset

29.3 KB
Binary file not shown.
-15.2 KB
Binary file not shown.
66.9 KB
Binary file not shown.

LICENSE

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
The MIT License (MIT)
22

33
Copyright (c) 2014 Aaron M. Shea (AaronShea)
4+
Copyright (c) 2016-present, Jan Kaniewski (Getnamo) & Contributors
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +19,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1819
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1920
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2021
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
22+
THE SOFTWARE.

README.md

+17-20
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
[![release](https://img.shields.io/github/release/getnamo/BLUI.svg?style=flat-square)](https://github.com/getnamo/BLUI/releases)
22
![BLUI-logo](https://cloud.githubusercontent.com/assets/1334174/5969395/201a1202-a7f1-11e4-98a4-12bc6793f830.png)
3+
[![Github All Releases](https://img.shields.io/github/downloads/getnamo/BLUI/total.svg)](https://github.com/getnamo/BLUI/releases)
34

45
## Getnamo Fork Notes
56

6-
Fork made to support small additions and changes for certain use cases.
7+
A fork of BLUI that is kept relatively up to date.
78

8-
To install check out the latest releases https://github.com/getnamo/BLUI/releases and drag and drop *Plugins* folder into your project root folder
9-
10-
### Download and Fullscreen Support
9+
Latest release is updated to [CEF 80.0.3987.132](https://github.com/chromiumembedded/cef/tree/3987).
1110

12-
Contains changes to allow downloading of files via the inbuilt browser.
11+
To install check out the latest releases https://github.com/getnamo/BLUI/releases and drag and drop *Plugins* folder into your project root folder
1312

14-
Updated CEF build to 3.2556 to support fullscreen videos.
13+
Unreal thread: https://forums.unrealengine.com/community/released-projects/29036-blui-open-source-html5-js-css-hud-ui
1514

1615
### Convenience Blueprints
1716

@@ -63,16 +62,21 @@ By default the actor has a BLUI resolution of 1000x1000, you can change this by
6362

6463
### BluTickActor
6564

65+
Since 4.0.0 - This actor is no longer needed. Ticking happens internally.
66+
67+
Older verions:
6668
Instead of ticking in your level bp, I prefer to use a simple actor to do the ticking. Other convenience blueprints may spawn this as necessary so if you use those, you don't ever need to use this directly.
6769

68-
## //End Fork Notes
70+
## Demo Project
71+
72+
Thanks to @oivio we have the Demo project updated to the latest release. See https://github.com/getnamo/BLUI/releases/tag/3.4.0 for the 4.22 Demo project release ([BLUI-v3.4.0-UE4.22-DemoExamples.7z](https://github.com/getnamo/BLUI/releases/download/3.4.0/BLUI-v3.4.0-UE4.22-DemoExamples.7z))
6973

70-
## HTML powered UI and HUD for Unreal Engine 4
71-
(Hit up the wiki for a quick start guide!)
74+
### Video of Demo project
7275

73-
Do you use BLUI in your project? I'd really love it if you credit me and it! You can even use the [logo right here!](https://res.cloudinary.com/aaronshea/image/upload/v1423576170/BLUI-Transparent_eu582n.png)
76+
[![Demo Project](https://img.youtube.com/vi/PRxO0yCO3Kk/0.jpg)](https://youtu.be/PRxO0yCO3Kk)
77+
78+
Click on image to take you to video.
7479

75-
License: MIT
7680

7781
What is it?
7882
---------------------------------------
@@ -97,21 +101,14 @@ Re-generate your project's Visual Studio file and load up the editor. Then check
97101

98102
Updating the CEF event loop
99103
---------------------------------------
100-
~~You must call the `BluManager::doBluMessageLoop();` method every tick in order for the CEF process to update properly. To do this, override the default GameMode's Tick function and include the `Blu/Public/BluManager.h` header file. You can then call the appropriate method.~~
101-
102-
As of now, you no longer need to do this. You can simply call a blueprint node to Tick the CEF loop every tick of the level blueprint.
104+
Some actor or level blueprint needs to call [RunBluEventLoop](https://github.com/getnamo/BLUI/blob/master/Source/Blu/Public/BluBlueprintFunctionLibrary.h#L18).
103105

104106

105107
Loading Local Files
106108
---------------------------------------
107-
Set your default URL or use the "Load URL" node/method to load a URL that starts with `blui://` this will point to the directory root of the project or the game (if packaged). So if you wanted to load an HTML file from `YourProject/UI/file.html`, set the URL to `blui://UI/file.html`
109+
Set your default URL or use the "Load URL" node/method to load a URL that starts with `blui://` (or `local://`) this will point to the directory root of the project or the game (if packaged). So if you wanted to load an HTML file from `YourProject/UI/file.html`, set the URL to `blui://UI/file.html`
108110

109111

110112
HUD Example Blueprint
111113
---------------------------------------
112114
Within the release, you'll find an ExampleHUD blueprint file, place this into your project's blueprints directory to try it out! (It's a simple UMG widget pre-configures to accept keyboard and mouse input, with a BluEye instance hooked up to a canvas)
113-
114-
115-
Shipping Your Game (Linux)
116-
---------------------------------------
117-
Copy all contents of the Linux shipping files into your packaged game's `GameName/Binaries/{Linux}`, these are the required files for the Chromium process.

Source/Blu/Blu.Build.cs

+26-29
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,33 @@ private string ThirdPartyPath
1111
get { return Path.GetFullPath(Path.Combine(ModuleDirectory, "../../ThirdParty/")); }
1212
}
1313

14-
private void stageFiles(String[] filesToStage)
14+
private void stageFiles(String[] FilesToStage)
1515
{
16-
foreach (var f in filesToStage)
16+
foreach (var File in FilesToStage)
1717
{
18-
RuntimeDependencies.Add(new RuntimeDependency(f));
18+
RuntimeDependencies.Add(File);
1919
}
2020
}
2121

2222
public Blu(ReadOnlyTargetRules Target) : base(Target)
2323
{
24-
25-
PublicDependencyModuleNames.AddRange(
26-
new string[]
27-
{
28-
"Core",
29-
"CoreUObject",
30-
"Engine",
31-
"InputCore",
32-
"RenderCore",
33-
"RHI",
34-
"Slate",
35-
"SlateCore",
36-
"UMG",
37-
"Json"
38-
});
24+
PublicDependencyModuleNames.AddRange(
25+
new string[] {
26+
"Core",
27+
"CoreUObject",
28+
"Engine",
29+
"InputCore",
30+
"RenderCore",
31+
"RHI",
32+
"Slate",
33+
"SlateCore",
34+
"UMG",
35+
"Json"
36+
});
3937

4038
PrivateIncludePaths.AddRange(
4139
new string[] {
42-
"Blu/Private",
40+
Path.Combine(ModuleDirectory, "Private"),
4341
});
4442

4543
if(Target.Platform == UnrealTargetPlatform.Win64)
@@ -61,8 +59,8 @@ public Blu(ReadOnlyTargetRules Target) : base(Target)
6159
});
6260

6361
// Add our runtime dependencies
64-
var filesToStage = Directory.GetFiles(Path.Combine(ThirdPartyPath, "cef/Win/shipping"), "*", SearchOption.AllDirectories);
65-
stageFiles(filesToStage);
62+
var FilesToStage = Directory.GetFiles(Path.Combine(ThirdPartyPath, "cef/Win/shipping"), "*", SearchOption.AllDirectories);
63+
stageFiles(FilesToStage);
6664

6765
} else if(Target.Platform == UnrealTargetPlatform.Linux)
6866
{
@@ -78,27 +76,26 @@ public Blu(ReadOnlyTargetRules Target) : base(Target)
7876
} else if(Target.Platform == UnrealTargetPlatform.Mac)
7977
{
8078

81-
var frameworkPath = Path.Combine(ThirdPartyPath, "cef/Mac/lib", "Chromium Embedded Framework.framework");
79+
var FrameworkPath = Path.Combine(ThirdPartyPath, "cef/Mac/lib", "Chromium Embedded Framework.framework");
8280

83-
PublicFrameworks.Add(frameworkPath);
81+
PublicFrameworks.Add(FrameworkPath);
8482
PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cef/Mac/lib", "libcef_dll_wrapper.a"));
8583

8684
PublicIncludePaths.AddRange(
8785
new string[] {
8886
Path.Combine(ThirdPartyPath, "cef", "Mac")
8987
});
9088

91-
var filesToStage = Directory.GetFiles(Path.Combine(ThirdPartyPath, "cef/Mac/shipping"), "*", SearchOption.AllDirectories);
92-
stageFiles(filesToStage);
89+
var FilesToStage = Directory.GetFiles(Path.Combine(ThirdPartyPath, "cef/Mac/shipping"), "*", SearchOption.AllDirectories);
90+
stageFiles(FilesToStage);
9391

94-
filesToStage = Directory.GetFiles(Path.Combine(ThirdPartyPath, "cef/Mac/lib"), "*", SearchOption.AllDirectories);
95-
stageFiles(filesToStage);
92+
FilesToStage = Directory.GetFiles(Path.Combine(ThirdPartyPath, "cef/Mac/lib"), "*", SearchOption.AllDirectories);
93+
stageFiles(FilesToStage);
9694

9795
if(!Target.bBuildEditor)
9896
{
99-
AdditionalBundleResources.Add(new UEBuildBundleResource(Path.Combine(frameworkPath, "Chromium Embedded Framework"), "MacOS", false));
97+
AdditionalBundleResources.Add(new BundleResource(Path.Combine(FrameworkPath, "Chromium Embedded Framework"), "MacOS", false));
10098
}
101-
10299
}
103100
else
104101
{

Source/Blu/Private/Blu.cpp

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#include "BluPrivatePCH.h"
1+
#include "IBlu.h"
2+
#include "BluManager.h"
23

34
class FBlu : public IBlu
45
{
@@ -10,9 +11,10 @@ class FBlu : public IBlu
1011
FString ExecutablePath = FPaths::ConvertRelativePathToFull(FPaths::ProjectDir() + "Plugins/BLUI/ThirdParty/cef/");
1112

1213
// Setup the default settings for BluManager
13-
BluManager::settings.windowless_rendering_enabled = true;
14-
BluManager::settings.no_sandbox = true;
15-
BluManager::settings.remote_debugging_port = 7777;
14+
BluManager::Settings.windowless_rendering_enabled = true;
15+
BluManager::Settings.no_sandbox = true;
16+
BluManager::Settings.remote_debugging_port = 7777;
17+
BluManager::Settings.uncaught_exception_stack_size = 5;
1618

1719
#if PLATFORM_LINUX
1820
ExecutablePath = "./blu_ue4_process";
@@ -27,24 +29,24 @@ class FBlu : public IBlu
2729
CefString realExePath = *ExecutablePath;
2830

2931
// Set the sub-process path
30-
CefString(&BluManager::settings.browser_subprocess_path).FromString(realExePath);
32+
CefString(&BluManager::Settings.browser_subprocess_path).FromString(realExePath);
3133

3234
// Set the cache path
33-
CefString(&BluManager::settings.cache_path).FromString(GameDirCef);
35+
CefString(&BluManager::Settings.cache_path).FromString(GameDirCef);
3436

3537
// Make a new manager instance
3638
CefRefPtr<BluManager> BluApp = new BluManager();
3739

3840
//CefExecuteProcess(BluManager::main_args, BluApp, NULL);
39-
CefInitialize(BluManager::main_args, BluManager::settings, BluApp, NULL);
41+
CefInitialize(BluManager::MainArgs, BluManager::Settings, BluApp, NULL);
4042

4143
UE_LOG(LogBlu, Log, TEXT(" STATUS: Loaded"));
4244
}
4345

4446
virtual void ShutdownModule() override
4547
{
4648
UE_LOG(LogBlu, Log, TEXT(" STATUS: Shutdown"));
47-
CefShutdown();
49+
//CefShutdown();
4850
}
4951

5052
};

Source/Blu/Private/BluBluprintFunctionLibrary.cpp

+26-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#include "BluPrivatePCH.h"
2-
#include "BluManager.h"
3-
#include "Json.h"
1+
#include "BluBlueprintFunctionLibrary.h"
2+
#include "BluJsonObj.h"
3+
44

55
UBluBlueprintFunctionLibrary::UBluBlueprintFunctionLibrary(const class FObjectInitializer& PCIP)
66
: Super(PCIP)
@@ -12,51 +12,61 @@ UBluEye* UBluBlueprintFunctionLibrary::NewBluEye(UObject* WorldContextObject)
1212
{
1313

1414
UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
15-
UBluEye* tempObject = Cast<UBluEye>(StaticConstructObject_Internal(UBluEye::StaticClass()));
15+
UBluEye* Eye = NewObject<UBluEye>(WorldContextObject);
1616

17-
return tempObject;
17+
return Eye;
1818

1919
}
2020

2121
UBluJsonObj* UBluBlueprintFunctionLibrary::NewBluJSONObj(UObject* WorldContextObject)
2222
{
2323

24-
UBluJsonObj* tempObj = NewObject<UBluJsonObj>(GetTransientPackage(), UBluJsonObj::StaticClass());
25-
tempObj->init("{}");
24+
UBluJsonObj* JsonObj = NewObject<UBluJsonObj>(GetTransientPackage(), UBluJsonObj::StaticClass());
25+
JsonObj->Init("{}");
2626

27-
return tempObj;
27+
return JsonObj;
2828

2929
}
3030

3131
void UBluBlueprintFunctionLibrary::RunBluEventLoop()
3232
{
33-
BluManager::doBluMessageLoop();
33+
BluManager::DoBluMessageLoop();
3434
}
3535

3636
UBluJsonObj* UBluBlueprintFunctionLibrary::ParseJSON(const FString& JSONString)
3737
{
3838

39-
UBluJsonObj* tempObj = NewObject<UBluJsonObj>(GetTransientPackage(), UBluJsonObj::StaticClass());
40-
tempObj->init(JSONString);
39+
UBluJsonObj* JsonObj = NewObject<UBluJsonObj>(GetTransientPackage(), UBluJsonObj::StaticClass());
40+
JsonObj->Init(JSONString);
4141

42-
return tempObj;
42+
return JsonObj;
4343

4444
}
4545

4646
FString UBluBlueprintFunctionLibrary::JSONToString(UBluJsonObj *ObjectToParse)
4747
{
4848

4949
// Create the JSON reader
50-
FString returnString;
51-
TSharedRef<TJsonWriter<TCHAR>> writer = TJsonWriterFactory<TCHAR>::Create(&returnString);
50+
FString ReturnString;
51+
TSharedRef<TJsonWriter<TCHAR>> writer = TJsonWriterFactory<TCHAR>::Create(&ReturnString);
5252

5353
// Convert the JSON object to an FString
54-
FJsonSerializer::Serialize(ObjectToParse->getJsonObj().ToSharedRef(), writer);
54+
FJsonSerializer::Serialize(ObjectToParse->GetJsonObj().ToSharedRef(), writer);
5555

56-
return returnString;
56+
return ReturnString;
5757

5858
}
5959

60+
FCharacterEvent UBluBlueprintFunctionLibrary::ToKeyEvent(FKey Key)
61+
{
62+
FModifierKeysState KeyState;
63+
64+
FCharacterEvent CharEvent = FCharacterEvent(Key.GetFName().ToString().ToUpper().GetCharArray()[0], KeyState, 0, 0);
65+
66+
return CharEvent;
67+
}
68+
69+
6070

6171
FString UBluBlueprintFunctionLibrary::GameRootDirectory()
6272
{

0 commit comments

Comments
 (0)