Compare commits

...

4 commits

Author SHA1 Message Date
XargonWan 3af3ac03d9
Merge a976afc378 into 98421be00c 2024-11-19 19:52:52 +00:00
XargonWan 98421be00c Fixed not showing version on GuiMenu and added an additional RetroDECK definition for "Quit RetroDECK"
Some checks failed
Build ES-DE / Building_RetroDECK-ES-DE (push) Has been cancelled
2024-11-19 12:01:05 +09:00
XargonWan a976afc378 Comments [skip ci] 2024-09-23 20:50:50 +09:00
XargonWan 7302759474 Added Xenia Canary 2024-09-19 14:38:31 +09:00
3 changed files with 38 additions and 25 deletions

View file

@ -93,7 +93,7 @@ GuiMenu::GuiMenu()
if (!Settings::getInstance()->getBool("ForceKiosk") &&
Settings::getInstance()->getString("UIMode") != "kiosk") {
#if defined(__APPLE__)
addEntry(_("QUIT ES-DE")}, mMenuColorPrimary, false, [this] { openQuitMenu(); });
addEntry(_("QUIT ES-DE"), mMenuColorPrimary, false, [this] { openQuitMenu(); });
#elif defined(__ANDROID__)
if (!AndroidVariables::sIsHomeApp)
addEntry(_("QUIT ES-DE"), mMenuColorPrimary, false, [this] { openQuitMenu(); });
@ -2305,7 +2305,11 @@ void GuiMenu::openQuitMenu()
_("NO"), nullptr));
});
auto quitText = std::make_shared<TextComponent>(
#if not defined RETRODECK
("QUIT ES-DE"), Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
# else // RetroDECK is defined
_("QUIT RETRODECK"), Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
#endif
quitText->setSelectable(true);
row.addElement(quitText, true);
s->addRow(row);
@ -2351,28 +2355,12 @@ void GuiMenu::openQuitMenu()
void GuiMenu::addVersionInfo()
{
mVersion.setFont(Font::get(FONT_SIZE_SMALL));
mVersion.setAutoCalcExtent(glm::ivec2 {0, 0});
mVersion.setColor(mMenuColorTertiary);
#if defined(RETRODECK)
// 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("RetroDECK " + retroDeckVersion);
LOG(LogInfo) << "RetroDECK version read OK.";
} else {
LOG(LogInfo) << "Error: Cannot read version from file or file is empty!";
retroDeckVersion = "UNKNOWN";
mVersion.setText("RetroDECK " + retroDeckVersion);
}
#else // If RETRODECK is NOT defined, execute this block
const std::string applicationName {"ES-DE"};
#if defined(IS_PRERELEASE)
#if defined(__ANDROID__)
@ -2391,7 +2379,26 @@ void GuiMenu::addVersionInfo()
#endif
#endif
#endif // End of RetroDECK logic check
#if defined(RETRODECK)
// 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()) {
LOG(LogInfo) << "RetroDECK version read OK. Version: " + retroDeckVersion;
mVersion.setText("RetroDECK " + retroDeckVersion);
} else {
LOG(LogInfo) << "Error: Cannot read version from file or file is empty!";
retroDeckVersion = "UNKNOWN";
mVersion.setText("RetroDECK " + retroDeckVersion);
}
#endif
mVersion.setHorizontalAlignment(ALIGN_CENTER);
addChild(&mVersion);
}
void GuiMenu::openThemeDownloader(GuiSettings* settings)

View file

@ -1136,6 +1136,13 @@
<entry>~/bin/Wine/wine*.AppImage</entry>
</rule>
</emulator>
<emulator name="XENIA-CANARY">
<!-- Microsoft Xbox 360 emulator xenia -->
<!-- RetroDECK -->
<rule type="systempath">
<entry>xenia-canary</entry>
</rule>
</emulator>
<emulator name="XENIA-WINDOWS">
<!-- Microsoft Xbox 360 emulator xenia -->
<rule type="staticpath">

View file

@ -2315,19 +2315,18 @@
<platform>xbox</platform>
<theme>xbox</theme>
</system>
<!--
<system>
<name>xbox360</name>
<fullname>Microsoft Xbox 360</fullname>
<path>%ROMPATH%/xbox360</path>
<extension>. .desktop .iso .ISO .sh .xex .XEX .zar .ZAR</extension>
<command label="xenia (Wine)">%STARTDIR%=%EMUDIR% %PRECOMMAND_WINE% %EMULATOR_XENIA-WINDOWS% %ROM%</command>
<command label="xenia (Proton)">%STARTDIR%=%EMUDIR% %PRECOMMAND_PROTON% %EMULATOR_XENIA-WINDOWS% %ROM%</command>
<command label="Shortcut or script">%ENABLESHORTCUTS% %EMULATOR_OS-SHELL% %ROM%</command>
<command label="Xenia Canary">%EMULATOR_XENIA-CANARY% %ROM%</command> <!-- RetroDECK -->
<!-- <command label="xenia (Wine)">%STARTDIR%=%EMUDIR% %PRECOMMAND_WINE% %EMULATOR_XENIA-WINDOWS% %ROM%</command> -->
<!-- <command label="xenia (Proton)">%STARTDIR%=%EMUDIR% %PRECOMMAND_PROTON% %EMULATOR_XENIA-WINDOWS% %ROM%</command> -->
<!-- <command label="Shortcut or script">%ENABLESHORTCUTS% %EMULATOR_OS-SHELL% %ROM%</command> -->
<platform>xbox360</platform>
<theme>xbox360</theme>
</system>
-->
<!--
<system>
<name>zmachine</name>