Skip to content

Commit 2dc6032

Browse files
Synchronize changes from 1.6 master branch [ci skip]
da7af8f New dialog for user assisted game searching (#3884)
2 parents 0aa9d5e + da7af8f commit 2dc6032

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

Client/loader/Utils.cpp

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <Softpub.h>
2323
#include <wintrust.h>
2424
#include <version.h>
25+
#include <windows.h>
2526
#pragma comment (lib, "wintrust")
2627

2728
namespace fs = std::filesystem;
@@ -527,30 +528,26 @@ bool LookForGtaProcess(SString& strOutPathFilename)
527528
//
528529
//
529530
///////////////////////////////////////////////////////////////
530-
SString DoUserAssistedSearch()
531+
static const SString DoUserAssistedSearch() noexcept
531532
{
532-
SString strResult;
533+
SString result;
533534

534-
ShowProgressDialog(g_hInstance, _("Searching for Grand Theft Auto San Andreas"), true);
535+
MessageBox(nullptr, _("Start Grand Theft Auto: San Andreas.\nEnsure the game is placed in the 'Program Files (x86)' folder."), _("Searching for GTA: San Andreas"), MB_OK | MB_ICONINFORMATION);
535536

536-
while (!UpdateProgress(0, 100, _("Please start Grand Theft Auto San Andreas")))
537+
while (true)
537538
{
538-
SString strPathFilename;
539-
// Check if user has started GTA
540-
if (LookForGtaProcess(strPathFilename))
539+
SString path;
540+
541+
if (LookForGtaProcess(path))
541542
{
542-
// If so, get the exe path
543-
ExtractFilename(strPathFilename, &strResult, NULL);
544-
// And then stop it
543+
ExtractFilename(path, &result, nullptr);
545544
TerminateGTAIfRunning();
546-
break;
545+
return result;
547546
}
548547

549-
Sleep(200);
548+
if (MessageBox(nullptr, _("Sorry, game not found.\nStart Grand Theft Auto: San Andreas and click retry.\nEnsure the game is placed in the 'Program Files (x86)' folder."), _("Searching for GTA: San Andreas"), MB_RETRYCANCEL | MB_ICONWARNING) == IDCANCEL)
549+
return result;
550550
}
551-
552-
HideProgressDialog();
553-
return strResult;
554551
}
555552

556553
///////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)