mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 07:35:38 +00:00
Renamed 'launch file' to 'folder link'.
This commit is contained in:
parent
fefe149ab8
commit
963834afec
|
@ -1240,8 +1240,8 @@ void FileData::launchGame()
|
|||
// Update last played time.
|
||||
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
|
||||
// the lastplayed timestamp for this folder to the same as the launched game.
|
||||
// If the cursor is on a folder then a folder link must have been configured, so set the
|
||||
// lastplayed timestamp for this folder to the same as the launched game.
|
||||
FileData* cursor {
|
||||
ViewController::getInstance()->getGamelistView(gameToUpdate->getSystem())->getCursor()};
|
||||
if (cursor->getType() == FOLDER)
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace
|
|||
{"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},
|
||||
{"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}
|
||||
};
|
||||
// clang-format on
|
||||
|
|
|
@ -34,7 +34,7 @@ enum MetaDataType {
|
|||
MD_MULTILINE_STRING,
|
||||
MD_CONTROLLER,
|
||||
MD_ALT_EMULATOR,
|
||||
MD_LAUNCH_FILE,
|
||||
MD_FOLDER_LINK,
|
||||
MD_PATH,
|
||||
MD_RATING,
|
||||
MD_DATE,
|
||||
|
|
|
@ -212,16 +212,16 @@ void Screensaver::nextGame()
|
|||
void Screensaver::launchGame()
|
||||
{
|
||||
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
|
||||
// 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* selectGame {mCurrentGame};
|
||||
FileData* launchFolder {nullptr};
|
||||
|
||||
while (entry != nullptr) {
|
||||
entry = entry->getParent();
|
||||
if (entry != nullptr && entry->metadata.get("launchfile") != "")
|
||||
if (entry != nullptr && entry->metadata.get("folderlink") != "")
|
||||
launchFolder = entry;
|
||||
}
|
||||
|
||||
|
@ -248,7 +248,7 @@ void Screensaver::goToGame()
|
|||
|
||||
while (entry != nullptr) {
|
||||
entry = entry->getParent();
|
||||
if (entry != nullptr && entry->metadata.get("launchfile") != "")
|
||||
if (entry != nullptr && entry->metadata.get("folderlink") != "")
|
||||
launchFolder = entry;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
|
|||
, mCancelled {false}
|
||||
, mIsCustomCollection {false}
|
||||
, mIsCustomCollectionGroup {false}
|
||||
, mLaunchFileOverride {false}
|
||||
, mFolderLinkOverride {false}
|
||||
, mCustomCollectionSystem {nullptr}
|
||||
{
|
||||
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.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),
|
||||
true);
|
||||
row.makeAcceptInputHandler([this, file] {
|
||||
mLaunchFileOverride = true;
|
||||
mFolderLinkOverride = true;
|
||||
getGamelist()->enterDirectory(file);
|
||||
delete this;
|
||||
});
|
||||
|
@ -328,7 +328,7 @@ GuiGamelistOptions::~GuiGamelistOptions()
|
|||
}
|
||||
|
||||
if (mSystem->getRootFolder()->getChildren().size() != 0 && mSystem->getName() != "recent" &&
|
||||
!mLaunchFileOverride)
|
||||
!mFolderLinkOverride)
|
||||
NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND);
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ private:
|
|||
bool mCancelled;
|
||||
bool mIsCustomCollection;
|
||||
bool mIsCustomCollectionGroup;
|
||||
bool mLaunchFileOverride;
|
||||
bool mFolderLinkOverride;
|
||||
SystemData* mCustomCollectionSystem;
|
||||
std::vector<std::string> mFirstLetterIndex;
|
||||
std::string mCurrentFirstCharacter;
|
||||
|
|
|
@ -52,7 +52,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
|||
, mMediaFilesUpdated {false}
|
||||
, mSavedMediaAndAborted {false}
|
||||
, mInvalidEmulatorEntry {false}
|
||||
, mInvalidLaunchFileEntry {false}
|
||||
, mInvalidFolderLinkEntry {false}
|
||||
{
|
||||
if (ViewController::getInstance()->getState().getSystem()->isCustomCollection() ||
|
||||
ViewController::getInstance()->getState().getSystem()->getThemeFolder() ==
|
||||
|
@ -405,7 +405,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case MD_LAUNCH_FILE: {
|
||||
case MD_FOLDER_LINK: {
|
||||
ed = std::make_shared<TextComponent>(
|
||||
"", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT);
|
||||
row.addElement(ed, true);
|
||||
|
@ -423,7 +423,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
|||
|
||||
std::vector<FileData*> children;
|
||||
if (originalValue != "")
|
||||
mInvalidLaunchFileEntry = true;
|
||||
mInvalidFolderLinkEntry = true;
|
||||
|
||||
for (auto child : mScraperParams.game->getChildrenRecursive()) {
|
||||
if (child->getType() == GAME && child->getCountAsGame() &&
|
||||
|
@ -433,13 +433,13 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
|||
std::string systemPath {child->getSystem()->getRootFolder()->getPath() +
|
||||
"/" + mScraperParams.game->getFileName() + "/"};
|
||||
if (Utils::String::replace(filePath, systemPath, "") == originalValue)
|
||||
mInvalidLaunchFileEntry = false;
|
||||
mInvalidFolderLinkEntry = false;
|
||||
}
|
||||
}
|
||||
|
||||
// OK callback (apply new value to ed).
|
||||
auto updateVal = [this, ed, originalValue](const std::string& newVal) {
|
||||
mInvalidLaunchFileEntry = false;
|
||||
mInvalidFolderLinkEntry = false;
|
||||
ed->setValue(newVal);
|
||||
if (newVal == originalValue)
|
||||
ed->setColor(DEFAULT_TEXTCOLOR);
|
||||
|
@ -491,7 +491,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
|||
clearText->setSelectable(true);
|
||||
row.addElement(clearText, true);
|
||||
row.makeAcceptInputHandler([this, s, ed] {
|
||||
mInvalidLaunchFileEntry = false;
|
||||
mInvalidFolderLinkEntry = false;
|
||||
ed->setValue("");
|
||||
delete s;
|
||||
});
|
||||
|
@ -596,7 +596,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
|||
if (it->type == MD_ALT_EMULATOR && mInvalidEmulatorEntry) {
|
||||
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);
|
||||
}
|
||||
else if (it->type == MD_CONTROLLER && mMetaData->get(it->key) != "") {
|
||||
|
@ -747,7 +747,7 @@ void GuiMetaDataEd::save()
|
|||
if (key == "altemulator" && mInvalidEmulatorEntry == true)
|
||||
continue;
|
||||
|
||||
if (key == "launchfile" && mInvalidLaunchFileEntry)
|
||||
if (key == "folderlink" && mInvalidFolderLinkEntry)
|
||||
continue;
|
||||
|
||||
if (key == "controller" && mEditors.at(i)->getValue() != "") {
|
||||
|
@ -921,7 +921,7 @@ void GuiMetaDataEd::close()
|
|||
if (key == "altemulator" && mInvalidEmulatorEntry)
|
||||
continue;
|
||||
|
||||
if (key == "launchfile" && mInvalidLaunchFileEntry)
|
||||
if (key == "folderlink" && mInvalidFolderLinkEntry)
|
||||
continue;
|
||||
|
||||
std::string mMetaDataValue {mMetaData->get(key)};
|
||||
|
|
|
@ -73,7 +73,7 @@ private:
|
|||
bool mMediaFilesUpdated;
|
||||
bool mSavedMediaAndAborted;
|
||||
bool mInvalidEmulatorEntry;
|
||||
bool mInvalidLaunchFileEntry;
|
||||
bool mInvalidFolderLinkEntry;
|
||||
};
|
||||
|
||||
#endif // ES_APP_GUIS_GUI_META_DATA_ED_H
|
||||
|
|
|
@ -78,18 +78,18 @@ bool GamelistBase::input(InputConfig* config, Input input)
|
|||
// It's a folder.
|
||||
if (cursor->getChildren().size() > 0) {
|
||||
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
|
||||
// instead of entering the folder.
|
||||
if (!CollectionSystemsManager::getInstance()->isEditing() &&
|
||||
cursor->metadata.get("launchfile") != "") {
|
||||
std::string launchFile;
|
||||
launchFile.append(cursor->getPath())
|
||||
cursor->metadata.get("folderlink") != "") {
|
||||
std::string folderLink;
|
||||
folderLink.append(cursor->getPath())
|
||||
.append("/")
|
||||
.append(Utils::String::replace(cursor->metadata.get("launchfile"), "\\",
|
||||
.append(Utils::String::replace(cursor->metadata.get("folderlink"), "\\",
|
||||
"/"));
|
||||
for (auto child : cursor->getChildrenRecursive()) {
|
||||
if (child->getPath() == launchFile) {
|
||||
if (child->getPath() == folderLink) {
|
||||
pauseViewVideos();
|
||||
ViewController::getInstance()->cancelViewTransitions();
|
||||
stopListScrolling();
|
||||
|
@ -599,13 +599,13 @@ void GamelistBase::populateList(const std::vector<FileData*>& files, FileData* f
|
|||
else if ((*it)->getType() == FOLDER &&
|
||||
mRoot->getSystem()->getName() != "collections") {
|
||||
if (Settings::getInstance()->getBool("SpecialCharsASCII")) {
|
||||
if ((*it)->metadata.get("launchfile") != "")
|
||||
if ((*it)->metadata.get("folderlink") != "")
|
||||
name = "> " + (*it)->getName();
|
||||
else
|
||||
name = "# " + (*it)->getName();
|
||||
}
|
||||
else {
|
||||
if ((*it)->metadata.get("launchfile") != "")
|
||||
if ((*it)->metadata.get("folderlink") != "")
|
||||
name = ViewController::FOLDERLINK_CHAR + " " + (*it)->getName();
|
||||
else
|
||||
name = ViewController::FOLDER_CHAR + " " + (*it)->getName();
|
||||
|
|
Loading…
Reference in a new issue