//////////////////////////////////////////////////////////// // // Common.h // // Simple data types used throughout the Unreal // interface to Luprex: type aliases, blueprint // enums for branching, and log categories. // //////////////////////////////////////////////////////////// #pragma once #include #include "lpx-basebuffer.hpp" #include "Blueprint/UserWidget.h" #include "Common.generated.h" //////////////////////////////////////////////////////////// // // LpxCommonTypes // // Type aliases used throughout the integration. // //////////////////////////////////////////////////////////// namespace LpxCommonTypes { // Array of tangible IDs. // using IdArray = TArray; // View of Array of tangible IDs. // using IdView = TArrayView; // Array of std::string_view. // using StringViewVec = TArray; } //////////////////////////////////////////////////////////// // // ElxLuaValueType // // Mirror of LuaValueType from base-buffer.hpp. // Values must match one-for-one. Note that "token" // has been renamed to "name" (synonymous). // //////////////////////////////////////////////////////////// UENUM(BlueprintType) enum class ElxLuaValueType : uint8 { End, String, Name, Float, Boolean, Vector }; struct LuaValue : BaseLuaValue { ElxLuaValueType GetElxType() const { return static_cast(type); } void SetElxType(ElxLuaValueType t) { type = static_cast(t); } }; //////////////////////////////////////////////////////////// // // Branching Enums // // Boolean-like results used with ExpandEnumAsExecs // to create branching blueprint functions. // //////////////////////////////////////////////////////////// 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, }; //////////////////////////////////////////////////////////// // // 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, }; //////////////////////////////////////////////////////////// // // Log Categories // //////////////////////////////////////////////////////////// // Messages from inside the Luprex Core. // DECLARE_LOG_CATEGORY_EXTERN(LogLuprex, Display, All); // Messages about the Luprex integration with Unreal. // DECLARE_LOG_CATEGORY_EXTERN(LogLuprexIntegration, Display, All);