Fixed an issue where skipping games would sometimes not work when multi-scraping.

This commit is contained in:
Leon Styhre 2021-09-22 23:10:40 +02:00
parent 2812b19ab4
commit 46f84ad756
3 changed files with 9 additions and 4 deletions

View file

@ -235,6 +235,7 @@ void GuiScraperMulti::skip()
mSearchQueue.pop();
mCurrentGame++;
mTotalSkipped++;
mSearchComp->decreaseScrapeCount();
mSearchComp->unsetRefinedSearch();
doNextSearch();
}

View file

@ -568,7 +568,7 @@ bool GuiScraperSearch::input(InputConfig* config, Input input)
}
// Skip game, unless the result has already been accepted.
if (!mAcceptedResult && mScrapeCount > 1 && config->isMappedTo("x", input) && input.value != 0)
if (!mAcceptedResult && config->isMappedTo("x", input) && input.value)
mSkipCallback();
return GuiComponent::input(config, input);
@ -589,6 +589,7 @@ void GuiScraperSearch::render(const glm::mat4& parentTrans)
void GuiScraperSearch::returnResult(ScraperSearchResult result)
{
mBlockAccept = true;
mAcceptedResult = true;
@ -931,8 +932,7 @@ std::vector<HelpPrompt> GuiScraperSearch::getHelpPrompts()
std::vector<HelpPrompt> prompts;
prompts.push_back(HelpPrompt("y", "refine search"));
if (mScrapeCount > 1)
prompts.push_back(HelpPrompt("x", "skip"));
prompts.push_back(HelpPrompt("x", "skip"));
if (mFoundGame && (mRefinedSearch || mSearchType != ACCEPT_SINGLE_MATCHES ||
(mSearchType == ACCEPT_SINGLE_MATCHES && mScraperResults.size() > 1)))
prompts.push_back(HelpPrompt("a", "accept result"));

View file

@ -69,7 +69,6 @@ public:
}
void setCancelCallback(const std::function<void()>& cancelCallback)
{
mScrapeCount -= 1;
mCancelCallback = cancelCallback;
}
@ -80,6 +79,11 @@ public:
HelpStyle getHelpStyle() override;
void onSizeChanged() override;
void decreaseScrapeCount()
{
if (mScrapeCount > 0)
mScrapeCount--;
}
void unsetRefinedSearch() { mRefinedSearch = false; }
bool getRefinedSearch() { return mRefinedSearch; }
bool getFoundGame() { return mFoundGame; }