mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-06 00:38:59 +00:00
Music Path can be changed in the JSON now.
This commit is contained in:
@@ -60,4 +60,5 @@ extern char * arg0;
|
|||||||
|
|
||||||
#define WORKING_DIR "/"
|
#define WORKING_DIR "/"
|
||||||
#define SCRIPTS_PATH "sdmc:/3ds/Universal-Updater/scripts/" // The Scripts will be here.
|
#define SCRIPTS_PATH "sdmc:/3ds/Universal-Updater/scripts/" // The Scripts will be here.
|
||||||
|
#define MUSIC_PATH "sdmc:/3ds/Universal-Updater/Music.wav" // Default Music File / Path.
|
||||||
#define SCRIPT_VERSION 2
|
#define SCRIPT_VERSION 2
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
namespace Config {
|
namespace Config {
|
||||||
extern int lang, Color1, Color2, Color3, TxtColor, SelectedColor, UnselectedColor, viewMode, ColorKeys, progressbarColor;
|
extern int lang, Color1, Color2, Color3, TxtColor, SelectedColor, UnselectedColor, viewMode, ColorKeys, progressbarColor;
|
||||||
extern std::string ScriptPath;
|
extern std::string ScriptPath, MusicPath;
|
||||||
|
|
||||||
void load();
|
void load();
|
||||||
void save();
|
void save();
|
||||||
|
|||||||
+2
-2
@@ -57,8 +57,8 @@ bool touching(touchPosition touch, Structs::ButtonPos button) {
|
|||||||
|
|
||||||
void loadSoundEffects(void) {
|
void loadSoundEffects(void) {
|
||||||
if (dspFound == true) {
|
if (dspFound == true) {
|
||||||
if( access( "sdmc:/3ds/Universal-Updater/Music.wav", F_OK ) != -1 ) {
|
if( access( Config::MusicPath.c_str(), F_OK ) != -1 ) {
|
||||||
bgm = new sound("sdmc:/3ds/Universal-Updater/Music.wav", 1, true);
|
bgm = new sound(Config::MusicPath, 1, true);
|
||||||
songIsFound = true;
|
songIsFound = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ int Config::viewMode;
|
|||||||
int Config::ColorKeys;
|
int Config::ColorKeys;
|
||||||
int Config::progressbarColor;
|
int Config::progressbarColor;
|
||||||
std::string Config::ScriptPath;
|
std::string Config::ScriptPath;
|
||||||
|
std::string Config::MusicPath;
|
||||||
nlohmann::json configJson;
|
nlohmann::json configJson;
|
||||||
|
|
||||||
void Config::load() {
|
void Config::load() {
|
||||||
@@ -117,6 +118,12 @@ void Config::load() {
|
|||||||
Config::progressbarColor = getInt("PROGRESSBARCOLOR");
|
Config::progressbarColor = getInt("PROGRESSBARCOLOR");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!configJson.contains("MUSICPATH")) {
|
||||||
|
Config::MusicPath = MUSIC_PATH;
|
||||||
|
} else {
|
||||||
|
Config::MusicPath = getString("MUSICPATH");
|
||||||
|
}
|
||||||
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
} else {
|
} else {
|
||||||
Config::Color1 = BarColor;
|
Config::Color1 = BarColor;
|
||||||
@@ -130,6 +137,7 @@ void Config::load() {
|
|||||||
Config::viewMode = 0;
|
Config::viewMode = 0;
|
||||||
Config::ColorKeys = C2D_Color32(0, 0, 200, 255);
|
Config::ColorKeys = C2D_Color32(0, 0, 200, 255);
|
||||||
Config::progressbarColor = WHITE;
|
Config::progressbarColor = WHITE;
|
||||||
|
Config::MusicPath = MUSIC_PATH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,6 +153,7 @@ void Config::save() {
|
|||||||
Config::setInt("VIEWMODE", Config::viewMode);
|
Config::setInt("VIEWMODE", Config::viewMode);
|
||||||
Config::setInt("COLORKEYS", Config::ColorKeys);
|
Config::setInt("COLORKEYS", Config::ColorKeys);
|
||||||
Config::setInt("PROGRESSBARCOLOR", Config::progressbarColor);
|
Config::setInt("PROGRESSBARCOLOR", Config::progressbarColor);
|
||||||
|
Config::setString("MUSICPATH", Config::MusicPath);
|
||||||
FILE* file = fopen("sdmc:/3ds/Universal-Updater/Settings.json", "w");
|
FILE* file = fopen("sdmc:/3ds/Universal-Updater/Settings.json", "w");
|
||||||
if(file) fwrite(configJson.dump(1, '\t').c_str(), 1, configJson.dump(1, '\t').size(), file);
|
if(file) fwrite(configJson.dump(1, '\t').c_str(), 1, configJson.dump(1, '\t').size(), file);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
@@ -164,6 +173,7 @@ void Config::initializeNewConfig() {
|
|||||||
Config::setInt("VIEWMODE", 0);
|
Config::setInt("VIEWMODE", 0);
|
||||||
Config::setInt("COLORKEYS", C2D_Color32(0, 0, 200, 255));
|
Config::setInt("COLORKEYS", C2D_Color32(0, 0, 200, 255));
|
||||||
Config::setInt("PROGRESSBARCOLOR", WHITE);
|
Config::setInt("PROGRESSBARCOLOR", WHITE);
|
||||||
|
Config::setString("MUSICPATH", MUSIC_PATH);
|
||||||
|
|
||||||
if(file) fwrite(configJson.dump(1, '\t').c_str(), 1, configJson.dump(1, '\t').size(), file);
|
if(file) fwrite(configJson.dump(1, '\t').c_str(), 1, configJson.dump(1, '\t').size(), file);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|||||||
Reference in New Issue
Block a user