#include <C4Config.h>
Public Member Functions | |
C4Config () | |
~C4Config () | |
const char * | GetSubkeyPath (const char *subkey) |
void | Default () |
bool | Save () |
bool | Load (const char *config_file=nullptr) |
bool | Init () |
bool | Registered () |
const char * | AtExePath (const char *filename) |
const char * | AtTempPath (const char *filename) |
const char * | AtTempUpdatePath (const char *filename) |
const char * | AtNetworkPath (const char *filename) |
const char * | AtScreenshotPath (const char *filename) |
const char * | AtUserDataPath (const char *filename) |
const char * | AtUserDataRelativePath (const char *filename) |
const char * | AtSystemDataPath (const char *filename) |
const char * | AtSystemDataRelativePath (const char *filename) |
const char * | AtRelativePath (const char *filename) |
const char * | GetRegistrationData (const char *field) |
void | ForceRelativePath (StdStrBuf *filename) |
void | CompileFunc (StdCompiler *compiler) |
bool | IsCorrupted () |
bool | RemoveModule (const char *path, char *modules) |
bool | IsModule (const char *path, char *modules) |
bool | AddModule (const char *path, char *modules) |
void | GetConfigFileName (StdStrBuf &filename, const char *config_file) |
void | CleanupTempUpdateFolder () |
const char * | MakeTempUpdateFolder () |
Static Public Member Functions | |
static void | ExpandEnvironmentVariables (char *path, size_t max_length) |
Definition at line 249 of file C4Config.h.
|
default |
Definition at line 286 of file C4Config.cpp.
References Default().
|
default |
bool C4Config::AddModule | ( | const char * | path, |
char * | modules | ||
) |
Definition at line 868 of file C4Config.cpp.
References SAddModule().
const char * C4Config::AtExePath | ( | const char * | filename | ) |
Definition at line 579 of file C4Config.cpp.
References C4ConfigGeneral::ExePath, General, StdStrBuf::getData(), and SCopy().
const char * C4Config::AtNetworkPath | ( | const char * | filename | ) |
Definition at line 607 of file C4Config.cpp.
References General, SCopy(), and C4ConfigGeneral::UserDataPath.
Referenced by C4Network2::CreateDynamic(), C4Network2ResList::CreateNetworkFolder(), and C4Network2ResList::FindTempResFileName().
const char * C4Config::AtRelativePath | ( | const char * | filename | ) |
Definition at line 741 of file C4Config.cpp.
References General, GetRelativePathS(), C4ConfigGeneral::SystemDataPath, and C4ConfigGeneral::UserDataPath.
Referenced by C4ComponentHost::CopyFilePathFromGroup(), C4DefList::GetByPath(), C4Language::GetPackGroups(), C4GameLobby::MainDlg::OnClientAddPlayer(), C4StartupPlrPropertiesDlg::OnClosed(), C4StartupMainDlg::OnPlayerSelContextAdd(), C4StartupMainDlg::OnShown(), C4Shader::Refresh(), C4Game::ReloadFile(), C4Player::Save(), C4Network2Res::SetByFile(), C4Network2Res::SetByGroup(), and C4GameSave::WriteDescDefinitions().
const char * C4Config::AtScreenshotPath | ( | const char * | filename | ) |
Definition at line 615 of file C4Config.cpp.
References General, SCopy(), and C4ConfigGeneral::ScreenshotPath.
Referenced by C4GraphicsSystem::SaveScreenshot().
const char * C4Config::AtSystemDataPath | ( | const char * | filename | ) |
Definition at line 593 of file C4Config.cpp.
References General, SCopy(), and C4ConfigGeneral::SystemDataPath.
Referenced by C4MusicSystem::Init().
const char * C4Config::AtSystemDataRelativePath | ( | const char * | filename | ) |
Definition at line 735 of file C4Config.cpp.
References General, GetRelativePathS(), and C4ConfigGeneral::SystemDataPath.
const char * C4Config::AtTempPath | ( | const char * | filename | ) |
Definition at line 600 of file C4Config.cpp.
References General, StdStrBuf::getData(), SCopy(), and C4ConfigGeneral::TempPath.
Referenced by C4ControlJoinPlayer::C4ControlJoinPlayer(), C4ControlReInitScenario::C4ControlReInitScenario(), C4StartupNetDlg::DoOK(), C4ScenarioSection::EnsureTempStore(), C4MusicFile::ExtractFile(), MakeTempUpdateFolder(), C4MusicFileSDL::Play(), C4PlayerInfoList::RecreatePlayerFiles(), C4MusicFile::RemTempFile(), C4Player::Save(), C4PXSSystem::Save(), C4PlayerList::Save(), C4Landscape::P::SaveDiffInternal(), C4Game::SaveGameTitle(), C4Landscape::P::SaveInternal(), C4Landscape::SaveMap(), C4Landscape::SaveTextures(), and C4ControlJoinPlayer::Strip().
const char * C4Config::AtTempUpdatePath | ( | const char * | filename | ) |
Definition at line 922 of file C4Config.cpp.
References General, SCopy(), and C4ConfigGeneral::TempUpdatePath.
const char * C4Config::AtUserDataPath | ( | const char * | filename | ) |
Definition at line 586 of file C4Config.cpp.
References General, SCopy(), and C4ConfigGeneral::UserDataPath.
Referenced by C4MainMenu::ActivateSavegame(), C4StartupPlrSelDlg::CheckPlayerName(), C4MusicSystem::Init(), C4Player::Init(), C4StartupPlrSelDlg::PlayerListItem::Load(), C4MusicSystem::LoadMoreMusic(), C4StartupPlrPropertiesDlg::OnClosed(), OpenExtraLogs(), OpenLog(), C4MessageInput::ProcessCommand(), C4Game::QuickSave(), C4Record::Start(), and C4StartupPlrSelDlg::PlayerListItem::UpdateCore().
const char * C4Config::AtUserDataRelativePath | ( | const char * | filename | ) |
Definition at line 729 of file C4Config.cpp.
References General, GetRelativePathS(), and C4ConfigGeneral::UserDataPath.
Referenced by C4GraphicsSystem::SaveScreenshot().
void C4Config::CleanupTempUpdateFolder | ( | ) |
Definition at line 901 of file C4Config.cpp.
References EraseItem(), General, and C4ConfigGeneral::TempUpdatePath.
Referenced by C4Application::DoInit().
void C4Config::CompileFunc | ( | StdCompiler * | compiler | ) |
Definition at line 850 of file C4Config.cpp.
References C4ConfigMaxGamepads, Controls, Developer, FormatString(), Gamepads, General, Graphics, IRC, Lobby, mkNamingAdapt(), Network, Security, Sound, Startup, and StdCompiler::Value().
void C4Config::Default | ( | ) |
Definition at line 296 of file C4Config.cpp.
References StdCompiler::Compile(), and ConfigLoaded.
Referenced by C4Config(), and C4Application::DoInit().
|
static |
Definition at line 883 of file C4Config.cpp.
References _MAX_PATH, _MAX_PATH_LEN, StdStrBuf::getData(), StdStrBuf::getLength(), GetWideChar(), SCopy(), SLen(), and SSearch().
Referenced by C4ConfigGeneral::DeterminePaths().
void C4Config::ForceRelativePath | ( | StdStrBuf * | filename | ) |
Definition at line 751 of file C4Config.cpp.
References StdStrBuf::Copy(), General, GetC4Filename(), StdStrBuf::getData(), GetRelativePathS(), IsGlobalPath(), C4ConfigGeneral::SystemDataPath, and StdStrBuf::Take().
void C4Config::GetConfigFileName | ( | StdStrBuf & | filename, |
const char * | config_file | ||
) |
Definition at line 303 of file C4Config.cpp.
References StdStrBuf::Copy(), and StdStrBuf::Ref().
Referenced by Load(), and Save().
|
inline |
Definition at line 285 of file C4Config.h.
Referenced by C4ClientPlayerInfos::C4ClientPlayerInfos(), C4StartupOptionsDlg::C4StartupOptionsDlg(), C4StartupOptionsDlg::SaveConfig(), and C4ClientCore::SetLocal().
const char * C4Config::GetSubkeyPath | ( | const char * | subkey | ) |
Definition at line 806 of file C4Config.cpp.
References sprintf.
Referenced by ConsoleDlgProc(), C4GUI::DialogWindow::Init(), C4ViewportWindow::Init(), C4Game::PreInit(), and PropertyDlgProc().
bool C4Config::Init | ( | ) |
Definition at line 801 of file C4Config.cpp.
Referenced by C4Application::DoInit().
|
inline |
Definition at line 288 of file C4Config.h.
References C4ConfigGeneral::ConfigResetSafety, C4ConfigGeneral::ConfigResetSafetyVal, General, Graphics, and C4ConfigGraphics::ResX.
Referenced by C4Application::DoInit().
bool C4Config::IsModule | ( | const char * | path, |
char * | modules | ||
) |
Definition at line 873 of file C4Config.cpp.
References SIsModule().
bool C4Config::Load | ( | const char * | config_file = nullptr | ) |
Definition at line 327 of file C4Config.cpp.
References C4NetStdPortDiscovery, C4NetStdPortRefServer, StdStrBuf::Clear(), StdCompiler::Compile(), Config, ConfigFilename, ConfigLoaded, StdStrBuf::Copy(), CreatePath(), C4ConfigGeneral::DefaultLanguage(), C4ConfigGeneral::DeterminePaths(), General, GetConfigFileName(), StdStrBuf::getData(), StdStrBuf::isNull(), StdStrBuf::LoadFromFile(), Log(), LogF(), StdCompiler::Exception::Msg, Network, C4ConfigNetwork::Nick, C4ConfigNetwork::PortDiscovery, C4ConfigNetwork::PortRefServer, C4ConfigNetwork::PortTCP, C4ConfigNetwork::PortUDP, StdStrBuf::Ref(), SEqual(), and StdCompilerINIRead::setInput().
Referenced by C4Application::DoInit().
const char * C4Config::MakeTempUpdateFolder | ( | ) |
Definition at line 911 of file C4Config.cpp.
References AtTempPath(), StdStrBuf::Copy(), CreatePath(), General, StdStrBuf::getData(), MakeTempFilename(), SCopy(), and C4ConfigGeneral::TempUpdatePath.
bool C4Config::Registered | ( | ) |
Definition at line 795 of file C4Config.cpp.
bool C4Config::RemoveModule | ( | const char * | path, |
char * | modules | ||
) |
Definition at line 878 of file C4Config.cpp.
References SRemoveModule().
bool C4Config::Save | ( | ) |
Definition at line 439 of file C4Config.cpp.
References ConfigFilename, StdCompiler::Decompile(), GetConfigFileName(), StdStrBuf::getData(), StdStrBuf::getLength(), StdCompilerINIWrite::getOutput(), LoadResStr(), LogF(), StdCompiler::Exception::Msg, and StdStrBuf::SaveToFile().
Referenced by C4Game::DoGameOver(), C4Application::DoInit(), C4Application::Quit(), and C4StartupOptionsDlg::SaveConfig().
StdStrBuf C4Config::ConfigFilename |
Definition at line 267 of file C4Config.h.
bool C4Config::ConfigLoaded |
Definition at line 266 of file C4Config.h.
Referenced by Default(), Load(), C4Application::Quit(), and ~C4Config().
C4ConfigControls C4Config::Controls |
Definition at line 263 of file C4Config.h.
Referenced by C4Viewport::AdjustPosition(), C4GUI::Button::Button(), C4StartupMainDlg::C4StartupMainDlg(), C4StartupPlrSelDlg::C4StartupPlrSelDlg(), C4GUI::CheckBox::CheckBox(), C4GUI::ComboBox::ComboBox(), CompileFunc(), C4GUI::ContextMenu::ContextMenu(), C4GUI::Dialog::Dialog(), C4Game::InitKeyboard(), C4Game::InitPlayerControlUserSettings(), C4GUI::ListBox::ListBox(), C4GUI::RenameEdit::RenameEdit(), and C4GUI::Tabular::Tabular().
C4ConfigDeveloper C4Config::Developer |
Definition at line 256 of file C4Config.h.
Referenced by CompileFunc(), C4Console::FileNew(), C4Console::FileOpen(), C4Console::FileOpenWPlrs(), C4Console::FileSaveAs(), C4Game::InitGame(), C4TextureShape::Load(), C4MessageInput::ProcessCommand(), and C4Console::RegisterRecentInput().
C4ConfigGamepad C4Config::Gamepads[C4ConfigMaxGamepads] |
Definition at line 262 of file C4Config.h.
Referenced by CompileFunc().
C4ConfigGeneral C4Config::General |
Definition at line 255 of file C4Config.h.
Referenced by C4Landscape::_SetPix2(), C4MainMenu::ActivateDisplay(), C4MainMenu::ActivateNewPlayer(), C4LSectors::Add(), C4Viewport::AdjustPosition(), C4Object::AssignRemoval(), AtExePath(), AtNetworkPath(), AtRelativePath(), AtScreenshotPath(), AtSystemDataPath(), AtSystemDataRelativePath(), AtTempPath(), AtTempUpdatePath(), AtUserDataPath(), AtUserDataRelativePath(), C4PortraitSelDlg::C4PortraitSelDlg(), C4StartupOptionsDlg::C4StartupOptionsDlg(), C4ScenarioListLoader::Scenario::CanOpen(), C4MassMover::Cease(), C4Playback::Check(), C4MCOverlay::CheckMask(), C4StartupPlrSelDlg::CheckPlayerName(), CleanupTempUpdateFolder(), C4Playback::Clear(), CompileFunc(), C4MassMoverSet::Create(), C4ScenarioListLoader::Entry::CreateEntryForFile(), C4MapFolderData::CreateGUIElements(), C4ConfigGeneral::CreateSaveFolder(), C4GameControl::DbgRec(), C4PXS::Deactivate(), C4AulExec::DirectExec(), C4Application::DoInit(), C4ScenarioListLoader::SubFolder::DoLoadContents(), C4Landscape::P::DoScan(), C4UpperBoard::Draw(), C4Game::DropFile(), C4Game::ExecObjects(), C4Game::Execute(), C4PXS::Execute(), C4Object::Execute(), C4Playback::ExecuteControl(), C4PlayerControl::ExecuteControlPacket(), C4Landscape::P::ExecuteScan(), ForceRelativePath(), C4Game::GetTranslatedString(), C4Reloc::Init(), C4Game::Init(), C4Player::InitControl(), C4Game::InitDefs(), C4GraphicsResource::InitFonts(), C4StartupGraphics::InitFonts(), C4Game::InitScriptEngine(), IsCorrupted(), C4StartupScenSelDlg::KeyCheat2(), C4MapFolderData::Load(), C4DefList::Load(), C4ScenarioListLoader::Entry::Load(), Load(), C4Game::LoadAdditionalSystemGroup(), C4ScenarioListLoader::Scenario::LoadCustomPre(), MakeTempUpdateFolder(), C4MainMenu::MenuCommand(), C4StartupPlrSelDlg::PlayerListItem::MoveFilename(), C4Game::NewObject(), C4StartupNetDlg::OnBtnRecord(), C4GameOptionButtons::OnBtnRecord(), C4StartupPlrPropertiesDlg::OnClosed(), C4StartupPlrSelDlg::OnDelBtnConfirm(), C4StartupMainDlg::OnPlayerSelContextAdd(), C4StartupMainDlg::OnPlayerSelContextAddPlr(), C4StartupMainDlg::OnPlayerSelContextRemove(), C4StartupMainDlg::OnPlayerSelContextRemovePlr(), C4StartupMainDlg::OnShown(), C4Playback::Open(), C4Game::OpenScenario(), C4Application::ParseCommandLine(), C4Application::PreInit(), C4MessageInput::ProcessCommand(), C4HTTPClient::Query(), C4Game::QuickSave(), RecordRandom(), C4Game::ReloadDef(), C4Game::ReloadFile(), C4LSectors::Remove(), C4GameControl::RequestRuntimeRecord(), RestartApplication(), C4Shape::Rotate(), C4GameSave::SaveDesc(), C4ScenarioSection::ScenarioLoad(), C4Network2Res::SetByCore(), C4Application::SetGameFont(), C4ClientCore::SetLocal(), C4Object::SetOCF(), C4ScenarioListLoader::Entry::SetTitleInGroup(), C4Record::Start(), C4Record::Stop(), C4LSectors::Update(), C4Game::UpdateLanguage(), C4Object::UpdateOCF(), and C4StartupMainDlg::UpdateParticipants().
C4ConfigGraphics C4Config::Graphics |
Definition at line 257 of file C4Config.h.
Referenced by C4MainMenu::ActivateDisplay(), C4Application::ApplyResolutionConstraints(), C4StartupOptionsDlg::C4StartupOptionsDlg(), CompileFunc(), CStdGL::CreateContext(), C4Application::DoInit(), C4UpperBoard::Draw(), C4PXSSystem::Draw(), C4MouseControl::Draw(), C4Game::DrawCrewOverheadText(), C4UpperBoard::Execute(), C4GraphicsSystem::FlashMessage(), C4Application::FullScreenMode(), C4Application::GameTick(), C4Application::GetConfigHeight(), C4Application::GetConfigWidth(), IsCorrupted(), C4Shader::IsLogging(), C4ParticleDef::Load(), C4GameParameters::Load(), C4MainMenu::MenuCommand(), C4Application::OnResolutionChanged(), C4Application::ParseCommandLine(), C4Application::PreInit(), C4ViewportList::RecalculateViewports(), C4Game::SetDefaultGamma(), and C4ApplicationGameTimer::SetGameTickDelay().
C4ConfigIRC C4Config::IRC |
Definition at line 261 of file C4Config.h.
Referenced by C4ChatControl::C4ChatControl(), C4Network2IRCClient::Close(), CompileFunc(), C4Network2IRCClient::Join(), C4ChatControl::OnConnectBtn(), C4ChatControl::ProcessInput(), and C4ChatControl::UpdateTitle().
C4ConfigLobby C4Config::Lobby |
Definition at line 260 of file C4Config.h.
Referenced by CompileFunc(), C4GameLobby::MainDlg::OnRunBtn(), and C4MessageInput::ProcessCommand().
C4ConfigNetwork C4Config::Network |
Definition at line 259 of file C4Config.h.
Referenced by C4Network2Client::AddAddrFromPuncher(), C4Network2::AllowJoin(), C4ChatControl::C4ChatControl(), C4GameOptionButtons::C4GameOptionButtons(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupOptionsDlg::C4StartupOptionsDlg(), C4StartupNetDlg::CheckVersionUpdate(), CompileFunc(), C4Network2ResList::CreateNetworkFolder(), C4GameControl::Default(), C4Network2::DoLobby(), C4Network2::DrawStatus(), C4Network2Reference::getSortOrder(), C4Network2Res::GetStandalone(), C4Network2IO::HandlePacket(), C4Network2::InitHost(), C4Network2::InitLeague(), C4Network2Reference::InitLocal(), C4Network2::InitNetIO(), C4Network2::LeaguePlrAuth(), C4Network2::LeagueUpdate(), C4GameParameters::Load(), Load(), C4GameOptionButtons::OnBtnComment(), C4StartupNetDlg::OnBtnInternet(), C4GameOptionButtons::OnBtnInternet(), C4GameOptionButtons::OnBtnLeague(), C4GameOptionButtons::OnBtnPassword(), C4GameOptionButtons::OnCommentSet(), C4GameOptionButtons::OnPasswordSet(), C4StartupMainDlg::OnShown(), C4GameControlNetwork::PackCompleteCtrl(), C4Application::ParseCommandLine(), C4MessageInput::ProcessCommand(), C4StartupOptionsDlg::SaveConfig(), C4Network2Res::SetByCore(), C4ClientCore::SetLocal(), and C4StartupNetListEntry::SetReference().
C4ConfigSecurity C4Config::Security |
Definition at line 265 of file C4Config.h.
Referenced by CompileFunc().
C4ConfigSound C4Config::Sound |
Definition at line 258 of file C4Config.h.
Referenced by C4MainMenu::ActivateOptions(), C4StartupOptionsDlg::C4StartupOptionsDlg(), CompileFunc(), C4SoundInstance::Create(), C4SoundInstance::Execute(), C4GUI::GUISound(), C4StartupOptionsDlg::KeyMusicToggle(), C4SoundEffect::Load(), C4MainMenu::MenuCommand(), C4SoundSystem::NewEffect(), C4MusicSystem::Play(), C4Application::PreInit(), C4MusicSystem::ScheduleWaitTime(), C4MusicSystem::SetPlayList(), StartSoundEffect(), StartSoundEffectAt(), C4MusicSystem::ToggleOnOff(), and C4MusicSystem::UpdateVolume().
C4ConfigStartup C4Config::Startup |
Definition at line 264 of file C4Config.h.
Referenced by C4PortraitSelDlg::C4PortraitSelDlg(), C4StartupOptionsDlg::C4StartupOptionsDlg(), CompileFunc(), C4StartupScenSelDlg::DoOK(), EntrySortFunc(), C4PortraitSelDlg::OnClosed(), C4ChatControl::OnConnectBtn(), C4PlayerInfoList::RestoreSavegameInfos(), and C4GameLobby::MainDlg::Start().