Skip to content

Commit

Permalink
Merge pull request #25 from sammyfreg/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
sammyfreg authored Jan 7, 2024
2 parents f102f79 + 906df94 commit 07f1b7f
Show file tree
Hide file tree
Showing 54 changed files with 5,807 additions and 2,930 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": 11,
"VersionName": "1.11",
"Version": 12,
"VersionName": "1.12",
"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
56 changes: 30 additions & 26 deletions NetImguiServer/netImgui.cfg
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
{
"CompressionEnable": true,
"Configs": [
{
"Auto": true,
"HostPort": 8889,
"Hostname": "localhost",
"Name": "UE Game"
},
{
"Auto": true,
"HostPort": 8890,
"Hostname": "localhost",
"Name": "UE Editor"
},
{
"Auto": true,
"HostPort": 8891,
"Hostname": "localhost",
"Name": "UE Server"
}
],
"Note": "netImgui Server's list of Clients (Using JSON format).",
"RefreshFPSActive": 30.0,
"RefreshFPSInactive": 30.0,
"ServerPort": 8888,
"Version": 2
"CompressionEnable": true,
"Configs": [
{
"Auto": true,
"DPIScaleEnabled": true,
"HostPort": 8889,
"Hostname": "localhost",
"Name": "UE Game"
},
{
"Auto": true,
"DPIScaleEnabled": true,
"HostPort": 8890,
"Hostname": "localhost",
"Name": "UE Editor"
},
{
"Auto": true,
"DPIScaleEnabled": true,
"HostPort": 8891,
"Hostname": "localhost",
"Name": "UE Server"
}
],
"DPIScaleRatio": 1.0,
"Note": "NetImgui Server's list of Clients (Using JSON format) Local File.",
"RefreshFPSActive": 30.0,
"RefreshFPSInactive": 30.0,
"ServerPort": 8888,
"Version": 3
}
Binary file modified NetImguiServer/netImguiServer.exe
Binary file not shown.
47 changes: 26 additions & 21 deletions Source/NetImgui.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,20 @@ public NetImgui(TargetInfo Target)
// define to know if this extension is active
bool bNodeEditor_Enabled = true;

//=========================================================================================
// User Configuration: Fonts
//=========================================================================================
// See 'NetImguiModule.h' for more details
// Note: Can either have IconAwesome or IconMaterialDesign enabled, not both

//---------------------------------------------------------------------
// Will load Japanese font
// Note: If not using Japanese, set this to false, saves on memory (avoids 6MB font data table source include)
bool bFontJapanese_Enabled = true;
// When true, enable the Unreal Command UI
// Allows to access to Unreal console commands remotely, with a list of possible commands
bool bUnrealCommand_Enabled = true;

//=========================================================================================
// User Configuration: Fonts
//=========================================================================================
// See 'NetImguiModule.h' for more details
// Note: Can either have IconAwesome or IconMaterialDesign enabled, not both

//---------------------------------------------------------------------
// Will load Japanese font
// Note: If not using Japanese, set this to false, saves on memory (avoids 6MB font data table source include)
bool bFontJapanese_Enabled = true;
//---------------------------------------------------------------------

// Will load the 'Kenney Game Icons' font
Expand All @@ -142,6 +146,9 @@ public NetImgui(TargetInfo Target)

// Will load 'Google Material Designs icons' font
// Contains various icons for every use
// Note: The Kenney Game icons unicode range overlap the Google Material Design
// unicode range, so some material design icons won't be usable when
// both are enabled
bool bFontIconMaterialDesign_Enabled = false;

//=========================================================================================
Expand Down Expand Up @@ -183,9 +190,10 @@ public NetImgui(TargetInfo Target)

PublicDependencyModuleNames.AddRange( new string[] { "Core", "Projects"} );
PrivateDependencyModuleNames.AddRange( new string[] { "CoreUObject", "Engine", "Sockets" } );
PrivateIncludePaths.Add("Private/ThirdParty/DearImgui");
PrivateIncludePaths.AddRange(new string[] { "Private/ThirdParty/DearImgui", "Private/ThirdParty/NetImgui" });


PCHUsage = PCHUsageMode.NoSharedPCHs; // Prevents problem with Dear ImGui/NetImgui sources not including the right first header
PCHUsage = PCHUsageMode.NoSharedPCHs; // Prevents problem with Dear ImGui/NetImgui sources not including the right first header
PrivatePCHHeaderFile = "Public/NetImguiModule.h";

bFreeType_Enabled &= bNetImgui_Enabled;
Expand All @@ -208,12 +216,13 @@ public NetImgui(TargetInfo Target)
PublicDefinitions.Add(string.Format("NETIMGUI_WAITCONNECTION_AUTO_ENABLED={0}", bAutoWaitConnection_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_FREETYPE_ENABLED={0}", bNetImgui_Enabled && bFreeType_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_IMPLOT_ENABLED={0}", bNetImgui_Enabled && bImPlot_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_NODE_EDITOR_ENABLED={0}", bNetImgui_Enabled && bNodeEditor_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_DEMO_IMGUI_ENABLED={0}", bNetImgui_Enabled && bDemoImgui_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_NODE_EDITOR_ENABLED={0}", bNetImgui_Enabled && bNodeEditor_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_DEMO_IMGUI_ENABLED={0}", bNetImgui_Enabled && bDemoImgui_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_DEMO_ACTOR_ENABLED={0}", bNetImgui_Enabled && bDemoActor_Enabled ? 1 : 0));

// Fonts support
PublicDefinitions.Add(string.Format("NETIMGUI_FONT_JAPANESE={0}", bFontJapanese_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("IM_UNREAL_COMMAND_ENABLED={0}", bNetImgui_Enabled && bUnrealCommand_Enabled ? 1 : 0));

// Fonts support
PublicDefinitions.Add(string.Format("NETIMGUI_FONT_JAPANESE={0}", bFontJapanese_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_FONT_ICON_GAMEKENNEY={0}", bFontIconGameKenney_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_FONT_ICON_AWESOME={0}", bFontIconAwesome_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_FONT_ICON_MATERIALDESIGN={0}", bFontIconMaterialDesign_Enabled && !bFontIconAwesome_Enabled ? 1 : 0));
Expand All @@ -236,10 +245,6 @@ public NetImgui(TargetInfo Target)
PublicDefinitions.Add("IMGUI_ENABLE_FREETYPE");
}

if (bNetImgui_Enabled && bImPlot_Enabled) {
PublicDefinitions.Add("IMGUI_DEFINE_MATH_OPERATORS"); // Note: Needed by ImPlot
}

PrivateDefinitions.Add(string.Format("RUNTIME_LOADER_ENABLED={0}", bEnableRuntimeLoader ? 1 : 0));
}
}
4 changes: 2 additions & 2 deletions Source/Private/ImUnrealCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "ImUnrealCommand.h"

#if IMGUI_UNREAL_COMMAND_ENABLED
#if IM_UNREAL_COMMAND_ENABLED

#include "HAL/IConsoleManager.h"
#include "Features/IModularFeatures.h"
Expand Down Expand Up @@ -657,4 +657,4 @@ bool& IsVisible(CommandContext* pCmdContext)

#undef LOCTEXT_NAMESPACE

#endif // IMGUI_UNREAL_COMMAND_ENABLED
#endif // IM_UNREAL_COMMAND_ENABLED
14 changes: 7 additions & 7 deletions Source/Private/ImUnrealCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
// @version : 0.3
// @brief : Support for 'Unreal Commands' through 'Dear ImGui UI'.
// @note : This '.h/.cpp pair' is part of the 'UnrealNetImgui' library, but can be used standalone in your own Dear ImGui Unreal integration
// @usage : Search for 'IMGUI_UNREAL_COMMAND_ENABLED' in 'https://github.com/sammyfreg/UnrealNetImgui/blob/master/Source/Private/NetImguiModule.cpp'
// @usage : Search for 'IM_UNREAL_COMMAND_ENABLED' in 'https://github.com/sammyfreg/UnrealNetImgui/blob/master/Source/Private/NetImguiModule.cpp'
// 1- Call 'Create()' once
// 2- Toggle visibility by changing 'IsVisible()' returned value
// 3- Call 'Show()' every frame
// 4- Call 'Destroy()' once, when program is closing
#pragma once

// Default value is 'Active' when nto specified
#ifndef IMGUI_UNREAL_COMMAND_ENABLED
#define IMGUI_UNREAL_COMMAND_ENABLED 1
#ifndef IM_UNREAL_COMMAND_ENABLED
#define IM_UNREAL_COMMAND_ENABLED 1
#endif

// When Dear Imgui is not detected, remove Imgui UnrealCommand support
#ifndef IMGUI_API
#undef IMGUI_UNREAL_COMMAND_ENABLED
#define IMGUI_UNREAL_COMMAND_ENABLED 0
#undef IM_UNREAL_COMMAND_ENABLED
#define IM_UNREAL_COMMAND_ENABLED 0
#endif


#if IMGUI_UNREAL_COMMAND_ENABLED
#if IM_UNREAL_COMMAND_ENABLED

#include "CoreMinimal.h"

Expand Down Expand Up @@ -55,4 +55,4 @@ namespace ImUnrealCommand
void AddPresetFilters(CommandContext* pCmdContext, const FString& presetName, const TArray<FString>& filters);
}

#endif // IMGUI_UNREAL_COMMAND_ENABLED
#endif // IM_UNREAL_COMMAND_ENABLED
Loading

0 comments on commit 07f1b7f

Please sign in to comment.