本文整理汇总了C++中menu::optSelected方法的典型用法代码示例。如果您正苦于以下问题:C++ menu::optSelected方法的具体用法?C++ menu::optSelected怎么用?C++ menu::optSelected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类menu
的用法示例。
在下文中一共展示了menu::optSelected方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: autoRestore
void autoRestore(menu m)
{
//This still needs user input.
for(unsigned i = 0; i < m.getSize(); i++)
{
FS_Archive saveArch;
if(m.optSelected(i) && openSaveArch(&saveArch, sdTitle[i], false))
restoreData(sdTitle[i], saveArch, MODE_SAVE);
FSUSER_CloseArchive(&saveArch);
FS_Archive extArch;
if(m.optSelected(i) && openExtdata(&extArch, sdTitle[i], false))
restoreData(sdTitle[i], extArch, MODE_EXTDATA);
FSUSER_CloseArchive(&extArch);
}
}
示例2: autoBackup
void autoBackup(menu m)
{
showMessage("This can take a few minutes depending on how many titles are selected.");
progressBar autoDump((float)m.getSelectCount(), "Copying saves...");
//Keep track of what's done
float dumpCount = 0;
for(unsigned i = 0; i < m.getSize(); i++)
{
//This is for titles with no save archive ex. Fantasy Life
bool dumped = false;
FS_Archive saveArch;
if(m.optSelected(i) && openSaveArch(&saveArch, sdTitle[i], false))//if it's selected and we can open save archive
{
createTitleDir(sdTitle[i], MODE_SAVE);
backupData(sdTitle[i], saveArch, MODE_SAVE, true);
dumpCount++;
dumped = true;
}
FSUSER_CloseArchive(&saveArch);
FS_Archive extArch;
if(m.optSelected(i) && openExtdata(&extArch, sdTitle[i], false))
{
createTitleDir(sdTitle[i], MODE_EXTDATA);
backupData(sdTitle[i], extArch, MODE_EXTDATA, true);
//check first to make sure we don't count it twice because no save arch
if(!dumped)
dumpCount++;
}
FSUSER_CloseArchive(&extArch);
sf2d_start_frame(GFX_BOTTOM, GFX_LEFT);
autoDump.draw(i);
sf2d_end_frame();
sf2d_swapbuffers();
}
showMessage("Complete!");
}