mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-12-12 15:35:39 +00:00
Compare commits
5 commits
8d38b741d8
...
d3f0041043
Author | SHA1 | Date | |
---|---|---|---|
XargonWan | d3f0041043 | ||
XargonWan | 9173b3cdc1 | ||
XargonWan | 2384ad2ab2 | ||
XargonWan | 5d75983b3f | ||
XargonWan | c0efc79ae8 |
|
@ -2362,40 +2362,43 @@ void GuiMenu::addVersionInfo()
|
|||
"ES-DE";
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__RETRODECK__)
|
||||
std::ifstream file("/app/retrodeck/version");
|
||||
std::string version;
|
||||
if (file.is_open() && std::getline(file, version) && !version.empty()) {
|
||||
file.close();
|
||||
#undef PROGRAM_VERSION_STRING
|
||||
#define PROGRAM_VERSION_STRING version.c_str()
|
||||
std::cout << "Version read from file: " << PROGRAM_VERSION_STRING << std::endl;
|
||||
// Only execute this block if RETRODECK is defined
|
||||
LOG(LogInfo) << "Reading /app/retrodeck/version...";
|
||||
std::ifstream versionFile("/app/retrodeck/version");
|
||||
std::string retroDeckVersion;
|
||||
|
||||
// Attempt to open the version file and read a line into retroDeckVersion;
|
||||
// also check that the line is not empty to ensure valid version information
|
||||
if (versionFile && std::getline(versionFile, retroDeckVersion) && !retroDeckVersion.empty()) {
|
||||
mVersion.setText(applicationName + " " + retroDeckVersion);
|
||||
LOG(LogInfo) << "RetroDECK version read OK.";
|
||||
} else {
|
||||
std::cerr << "Error: Cannot read version from file or file is empty!" << std::endl;
|
||||
// Set a default value in case the file can't be read
|
||||
#define PROGRAM_VERSION_STRING "UNKNOWN"
|
||||
LOG(LogInfo) << "Error: Cannot read version from file or file is empty!";
|
||||
retroDeckVersion = "UNKNOWN";
|
||||
mVersion.setText(applicationName + " " + retroDeckVersion);
|
||||
}
|
||||
#else // not RetroDECK
|
||||
|
||||
#if defined(IS_PRERELEASE)
|
||||
#if defined(__ANDROID__)
|
||||
mVersion.setText(applicationName + " " + Utils::String::toUpper(PROGRAM_VERSION_STRING) + "-" +
|
||||
std::to_string(ANDROID_VERSION_CODE) + " (Built " + __DATE__ + ")");
|
||||
#else
|
||||
mVersion.setText(applicationName + " " + Utils::String::toUpper(PROGRAM_VERSION_STRING) +
|
||||
" (Built " + __DATE__ + ")");
|
||||
#endif
|
||||
#else
|
||||
#if defined(__ANDROID__)
|
||||
mVersion.setText(applicationName + " " + Utils::String::toUpper(PROGRAM_VERSION_STRING) + "-" +
|
||||
std::to_string(ANDROID_VERSION_CODE));
|
||||
#else
|
||||
mVersion.setText(applicationName + " " + Utils::String::toUpper(PROGRAM_VERSION_STRING));
|
||||
#endif
|
||||
#endif
|
||||
#else // If RETRODECK is NOT defined, execute this block
|
||||
|
||||
#endif //RetroDECK
|
||||
#if defined(IS_PRERELEASE)
|
||||
#if defined(__ANDROID__)
|
||||
mVersion.setText(applicationName + " " + Utils::String::toUpper(PROGRAM_VERSION_STRING) + "-" +
|
||||
std::to_string(ANDROID_VERSION_CODE) + " (Built " + __DATE__ + ")");
|
||||
#else
|
||||
mVersion.setText(applicationName + " " + Utils::String::toUpper(PROGRAM_VERSION_STRING) +
|
||||
" (Built " + __DATE__ + ")");
|
||||
#endif
|
||||
#else
|
||||
#if defined(__ANDROID__)
|
||||
mVersion.setText(applicationName + " " + Utils::String::toUpper(PROGRAM_VERSION_STRING) + "-" +
|
||||
std::to_string(ANDROID_VERSION_CODE));
|
||||
#else
|
||||
mVersion.setText(applicationName + " " + Utils::String::toUpper(PROGRAM_VERSION_STRING));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // End of RetroDECK logic check
|
||||
}
|
||||
|
||||
void GuiMenu::openThemeDownloader(GuiSettings* settings)
|
||||
|
|
|
@ -262,16 +262,16 @@ void ViewController::invalidSystemsFileDialog()
|
|||
|
||||
void ViewController::noGamesDialog()
|
||||
{
|
||||
#if defined(__ANDROID__)
|
||||
#if defined(__RETRODECK__)
|
||||
mNoGamesErrorMessage = _("NO GAME WERE FOUND. PLEASE PLACE YOUR GAMES IN "
|
||||
"THE RETRODECK ROM DIRECTORY LOCATED IN:\n");
|
||||
#elif defined(__ANDROID__)
|
||||
mNoGamesErrorMessage = _("NO GAME FILES WERE FOUND, PLEASE PLACE YOUR GAMES IN "
|
||||
"THE CONFIGURED ROM DIRECTORY. OPTIONALLY THE ROM "
|
||||
"DIRECTORY STRUCTURE CAN BE GENERATED WHICH WILL "
|
||||
"CREATE A TEXT FILE FOR EACH SYSTEM PROVIDING SOME "
|
||||
"INFORMATION SUCH AS THE SUPPORTED FILE EXTENSIONS.\n"
|
||||
"THIS IS THE CURRENTLY CONFIGURED ROM DIRECTORY:\n");
|
||||
#elif defined(__RETRODECK__)
|
||||
mNoGamesErrorMessage = _("NO GAME WERE FOUND. PLEASE PLACE YOUR GAMES IN "
|
||||
"THE RETRODECK ROM DIRECTORY LOCATED IN:\n");
|
||||
#else
|
||||
mNoGamesErrorMessage = _("NO GAME FILES WERE FOUND. EITHER PLACE YOUR GAMES IN "
|
||||
"THE CURRENTLY CONFIGURED ROM DIRECTORY OR CHANGE "
|
||||
|
@ -289,6 +289,7 @@ void ViewController::noGamesDialog()
|
|||
#endif
|
||||
|
||||
#if defined(__RETRODECK__)
|
||||
// Show a simple message with a "QUIT" option if RETRODECK is defined
|
||||
mNoGamesMessageBox = new GuiMsgBox(
|
||||
HelpStyle(),
|
||||
mNoGamesErrorMessage + mRomDirectory,
|
||||
|
@ -297,9 +298,11 @@ void ViewController::noGamesDialog()
|
|||
SDL_Event quit {};
|
||||
quit.type = SDL_QUIT;
|
||||
SDL_PushEvent(&quit);
|
||||
},
|
||||
)
|
||||
#elif defined(__ANDROID__)
|
||||
}
|
||||
);
|
||||
#else
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
mNoGamesMessageBox = new GuiMsgBox(
|
||||
HelpStyle(), mNoGamesErrorMessage + mRomDirectory,
|
||||
#else
|
||||
|
@ -418,13 +421,14 @@ void ViewController::noGamesDialog()
|
|||
"", nullptr, nullptr, true, false,
|
||||
(mRenderer->getIsVerticalOrientation() ?
|
||||
0.90f :
|
||||
0.58f * (1.778f / mRenderer->getScreenAspectRatio()));
|
||||
0.58f * (1.778f / mRenderer->getScreenAspectRatio())));
|
||||
#else
|
||||
nullptr, true, false,
|
||||
(mRenderer->getIsVerticalOrientation() ?
|
||||
0.90f :
|
||||
0.62f * (1.778f / mRenderer->getScreenAspectRatio()));
|
||||
0.62f * (1.778f / mRenderer->getScreenAspectRatio())));
|
||||
#endif
|
||||
#endif // RetroDECK
|
||||
|
||||
mWindow->pushGui(mNoGamesMessageBox);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue