本文整理汇总了C++中Args::getArgValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Args::getArgValue方法的具体用法?C++ Args::getArgValue怎么用?C++ Args::getArgValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Args
的用法示例。
在下文中一共展示了Args::getArgValue方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showPrompt
void InternalLink::showPrompt(DesuraId id, Args args)
{
std::string prompt = args.getArgValue("prompt");
UserCore::Item::ItemInfoI* item = GetUserCore()->getItemManager()->findItemInfo( id );
if (prompt == "update")
{
std::vector<std::string> a;
a.push_back("reminder=true");
showUpdateForm(id, Args(a));
}
else if (prompt == "launch")
{
LaunchItemDialog* form = new LaunchItemDialog(m_pParent);
regForm(id, form);
form->setInfo(item);
form->Show(true);
form->Raise();
}
else if (prompt == "eula")
{
showEULA(id);
}
else if (prompt == "preload")
{
showPreorderPrompt(id, true);
}
}
示例2: installItem
void InternalLink::installItem(DesuraId id, Args args)
{
std::string branch = args.getArgValue("branch");
std::string global = args.getArgValue("global");
MCFBranch iBranch;
if (branch == "shortcut" || global == "shortcut")
{
iBranch = MCFBranch::BranchFromInt(-1);
}
else if (global.size() > 0)
{
iBranch = MCFBranch::BranchFromInt(Safe::atoi(global.c_str()), true);
}
else
{
iBranch = MCFBranch::BranchFromInt(Safe::atoi(branch.c_str()));
}
g_pMainApp->showPlay();
if (iBranch == 0 && !args.containsArg("skippreorder") && checkForPreorder(id))
return;
UI::Forms::ItemForm* form = showItemForm(id, UI::Forms::INSTALL_ACTION::IA_INSTALL, iBranch);
if (!form)
Warning(gcString("Cant find item (or item not ready) for install [{0}].\n", id.toInt64()));
}
示例3: resumeUploadMCF
void InternalLink::resumeUploadMCF(DesuraId id, Args args)
{
std::string key = args.getArgValue("key");
std::string uid = args.getArgValue("uid");
UserCore::Item::ItemInfoI* item = GetUserCore()->getItemManager()->findItemInfo( id );
if (!item && !GetUserCore()->isAdmin())
{
//cant upload show prompt
gcMessageBox(g_pMainApp->getMainWindow(), Managers::GetString(L"#MF_NONDEV_ERROR"), Managers::GetString(L"#MF_PERMISSION_ERRTITLE"));
return;
}
//create new create from
UploadMCFForm* form = new UploadMCFForm(m_pParent);
if (!key.empty())
form->setInfo_key(id, key.c_str());
else if (!uid.empty())
form->setInfo_uid(id, uid.c_str());
else
form->setInfo(id);
form->Show(true);
form->Raise();
form->run();
m_vSubForms.push_back(form);
}
示例4: updateItem
void InternalLink::updateItem(DesuraId id, Args args)
{
bool show = args.containsArg("show") && args.getArgValue("show") == "true";
UI::Forms::ItemForm* form = showItemForm(id, UI::Forms::INSTALL_ACTION::IA_UPDATE, show);
if (!form)
Warning(gcString("Cant find item (or item not ready) for update [{0}].\n", id.toInt64()));
}
示例5: installTestMCF
void InternalLink::installTestMCF(DesuraId id, Args args)
{
std::string branch = args.getArgValue("branch");
std::string build = args.getArgValue("build");
MCFBranch iBranch;
MCFBuild iBuild ;
if (branch.size() > 0)
iBranch = MCFBranch::BranchFromInt(Safe::atoi(branch.c_str()));
if (build.size() > 0)
iBuild = MCFBuild::BuildFromInt(Safe::atoi(build.c_str()));
UI::Forms::ItemForm* form = showItemForm(id, UI::Forms::INSTALL_ACTION::IA_INSTALL_TESTMCF, iBranch, iBuild);
if (!form)
Warning(gcString("Cant find item (or item not ready) for install test mcf [{0}].\n", id.toInt64()));
}
示例6: verifyItem
void InternalLink::verifyItem(DesuraId id, Args args)
{
bool showForm = args.getArgValue("show") != "false";
UI::Forms::ItemForm* form = showItemForm(id, UI::Forms::INSTALL_ACTION::IA_VERIFY, showForm);
if (!form)
Warning(gcString("Cant find item (or item not ready) for verify [{0}].\n", id.toInt64()));
else if (showForm == false)
form->Show(false);
}
示例7: showCDKey
void InternalLink::showCDKey(DesuraId id, Args args)
{
FINDFORM(id, CDKeyForm);
UserCore::Item::ItemInfoI* item = GetUserCore()->getItemManager()->findItemInfo( id );
if (!item)
{
Warning(gcString("Cant find item for show cd key [{0}].\n", id.toInt64()));
return;
}
std::string launch = args.getArgValue("launch");
std::string exe = args.getArgValue("exe");
CDKeyForm* form = new CDKeyForm(m_pParent, exe.c_str(), launch == "true");
m_vSubForms.push_back(form);
form->setInfo(id);
form->Show(true);
}
示例8: switchBranch
void InternalLink::switchBranch(DesuraId id, Args args)
{
std::string branch = args.getArgValue("branch");
if (branch.size() == 0)
return;
MCFBranch iBranch = MCFBranch::BranchFromInt(Safe::atoi(branch.c_str()));
if (iBranch == 0)
return;
UI::Forms::ItemForm* form = showItemForm(id, UI::Forms::INSTALL_ACTION::IA_SWITCH_BRANCH, iBranch);
if (!form)
Warning(gcString("Cant find item (or item not ready) for uninstall [{0}].\n", id.toInt64()));
}
示例9: showUpdateForm
void InternalLink::showUpdateForm(DesuraId id, Args args)
{
UserCore::Item::ItemInfoI* item = GetUserCore()->getItemManager()->findItemInfo( id );
if (!item)
return;
if (!HasAllFlags(item->getStatus(), UserCore::Item::ItemInfoI::STATUS_UPDATEAVAL))
return;
std::string reminder = args.getArgValue("reminder");
//create new gather info form from
UpdateInfoForm* form = new UpdateInfoForm(m_pParent);
regForm(id, form);
form->setInfo(id, reminder == "true");
form->Show(true);
}
示例10: showSettings
void InternalLink::showSettings(Args &args)
{
gcString c(GetGCThemeManager()->getWebPage("settings"));
if (args.containsArg("tab"))
{
gcString tab = args.getArgValue("tab");
if (tab == "cip")
tab = "games";
c += "#" + tab;
}
else
{
c += "#general";
}
g_pMainApp->loadUrl(c.c_str(), SUPPORT);
}
示例11: launchItem
void InternalLink::launchItem(DesuraId id, Args args)
{
bool cdKeyArg = args.containsArg("cdkey");
bool noUpdateArg = args.containsArg("noupdate");
bool exeNumArg = args.containsArg("exe");
std::string exe = args.getArgValue("exe");
if (exe == "")
exeNumArg = false;
g_pMainApp->showPlay();
if (checkForPreorder(id))
return;
UserCore::Item::ItemInfoI* item = GetUserCore()->getItemManager()->findItemInfo(id);
bool delFlag=false;
if (!item || !item->isLaunchable())
{
installItem(id, Args());
return;
}
if (!item->hasAcceptedEula())
{
showPrompt(id, FormatArgs("prompt=eula"));
return;
}
if (!exeNumArg && item->getExeCount(true) > 1)
{
showExeSelect(id, cdKeyArg);
return;
}
else if (exe.size() > 0)
{
item->setActiveExe(exe.c_str());
}
bool hasCDKey = item->getCurrentBranch() && item->getCurrentBranch()->hasCDKey();
bool hasDLCDKey = item->getCurrentBranch() && item->getCurrentBranch()->isCDKeyValid();
if (!cdKeyArg && ((item->isFirstLaunch() && hasCDKey) || (hasCDKey && !hasDLCDKey)))
{
showCDKey(id, FormatArgs("launch=true", std::string("exe=") + exe));
return;
}
bool shouldShowGameDisk = false;
if (args.containsArg("gamedisk") == false && HasAnyFlags(item->getOptions(), UserCore::Item::ItemInfoI::OPTION_DONTPROMPTGAMEDISK) == false)
{
size_t x=0;
while (g_GameDiskList[x].isOk())
{
if (item->getId() == g_GameDiskList[x] || item->getParentId() == g_GameDiskList[x])
{
shouldShowGameDisk = true;
break;
}
x++;
}
}
if (shouldShowGameDisk)
{
showGameDisk(id, exe.c_str(), cdKeyArg);
return;
}
if (noUpdateArg && !HasAnyFlags(item->getOptions(), UserCore::Item::ItemInfoI::OPTION_NOTREMINDUPDATE))
{
item->addOFlag(UserCore::Item::ItemInfoI::OPTION_NOTREMINDUPDATE);
delFlag = true;
}
UI::Forms::ItemForm* form = showItemForm(id, UI::Forms::INSTALL_ACTION::IA_LAUNCH);
if (!form)
Warning(gcString("Cant find item (or item not ready) for launch [{0}].\n", id.toInt64()));
if (item && delFlag)
item->delOFlag(UserCore::Item::ItemInfoI::OPTION_NOTREMINDUPDATE);
}