diff --git a/src/Application.cpp b/src/Application.cpp index a48f5eb..098f0f5 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -226,7 +226,7 @@ void Application::executeThread(void){ void Application::loadLanguageFromConfig(){ if(!CSettings::getValueAsString(CSettings::AppLanguage).empty()){ - std::string languagePath = "sd:/wiiu/apps/hidtovpad/languages/" + CSettings::getValueAsString(CSettings::AppLanguage) + ".lang"; + std::string languagePath = std::string(DEFAULT_LANG_PATH) + "/" + CSettings::getValueAsString(CSettings::AppLanguage) + std::string(LANGUAGE_FILE_EXT); gettextLoadLanguage(languagePath.c_str()); } } diff --git a/src/common/common.h b/src/common/common.h index 39987bc..f7a550e 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -51,6 +51,10 @@ extern "C" { #define EXIT_HBL_EXIT 0xFFFFFFFE #define EXIT_RELAUNCH_ON_LOAD 0xFFFFFFFD +#define DEFAULT_HID_TO_VPAD_PATH SD_PATH WIIU_PATH "/apps/hidtovpad" +#define DEFAULT_LANG_PATH DEFAULT_HID_TO_VPAD_PATH "/languages" +#define LANGUAGE_FILE_EXT ".lang" + #ifdef __cplusplus } #endif diff --git a/src/settings/CSettings.cpp b/src/settings/CSettings.cpp index 93f2c64..9b764f9 100644 --- a/src/settings/CSettings.cpp +++ b/src/settings/CSettings.cpp @@ -27,7 +27,8 @@ #include "language/gettext.h" #define VERSION_LINE "# HID to VPAD - Main settings file v" -#define VALID_VERSION 1 +#define VALID_VERSION 2 +#define CONFIG_FILENAME "/hidtovpad.cfg" CSettings *CSettings::settingsInstance = NULL; @@ -36,7 +37,7 @@ CSettings::CSettings(){ memset(&nullValue, 0, sizeof(nullValue)); nullValue.strValue = new std::string(); - configPath = SD_PATH WIIU_PATH "/apps/hidtovpad"; + configPath = DEFAULT_HID_TO_VPAD_PATH; this->SetDefault(); } @@ -65,8 +66,12 @@ void CSettings::SetDefault() settingsValues[AppLanguage].strValue = new std::string(); settingsNames[RumbleActivated] = "RumbleActivated"; - settingsValues[RumbleActivated].dataType = TypeU8; + settingsValues[RumbleActivated].dataType = TypeBool; settingsValues[RumbleActivated].ucValue = SETTING_ON; + + settingsNames[MusicActivated] = "MusicActivated"; + settingsValues[MusicActivated].dataType = TypeBool; + settingsValues[MusicActivated].ucValue = SETTING_ON; } bool CSettings::Load(){ @@ -74,7 +79,7 @@ bool CSettings::Load(){ SetDefault(); std::string filepath = configPath; - filepath += "/hidtovpad.cfg"; + filepath += CONFIG_FILENAME; CFile file(filepath, CFile::ReadOnly); if (!file.isOpen()) @@ -191,7 +196,7 @@ bool CSettings::Save(){ CreateSubfolder(configPath.c_str()); std::string filepath = configPath; - filepath += "/hidtovpad.cfg"; + filepath += CONFIG_FILENAME; CFile file(filepath, CFile::WriteOnly); if (!file.isOpen()) diff --git a/src/settings/CSettings.h b/src/settings/CSettings.h index 784f8f9..7c07e9b 100644 --- a/src/settings/CSettings.h +++ b/src/settings/CSettings.h @@ -69,6 +69,7 @@ public: INVALID = -1, AppLanguage, RumbleActivated, + MusicActivated, MAX_VALUE };