diff --git a/Themes/Til Death/BGAnimations/ScreenTitleMenu underlay.lua b/Themes/Til Death/BGAnimations/ScreenTitleMenu underlay.lua index 8ffeb8fa95..40e3e5cce8 100644 --- a/Themes/Til Death/BGAnimations/ScreenTitleMenu underlay.lua +++ b/Themes/Til Death/BGAnimations/ScreenTitleMenu underlay.lua @@ -114,12 +114,13 @@ for i=1,choiceCount do transformF(self, 0, i, choiceCount) self:addx(SCREEN_CENTER_X-20) self:addy(SCREEN_CENTER_Y-20) + self:diffusealpha(0) end, MouseLeftClickMessageCommand = function(self) if(isOver(self)) then SCREENMAN:GetTopScreen():playcommand("MadeChoicePlayer_1") SCREENMAN:GetTopScreen():playcommand("Choose") - if not choices[i] == "Multi" then -- for some reason multi gets stuck :/ + if choices[i] ~= "Multi" then -- for some reason multi gets stuck :/ GAMESTATE:ApplyGameCommand(THEME:GetMetric("ScreenTitleMenu", "Choice"..choices[i])) end end diff --git a/src/DownloadManager.cpp b/src/DownloadManager.cpp index a2ad9dac73..df0984043b 100644 --- a/src/DownloadManager.cpp +++ b/src/DownloadManager.cpp @@ -1211,6 +1211,11 @@ void DownloadManager::RefreshTop25(Skillset ss) catch (exception e) { } auto scores = j.find("data"); vector & vec = DLMAN->topScores[ss]; + + if(scores == j.end()) { + return; + } + for (auto scoreJ : (*scores)) { try { auto score = *(scoreJ.find("attributes")); @@ -1764,7 +1769,7 @@ class LunaPacklist: public Luna p->packs.clear(); p->packs = DLMAN->GetCoreBundle(SArg(1)); MESSAGEMAN->Broadcast("RefreshPacklist"); - return 1; + return 0; } static int FilterAndSearch(T* p, lua_State* L) { if (lua_gettop(L) < 5) { @@ -1787,7 +1792,7 @@ class LunaPacklist: public Luna p->packs.push_back(&packs[i]); } MESSAGEMAN->Broadcast("RefreshPacklist"); - return 1; + return 0; } static int GetTotalSize(T* p, lua_State* L) { size_t totalsize = 0; @@ -1812,14 +1817,14 @@ class LunaPacklist: public Luna auto comp = [](DownloadablePack* a, DownloadablePack* b) { return Rage::make_lower(a->name) > Rage::make_lower(b->name); }; // custom operators? sort(p->packs.begin(), p->packs.end(), comp); p->asc = false; - return 1; + return 0; } auto comp = [](DownloadablePack* a, DownloadablePack* b) { return Rage::make_lower(a->name) < Rage::make_lower(b->name); }; sort(p->packs.begin(), p->packs.end(), comp); p->sortmode = 1; p->asc = true; MESSAGEMAN->Broadcast("RefreshPacklist"); - return 1; + return 0; } static int SortByDiff(T* p, lua_State* L) { auto& packs = p->packs; @@ -1828,14 +1833,14 @@ class LunaPacklist: public Luna auto comp = [](DownloadablePack* a, DownloadablePack* b) { return (a->avgDifficulty < b->avgDifficulty); }; sort(packs.begin(), packs.end(), comp); p->asc = false; - return 1; + return 0; } auto comp = [](DownloadablePack* a, DownloadablePack* b) { return (a->avgDifficulty > b->avgDifficulty); }; sort(packs.begin(), packs.end(), comp); p->sortmode = 2; p->asc = true; MESSAGEMAN->Broadcast("RefreshPacklist"); - return 1; + return 0; } static int SortBySize(T* p, lua_State* L) { auto& packs = p->packs; @@ -1844,14 +1849,14 @@ class LunaPacklist: public Luna auto comp = [](DownloadablePack* a, DownloadablePack* b) { return (a->size < b->size); }; sort(packs.begin(), packs.end(), comp); p->asc = false; - return 1; + return 0; } auto comp = [](DownloadablePack* a, DownloadablePack* b) { return (a->size > b->size); }; sort(packs.begin(), packs.end(), comp); p->sortmode = 3; p->asc = true; MESSAGEMAN->Broadcast("RefreshPacklist"); - return 1; + return 0; } static int SetFromAll(T* p, lua_State* L) { auto& packs = DLMAN->downloadablePacks; @@ -1859,7 +1864,7 @@ class LunaPacklist: public Luna for (auto& n : packs) p->packs.emplace_back(&n); MESSAGEMAN->Broadcast("RefreshPacklist"); - return 1; + return 0; } LunaPacklist() { diff --git a/src/Profile.cpp b/src/Profile.cpp index 67de0ecbb1..d712fc4bb8 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -1601,7 +1601,7 @@ class LunaProfile : public Luna static int SetFromAll(T* p, lua_State *L) { p->FillGoalTable(); p->filtermode = 1; - return 1; + return 0; } static int SortByDate(T* p, lua_State* L) { @@ -1610,13 +1610,13 @@ class LunaProfile : public Luna auto comp = [](ScoreGoal* a, ScoreGoal* b) { return a->timeassigned > b->timeassigned; }; // custom operators? sort(p->goaltable.begin(), p->goaltable.end(), comp); p->asc = false; - return 1; + return 0; } auto comp = [](ScoreGoal* a, ScoreGoal* b) { return a->timeassigned < b->timeassigned; }; sort(p->goaltable.begin(), p->goaltable.end(), comp); p->sortmode = 1; p->asc = true; - return 1; + return 0; } static int SortByRate(T* p, lua_State* L) { @@ -1625,13 +1625,13 @@ class LunaProfile : public Luna auto comp = [](ScoreGoal* a, ScoreGoal* b) { return a->rate > b->rate; }; // custom operators? sort(p->goaltable.begin(), p->goaltable.end(), comp); p->asc = false; - return 1; + return 0; } auto comp = [](ScoreGoal* a, ScoreGoal* b) { return a->rate < b->rate; }; sort(p->goaltable.begin(), p->goaltable.end(), comp); p->sortmode = 2; p->asc = true; - return 1; + return 0; } static int SortByName(T* p, lua_State* L) { @@ -1641,14 +1641,14 @@ class LunaProfile : public Luna Rage::make_lower(SONGMAN->GetSongByChartkey(b->chartkey)->GetDisplayMainTitle()); }; // custom operators? sort(p->goaltable.begin(), p->goaltable.end(), comp); p->asc = false; - return 3; + return 0; } auto comp = [](ScoreGoal* a, ScoreGoal* b) { return Rage::make_lower(SONGMAN->GetSongByChartkey(a->chartkey)->GetDisplayMainTitle()) < Rage::make_lower(SONGMAN->GetSongByChartkey(b->chartkey)->GetDisplayMainTitle()); }; sort(p->goaltable.begin(), p->goaltable.end(), comp); p->sortmode = 3; p->asc = true; - return 1; + return 0; } static int SortByPriority(T* p, lua_State* L) { @@ -1657,13 +1657,13 @@ class LunaProfile : public Luna auto comp = [](ScoreGoal* a, ScoreGoal* b) { return a->priority > b->priority; }; // custom operators? sort(p->goaltable.begin(), p->goaltable.end(), comp); p->asc = false; - return 3; + return 0; } auto comp = [](ScoreGoal* a, ScoreGoal* b) { return a->priority < b->priority; }; sort(p->goaltable.begin(), p->goaltable.end(), comp); p->sortmode = 4; p->asc = true; - return 1; + return 0; } static int SortByDiff(T* p, lua_State* L) { @@ -1673,14 +1673,14 @@ class LunaProfile : public Luna SONGMAN->GetStepsByChartkey(b->chartkey)->GetMSD(b->rate, 0); }; sort(p->goaltable.begin(), p->goaltable.end(), comp); p->asc = false; - return 3; + return 0; } auto comp = [](ScoreGoal* a, ScoreGoal* b) { return SONGMAN->GetStepsByChartkey(a->chartkey)->GetMSD(a->rate, 0) < SONGMAN->GetStepsByChartkey(b->chartkey)->GetMSD(b->rate, 0); }; sort(p->goaltable.begin(), p->goaltable.end(), comp); p->sortmode = 5; p->asc = true; - return 1; + return 0; } static int ToggleFilter(T* p, lua_State* L) { @@ -1688,7 +1688,7 @@ class LunaProfile : public Luna if (p->filtermode == 3) { p->filtermode = 1; - return 1; + return 0; } vector doot; @@ -1698,7 +1698,7 @@ class LunaProfile : public Luna doot.emplace_back(sg); p->goaltable = doot; p->filtermode = 2; - return 1; + return 0; } if (p->filtermode == 2) { for (auto& sg : p->goaltable) @@ -1706,9 +1706,9 @@ class LunaProfile : public Luna doot.emplace_back(sg); p->goaltable = doot; p->filtermode = 3; - return 1; + return 0; } - return 1; + return 0; } static int GetFilterMode(T* p, lua_State *L) { lua_pushnumber(L, p->filtermode);