![]() |
Blamite Game Engine - Guerilla (Library)
00402.09.29.23.0627.blamite
The tag editor for the Blamite Game Engine.
|
Class representing a Plugin. More...
#include <tags.h>
Public Member Functions | |
BlamPlugin (std::string _file_path) | |
Prepares a new plugin for load. More... | |
~BlamPlugin () | |
Destroys the plugin data and releases all field data. More... | |
BlamResult | LoadFromDisk () |
Loads the plugin XML document from disk. More... | |
int | GetVersion () |
Retrieves the current revision of the plugin. More... | |
BlamTag * | CreateNewTag () |
Creates a new tag using the plugin. More... | |
BlamTag * | CreateNewTag (std::string filename) |
Creates a new tag using the plugin. More... | |
BlamPluginField * | GetField (std::string id) |
Attempts to locate a field with a given ID. More... | |
BlamPluginField * | GetField (std::string id, BlamTagFieldType type) |
Attempts to locate a field with a given ID and type. More... | |
void | RecalculateFieldData () |
Recalculates all offsets and lengths for the plugin. More... | |
bool | SavePlugin (bool recalculate_field_data=true) |
Saves the plugin file back to disk. More... | |
bool | IsBuiltIn () |
Checks if the plugin is a built-in plugin. More... | |
bool | ExportPluginToCpp (std::string export_directory="", bool include_comments=true, bool generate_doxygen_comments=true) |
Exports the plugin file to the appropriate C++ source and header files. More... | |
std::string | GenerateCppHeaderFile (bool include_comments=true, bool generate_doxygen_comments=true) |
Generates C++ header source code containing the necessary information about the plugin file. More... | |
std::string | GenerateCppSourceFile (bool include_comments=true, bool generate_doxygen_comments=true) |
Generates C++ file source code containing the necessary information about the plugin file. More... | |
BlamPluginField * | ParseField (rapidxml::xml_node<> *field_node) |
Attempts to parse an XML node as a plugin field. More... | |
bool | VerifyIDs () |
Public Attributes | |
std::string | class_name_long = "" |
The long class name. Ex: scenario . Can be any length. More... | |
std::string | class_name_short = "" |
The short class name. Ex: scnr . Must be 4 characters or fewer. More... | |
int | base_size = 0 |
The base size of the tag. More... | |
int | fieldset_version = 0 |
The fieldset version of the tag. More... | |
std::string | project_name = "blam!" |
The game/project that this plugin was created for. More... | |
std::string | engine_version = "" |
The game engine version that generated this plugin, if applicable. More... | |
std::string | short_description = "" |
An optional short description of the plugin. More... | |
std::string | description = "" |
An optional long description of the plugin. More... | |
std::vector< BlamRevision > | revisions = std::vector<BlamRevision>() |
The list of revisions contained within this plugin. More... | |
std::vector< BlamPluginField * > | fields = std::vector<BlamPluginField*>() |
The list of fields contained within this plugin. More... | |
std::string | file_path = "" |
The path to the plugin file. More... | |
bool | valid = true |
Whether or not the plugin was able to be loaded. More... | |
Class representing a Plugin.
Plugins are XML files that contain tag layout information, additional non-data fields (such as comments), tooltips, and the needed information in order to compile a tag for use with the game engine. They are a concept created by the Halo modding community and are quite useful in this context as well.
BlamPlugin::BlamPlugin | ( | std::string | _file_path | ) |
Prepares a new plugin for load.
_file_path | - The path to the plugin file. |
BlamPlugin::~BlamPlugin | ( | ) |
Destroys the plugin data and releases all field data.
BlamTag * BlamPlugin::CreateNewTag | ( | ) |
Creates a new tag using the plugin.
BlamTag * BlamPlugin::CreateNewTag | ( | std::string | filename | ) |
Creates a new tag using the plugin.
filename | - The new filename of the tag. |
bool BlamPlugin::ExportPluginToCpp | ( | std::string | export_directory = "" , |
bool | include_comments = true , |
||
bool | generate_doxygen_comments = true |
||
) |
Exports the plugin file to the appropriate C++ source and header files.
The files generated from this are intended for use within the game engine and/or engine extensions.
export_directory | - The directory path to save generated files within. If this is set to an empty string, the files will be saved to the same directory as the plugin XML file. |
include_comments | - Whether or not to include comment fields when generating the tag data structure. |
generate_doxygen_comments | - Whether or not to include doxygen-compatible comments when generating the tag struct. |
true
if the C++ files were generated successfully, otherwise returns false
. std::string BlamPlugin::GenerateCppHeaderFile | ( | bool | include_comments = true , |
bool | generate_doxygen_comments = true |
||
) |
Generates C++ header source code containing the necessary information about the plugin file.
This is used during the C++ export process, but can also be used directly to show a preview of the code to the user within the Editing Kit. This method specifically creates the file for the .h
file for this tag class.
include_comments | - Whether or not to include comment fields when generating the tag data structure. |
generate_doxygen_comments | - Whether or not to include doxygen-compatible comments when generating the tag struct. |
std::string BlamPlugin::GenerateCppSourceFile | ( | bool | include_comments = true , |
bool | generate_doxygen_comments = true |
||
) |
Generates C++ file source code containing the necessary information about the plugin file.
This is used during the C++ export process, but can also be used directly to show a preview of the code to the user within the Editing Kit. This method specifically creates the file for the .cpp
file for this tag class.
include_comments | - Whether or not to include comment fields when generating the tag data structure. |
generate_doxygen_comments | - Whether or not to include doxygen-compatible comments when generating the tag struct. |
BlamPluginField * BlamPlugin::GetField | ( | std::string | id | ) |
Attempts to locate a field with a given ID.
id | - The ID of the desired field. |
nullptr
. BlamPluginField * BlamPlugin::GetField | ( | std::string | id, |
BlamTagFieldType | type | ||
) |
Attempts to locate a field with a given ID and type.
id | - The ID of the desired field. |
type | - The type of the desired field. |
nullptr
. int BlamPlugin::GetVersion | ( | ) |
Retrieves the current revision of the plugin.
bool BlamPlugin::IsBuiltIn | ( | ) |
Checks if the plugin is a built-in plugin.
Built-in plugins refer to plugins which are shipped with the Editing Kit. They are typically not meant to be modified, and certain editing features of these plugins should be disabled. Instead, any modifications should be done to a copy of the plugin.
true
if the plugin is built-in, otherwise returns false
. BlamResult BlamPlugin::LoadFromDisk | ( | ) |
Loads the plugin XML document from disk.
BlamPluginField * BlamPlugin::ParseField | ( | rapidxml::xml_node<> * | field_node | ) |
Attempts to parse an XML node as a plugin field.
field_node | - The XML node to parse. |
nullptr
is returned. void BlamPlugin::RecalculateFieldData | ( | ) |
Recalculates all offsets and lengths for the plugin.
This function should typically only be called from the Tag Designer. This will iterate through the entire plugin's field list and update all offsets and lengths where appropriate to ensure the plugin will be valid for compilation.
bool BlamPlugin::SavePlugin | ( | bool | recalculate_field_data = true | ) |
Saves the plugin file back to disk.
This should typically only be done from the Tag Designer.
recalculate_field_data | - Whether or not to recalculate field data before saving. This does not need to be done if you have already called RecalculateFieldData directly. |
true
if the plugin file was saved successfully, otherwise returns false
. bool BlamPlugin::VerifyIDs | ( | ) |
int BlamPlugin::base_size = 0 |
The base size of the tag.
std::string BlamPlugin::class_name_long = "" |
The long class name. Ex: scenario
. Can be any length.
std::string BlamPlugin::class_name_short = "" |
The short class name. Ex: scnr
. Must be 4 characters or fewer.
std::string BlamPlugin::description = "" |
An optional long description of the plugin.
std::string BlamPlugin::engine_version = "" |
The game engine version that generated this plugin, if applicable.
std::vector<BlamPluginField*> BlamPlugin::fields = std::vector<BlamPluginField*>() |
The list of fields contained within this plugin.
int BlamPlugin::fieldset_version = 0 |
The fieldset version of the tag.
std::string BlamPlugin::file_path = "" |
The path to the plugin file.
std::string BlamPlugin::project_name = "blam!" |
The game/project that this plugin was created for.
std::vector<BlamRevision> BlamPlugin::revisions = std::vector<BlamRevision>() |
The list of revisions contained within this plugin.
std::string BlamPlugin::short_description = "" |
An optional short description of the plugin.
bool BlamPlugin::valid = true |
Whether or not the plugin was able to be loaded.