#include <SettingManager.h>
Definition at line 29 of file SettingManager.h.
typedef void(*) SettingManager::ConfigCallback(Pentagram::istring key) |
Definition at line 89 of file SettingManager.h.
Definition at line 37 of file SettingManager.h.
SettingManager::SettingManager | ( | ) |
Definition at line 28 of file SettingManager.cpp.
References con, conffileman, DOM_GAME, domains, ConfigFileManager::get_instance(), MM_INFO, Console::Print(), ConfigFileManager::readConfigString(), and settingmanager.
SettingManager::~SettingManager | ( | ) |
Definition at line 42 of file SettingManager.cpp.
References con, MM_INFO, Console::Print(), and settingmanager.
void SettingManager::callCallbacks | ( | Pentagram::istring | key | ) | [private] |
bool SettingManager::exists | ( | Pentagram::istring | key, | |
Domain | dom = DOM_CURRENT | |||
) |
bool SettingManager::findKeyDomain | ( | Pentagram::istring | key, | |
Domain | dom, | |||
Domain & | keydom | |||
) | [private] |
bool SettingManager::get | ( | Pentagram::istring | key, | |
bool & | ret, | |||
Domain | dom = DOM_CURRENT | |||
) |
get value
bool SettingManager::get | ( | Pentagram::istring | key, | |
int & | ret, | |||
Domain | dom = DOM_CURRENT | |||
) |
get value
bool SettingManager::get | ( | Pentagram::istring | key, | |
std::string & | ret, | |||
Domain | dom = DOM_CURRENT | |||
) |
get value
Referenced by FontManager::addTTFOverride(), BarkGump::BarkGump(), MainActor::ConCmd_recall(), ActorAnimProcess::doSpecial(), CoreApp::getDefaultGame(), GUIApp::GraphicSysInit(), MenuGump::InitGump(), AvatarMoverProcess::jump(), CoreApp::loadConfig(), BarkGump::loadData(), GUIApp::loadGame(), FontManager::loadTTFont(), Pentagram::AudioMixer::openMidiOutput(), MenuGump::selectEntry(), CoreApp::setupGamePaths(), GameData::setupJPOverrides(), ScalerGump::SetupScalers(), GameData::setupTTFOverrides(), StartU8Process::StartU8Process(), GUIApp::startup(), GUIApp::startupGame(), and NS_TIMIDITY::Timidity_Init_Simple().
static SettingManager* SettingManager::get_instance | ( | ) | [inline, static] |
Definition at line 35 of file SettingManager.h.
References settingmanager.
Referenced by FontManager::addTTFOverride(), BarkGump::BarkGump(), ScalerGump::ChangeScaler(), MainActor::ConCmd_listmarks(), MainActor::ConCmd_mark(), MainActor::ConCmd_recall(), HIDManager::ConCmd_save(), ActorAnimProcess::doSpecial(), FontManager::FontManager(), PentagramMenuGump::InitGump(), MenuGump::InitGump(), AvatarMoverProcess::jump(), HIDManager::loadBindings(), BarkGump::loadData(), FontManager::loadTTFont(), Pentagram::AudioMixer::openMidiOutput(), RemorseGame::RemorseGame(), CreditsGump::Run(), HIDManager::saveBindings(), MenuGump::selectEntry(), GameData::setupJPOverrides(), ScalerGump::SetupScalers(), GameData::setupTTFOverrides(), StartU8Process::StartU8Process(), NS_TIMIDITY::Timidity_Init_Simple(), and U8Game::U8Game().
Pentagram::istring SettingManager::getConfigKey | ( | Pentagram::istring | key, | |
Domain | dom | |||
) | [private] |
std::vector<Pentagram::istring> SettingManager::listDataKeys | ( | Pentagram::istring | section | ) |
list all keys in a game data section
section | The section to return setkeys of |
Referenced by MainActor::ConCmd_listmarks().
std::map<Pentagram::istring,std::string> SettingManager::listDataValues | ( | Pentagram::istring | section | ) |
list all key-value pairs in the given section.
section | The section to list |
Referenced by HIDManager::loadBindings().
std::vector< istring > SettingManager::listGames | ( | ) |
list all games
Definition at line 195 of file SettingManager.cpp.
References conffileman, ConfigFileManager::exists(), and ConfigFileManager::listSections().
Referenced by GUIApp::ConCmd_listGames(), PentagramMenuGump::InitGump(), and CoreApp::setupGameList().
bool SettingManager::readConfigFile | ( | std::string | fname, | |
bool | readonly = false | |||
) |
read a config file. Multiple files may be read. Order is important.
fname | The file to read | |
readonly | If true, don't write to this file's tree (or the file) |
Definition at line 49 of file SettingManager.cpp.
References conffileman, and ConfigFileManager::readConfigFile().
Referenced by CoreApp::loadConfig().
void SettingManager::registerCallback | ( | Pentagram::istring | key, | |
ConfigCallback | callback | |||
) |
register a function to be called when the key changes
void SettingManager::set | ( | Pentagram::istring | key, | |
bool | value, | |||
Domain | dom = DOM_CURRENT | |||
) |
set value
void SettingManager::set | ( | Pentagram::istring | key, | |
int | value, | |||
Domain | dom = DOM_CURRENT | |||
) |
set value
void SettingManager::set | ( | Pentagram::istring | key, | |
const char * | value, | |||
Domain | dom = DOM_CURRENT | |||
) |
set value
void SettingManager::set | ( | Pentagram::istring | key, | |
std::string | value, | |||
Domain | dom = DOM_CURRENT | |||
) |
set value
Referenced by ScalerGump::ChangeScaler(), GUIApp::changeVideoMode(), MainActor::ConCmd_mark(), GUIApp::GraphicSysInit(), CreditsGump::Run(), and HIDManager::saveBindings().
void SettingManager::setCurrentDomain | ( | Domain | dom | ) |
set the current domain
Definition at line 160 of file SettingManager.cpp.
References currentDomain.
Referenced by CoreApp::killGame(), CoreApp::setupGamePaths(), and CoreApp::sysInit().
void SettingManager::setDefault | ( | Pentagram::istring | key, | |
bool | value | |||
) |
set default value
void SettingManager::setDefault | ( | Pentagram::istring | key, | |
int | value | |||
) |
set default value
void SettingManager::setDefault | ( | Pentagram::istring | key, | |
const char * | value | |||
) |
set default value
void SettingManager::setDefault | ( | Pentagram::istring | key, | |
std::string | value | |||
) |
set default value
Referenced by FontManager::FontManager(), GUIApp::GraphicSysInit(), GUIApp::loadGame(), Pentagram::AudioMixer::openMidiOutput(), RemorseGame::RemorseGame(), ScalerGump::SetupScalers(), GUIApp::startupGame(), and U8Game::U8Game().
void SettingManager::setDomainName | ( | Domain | dom, | |
Pentagram::istring | section | |||
) |
set the configuration section for a domain
Referenced by CoreApp::setupGamePaths(), and CoreApp::sysInit().
void SettingManager::unregisterCallback | ( | Pentagram::istring | key, | |
ConfigCallback | callback | |||
) |
unregister a callback
void SettingManager::unset | ( | Pentagram::istring | key, | |
Domain | dom = DOM_CURRENT | |||
) |
void SettingManager::write | ( | ) |
write all (writable) config files
Definition at line 54 of file SettingManager.cpp.
References conffileman, and ConfigFileManager::write().
Referenced by MainActor::ConCmd_mark(), and HIDManager::ConCmd_save().
std::map<Pentagram::istring, std::vector<ConfigCallback> > SettingManager::callbacks [private] |
Definition at line 116 of file SettingManager.h.
ConfigFileManager* SettingManager::conffileman [private] |
Definition at line 121 of file SettingManager.h.
Referenced by listGames(), readConfigFile(), SettingManager(), and write().
Domain SettingManager::currentDomain [private] |
std::vector<Pentagram::istring> SettingManager::domains [private] |
SettingManager * SettingManager::settingmanager = 0 [static, private] |
Definition at line 123 of file SettingManager.h.
Referenced by get_instance(), SettingManager(), and ~SettingManager().