Skip to content

Commit

Permalink
fix settings adding repetitive default song paths
Browse files Browse the repository at this point in the history
  • Loading branch information
3drosalia committed May 4, 2024
1 parent 1b425c2 commit 632360e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
11 changes: 4 additions & 7 deletions Encore/include/game/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -500,12 +500,9 @@ class Settings {
fullscreenError = true;
}
if (settings.HasMember("songDirectories") && settings["songDirectories"].IsArray()){

for (auto& songPath : settings["songDirectories"].GetArray()) {
songPaths.push_back(songPath.GetString());
}


} else {
songDirectoryError = true;
}
Expand Down Expand Up @@ -859,10 +856,10 @@ class Settings {
missHighwayColorMember->value.SetBool(missHighwayDefault);
rapidjson::Value::MemberIterator mirrorMember = settings.FindMember("mirror");
mirrorMember->value.SetBool(mirrorMode);
rapidjson::Value::MemberIterator songDirMember = settings.FindMember("songDirectories");
songDirMember->value.Clear();
for (std::filesystem::path& path : songPaths)
songDirMember->value.PushBack(rapidjson::Value().SetString(path.string(), allocator), allocator);
// rapidjson::Value::MemberIterator songDirMember = settings.FindMember("songDirectories");
// songDirMember->value.Clear();
// for (std::filesystem::path& path : songPaths)
// songDirMember->value.PushBack(rapidjson::Value().SetString(path.string(), allocator), allocator);
rapidjson::Value::MemberIterator keybinds4KMember = settings["keybinds"].FindMember("4k");
keybinds4KMember->value.Clear();
for (int& key : keybinds4K)
Expand Down
2 changes: 2 additions & 0 deletions Encore/src/game/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ void Menu::showResults(const Player& player, Assets assets) {
DrawBottomOvershell();
DrawBottomBottomOvershell();



float songNamePos = (float)GetScreenWidth()/2 - MeasureTextEx(assets.redHatDisplayBlack,player.songToBeJudged.title.c_str(), SongNameFontSize, 1).x/2;
float bigScorePos = (float)GetScreenWidth()/2 - 15 - MeasureTextEx(assets.redHatDisplayItalicLarge,scoreCommaFormatter(player.score).c_str(), ScoreFontSize, 1).x;
float bigStarPos = (float)GetScreenWidth()/2 + 140;
Expand Down
3 changes: 1 addition & 2 deletions Encore/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,7 @@ int main(int argc, char* argv[])
(GetMonitorHeight(GetCurrentMonitor()) * 0.5) -
(GetMonitorHeight(GetCurrentMonitor()) * 0.375));
} else {
SetWindowState(FLAG_WINDOW_UNDECORATED);
SetWindowState(FLAG_MSAA_4X_HINT);
SetWindowState(FLAG_WINDOW_UNDECORATED + FLAG_MSAA_4X_HINT);
int CurrentMonitor = GetCurrentMonitor();
SetWindowPosition(0, 0);
SetWindowSize(GetMonitorWidth(CurrentMonitor), GetMonitorHeight(CurrentMonitor));
Expand Down

0 comments on commit 632360e

Please sign in to comment.