2026-02-14 02:14:19 -05:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Common.h
|
|
|
|
|
//
|
|
|
|
|
// Simple data types used throughout the Unreal
|
|
|
|
|
// interface to Luprex: type aliases, blueprint
|
|
|
|
|
// enums for branching, and log categories.
|
|
|
|
|
//
|
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
|
2026-02-09 13:54:00 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <string_view>
|
2026-03-04 20:32:05 -05:00
|
|
|
#include "lpx-basebuffer.hpp"
|
2026-03-03 00:56:43 -05:00
|
|
|
#include "Blueprint/UserWidget.h"
|
2026-02-09 13:54:00 -05:00
|
|
|
#include "Common.generated.h"
|
|
|
|
|
|
2026-02-14 02:14:19 -05:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// LpxCommonTypes
|
2026-02-09 13:54:00 -05:00
|
|
|
//
|
2026-02-14 02:14:19 -05:00
|
|
|
// Type aliases used throughout the integration.
|
2026-02-09 13:54:00 -05:00
|
|
|
//
|
2026-02-14 02:14:19 -05:00
|
|
|
////////////////////////////////////////////////////////////
|
2026-02-09 13:54:00 -05:00
|
|
|
|
|
|
|
|
namespace LpxCommonTypes {
|
|
|
|
|
// Array of tangible IDs.
|
2026-02-14 02:14:19 -05:00
|
|
|
//
|
2026-02-09 13:54:00 -05:00
|
|
|
using IdArray = TArray<int64>;
|
|
|
|
|
|
|
|
|
|
// View of Array of tangible IDs.
|
2026-02-14 02:14:19 -05:00
|
|
|
//
|
2026-02-09 13:54:00 -05:00
|
|
|
using IdView = TArrayView<const int64>;
|
|
|
|
|
|
2026-02-14 02:14:19 -05:00
|
|
|
// Array of std::string_view.
|
|
|
|
|
//
|
2026-02-09 13:54:00 -05:00
|
|
|
using StringViewVec = TArray<std::string_view>;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-14 02:14:19 -05:00
|
|
|
////////////////////////////////////////////////////////////
|
2026-02-09 13:54:00 -05:00
|
|
|
//
|
2026-02-14 02:14:19 -05:00
|
|
|
// ElxLuaValueType
|
2026-02-09 13:54:00 -05:00
|
|
|
//
|
2026-02-14 02:14:19 -05:00
|
|
|
// Mirror of LuaValueType from base-buffer.hpp.
|
|
|
|
|
// Values must match one-for-one. Note that "token"
|
|
|
|
|
// has been renamed to "name" (synonymous).
|
|
|
|
|
//
|
|
|
|
|
////////////////////////////////////////////////////////////
|
2026-02-09 13:54:00 -05:00
|
|
|
|
|
|
|
|
UENUM(BlueprintType)
|
|
|
|
|
enum class ElxLuaValueType : uint8 {
|
|
|
|
|
End,
|
|
|
|
|
String,
|
|
|
|
|
Name,
|
|
|
|
|
Float,
|
|
|
|
|
Boolean,
|
|
|
|
|
Vector
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-04 20:32:05 -05:00
|
|
|
struct LuaValue : BaseLuaValue<std::string>
|
|
|
|
|
{
|
|
|
|
|
ElxLuaValueType GetElxType() const { return static_cast<ElxLuaValueType>(type); }
|
|
|
|
|
void SetElxType(ElxLuaValueType t) { type = static_cast<LuaValueType>(t); }
|
|
|
|
|
};
|
|
|
|
|
|
2026-02-14 02:14:19 -05:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Branching Enums
|
2026-02-09 13:54:00 -05:00
|
|
|
//
|
2026-02-14 02:14:19 -05:00
|
|
|
// Boolean-like results used with ExpandEnumAsExecs
|
|
|
|
|
// to create branching blueprint functions.
|
2026-02-09 13:54:00 -05:00
|
|
|
//
|
2026-02-14 02:14:19 -05:00
|
|
|
////////////////////////////////////////////////////////////
|
2026-02-09 13:54:00 -05:00
|
|
|
|
|
|
|
|
UENUM(BlueprintType)
|
|
|
|
|
enum class ElxSuccessOrError : uint8 {
|
|
|
|
|
Success,
|
|
|
|
|
Error,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
UENUM(BlueprintType)
|
|
|
|
|
enum class ElxValidOrNotValid : uint8 {
|
|
|
|
|
Valid,
|
|
|
|
|
NotValid,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
UENUM(BlueprintType)
|
|
|
|
|
enum class ElxFoundOrNotFound : uint8 {
|
|
|
|
|
Found,
|
|
|
|
|
NotFound,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
UENUM(BlueprintType)
|
|
|
|
|
enum class ElxUsedOrNotUsed : uint8 {
|
|
|
|
|
Used,
|
|
|
|
|
NotUsed,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
UENUM(BlueprintType)
|
|
|
|
|
enum class ElxSuccessOrWrongType : uint8 {
|
|
|
|
|
Success,
|
|
|
|
|
WrongType,
|
|
|
|
|
};
|
|
|
|
|
|
2026-02-14 03:35:08 -05:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// ElxLuaSyntaxCheck
|
|
|
|
|
//
|
|
|
|
|
// Classifies console commands syntactically:
|
|
|
|
|
//
|
|
|
|
|
// SlashCommand: starts with a slash, not lua
|
|
|
|
|
// Whitespace: the input only contains whitespace
|
|
|
|
|
// ValidLua: the input is valid lua code
|
|
|
|
|
// TruncatedLua: the input is truncated
|
|
|
|
|
// InvalidLua: invalid lua
|
|
|
|
|
//
|
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
UENUM(BlueprintType)
|
|
|
|
|
enum class ElxLuaSyntaxCheck : uint8 {
|
|
|
|
|
SlashCommand,
|
|
|
|
|
Whitespace,
|
|
|
|
|
ValidLua,
|
|
|
|
|
TruncatedLua,
|
|
|
|
|
InvalidLua,
|
|
|
|
|
};
|
|
|
|
|
|
2026-02-14 02:14:19 -05:00
|
|
|
////////////////////////////////////////////////////////////
|
2026-02-09 13:54:00 -05:00
|
|
|
//
|
2026-02-14 02:14:19 -05:00
|
|
|
// Log Categories
|
2026-02-09 13:54:00 -05:00
|
|
|
//
|
2026-02-14 02:14:19 -05:00
|
|
|
////////////////////////////////////////////////////////////
|
2026-02-09 13:54:00 -05:00
|
|
|
|
2026-02-14 02:14:19 -05:00
|
|
|
// Messages from inside the Luprex Core.
|
|
|
|
|
//
|
2026-02-09 13:54:00 -05:00
|
|
|
DECLARE_LOG_CATEGORY_EXTERN(LogLuprex, Display, All);
|
|
|
|
|
|
2026-02-14 02:14:19 -05:00
|
|
|
// Messages about the Luprex integration with Unreal.
|
|
|
|
|
//
|
2026-02-09 13:54:00 -05:00
|
|
|
DECLARE_LOG_CATEGORY_EXTERN(LogLuprexIntegration, Display, All);
|