Spellforce-Spell-framework
Toggle main menu visibility
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
22
typedef
enum
23
{
24
CONFLICT_SPELL_ID
= 0,
25
CONFLICT_SPELL_EFFECT_ID
,
26
CONFLICT_BUILDING_ID
,
27
CONFLICT_CAMPAIGN_FOLDER
,
28
CONFLICT_CAMPAIGN_NAME
,
29
CONFLICT_CAMPAIGN_AVATAR_TYPE
,
30
CONFLICT_DOMAIN_COUNT
31
}
ConflictDomain
;
32
40
typedef
enum
41
{
42
MOD_TYPE_FRAMEWORK
= 0,
43
MOD_TYPE_CORE
,
44
MOD_TYPE_EXTERNAL
,
45
}
ModType
;
46
48
typedef
struct
49
{
50
SFMod
*
mod
;
51
ModType
type
;
52
}
RegisteredMod
;
53
55
const
char
*
get_mod_type_label
(
ModType
type);
56
64
void
append_mod_error
(
SFMod
*mod,
const
char
*format, ...)
LOG_PRINTF_FMT
(2, 3);
65
69
void
report_mod_error
(
SFMod
*mod, const
char
*format, ...)
LOG_PRINTF_FMT
(2, 3);
70
77
void
report_mod_warning
(
SFMod
*mod, const
char
*format, ...)
LOG_PRINTF_FMT
(2, 3);
78
86
void
report_mod_warning
(
SFMod
*mod,
DebugLevel
level, const
char
*format, ...)
LOG_PRINTF_FMT
(3, 4);
87
89
void
clear_mod_errors
(
SFMod
*mod);
90
106
bool
claim_numeric_id
(
ConflictDomain
domain, uint32_t
id
,
SFMod
*mod,
107
uint32_t vanilla_max, const
char
*id_label);
108
115
bool
claim_string_id
(
ConflictDomain
domain, const
char
*key,
SFMod
*mod,
116
const
char
*id_label);
117
119
void
reset_conflict_domain
(
ConflictDomain
domain);
120
127
void
register_mod_for_listing
(
SFMod
*mod,
ModType
type);
128
135
const std::list<
RegisteredMod
> &
get_registered_mods
();
136
138
#endif
// SF_ERROR_REGISTRY_H
get_mod_type_label
const char * get_mod_type_label(ModType type)
Tag rendered next to a mod in the list. Empty for external mods.
Definition
sf_error_registry.cpp:192
claim_numeric_id
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.
Definition
sf_error_registry.cpp:114
clear_mod_errors
void clear_mod_errors(SFMod *mod)
Empties a mod's error buffer.
Definition
sf_error_registry.cpp:106
register_mod_for_listing
void register_mod_for_listing(SFMod *mod, ModType type)
Adds a mod to the list rendered by the in-game mod list screen.
Definition
sf_error_registry.cpp:205
claim_string_id
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...
Definition
sf_error_registry.cpp:153
append_mod_error
void append_mod_error(SFMod *mod, const char *format,...)
Appends a line to a mod's error buffer without logging it.
Definition
sf_error_registry.cpp:46
get_registered_mods
const std::list< RegisteredMod > & get_registered_mods()
The mods known to the framework, grouped framework -> core -> external.
Definition
sf_error_registry.cpp:236
report_mod_warning
void report_mod_warning(SFMod *mod, const char *format,...)
Logs a warning against a mod at DEBUG_INFO, i.e. always shown.
Definition
sf_error_registry.cpp:78
ConflictDomain
ConflictDomain
Namespaces for conflict checking.
Definition
sf_error_registry.h:23
ModType
ModType
What sort of mod an entry in the mod list is.
Definition
sf_error_registry.h:41
reset_conflict_domain
void reset_conflict_domain(ConflictDomain domain)
Drops every claim in a domain. Intended for reloads and tests.
Definition
sf_error_registry.cpp:183
report_mod_error
void report_mod_error(SFMod *mod, const char *format,...)
Logs an error, appends it to the mod's error buffer and counts it.
Definition
sf_error_registry.cpp:59
CONFLICT_DOMAIN_COUNT
@ CONFLICT_DOMAIN_COUNT
Definition
sf_error_registry.h:30
CONFLICT_SPELL_EFFECT_ID
@ CONFLICT_SPELL_EFFECT_ID
Definition
sf_error_registry.h:25
CONFLICT_CAMPAIGN_FOLDER
@ CONFLICT_CAMPAIGN_FOLDER
Definition
sf_error_registry.h:27
CONFLICT_SPELL_ID
@ CONFLICT_SPELL_ID
Definition
sf_error_registry.h:24
CONFLICT_BUILDING_ID
@ CONFLICT_BUILDING_ID
Definition
sf_error_registry.h:26
CONFLICT_CAMPAIGN_AVATAR_TYPE
@ CONFLICT_CAMPAIGN_AVATAR_TYPE
Definition
sf_error_registry.h:29
CONFLICT_CAMPAIGN_NAME
@ CONFLICT_CAMPAIGN_NAME
Definition
sf_error_registry.h:28
MOD_TYPE_CORE
@ MOD_TYPE_CORE
Definition
sf_error_registry.h:43
MOD_TYPE_FRAMEWORK
@ MOD_TYPE_FRAMEWORK
Definition
sf_error_registry.h:42
MOD_TYPE_EXTERNAL
@ MOD_TYPE_EXTERNAL
Definition
sf_error_registry.h:44
DebugLevel
DebugLevel
Definition
sf_general_structures.h:36
LOG_PRINTF_FMT
#define LOG_PRINTF_FMT(fmt_idx, arg_idx)
Definition
sf_ui_wrappers.h:7
sf_wrappers.h
sfsf.h
RegisteredMod
A mod as shown in the in-game mod list.
Definition
sf_error_registry.h:49
RegisteredMod::type
ModType type
Definition
sf_error_registry.h:51
RegisteredMod::mod
SFMod * mod
Definition
sf_error_registry.h:50
SFMod
Definition
sf_general_structures.h:811
src
internal
registry
sf_error_registry.h
Generated by
1.17.0