add documentation and minor design changes

This commit is contained in:
Respirant
2020-12-30 15:03:47 +03:00
parent 4b231810ca
commit 643dc518b2
4 changed files with 15 additions and 27 deletions
+3 -9
View File
@@ -11,16 +11,10 @@ Runtime Files Downloader plugin for Unreal Engine. Allows you to download any fi
![Runtime Files Downloader Unreal Engine Plugin Nodes 1](image/nodesexample1.png "RuntimeFilesDownloader Unreal Engine Plugin Nodes 1")
![Runtime Files Downloader Unreal Engine Plugin Nodes 2](image/nodesexample2.png "RuntimeFilesDownloader Unreal Engine Plugin Nodes 2")
![Runtime Files Downloader Unreal Engine Plugin Nodes 3](image/nodesexample3.png "RuntimeFilesDownloader Unreal Engine Plugin Nodes 3")
## How to install
There're two ways to install the plugin:
1) [Through the marketplace (not ready yet)](https://www.unrealengine.com/marketplace/product/runtime-files-downloader).
2) Manual installation. Just extract the "RuntimeFilesDownloader" folder into your plugins project folder to get the following path: "[ProjectName]/Plugins/RuntimeFilesDownloader".
## How to use
There are two ways to use this plugin: using Blueprints and C++:
1. Blueprints. Just reopen your Unreal project and use "Create Downloader" and "Download File" nodes.
2. C++. Open your "[ProjectName].Build.cs" and find a block of ` PublicDependencyModuleNames ` or ` PrivateDependencyModuleNames ` (it depends on your needs). Add `"RuntimeFilesDownloader"` String inside this block. After just include "RuntimeFilesDownloaderBPLibrary.h" using ` #include "RuntimeFilesDownloaderBPLibrary.h" ` where needed.
## Documentation
Click on the following link to view the documentation - https://unreal.blog/runtime-files-downloader-documentation
## Legal info
@@ -33,8 +33,7 @@
"PS4",
"HTML5",
"TVOS",
"Switch",
"Unknown"
"Switch"
]
}
]
@@ -4,12 +4,11 @@
#include "RuntimeFilesDownloader.h"
URuntimeFilesDownloaderBPLibrary::URuntimeFilesDownloaderBPLibrary(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
: Super(ObjectInitializer)
{
}
URuntimeFilesDownloaderBPLibrary::URuntimeFilesDownloaderBPLibrary() :
FileUrl(TEXT(""))
, FileSavePath(TEXT(""))
@@ -20,23 +19,22 @@ URuntimeFilesDownloaderBPLibrary::~URuntimeFilesDownloaderBPLibrary()
{
}
URuntimeFilesDownloaderBPLibrary* URuntimeFilesDownloaderBPLibrary::MakeDownloader()
URuntimeFilesDownloaderBPLibrary* URuntimeFilesDownloaderBPLibrary::CreateDownloader()
{
URuntimeFilesDownloaderBPLibrary* Downloader = NewObject<URuntimeFilesDownloaderBPLibrary>();
return Downloader;
}
URuntimeFilesDownloaderBPLibrary* URuntimeFilesDownloaderBPLibrary::DownloadFile(const FString& Url, FString SavePath)
URuntimeFilesDownloaderBPLibrary* URuntimeFilesDownloaderBPLibrary::DownloadFile(const FString& URL, FString SavePath)
{
URuntimeFilesDownloaderBPLibrary* Downloader = NewObject<URuntimeFilesDownloaderBPLibrary>();
FileUrl = Url;
FileUrl = URL;
FileSavePath = SavePath;
TSharedRef< IHttpRequest, ESPMode::ThreadSafe > HttpRequest = FHttpModule::Get().CreateRequest();
HttpRequest->SetVerb("GET");
HttpRequest->SetURL(Url);
HttpRequest->SetURL(URL);
HttpRequest->OnProcessRequestComplete().BindUObject(this, &URuntimeFilesDownloaderBPLibrary::OnReady);
HttpRequest->OnRequestProgress().BindUObject(this, &URuntimeFilesDownloaderBPLibrary::OnProgress_Internal);
@@ -45,8 +43,6 @@ URuntimeFilesDownloaderBPLibrary* URuntimeFilesDownloaderBPLibrary::DownloadFile
AddToRoot();
return this;
}
void URuntimeFilesDownloaderBPLibrary::OnReady(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
@@ -61,19 +61,18 @@ public:
*
* @return The FileDownloader object. Bind to it's OnResult event to know when it's done downloading.
*/
UFUNCTION(BlueprintCallable, Meta = (DisplayName = "Create Downloader"), Category = "RuntimeFilesDownloader")
static URuntimeFilesDownloaderBPLibrary* MakeDownloader();
UFUNCTION(BlueprintCallable, Category = "RuntimeFilesDownloader")
static URuntimeFilesDownloaderBPLibrary* CreateDownloader();
/**
* Starts downloading a file and saves it when done. Bind to the OnResult
* event to know when the download is done (preferrably, before calling this function).
* Starts downloading a file and saves it when done.
*
* @param Url The file Url to be downloaded.
* @param SavePath The absolute path and file name to save the downloaded file.
* @return Returns itself.
*/
UFUNCTION(BlueprintCallable, Meta = (DisplayName = "Download File"), Category = "RuntimeFilesDownloader")
URuntimeFilesDownloaderBPLibrary* DownloadFile(const FString & Url, FString SavePath);
UFUNCTION(BlueprintCallable, Category = "RuntimeFilesDownloader")
URuntimeFilesDownloaderBPLibrary* DownloadFile(const FString & URL, FString SavePath);
private: