Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions include/RED4ext/Api/v0/Scripts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,33 @@ namespace RED4ext::v0
struct Scripts
{
/**
* @brief Attach a hook.
* @brief Add a script path to the redscript compilation.
*
* @param[in] aHandle The plugin's handle.
* @param[in] aPath The path to be added to the redscript compilation - can be a folder or a .reds file
*
* @return Returns true if the path was added is attached, false otherwise.
* @return Returns true if the path was added, false otherwise.
*/
bool (*Add)(PluginHandle aHandle, const wchar_t* aPath);

/**
* @brief Register a type as being @neverRef, i.e. a type that shouldn't be stored behind
* a reference in scripts.
*
* @example
* @param[in] aType The type to be registered.
*
* RED4EXT_C_EXPORT bool RED4EXT_CALL Main(RED4ext::PluginHandle aHandle, RED4ext::EMainReason aReason, const
* RED4ext::Sdk* aSdk)
* {
* switch (aReason)
* {
* case RED4ext::EMainReason::Load:
* {
* aSdk->scripts->Add(aHandle, "my_mod.reds");
* break;
* }
* }
* @return Returns true if the type was registered successfully, false otherwise.
*/
bool (*RegisterNeverRefType)(const char* aType);

/**
* @brief Register a type as being @mixedRef, i.e. a type that can be stored behind a reference
* in scripts, but also can be used as a value.
*
* return true;
* }
* @param[in] aType The type to be registered.
*
* @return Returns true if the type was registered successfully, false otherwise.
*/
bool (*Add)(PluginHandle aHandle, const wchar_t* aPath);
bool (*RegisterMixedRefType)(const char* aType);
};
} // namespace RED4ext::v0