forked from alandtse/MergeMapper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMergeMapperPluginAPI.h
More file actions
51 lines (43 loc) · 2.59 KB
/
Copy pathMergeMapperPluginAPI.h
File metadata and controls
51 lines (43 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include <RE/Skyrim.h>
#include <SKSE/SKSE.h>
// Interface code based on https://github.com/adamhynek/higgs
namespace MergeMapperPluginAPI {
constexpr const auto MergeMapperPluginName = "MergeMapper";
// A message used to fetch MergeMapper's interface
struct MergeMapperMessage {
enum : uint32_t { kMessage_GetInterface = 0xe6cb8b59 }; // Randomly generated
void* (*GetApiFunction)(unsigned int revisionNumber) = nullptr;
};
// Returns an IMergeMapperInterface001 object compatible with the API shown below
// This should only be called after SKSE sends kMessage_PostLoad to your plugin
struct IMergeMapperInterface001;
IMergeMapperInterface001* GetMergeMapperInterface001();
// This object provides access to MergeMapper's mod support API
struct IMergeMapperInterface001 {
// Gets the MergeMapper build number
virtual unsigned int GetBuildNumber() = 0;
/// @brief Get the new modName and formID
/// @param oldName The original modName char* e.g., Dragonborn.esp
/// @param oldFormID The original formID in hex format as an uint_32 e.g., 0x134ab
/// @return a pair with char* modName and uint32 FormID. If no merge is found, it will return oldName and
/// oldFormID.
virtual std::pair<const char*, RE::FormID> GetNewFormID(const char* oldName, const RE::FormID oldFormID) = 0;
/// @brief Get the original modName and formID
/// @param newName The new merged modName char* e.g., Merge.esp
/// @param newFormID The new merged formID in hex format as an uint_32 e.g., 0x134ab
/// @return a pair with char* modName and uint32 FormID. If no merge is found, it will return newName and
/// newFormID.
virtual std::pair<const char*, RE::FormID> GetOriginalFormID(const char* newName,
const RE::FormID newFormID) = 0;
/// @brief Whether modName is a zmerge output file. To find old file use GetOldFormID(modName, 0)
/// @param modName The modName to check, char* e.g., merged1.esp
/// @return true if merged
virtual bool isMerge(const char* modName) = 0;
/// @brief Whether modName was an input to a zmerge file. To find new file use GetNewFormID(modName, 0)
/// @param modName The modName to check, char* e.g., input1.esp
/// @return true if was merged into some file
virtual bool wasMerged(const char* modName) = 0;
};
} // namespace MergeMapperPluginAPI
extern MergeMapperPluginAPI::IMergeMapperInterface001* g_mergeMapperInterface;