Skip to content

Commit

Permalink
Update to doc and fix for UE 5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
sammyfreg committed May 21, 2023
1 parent 4c38d9a commit db7ba22
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 13 deletions.
4 changes: 2 additions & 2 deletions NetImgui.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 10,
"VersionName": "1.10",
"Version": 11,
"VersionName": "1.11",
"FriendlyName": "Unreal NetImgui",
"Description": "Plugin exposing Dear ImGui library for drawing 2D menus. These menus are displayed and controlled from an external application but processed from this engine code.",
"Category": "2D",
Expand Down
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<p align="center" style="font-size:30px"><b>Unreal NetImgui</b></p>
<p align="center" style="vertical-align:middle">
<img src="https://avatars3.githubusercontent.com/u/6615685?s=200&v=4" width=128 height=128>
Expand All @@ -8,7 +9,7 @@
# Summary
### Support of [NetImgui](https://github.com/sammyfreg/netImgui "NetImgui") in [Unreal Engine 4 & 5](https://github.com/EpicGames)

**UnrealNetImgui** is a plugin adding remote debug GUI interface to **Unreal Engine** using the [**Dear ImGui**](https://github.com/ocornut/imgui "Dear ImGui") paired with [**NetImgui**](https://github.com/sammyfreg/netImgui). Allows **UE** users to remotely display and control some custom GUI on the dedicated **NetImgui Server** application. This proves convenient with games running on limited inputs/display hardware, such as gaming consoles and smartphones. Also reduces the game screen clutter of debug informations contents.
**UnrealNetImgui** is a plugin adding remote debug GUI interface to **Unreal Engine** using the [**Dear ImGui**](https://github.com/ocornut/imgui "Dear ImGui") paired with [**NetImgui**](https://github.com/sammyfreg/netImgui). Allows **Unreal Engine** users to remotely display and control some custom GUI on the dedicated **NetImgui Server** application. This proves convenient with games running on limited inputs/display hardware, such as gaming consoles and smartphones. Also reduces the game screen clutter of debug informations contents.

![NetImgui](https://raw.githubusercontent.com/wiki/sammyfreg/netImgui/Web/img/UnrealNetImgui.gif)

Expand All @@ -19,6 +20,22 @@
# Fonts and Icons
The plugin comes packaged with various Latin fonts, a Japanese Mincho font, [Kenney's Gaming Icons](https://kenney.nl/assets/game-icons "gaming icons"), [Font Awesome](https://fontawesome.com "Font Awesome") (the free subset) and [Google Material Designs icons](https://github.com/google/material-design-icons "Google Material Designs icons"), for a nice selection of useful icons. The screenshot above shows a small subset of available icons. Mixing latin text, kanjis and icons is kept straightforward using utf8 strings.

# Dear ImGui extensions
Additional to the inclusion of extra fonts and icons, some Dear ImGui extension are already integrated and ready to use.
### ImPlot
From the author :
> ImPlot is an immediate mode, GPU accelerated plotting library for [Dear ImGui](https://github.com/ocornut/imgui). It aims to provide a first-class API that ImGui fans will love. ImPlot is well suited for visualizing program data in real-time or creating interactive plots, and requires minimal code to integrate. Just like ImGui, it does not burden the end user with GUI state management, avoids STL containers and C++ headers, and has no external dependencies except for ImGui itself.
>
|<img src="https://raw.githubusercontent.com/wiki/sammyfreg/netImgui/Web/img/ImPlot-pie.gif"> | <img src="https://raw.githubusercontent.com/wiki/sammyfreg/netImgui/Web/img/ImPlot-tables.gif"> | <img src="https://raw.githubusercontent.com/wiki/sammyfreg/netImgui/Web/img/ImPlot-controls.gif"> |
|---|---|---|
https://github.com/epezent/implot

### Node-Editor
From the author :
> An implementation of node editor with ImGui-like API. Project purpose is to serve as a basis for more complex solutions like blueprint editors.
<img src="https://raw.githubusercontent.com/wiki/sammyfreg/netImgui/Web/img/Node-Editor.gif" >
https://github.com/thedmd/imgui-node-editor

# Connecting to the NetImgui Server
There are mutliple ways of connecting your game to the **NetImguiServer**.

Expand Down Expand Up @@ -149,9 +166,17 @@ void AMyImGuiActor::Tick(float DeltaTime)
#endif
}
```
# Release notes 1.10
- Updated to [Dear ImGui 1.89.5](https://github.com/ocornut/imgui/releases/tag/v1.89.5) (docking branch)
- Updated to [NetImgui 1.19](https://github.com/sammyfreg/netImgui/releases/tag/v1.9.0)
- Tested on **Unreal Engine 4.27, 5.0, 5.2** *(other versions should be supported without issues)*
- Added support for [ImPlot](https://github.com/epezent/implot)
- Added support for [Node-Editor](https://github.com/thedmd/imgui-node-editor)
# Release notes 1.9
- Tested with **Unreal Engine 5**
- Updated **Font Awesome** icons (v5 -> v6)
# Release notes 1.8
- Added Japanese Font
- Added Kenney's gaming icons
Expand All @@ -169,7 +194,7 @@ void AMyImGuiActor::Tick(float DeltaTime)
- Added ***Imgui Unreal Commands*** support (browse and execute Unreal Commands)
- Upgraded to **Dear Imgui 1.83** *(docking branch)*
- Upgraded to [**NetImgui 1.5**](https://github.com/sammyfreg/netImgui/releases/tag/v1.5.0) *(more details in link)*
- Tested on **Unreal 4.26** *(other versions should be supported without issues)*
- Tested on **Unreal Engine 4.26, ** *(other versions should be supported without issues)*
- **NetImgui Server** now requires less CPU/GPU
# Credits
Expand All @@ -184,4 +209,8 @@ Various icons have been integrated to **UnrealNetImgui** existing fonts and acce
- [Kenney's Gaming Icons](https://kenney.nl/assets/game-icons "gaming icons") for his set of useful game related symbols.
- [Font Awesome](https://fontawesome.com "Font Awesome") (the free subset) for the nice selection of every day use icons.
- [Font Awesome](https://fontawesome.com "Font Awesome") (the free subset) for the nice selection of every day use icons.
**Dear ImGui Extensions**
- [ImPlot](https://github.com/epezent/implot) by [Evan Pezent](https://github.com/epezent).
- [Node-Editor](https://github.com/thedmd/imgui-node-editor) by [Michał Cichoń](https://github.com/thedmd).
7 changes: 4 additions & 3 deletions Source/NetImgui.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//-------------------------------------------------------------------------------------------------
// Plugin exposing Dear ImGui library for drawing 2D menus. These menus are displayed and
// controlled from an external application ("Plugin\UnrealNetImgui\NetImguiServer\netImguiServer.exe")
// but processed from this engine code. Works on various platform supported by UE4
// but processed from this engine code. Works on various platform supported by UE4 and UE5
//
// Note: Displaying Dear ImGui menus InGame, can be done by using the plugin UnrealImgui instead
// (https://github.com/segross/UnrealImGui). It was designed for local display of
Expand Down Expand Up @@ -42,8 +42,9 @@
// "-netimguiserver 192.168.1.2:60" Try connecting to NetImguiServer at '192.168.1.2 : 60'
//
//-------------------------------------------------------------------------------------------------
// Dear ImGui Library : v1.88 (https://github.com/ocornut/imgui)
// NetImGui Library : v1.8 (https://github.com/sammyfreg/netImgui)
// Dear ImGui Library : v1.89 docking (https://github.com/ocornut/imgui)
// NetImGui Library : v1.9 (https://github.com/sammyfreg/netImgui)
// Tested on Unreal Engine 4.27, 5.0, 5.2
//=================================================================================================

public class NetImgui : ModuleRules
Expand Down
18 changes: 13 additions & 5 deletions Source/Private/ThirdParty/NetImgui/Private/NetImgui_NetworkUE4.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
#include "NetImgui_Shared.h"

// Tested with Unreal Engine 4.27, 5.0, 5.2

#if NETIMGUI_ENABLED && defined(__UNREAL__)

#include "CoreMinimal.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Misc/OutputDeviceRedirector.h"
#include "SocketSubsystem.h"
#include "Sockets.h"
#include "HAL/PlatformProcess.h"
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2
#include "IPAddressAsyncResolve.h"
#endif

namespace NetImgui { namespace Internal { namespace Network
{
Expand Down Expand Up @@ -39,14 +46,15 @@ SocketInfo* Connect(const char* ServerHost, uint32_t ServerPort)
{
SocketInfo* pSocketInfo = nullptr;
ISocketSubsystem* SocketSubSystem = ISocketSubsystem::Get();
auto ResolveInfo = SocketSubSystem->GetHostByName(ServerHost);
while( !ResolveInfo->IsComplete() )
FPlatformProcess::Sleep(0.1);

auto ResolveInfo = SocketSubSystem->GetHostByName(ServerHost);
while( !ResolveInfo->IsComplete() ){
FPlatformProcess::YieldThread();
}

if (ResolveInfo->GetErrorCode() == 0)
{
TSharedRef<FInternetAddr> IpAddress = ResolveInfo->GetResolvedAddress().Clone();
IpAddress->SetPort(ServerPort);
IpAddress->SetPort(ServerPort);
if (IpAddress->IsValid())
{
FSocket* pNewSocket = SocketSubSystem->CreateSocket(NAME_Stream, "netImgui", IpAddress->GetProtocolType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ struct Example:
ed::Config config;
config.SettingsFile = "NodeEditorSampleNetImgui.json";
m_Context = ed::CreateEditor(&config);
ed::SetCurrentEditor(m_Context);
ed::GetStyle().FlowSpeed *= 0.5f;
ed::GetStyle().FlowDuration = 1.f;
m_ActivesPin.Init(false, 64);
ed::SetCurrentEditor(nullptr);
}

void OnStop() override
Expand Down

0 comments on commit db7ba22

Please sign in to comment.