Pack default CS config

*Technically* it was already being loaded as if it were packed, but it
made no difference because it's supposed to be empty.
dont-compose-content
AnyOldName3 3 years ago
parent 873b3b4800
commit d38126ef1c

@ -458,8 +458,8 @@ else ()
"${OpenMW_BINARY_DIR}/openmw.cfg")
endif ()
configure_resource_file(${OpenMW_SOURCE_DIR}/files/openmw-cs.cfg
"${OpenMW_BINARY_DIR}" "openmw-cs.cfg")
pack_resource_file(${OpenMW_SOURCE_DIR}/files/openmw-cs.cfg
"${OpenMW_BINARY_DIR}" "defaults-cs.bin")
# Needs the copy version because the configure version assumes the end of the file has been reached when a null character is reached and there are no CMake expressions to evaluate.
copy_resource_file(${OpenMW_SOURCE_DIR}/files/opencs/defaultfilters
@ -928,7 +928,7 @@ elseif(NOT APPLE)
INSTALL(FILES "${INSTALL_SOURCE}/gamecontrollerdb.txt" DESTINATION "${SYSCONFDIR}" COMPONENT "openmw")
IF(BUILD_OPENCS)
INSTALL(FILES "${INSTALL_SOURCE}/openmw-cs.cfg" DESTINATION "${SYSCONFDIR}" COMPONENT "opencs")
INSTALL(FILES "${INSTALL_SOURCE}/defaults-cs.bin" DESTINATION "${SYSCONFDIR}" COMPONENT "opencs")
ENDIF(BUILD_OPENCS)
# Install resources

@ -158,7 +158,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
if(APPLE)
set (OPENCS_MAC_ICON "${CMAKE_SOURCE_DIR}/files/mac/openmw-cs.icns")
set (OPENCS_CFG "${OpenMW_BINARY_DIR}/openmw-cs.cfg")
set (OPENCS_CFG "${OpenMW_BINARY_DIR}/defaults-cs.bin")
set (OPENCS_DEFAULT_FILTERS_FILE "${OpenMW_BINARY_DIR}/resources/defaultfilters")
set (OPENCS_OPENMW_CFG "${OpenMW_BINARY_DIR}/openmw.cfg")
else()
@ -270,7 +270,7 @@ if (WIN32)
SET(INSTALL_SOURCE "${OpenMW_BINARY_DIR}")
endif ()
INSTALL(FILES "${INSTALL_SOURCE}/openmw-cs.cfg" DESTINATION ".")
INSTALL(FILES "${INSTALL_SOURCE}/defaults-cs.bin" DESTINATION ".")
endif()
if (MSVC)

@ -17,15 +17,15 @@ CSMPrefs::State *CSMPrefs::State::sThis = nullptr;
void CSMPrefs::State::load()
{
// default settings file
boost::filesystem::path local = mConfigurationManager.getLocalPath() / mConfigFile;
boost::filesystem::path global = mConfigurationManager.getGlobalPath() / mConfigFile;
boost::filesystem::path local = mConfigurationManager.getLocalPath() / mDefaultConfigFile;
boost::filesystem::path global = mConfigurationManager.getGlobalPath() / mDefaultConfigFile;
if (boost::filesystem::exists (local))
mSettings.loadDefault (local.string());
else if (boost::filesystem::exists (global))
mSettings.loadDefault (global.string());
else
throw std::runtime_error ("No default settings file found! Make sure the file \"openmw-cs.cfg\" was properly installed.");
throw std::runtime_error ("No default settings file found! Make sure the file \"" + mDefaultConfigFile + "\" was properly installed.");
// user settings file
boost::filesystem::path user = mConfigurationManager.getUserConfigPath() / mConfigFile;
@ -641,7 +641,7 @@ void CSMPrefs::State::setDefault (const std::string& key, const std::string& def
}
CSMPrefs::State::State (const Files::ConfigurationManager& configurationManager)
: mConfigFile ("openmw-cs.cfg"), mConfigurationManager (configurationManager),
: mConfigFile ("openmw-cs.cfg"), mDefaultConfigFile("defaults-cs.bin"), mConfigurationManager (configurationManager),
mCurrentCategory (mCategories.end())
{
if (sThis)

@ -48,6 +48,7 @@ namespace CSMPrefs
private:
const std::string mConfigFile;
const std::string mDefaultConfigFile;
const Files::ConfigurationManager& mConfigurationManager;
ShortcutManager mShortcutManager;
Settings::Manager mSettings;

Loading…
Cancel
Save