ue4安装插件_ue4 软引用

ue4安装插件_ue4 软引用原创文章,转载请注明出处。本文介绍两个知识点Plugin/Module插件和模块的联系区别,同时介绍插件和我们的Source中创建多模块。**一、Plugin/Module插件和模块的联系区别**1>一个插件至少有一个模块2>一般插件都是做底层做通用设计的,而模块做的负责的我理解为逻辑ProjectName.Build.cs //主要管理的是链接,dll的链接ProjectName.Target.cs //管理的是编译,加上才会编译你的Module,如果你是run

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

原创文章,转载请注明出处。

本文介绍 两个知识点Plugin/Module 插件和模块的联系区别,同时介绍插件和我们的Source中创建多模块。

**

一、Plugin/Module 插件和模块的联系区别

**
1> 一个插件至少有一个模块
2>一般插件都是做底层做通用设计的,而模块做的负责的我理解为逻辑

ProjectName.Build.cs		//主要管理的是链接, dll的链接
ProjectName.Target.cs		//管理的是编译,加上才会编译你的Module, 如果你是runtime模块,放到这里
ProjectName.Editor.Target.cs	//管理的是编译,加上才会编译你的Module, 如果你的是editor模块,那么好,放这里

关于.Build.cs中的一些介绍

PublicDependencyModuleNames.AddRange(new string[] { 
    "Core", "CoreUObject", "Engine", "InputCore" });

PrivateDependencyModuleNames.AddRange(new string[] { 
     });
PublicDependencyModuleNames 里面的所有模块都会被引用该模块的模块所继承使用,你就理解成public
PrivateDependencyModuleNames 与上面相反了,按private理解

二、在Plugin中创建多模块以及在我们的Source中创建多模块

1>我的SelectDialog插件,放置三个模块。如下图
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
2>在你的Plugin中加上你的模块引用,如下图
在这里插入图片描述
3>加上模块中的 StartupModule和ShutdownModule可以在模块初始化和模块卸载时增加你的业务逻辑,如下图

头文件.h

// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
#include "ISlateFileDialogModuleEx.h"

class FSlateFileDialogsStyle;

class FSlateFileDialogsModule : public ISlateFileDialogsModule
{ 
   
public:

	// IModuleInterface interface

	virtual void StartupModule() override;
	virtual void ShutdownModule() override;

public:
	//ISlateFileDialogModule interface

	bool OpenFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
		const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames, int32& OutFilterIndex);

	bool OpenFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
		const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames);

	bool OpenDirectoryDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
		FString& OutFoldername);

	bool SaveFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
		const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames);

	ISlateFileDialogsModule* Get();

	FSlateFileDialogsStyle *GetFileDialogsStyle() { 
    return FileDialogStyle; }

private:
	ISlateFileDialogsModule *SlateFileDialog;

	FSlateFileDialogsStyle	*FileDialogStyle;
};

实现.cpp

// Copyright Epic Games, Inc. All Rights Reserved.

#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
#include "SlateFileDialogsEx.h"
#include "SlateFileDialogsStylesEx.h"
#include "SlateFileDlgWindowEx.h"

void FSlateFileDialogsModule::StartupModule()
{ 
   
	SlateFileDialog = new FSlateFileDialogsModule();

	FileDialogStyle = new FSlateFileDialogsStyle;
	FileDialogStyle->Initialize();
}


void FSlateFileDialogsModule::ShutdownModule()
{ 
   
	if (SlateFileDialog != NULL)
	{ 
   
		FileDialogStyle->Shutdown();
		delete FileDialogStyle;

		delete SlateFileDialog;
		SlateFileDialog = NULL;
	}
}


bool FSlateFileDialogsModule::OpenFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
		const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames, int32& OutFilterIndex)
{ 
   
	FSlateFileDlgWindow dialog(FileDialogStyle);
	return dialog.OpenFileDialog(ParentWindowHandle, DialogTitle, DefaultPath, DefaultFile, FileTypes, Flags, OutFilenames, OutFilterIndex);
}


bool FSlateFileDialogsModule::OpenFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
		const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames)
{ 
   
	FSlateFileDlgWindow dialog(FileDialogStyle);
	return dialog.OpenFileDialog(ParentWindowHandle, DialogTitle, DefaultPath, DefaultFile, FileTypes, Flags, OutFilenames);
}


bool FSlateFileDialogsModule::OpenDirectoryDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
		FString& OutFoldername)
{ 
   
	FSlateFileDlgWindow dialog(FileDialogStyle);
	return dialog.OpenDirectoryDialog(ParentWindowHandle, DialogTitle, DefaultPath, OutFoldername);
}


bool FSlateFileDialogsModule::SaveFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
	const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames)
{ 
   
	FSlateFileDlgWindow dialog(FileDialogStyle);
	return dialog.SaveFileDialog(ParentWindowHandle, DialogTitle, DefaultPath, DefaultFile, FileTypes, Flags, OutFilenames);
}


ISlateFileDialogsModule* FSlateFileDialogsModule::Get()
{ 
   
	return SlateFileDialog;
}

IMPLEMENT_MODULE(FSlateFileDialogsModule, SlateFileDialogsEx);

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/186104.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • USB协议分析仪

    USB协议分析仪USB协议分析仪

    2022年6月22日
    82
  • zencart免费模板下载

    zencart免费模板下载最近工作比较忙,没有时间专门来制作这个免费的包包模板。趁国庆放假有时间,顺便就把这个免费模板制作完了。今天特别提供出来给大家下载使用。考虑到很难满足所有有的要求,所以这个模板在一些地方基本没有修改原有模板的布局,只是简单的修改CSS。不过经过修改的这个模板也还算漂亮,大体上的布局已经设置好。我们没有那么多的时间去美化一个这样的模板,俗话说:授人鱼不如授人渔。如果有兴趣做二次开发的朋友可以继续修

    2022年7月27日
    5
  • STM8S之STVD问题解决47 can’t openfile crtsi0.sm8「建议收藏」

    STM8S之STVD问题解决47 can’t openfile crtsi0.sm8「建议收藏」用STVD+COSMIC编译工程时出现以下错误(加载的别人的工程):#errorclnkDebug\demo.lkf:47can’topenfilecrtsi0.sm8#errorclnkDebug\demo.lkf:60can’topenfilelibis0.sm8#errorclnkDebug\demo.lkf:61can’topenfilelibm0.sm…

    2022年9月23日
    3
  • bool数组初始化

    bool数组初始化输入memset(boolArray,0,sizeof(Array));头文件是#include;如果初始化为全部false,c++有一个零初始化器(zero-initializer)boolboolArray[ARRAY_SIZE]={0};这个零初始化器是通用的,其他类型的数组也可以通过这个初始化;charmyarray[ARRAY_SIZE]=

    2022年7月18日
    13
  • myBatis源码学习之SqlSessionFactory

    myBatis源码学习之SqlSessionFactory/***Createsan{@linkSqlSesion}outofaconnectionoraDataSource**@authorClintonBegin*///SqlSessionFactory接口,通过openSession方法获得SQLSessionpublicinterfaceSqlSessionFactory{SqlS

    2022年5月11日
    36
  • Python玫瑰花绘制「建议收藏」

    Python玫瑰花绘制「建议收藏」刚开始学Python,画个玫瑰花练练手,正好今天也是情人节我自认为还是挺好看的,感觉比我搜到的那几个画出来的强代码如下importturtleastt.setup(1100,1000)t.hideturtle()t.speed(11)t.penup()t.goto(50,-450)t.pensize(5)t.pencolor("black")t.seth(140)t…

    2022年4月18日
    85

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号