Renamed 'launch file' to 'folder link'.

This commit is contained in:
Leon Styhre 2022-04-12 18:35:57 +02:00
parent fefe149ab8
commit 963834afec
9 changed files with 32 additions and 32 deletions

View file

@ -1240,8 +1240,8 @@ void FileData::launchGame()
// Update last played time. // Update last played time.
gameToUpdate->metadata.set("lastplayed", Utils::Time::DateTime(Utils::Time::now())); gameToUpdate->metadata.set("lastplayed", Utils::Time::DateTime(Utils::Time::now()));
// If the cursor is a folder, the "launch file" functionality must have been used, so set // If the cursor is on a folder then a folder link must have been configured, so set the
// the lastplayed timestamp for this folder to the same as the launched game. // lastplayed timestamp for this folder to the same as the launched game.
FileData* cursor { FileData* cursor {
ViewController::getInstance()->getGamelistView(gameToUpdate->getSystem())->getCursor()}; ViewController::getInstance()->getGamelistView(gameToUpdate->getSystem())->getCursor()};
if (cursor->getType() == FOLDER) if (cursor->getType() == FOLDER)

View file

@ -63,7 +63,7 @@ namespace
{"nomultiscrape", MD_BOOL, "false", false, "exclude from multi-scraper", "enter no multi-scrape off/on", false}, {"nomultiscrape", MD_BOOL, "false", false, "exclude from multi-scraper", "enter no multi-scrape off/on", false},
{"hidemetadata", MD_BOOL, "false", false, "hide metadata fields", "enter hide metadata off/on", false}, {"hidemetadata", MD_BOOL, "false", false, "hide metadata fields", "enter hide metadata off/on", false},
{"controller", MD_CONTROLLER, "", false, "controller", "select controller", true}, {"controller", MD_CONTROLLER, "", false, "controller", "select controller", true},
{"launchfile", MD_LAUNCH_FILE, "", false, "launch file", "select launch file", false}, {"folderlink", MD_FOLDER_LINK, "", false, "folder link", "select folder link", false},
{"lastplayed", MD_TIME, "0", true, "last played", "enter last played date", false} {"lastplayed", MD_TIME, "0", true, "last played", "enter last played date", false}
}; };
// clang-format on // clang-format on

View file

@ -34,7 +34,7 @@ enum MetaDataType {
MD_MULTILINE_STRING, MD_MULTILINE_STRING,
MD_CONTROLLER, MD_CONTROLLER,
MD_ALT_EMULATOR, MD_ALT_EMULATOR,
MD_LAUNCH_FILE, MD_FOLDER_LINK,
MD_PATH, MD_PATH,
MD_RATING, MD_RATING,
MD_DATE, MD_DATE,

View file

@ -212,16 +212,16 @@ void Screensaver::nextGame()
void Screensaver::launchGame() void Screensaver::launchGame()
{ {
if (mCurrentGame != nullptr) { if (mCurrentGame != nullptr) {
// If the game is inside a folder where a "launch file" entry is present, then jump to // If the game is inside a folder where a folder link entry is present, then jump to
// that folder instead of to the actual game file. Also check the complete hierarchy in // that folder instead of to the actual game file. Also check the complete hierarchy in
// case launch file entries are set on multiple levels of the folder structure. // case folder link entries are set on multiple levels.
FileData* entry {mCurrentGame}; FileData* entry {mCurrentGame};
FileData* selectGame {mCurrentGame}; FileData* selectGame {mCurrentGame};
FileData* launchFolder {nullptr}; FileData* launchFolder {nullptr};
while (entry != nullptr) { while (entry != nullptr) {
entry = entry->getParent(); entry = entry->getParent();
if (entry != nullptr && entry->metadata.get("launchfile") != "") if (entry != nullptr && entry->metadata.get("folderlink") != "")
launchFolder = entry; launchFolder = entry;
} }
@ -248,7 +248,7 @@ void Screensaver::goToGame()
while (entry != nullptr) { while (entry != nullptr) {
entry = entry->getParent(); entry = entry->getParent();
if (entry != nullptr && entry->metadata.get("launchfile") != "") if (entry != nullptr && entry->metadata.get("folderlink") != "")
launchFolder = entry; launchFolder = entry;
} }

View file

@ -38,7 +38,7 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
, mCancelled {false} , mCancelled {false}
, mIsCustomCollection {false} , mIsCustomCollection {false}
, mIsCustomCollectionGroup {false} , mIsCustomCollectionGroup {false}
, mLaunchFileOverride {false} , mFolderLinkOverride {false}
, mCustomCollectionSystem {nullptr} , mCustomCollectionSystem {nullptr}
{ {
addChild(&mMenu); addChild(&mMenu);
@ -234,13 +234,13 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
} }
} }
if (file->getType() == FOLDER && file->metadata.get("launchfile") != "") { if (file->getType() == FOLDER && file->metadata.get("folderlink") != "") {
row.elements.clear(); row.elements.clear();
row.addElement(std::make_shared<TextComponent>("ENTER FOLDER (OVERRIDE LAUNCH FILE)", row.addElement(std::make_shared<TextComponent>("ENTER FOLDER (OVERRIDE FOLDER LINK)",
Font::get(FONT_SIZE_MEDIUM), 0x777777FF), Font::get(FONT_SIZE_MEDIUM), 0x777777FF),
true); true);
row.makeAcceptInputHandler([this, file] { row.makeAcceptInputHandler([this, file] {
mLaunchFileOverride = true; mFolderLinkOverride = true;
getGamelist()->enterDirectory(file); getGamelist()->enterDirectory(file);
delete this; delete this;
}); });
@ -328,7 +328,7 @@ GuiGamelistOptions::~GuiGamelistOptions()
} }
if (mSystem->getRootFolder()->getChildren().size() != 0 && mSystem->getName() != "recent" && if (mSystem->getRootFolder()->getChildren().size() != 0 && mSystem->getName() != "recent" &&
!mLaunchFileOverride) !mFolderLinkOverride)
NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND); NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND);
} }

View file

@ -59,7 +59,7 @@ private:
bool mCancelled; bool mCancelled;
bool mIsCustomCollection; bool mIsCustomCollection;
bool mIsCustomCollectionGroup; bool mIsCustomCollectionGroup;
bool mLaunchFileOverride; bool mFolderLinkOverride;
SystemData* mCustomCollectionSystem; SystemData* mCustomCollectionSystem;
std::vector<std::string> mFirstLetterIndex; std::vector<std::string> mFirstLetterIndex;
std::string mCurrentFirstCharacter; std::string mCurrentFirstCharacter;

View file

@ -52,7 +52,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
, mMediaFilesUpdated {false} , mMediaFilesUpdated {false}
, mSavedMediaAndAborted {false} , mSavedMediaAndAborted {false}
, mInvalidEmulatorEntry {false} , mInvalidEmulatorEntry {false}
, mInvalidLaunchFileEntry {false} , mInvalidFolderLinkEntry {false}
{ {
if (ViewController::getInstance()->getState().getSystem()->isCustomCollection() || if (ViewController::getInstance()->getState().getSystem()->isCustomCollection() ||
ViewController::getInstance()->getState().getSystem()->getThemeFolder() == ViewController::getInstance()->getState().getSystem()->getThemeFolder() ==
@ -405,7 +405,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
} }
break; break;
} }
case MD_LAUNCH_FILE: { case MD_FOLDER_LINK: {
ed = std::make_shared<TextComponent>( ed = std::make_shared<TextComponent>(
"", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT); "", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT);
row.addElement(ed, true); row.addElement(ed, true);
@ -423,7 +423,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
std::vector<FileData*> children; std::vector<FileData*> children;
if (originalValue != "") if (originalValue != "")
mInvalidLaunchFileEntry = true; mInvalidFolderLinkEntry = true;
for (auto child : mScraperParams.game->getChildrenRecursive()) { for (auto child : mScraperParams.game->getChildrenRecursive()) {
if (child->getType() == GAME && child->getCountAsGame() && if (child->getType() == GAME && child->getCountAsGame() &&
@ -433,13 +433,13 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
std::string systemPath {child->getSystem()->getRootFolder()->getPath() + std::string systemPath {child->getSystem()->getRootFolder()->getPath() +
"/" + mScraperParams.game->getFileName() + "/"}; "/" + mScraperParams.game->getFileName() + "/"};
if (Utils::String::replace(filePath, systemPath, "") == originalValue) if (Utils::String::replace(filePath, systemPath, "") == originalValue)
mInvalidLaunchFileEntry = false; mInvalidFolderLinkEntry = false;
} }
} }
// OK callback (apply new value to ed). // OK callback (apply new value to ed).
auto updateVal = [this, ed, originalValue](const std::string& newVal) { auto updateVal = [this, ed, originalValue](const std::string& newVal) {
mInvalidLaunchFileEntry = false; mInvalidFolderLinkEntry = false;
ed->setValue(newVal); ed->setValue(newVal);
if (newVal == originalValue) if (newVal == originalValue)
ed->setColor(DEFAULT_TEXTCOLOR); ed->setColor(DEFAULT_TEXTCOLOR);
@ -491,7 +491,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
clearText->setSelectable(true); clearText->setSelectable(true);
row.addElement(clearText, true); row.addElement(clearText, true);
row.makeAcceptInputHandler([this, s, ed] { row.makeAcceptInputHandler([this, s, ed] {
mInvalidLaunchFileEntry = false; mInvalidFolderLinkEntry = false;
ed->setValue(""); ed->setValue("");
delete s; delete s;
}); });
@ -596,7 +596,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
if (it->type == MD_ALT_EMULATOR && mInvalidEmulatorEntry) { if (it->type == MD_ALT_EMULATOR && mInvalidEmulatorEntry) {
ed->setValue(ViewController::EXCLAMATION_CHAR + " " + originalValue); ed->setValue(ViewController::EXCLAMATION_CHAR + " " + originalValue);
} }
else if (it->type == MD_LAUNCH_FILE && mInvalidLaunchFileEntry) { else if (it->type == MD_FOLDER_LINK && mInvalidFolderLinkEntry) {
ed->setValue(ViewController::EXCLAMATION_CHAR + " " + originalValue); ed->setValue(ViewController::EXCLAMATION_CHAR + " " + originalValue);
} }
else if (it->type == MD_CONTROLLER && mMetaData->get(it->key) != "") { else if (it->type == MD_CONTROLLER && mMetaData->get(it->key) != "") {
@ -747,7 +747,7 @@ void GuiMetaDataEd::save()
if (key == "altemulator" && mInvalidEmulatorEntry == true) if (key == "altemulator" && mInvalidEmulatorEntry == true)
continue; continue;
if (key == "launchfile" && mInvalidLaunchFileEntry) if (key == "folderlink" && mInvalidFolderLinkEntry)
continue; continue;
if (key == "controller" && mEditors.at(i)->getValue() != "") { if (key == "controller" && mEditors.at(i)->getValue() != "") {
@ -921,7 +921,7 @@ void GuiMetaDataEd::close()
if (key == "altemulator" && mInvalidEmulatorEntry) if (key == "altemulator" && mInvalidEmulatorEntry)
continue; continue;
if (key == "launchfile" && mInvalidLaunchFileEntry) if (key == "folderlink" && mInvalidFolderLinkEntry)
continue; continue;
std::string mMetaDataValue {mMetaData->get(key)}; std::string mMetaDataValue {mMetaData->get(key)};

View file

@ -73,7 +73,7 @@ private:
bool mMediaFilesUpdated; bool mMediaFilesUpdated;
bool mSavedMediaAndAborted; bool mSavedMediaAndAborted;
bool mInvalidEmulatorEntry; bool mInvalidEmulatorEntry;
bool mInvalidLaunchFileEntry; bool mInvalidFolderLinkEntry;
}; };
#endif // ES_APP_GUIS_GUI_META_DATA_ED_H #endif // ES_APP_GUIS_GUI_META_DATA_ED_H

View file

@ -78,18 +78,18 @@ bool GamelistBase::input(InputConfig* config, Input input)
// It's a folder. // It's a folder.
if (cursor->getChildren().size() > 0) { if (cursor->getChildren().size() > 0) {
ViewController::getInstance()->cancelViewTransitions(); ViewController::getInstance()->cancelViewTransitions();
// If a "launch file" entry has been set on the folder, then check if it // If a folder link entry has been set on the folder, then check if it
// corresponds to an actual child entry, and if so then launch this child // corresponds to an actual child entry, and if so then launch this child
// instead of entering the folder. // instead of entering the folder.
if (!CollectionSystemsManager::getInstance()->isEditing() && if (!CollectionSystemsManager::getInstance()->isEditing() &&
cursor->metadata.get("launchfile") != "") { cursor->metadata.get("folderlink") != "") {
std::string launchFile; std::string folderLink;
launchFile.append(cursor->getPath()) folderLink.append(cursor->getPath())
.append("/") .append("/")
.append(Utils::String::replace(cursor->metadata.get("launchfile"), "\\", .append(Utils::String::replace(cursor->metadata.get("folderlink"), "\\",
"/")); "/"));
for (auto child : cursor->getChildrenRecursive()) { for (auto child : cursor->getChildrenRecursive()) {
if (child->getPath() == launchFile) { if (child->getPath() == folderLink) {
pauseViewVideos(); pauseViewVideos();
ViewController::getInstance()->cancelViewTransitions(); ViewController::getInstance()->cancelViewTransitions();
stopListScrolling(); stopListScrolling();
@ -599,13 +599,13 @@ void GamelistBase::populateList(const std::vector<FileData*>& files, FileData* f
else if ((*it)->getType() == FOLDER && else if ((*it)->getType() == FOLDER &&
mRoot->getSystem()->getName() != "collections") { mRoot->getSystem()->getName() != "collections") {
if (Settings::getInstance()->getBool("SpecialCharsASCII")) { if (Settings::getInstance()->getBool("SpecialCharsASCII")) {
if ((*it)->metadata.get("launchfile") != "") if ((*it)->metadata.get("folderlink") != "")
name = "> " + (*it)->getName(); name = "> " + (*it)->getName();
else else
name = "# " + (*it)->getName(); name = "# " + (*it)->getName();
} }
else { else {
if ((*it)->metadata.get("launchfile") != "") if ((*it)->metadata.get("folderlink") != "")
name = ViewController::FOLDERLINK_CHAR + " " + (*it)->getName(); name = ViewController::FOLDERLINK_CHAR + " " + (*it)->getName();
else else
name = ViewController::FOLDER_CHAR + " " + (*it)->getName(); name = ViewController::FOLDER_CHAR + " " + (*it)->getName();