Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cowboy-69 committed Sep 4, 2024
1 parent 5f62ce5 commit d2445f4
Show file tree
Hide file tree
Showing 6 changed files with 453 additions and 0 deletions.
31 changes: 31 additions & 0 deletions FileSystemRedux.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.10.35027.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FileSystemRedux", "FileSystemRedux.vcxproj", "{3B3F7ECE-2452-4B2E-B042-CD5324433A3B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3B3F7ECE-2452-4B2E-B042-CD5324433A3B}.Debug|x64.ActiveCfg = Debug|x64
{3B3F7ECE-2452-4B2E-B042-CD5324433A3B}.Debug|x64.Build.0 = Debug|x64
{3B3F7ECE-2452-4B2E-B042-CD5324433A3B}.Debug|x86.ActiveCfg = Debug|Win32
{3B3F7ECE-2452-4B2E-B042-CD5324433A3B}.Debug|x86.Build.0 = Debug|Win32
{3B3F7ECE-2452-4B2E-B042-CD5324433A3B}.Release|x64.ActiveCfg = Release|x64
{3B3F7ECE-2452-4B2E-B042-CD5324433A3B}.Release|x64.Build.0 = Release|x64
{3B3F7ECE-2452-4B2E-B042-CD5324433A3B}.Release|x86.ActiveCfg = Release|Win32
{3B3F7ECE-2452-4B2E-B042-CD5324433A3B}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EA7FDCCB-456A-4B0C-94DF-76E1A5C5D01F}
EndGlobalSection
EndGlobal
162 changes: 162 additions & 0 deletions FileSystemRedux.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{3b3f7ece-2452-4b2e-b042-cd5324433a3b}</ProjectGuid>
<RootNamespace>FileSystemRedux</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>FileSystemRedux</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<TargetExt>.dll</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetExt>.cleo</TargetExt>
<TargetName>FileSystem</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetExt>.cleo</TargetExt>
<TargetName>FileSystem</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;FILESYSTEMREDUX_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>cleo_redux.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;FILESYSTEMREDUX_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>lib/cleo_redux.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;FILESYSTEMREDUX_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;FILESYSTEMREDUX_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\dllmain.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
22 changes: 22 additions & 0 deletions FileSystemRedux.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\dllmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
158 changes: 158 additions & 0 deletions include/cleo_redux_sdk.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
#pragma once
#include <stdint.h>

#define STR_MAX_LEN 128

enum class HandlerResult
{
// Proceed to the next command
CONTINUE = 0,
// Pause the script and continue on the next game loop iteration
BREAK = 1,
// End the script gracefully
TERMINATE = 2,
// End the script and throw an error
ERR = -1
};

enum class HostId
{
RE3 = 1,
REVC = 2,
GTA3 = 3,
VC = 4,
SA = 5,
GTA3_UNREAL = 6,
VC_UNREAL = 7,
SA_UNREAL = 8,
IV = 9,
BULLY = 10,
MANIFEST = 254,
UNKNOWN = 255
};

enum class Directory
{
// /CLEO directory
CLEO = 0,
// /CLEO/.config
CONFIG = 1,
// /CLEO/CLEO_TEXT
TEXT = 2,
// /CLEO/CLEO_PLUGINS
PLUGINS = 3,
// Current working directory
CWD = 4,
// Host root directory
HOST = 5,
};

typedef void* Context;
typedef intptr_t isize;

typedef HandlerResult (*CommandHandler)(Context);
typedef void* (*CustomLoader)(const char*);
typedef void (*OnTickCallback)(unsigned int current_time, int time_step);
typedef void (*OnRuntimeInitCallback)();
typedef void (*OnShowTextBoxCallback)(const char*);

extern "C" {
// since v1
// Returns the current SDK version as an integer number.
long GetSDKVersion();
// since v1
// Returns the current host (game) id
HostId GetHostId();
// since v1
// Resolves a path to the absolute path
void ResolvePath(const char* src, char* dest);
// since v1
// Returns the absolute path to the CLEO directory
// deprecated: use GetDirectoryPath
void GetCLEOFolder(char* dest);
// since v1
// Returns the absolute path to the current working directory (normally the game directory)
void GetCwd(char* dest);
// since v1
// Prints a new entry to the cleo_redux.log
void Log(const char* text);
// since v1
// Registers a new callback handler for the command with the given name. Permission token is required for unsafe operations interacting with the user environment (e.g. mem, fs, net)
void RegisterCommand(const char* name, CommandHandler handler, const char* permission = nullptr);
// since v1
// Reads an integer argument (either 32 or 64 bit depending on the target platform) from the script input
isize GetIntParam(Context ctx);
// since v1
// Reads a floating-point argument from the script input
float GetFloatParam(Context ctx);
// since v1
// Copies atmost {maxlen} bytes of a UTF-8 encoded character sequence in the script input to {dest}
void GetStringParam(Context ctx, char* dest, unsigned char maxlen);
// since v1
// Writes the integer {value} (either 32 or 64 bit depending on the target platform) to the script output
void SetIntParam(Context ctx, isize value);
// since v1
// Writes the floating-point {value} to the script output
void SetFloatParam(Context ctx, float value);
// since v1
// Copies a null-terminated UTF-8 encoded character sequence from {src} to the script output
void SetStringParam(Context ctx, const char* src);
// since v1
// Sets the status of the current condition
void UpdateCompareFlag(Context ctx, bool result);
// since v2
// Copies atmost {maxlen} bytes of a UTF-8 encoded host name to {dest}
void GetHostName(char* dest, unsigned char maxlen);
// since v2
// Sets the new host name (available in scripts as the HOST constant)
void SetHostName(const char* src);
// since v2
// Initializes or reloads CLEO runtime
void RuntimeInit();
// since v2
// Iterates the main loop
void RuntimeNextTick(unsigned int current_time, int time_step);
// since v3
// Registers a new loader for files matching a glob pattern
void RegisterLoader(const char* glob, CustomLoader loader);
// since v3
// Allocates a memory chunk with size in bytes. Memory is guaranteed to be zero initialized
void* AllocMem(size_t size);
// since v3
// Frees up the memory chunk allocated with AllocMem
void FreeMem(void *ptr);
// since v4
// Registers a new callback invoked on each main loop iteration (before scripts are executed)
void OnBeforeScripts(OnTickCallback callback);
// since v4
// Registers a new callback invoked on each main loop iteration (after scripts are executed)
void OnAfterScripts(OnTickCallback callback);
// since v4
// Registers a new callback invoked on each runtime init event (new game, saved game load, or SDK's RuntimeInit)
void OnRuntimeInit(OnRuntimeInitCallback callback);
// since v5
// Registers a new callback invoked on a ShowTextBox function call. Providing a callback shadows built-in ShowTextBox implementation.
void OnShowTextBox(OnShowTextBoxCallback callback);
/// since v6
/// Returns the absolute path to the CLEO root directory or one of its sub-directories
void GetDirectoryPath(Directory dir, char* dest);
/// since v6
/// Returns CLEO Redux version as a string
void GetCLEOVersion(char* dest);
/// since v6
/// Returns a memory address for the given symbol, or 0 if not found
void* GetSymbolAddress(const char* symbol);
/// since v6
/// Returns number of active CS scripts
size_t GetNumberOfActiveCSScripts();
/// since v6
/// Returns number of active JS scripts
size_t GetNumberOfActiveJSScripts();
/// since v6
/// Is end of arguments reached
bool IsEndOfArguments(Context ctx);
/// since v7
/// Triggers an event with the given name and data
void TriggerEvent(const char* name, const char* data);
}

Binary file added lib/cleo_redux.lib
Binary file not shown.
Loading

0 comments on commit d2445f4

Please sign in to comment.