Spellforce-Spell-framework
Loading...
Searching...
No Matches
sf_error_registry.h
Go to the documentation of this file.
1
9
10#ifndef SF_ERROR_REGISTRY_H
11#define SF_ERROR_REGISTRY_H
12
13#include "../../api/sfsf.h"
14#include "../core/sf_wrappers.h"
15
16#include <list>
17
32
46
48typedef struct
49{
53
55const char *get_mod_type_label(ModType type);
56
64void append_mod_error(SFMod *mod, const char *format, ...) LOG_PRINTF_FMT(2, 3);
65
69void report_mod_error(SFMod *mod, const char *format, ...) LOG_PRINTF_FMT(2, 3);
70
77void report_mod_warning(SFMod *mod, const char *format, ...) LOG_PRINTF_FMT(2, 3);
78
86void report_mod_warning(SFMod *mod, DebugLevel level, const char *format, ...) LOG_PRINTF_FMT(3, 4);
87
89void clear_mod_errors(SFMod *mod);
90
106bool claim_numeric_id(ConflictDomain domain, uint32_t id, SFMod *mod,
107 uint32_t vanilla_max, const char *id_label);
108
115bool claim_string_id(ConflictDomain domain, const char *key, SFMod *mod,
116 const char *id_label);
117
120
127void register_mod_for_listing(SFMod *mod, ModType type);
128
135const std::list<RegisteredMod> &get_registered_mods();
136
138#endif // SF_ERROR_REGISTRY_H
const char * get_mod_type_label(ModType type)
Tag rendered next to a mod in the list. Empty for external mods.
bool claim_numeric_id(ConflictDomain domain, uint32_t id, SFMod *mod, uint32_t vanilla_max, const char *id_label)
Claims a numeric ID within a domain for a mod.
void clear_mod_errors(SFMod *mod)
Empties a mod's error buffer.
void register_mod_for_listing(SFMod *mod, ModType type)
Adds a mod to the list rendered by the in-game mod list screen.
bool claim_string_id(ConflictDomain domain, const char *key, SFMod *mod, const char *id_label)
Claims a string key within a domain for a mod. Comparison is case-insensitive, since the keys are Win...
void append_mod_error(SFMod *mod, const char *format,...)
Appends a line to a mod's error buffer without logging it.
const std::list< RegisteredMod > & get_registered_mods()
The mods known to the framework, grouped framework -> core -> external.
void report_mod_warning(SFMod *mod, const char *format,...)
Logs a warning against a mod at DEBUG_INFO, i.e. always shown.
ConflictDomain
Namespaces for conflict checking.
ModType
What sort of mod an entry in the mod list is.
void reset_conflict_domain(ConflictDomain domain)
Drops every claim in a domain. Intended for reloads and tests.
void report_mod_error(SFMod *mod, const char *format,...)
Logs an error, appends it to the mod's error buffer and counts it.
@ CONFLICT_DOMAIN_COUNT
@ CONFLICT_SPELL_EFFECT_ID
@ CONFLICT_CAMPAIGN_FOLDER
@ CONFLICT_SPELL_ID
@ CONFLICT_BUILDING_ID
@ CONFLICT_CAMPAIGN_AVATAR_TYPE
@ CONFLICT_CAMPAIGN_NAME
@ MOD_TYPE_CORE
@ MOD_TYPE_FRAMEWORK
@ MOD_TYPE_EXTERNAL
#define LOG_PRINTF_FMT(fmt_idx, arg_idx)
A mod as shown in the in-game mod list.