From 643dc518b227eff1b3c33e1bd40f6c0ee317edc3 Mon Sep 17 00:00:00 2001 From: Respirant Date: Wed, 30 Dec 2020 15:03:47 +0300 Subject: [PATCH] add documentation and minor design changes --- README.md | 12 +++--------- .../RuntimeFilesDownloader.uplugin | 3 +-- .../Private/RuntimeFilesDownloaderBPLibrary.cpp | 16 ++++++---------- .../Public/RuntimeFilesDownloaderBPLibrary.h | 11 +++++------ 4 files changed, 15 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 0e70257..98364ef 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/RuntimeFilesDownloader/RuntimeFilesDownloader.uplugin b/RuntimeFilesDownloader/RuntimeFilesDownloader.uplugin index f6cbd91..dc63480 100644 --- a/RuntimeFilesDownloader/RuntimeFilesDownloader.uplugin +++ b/RuntimeFilesDownloader/RuntimeFilesDownloader.uplugin @@ -33,8 +33,7 @@ "PS4", "HTML5", "TVOS", - "Switch", - "Unknown" + "Switch" ] } ] diff --git a/RuntimeFilesDownloader/Source/RuntimeFilesDownloader/Private/RuntimeFilesDownloaderBPLibrary.cpp b/RuntimeFilesDownloader/Source/RuntimeFilesDownloader/Private/RuntimeFilesDownloaderBPLibrary.cpp index d7f2ebc..798a86e 100644 --- a/RuntimeFilesDownloader/Source/RuntimeFilesDownloader/Private/RuntimeFilesDownloaderBPLibrary.cpp +++ b/RuntimeFilesDownloader/Source/RuntimeFilesDownloader/Private/RuntimeFilesDownloaderBPLibrary.cpp @@ -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(); return Downloader; } - -URuntimeFilesDownloaderBPLibrary* URuntimeFilesDownloaderBPLibrary::DownloadFile(const FString& Url, FString SavePath) +URuntimeFilesDownloaderBPLibrary* URuntimeFilesDownloaderBPLibrary::DownloadFile(const FString& URL, FString SavePath) { URuntimeFilesDownloaderBPLibrary* Downloader = NewObject(); - 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) diff --git a/RuntimeFilesDownloader/Source/RuntimeFilesDownloader/Public/RuntimeFilesDownloaderBPLibrary.h b/RuntimeFilesDownloader/Source/RuntimeFilesDownloader/Public/RuntimeFilesDownloaderBPLibrary.h index 3ae44ae..993b490 100644 --- a/RuntimeFilesDownloader/Source/RuntimeFilesDownloader/Public/RuntimeFilesDownloaderBPLibrary.h +++ b/RuntimeFilesDownloader/Source/RuntimeFilesDownloader/Public/RuntimeFilesDownloaderBPLibrary.h @@ -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: