FConfigClassBinder
[/Script/<Module>.<Class>] onto a reflected object. The section names the class without its M/A prefix the way UE drops U/A ("/Script/Mowo.HealthComponent" for MHealthComponent); the module part is not checked, since an MClass does not know its module. Super-class sections apply first, so a subclass section overrides its base. Each key sets the MPROPERTY(Config) of that name — a field without the flag is never written, whatever the file says: bool, integers, float, double, std::string, std::vector<std::string> (from a list).
- Module
- Core
- Header
#include "Core/ConfigIni.h"- Namespace
Mowo
UE's MCLASS(Config=Game) picks the one file a class reads; here a class is a config class when any field up its chain is MPROPERTY(Config), and the caller applies Engine then Game, so a Game section wins. MCLASS(Config=Game) is kept on the MClass (FMClassFlags::Config and the "Config" meta entry), but the binder does not narrow the files by it: the section name already decides which keys apply.
Public functions
| Returns | Name | Description |
|---|---|---|
std::string | SectionNameFor | |
uint32_t | Apply | Returns how many properties were set. |
bool | IsConfigClass | |
uint32_t | ApplyToClassDefaults | Every registered config class's default object: what a spawn clones and the asset writer diffs against, so the INI reaches every instance that never overrode the field. |
uint32_t | CopyConfigFromClassDefault | Copies every MPROPERTY(Config) field from the class default object onto object. |
void | SetActiveClassConfig | The files the open project applied to the class defaults, lowest first (Engine, then Game), remembered so a module loaded afterwards — the project's game module, a plugin, a hot reload — gets the same pass for the classes it brings. |
void | ClearActiveClassConfig | |
uint32_t | ApplyActiveConfigToModule | The remembered files onto the default object of every config class the module at moduleHandle registered. |
Function details
SectionNameFor
static std::string SectionNameFor(const std::string& module, const std::string& className)Apply
static uint32_t Apply(const FConfigIniFile& file, MObject& object)Returns how many properties were set.
IsConfigClass
static bool IsConfigClass(MClass& cls)ApplyToClassDefaults
static uint32_t ApplyToClassDefaults(const FConfigIniFile& file)Every registered config class's default object: what a spawn clones and the asset writer diffs against, so the INI reaches every instance that never overrode the field. Creates the CDOs it needs.
CopyConfigFromClassDefault
static uint32_t CopyConfigFromClassDefault(MObject& object)Copies every MPROPERTY(Config) field from the class default object onto object. A component an actor's constructor makes (CreateDefaultSubobject) starts from its constructor values, and a spawn never clones an actor's own components from its default, so without this the INI never reached them. Only an existing default is read — one exists for every config class once a project's INI has applied — so this never constructs an object. Returns the fields copied.
SetActiveClassConfig
static void SetActiveClassConfig(const std::vector<FConfigIniFile>& files)The files the open project applied to the class defaults, lowest first (Engine, then Game), remembered so a module loaded afterwards — the project's game module, a plugin, a hot reload — gets the same pass for the classes it brings. Cleared when the project closes.
ClearActiveClassConfig
static void ClearActiveClassConfig()ApplyActiveConfigToModule
static uint32_t ApplyActiveConfigToModule(void* moduleHandle)The remembered files onto the default object of every config class the module at moduleHandle registered. FModuleManager calls it after each load; returns the properties set.