feat: move Lua scripts to Script/lua and add binary UE bundle packing
This commit is contained in:
1 parent
256a60ac80
commit
ebce41f347
41 files changed
+1545
-57
No files matched your search
@@ -0,0 +1,43 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "LuaBundle/LuaBundleArchive.h"
|
||||
|
||||
struct UNREALLUADEMOEDITOR_API FLuaBundlePackResult
|
||||
{
|
||||
bool bSuccess = false;
|
||||
int32 ScriptCount = 0;
|
||||
int32 ArchiveByteSize = 0;
|
||||
bool bEncrypted = false;
|
||||
FString OutputPath;
|
||||
FString ErrorMessage;
|
||||
};
|
||||
|
||||
/**
|
||||
* Editor-only packer that collects external Lua scripts (Script/lua and optionally
|
||||
* Plugins/UnLua/Content/Script) into a single FLuaBundleArchive and writes it to either
|
||||
* a UE DataAsset (ULuaBundleAsset) for cooked builds or a standalone binary file.
|
||||
*/
|
||||
class UNREALLUADEMOEDITOR_API FLuaBundlePacker
|
||||
{
|
||||
public:
|
||||
/** Collects all .lua source files according to ULuaScriptSettings. */
|
||||
static bool CollectLuaSources(TArray<FLuaBundleSourceItem>& OutItems, FString& OutError);
|
||||
|
||||
/** Packs external Lua scripts into the default ULuaBundleAsset configured in ULuaScriptSettings. */
|
||||
static bool PackToDefaultAsset(FLuaBundlePackResult& OutResult, TOptional<bool> bEncryptOverride = {});
|
||||
|
||||
/** Packs external Lua scripts into a specific UE asset soft object path (e.g. /Game/Generated/DA_LuaBundle.DA_LuaBundle). */
|
||||
static bool PackToAsset(const FSoftObjectPath& TargetAssetPath, FLuaBundlePackResult& OutResult, TOptional<bool> bEncryptOverride = {});
|
||||
|
||||
/** Packs external Lua scripts into a standalone binary archive file (useful for CI/hot-update pipelines). */
|
||||
static bool PackToStandaloneFile(const FString& OutputFilePath, FLuaBundlePackResult& OutResult, TOptional<bool> bEncryptOverride = {});
|
||||
|
||||
private:
|
||||
static void CollectDirectoryLuaFiles(
|
||||
const FString& RootDir,
|
||||
TMap<FString, FLuaBundleSourceItem>& InOutItemsByLowerPath,
|
||||
bool bAllowOverwrite);
|
||||
};
|
||||
Reference in new issue
Block a user