Add icon for Editor on Linux
This commit is contained in:
@@ -19,6 +19,9 @@
|
||||
#include "Engine/Engine/Engine.h"
|
||||
#include "Engine/ShadowsOfMordor/Builder.h"
|
||||
#include "FlaxEngine.Gen.h"
|
||||
#if PLATFORM_LINUX
|
||||
#include "Engine/Tools/TextureTool/TextureTool.h"
|
||||
#endif
|
||||
|
||||
namespace EditorImpl
|
||||
{
|
||||
@@ -480,7 +483,29 @@ int32 Editor::LoadProduct()
|
||||
|
||||
Window* Editor::CreateMainWindow()
|
||||
{
|
||||
return Managed->GetMainWindow();
|
||||
Window* window = Managed->GetMainWindow();
|
||||
|
||||
#if PLATFORM_LINUX
|
||||
// Set window icon
|
||||
const String iconPath = Globals::BinariesFolder / TEXT("Logo.png");
|
||||
if (FileSystem::FileExists(iconPath))
|
||||
{
|
||||
TextureData icon;
|
||||
if (TextureTool::ImportTexture(iconPath, icon))
|
||||
{
|
||||
LOG(Warning, "Failed to load icon file.");
|
||||
}
|
||||
else
|
||||
{
|
||||
window->SetIcon(icon);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(Warning, "Missing icon file.");
|
||||
}
|
||||
#endif
|
||||
return window;
|
||||
}
|
||||
|
||||
bool Editor::Init()
|
||||
|
||||
@@ -44,6 +44,7 @@ public class FlaxEditor : EngineTarget
|
||||
{
|
||||
base.SetupTargetEnvironment(options);
|
||||
|
||||
// Setup output folder for Editor binaries
|
||||
switch (options.Platform.Target)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
@@ -60,6 +61,7 @@ public class FlaxEditor : EngineTarget
|
||||
break;
|
||||
case TargetPlatform.Linux:
|
||||
options.OutputFolder = Path.Combine(options.WorkingDirectory, "Binaries", "Editor", "Linux", options.Configuration.ToString());
|
||||
options.DependencyFiles.Add(Path.Combine(Globals.EngineRoot, "Source", "Logo.png"));
|
||||
break;
|
||||
default: throw new InvalidPlatformException(options.Platform.Target, "Not supported Editor platform.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user