bool ISimpleGameListView::input(InputConfig* config, Input input) { if(input.value != 0) { if(config->isMappedTo("a", input)) { LOG(LogDebug) << "ISimpleGameListView::input(): a detected!"; FileData* cursor = getCursor(); if(cursor->getType() == GAME) { Sound::getFromTheme(getTheme(), getName(), "launch")->play(); launch(cursor); }else{ // it's a folder if(cursor->getChildren().size() > 0) { mCursorStack.push(cursor); populateList(cursor->getChildren()); } } return true; }else if(config->isMappedTo("b", input)) { LOG(LogDebug) << "ISimpleGameListView::input(): b detected!"; if(mCursorStack.size()) { populateList(mCursorStack.top()->getParent()->getChildren()); setCursor(mCursorStack.top()); mCursorStack.pop(); Sound::getFromTheme(getTheme(), getName(), "back")->play(); }else{ onFocusLost(); if (mFavoriteChange || mKidGameChange) { ViewController::get()->setInvalidGamesList(getCursor()->getSystem()); mFavoriteChange = false; mKidGameChange = false; } ViewController::get()->goToSystemView(getCursor()->getSystem()); } return true; }else if (config->isMappedTo("x", input)) { FileData* cursor = getCursor(); LOG(LogDebug) << "ISimpleGameListView::input(): x detected!"; if (cursor->getSystem()->getHasFavorites()) { if (cursor->getType() == GAME) { mFavoriteChange = true; MetaDataList* md = &cursor->metadata; std::string value = md->get("favorite"); LOG(LogDebug) << "Favorite = "<< value; if (value.compare("false") == 0) { md->set("favorite", "true"); }else { md->set("favorite", "false"); } LOG(LogDebug) << "New Favorite value set to: "<< md->get("favorite"); updateInfoPanel(); } } }else if (config->isMappedTo("y", input)) { LOG(LogDebug) << "ISimpleGameListView::input(): y detected!"; FileData* cursor = getCursor(); if (cursor->getSystem()->getHasKidGames() && !mFilterHidden) // only when kidgames are supported by system+theme, and when in UImode=full { if (cursor->getType() == GAME) { mKidGameChange = true; MetaDataList* md = &cursor->metadata; std::string value = md->get("kidgame"); LOG(LogDebug) << "kidgame = "<< value; if (value.compare("false") == 0) { md->set("kidgame", "true"); } else { md->set("kidgame", "false"); } LOG(LogDebug) << "New kidgame value set to: "<< md->get("kidgame"); updateInfoPanel(); } } }else if(config->isMappedTo("right", input)) { if(Settings::getInstance()->getBool("QuickSystemSelect")) { onFocusLost(); if (mFavoriteChange || mKidGameChange) { ViewController::get()->setInvalidGamesList(getCursor()->getSystem()); mFavoriteChange = false; mKidGameChange = false; } ViewController::get()->goToNextGameList(mFilterHidden, mFilterFav, mFilterKid); return true; } }else if(config->isMappedTo("left", input)) { if(Settings::getInstance()->getBool("QuickSystemSelect")) { onFocusLost(); if (mFavoriteChange || mKidGameChange) { ViewController::get()->setInvalidGamesList(getCursor()->getSystem()); mFavoriteChange = false; mKidGameChange = false; } ViewController::get()->goToPrevGameList(mFilterHidden, mFilterFav, mFilterKid); return true; } } } return IGameListView::input(config, input); }
bool ISimpleGameListView::input(InputConfig* config, Input input) { if(input.value != 0) { if(config->isMappedTo("a", input)) { FileData* cursor = getCursor(); if(cursor->getType() == GAME) { //Sound::getFromTheme(getTheme(), getName(), "launch")->play(); launch(cursor); }else{ // it's a folder if(cursor->getChildren().size() > 0) { mCursorStack.push(cursor); populateList(cursor->getChildren()); } } return true; }else if(config->isMappedTo("b", input)) { if(mCursorStack.size()) { populateList(mCursorStack.top()->getParent()->getChildren()); setCursor(mCursorStack.top()); mCursorStack.pop(); //Sound::getFromTheme(getTheme(), getName(), "back")->play(); }else{ onFocusLost(); if (mFavoriteChange) { ViewController::get()->setInvalidGamesList(getCursor()->getSystem()); mFavoriteChange = false; } ViewController::get()->goToSystemView(getCursor()->getSystem()); } return true; }else if (config->isMappedTo("y", input)) { FileData* cursor = getCursor(); if (cursor->getSystem()->getHasFavorites()) { if (cursor->getType() == GAME) { mFavoriteChange = true; MetaDataList* md = &cursor->metadata; std::string value = md->get("favorite"); if (value.compare("no") == 0) { md->set("favorite", "yes"); } else { md->set("favorite", "no"); } FileData* cursor = getCursor(); populateList(cursor->getParent()->getChildren()); setCursor(cursor); updateInfoPanel(); } } }else if(config->isMappedTo("right", input)) { if(Settings::getInstance()->getBool("QuickSystemSelect")) { onFocusLost(); if (mFavoriteChange) { ViewController::get()->setInvalidGamesList(getCursor()->getSystem()); mFavoriteChange = false; } ViewController::get()->goToNextGameList(); return true; } }else if(config->isMappedTo("left", input)) { if(Settings::getInstance()->getBool("QuickSystemSelect")) { onFocusLost(); if (mFavoriteChange) { ViewController::get()->setInvalidGamesList(getCursor()->getSystem()); mFavoriteChange = false; } ViewController::get()->goToPrevGameList(); return true; } } } return IGameListView::input(config, input); }