Spellforce-Spell-framework
Loading...
Searching...
No Matches
sf_registry.cpp
Go to the documentation of this file.
1
19
21#include "../core/sf_wrappers.h"
22#include "../core/sf_hooks.h"
25
26#include "sf_registry.h"
27#include "sf_vanilla_registry.h"
28#include "sf_mod_registry.h"
29#include "sf_error_registry.h"
30
38
39
40#include <windows.h>
41#include <iostream>
42
43// Exposed in sfsf.h
47
58{
59 log_info("| - Loading framework with API Addresses");
60 frameworkAPI.figureAPI = &figureAPI;
61 frameworkAPI.spellAPI = &spellAPI;
62 frameworkAPI.uiAPI = &uiAPI;
63 frameworkAPI.toolboxAPI = &toolboxAPI;
64 frameworkAPI.iteratorAPI = &iteratorAPI;
65 frameworkAPI.registrationAPI = &registrationAPI;
66 frameworkAPI.logAPI = setup_logger();
67 frameworkAPI.effectAPI = &effectAPI;
68 frameworkAPI.aiAPI = &aiAPI;
69 frameworkAPI.buildingAPI = &buildingAPI;
70 log_info("| - Loading framework with create_mod_info Address");
71 frameworkAPI.createModInfo = &createModInfo;
72
73
74 log_info("| - Loading Default Mod Information");
75 char version_tag_buffer[128];
76 sprintf_s(version_tag_buffer, sizeof(version_tag_buffer), "%d.%d.%d-%s", SPELLFRAMEWORK_VERSION_MAJOR,
78
79 g_framework_mod = createModInfo("Spellforce Spell Framework", version_tag_buffer,
80 "Muddykat, UnSchtalch and shovel_knight",
81 "A Modding Framework to ease the creation of new Spells in the game Spellforce Platinum Edition.");
84}
85
114{
115
116 log_info(
117 "|=====| Spellforce Spell Framework Configuration Phase Start |=====|");
118
119 log_info("| - Initializing Data Hooks");
120
122
123 log_info("| - Linking API functions");
124
126
127 log_info("| - Initialization of Vanilla Spells");
128
130
131 log_info("| - Effect Handlers");
132
134
135 log_info("| - Registration of Vanilla Spell End Handlers");
136
138
139 log_info("| - Registration of Vanilla Sub Effect Handlers");
140
142 log_info("| - Registration of Vanilla Enchantnments Chance Handlers");
144
145 log_info("| - Registration of Vanilla Spell Refresh Handlers");
146
148
149 log_info("| - Registration of Vanilla Spell Deal Damage Handlers");
151
152 log_info("| - Registration of Vanilla Building Done Handlers");
154
155 log_info(
156 "|======| Spellforce Spell Framework Configuration Phase End |======|");
157 log_info(
158 "|+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.|");
159 log_info(
160 "|===== ===== ======| Core Module Phase Start |===== ===== ======-|");
161
164
165 log_info(
166 "|====== ===== =====| Core Module Phase End |===== ===== ======--|");
167 log_info(
168 "|+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.|");
169 log_info(
170 "|====== ====== ======| Mod Loading Phase Start |====== ====== =====|");
171
173
174 log_info(
175 "|====== ====== ======| Mod Loading Phase End |====== ====== ======-|");
176 log_info(
177 "|+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.|");
178 log_info(
179 "|====== === ======| Mod Registration Phase Start |====== === ======|");
180
183
184 log_info(
185 "|====== ==== ======| Mod Registration Phase End |====== ==== ======|");
186 log_info(
187 "|+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.|");
188 log_info(
189 "|=== === ===| Spellforce Spell Framework Working (^_^) |=== === ===|");
190 log_info(
191 "|======================| Injecting Assembly |======================|");
192}
RegistrationFunctions * registrationAPI
Definition TestMod.cpp:14
SpellFunctions * spellAPI
Definition TestMod.cpp:11
FigureFunctions * figureAPI
Definition TestMod.cpp:13
ToolboxFunctions * toolboxAPI
Definition TestMod.cpp:12
void initialize_campaign_module()
Creates the module's mod entry and loads sfsf\campaigns*.json.
void register_mod_for_listing(SFMod *mod, ModType type)
Adds a mod to the list rendered by the in-game mod list screen.
@ MOD_TYPE_FRAMEWORK
void initialize_data_hooks()
Used to initialize all disparate hooks in one place.
Definition sf_hooks.c:61
EffectFunctions effectAPI
Definition sf_hooks.c:45
UiFunctions uiAPI
Definition sf_hooks.c:50
IteratorFunctions iteratorAPI
Definition sf_hooks.c:49
BuildingFunctions buildingAPI
Definition sf_hooks.c:47
AiFunctions aiAPI
Definition sf_hooks.c:51
void initialize_screens_module()
Loads and validates sfsf\screens.json.
SFLog * setup_logger()
void log_info(const char *format,...)
void register_vanilla_enchants_handlers()
SFMod * createModInfo(const char *mod_id, const char *mod_version, const char *mod_author, const char *mod_description)
void register_mod_buildings()
void register_mod_spells()
Registers the mod spells and performs basic conflict checking.
void initialize_mods()
SFMod * g_current_mod
SFMod * g_framework_mod
SpellforceSpellFramework frameworkAPI
void registerFrameworkAPI()
Registers the framework API addresses.
void initialize_framework()
Initializes the Spellforce Spell Framework (SFSF).
#define SPELLFRAMEWORK_TAG
Definition sf_registry.h:3
void __thiscall register_vanilla_spell_damage_handlers()
void register_vanilla_effect_handlers()
void register_vanilla_spell_end_handlers()
void register_vanilla_spell_refresh_handlers()
void register_vanilla_sub_effect_handlers()
void initialize_vanilla_buildings()
void initialize_vanilla_spells()
#define SPELLFRAMEWORK_VERSION_PATCH
Definition sfsf.h:20
#define SPELLFRAMEWORK_VERSION_MAJOR
Definition sfsf.h:18
#define SPELLFRAMEWORK_VERSION_MINOR
Definition sfsf.h:19
Represents the Spellforce Spell Framework API.This structure serves as the central interface for inte...
Definition sfsf.h:42