本文整理汇总了C++中usercore::item::ItemInfoI::isLaunchable方法的典型用法代码示例。如果您正苦于以下问题:C++ ItemInfoI::isLaunchable方法的具体用法?C++ ItemInfoI::isLaunchable怎么用?C++ ItemInfoI::isLaunchable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类usercore::item::ItemInfoI
的用法示例。
在下文中一共展示了ItemInfoI::isLaunchable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onButtonClicked
void CDKInfo::onButtonClicked(wxCommandEvent& event)
{
if (event.GetId() == m_butClose->GetId())
{
GetParent()->Close();
}
else if (event.GetId() == m_imgCopyAll->GetId() || (m_vSplitKey.size() == 0 && event.GetId() == m_imgCopyPart->GetId()))
{
if (wxTheClipboard->Open())
{
wxTheClipboard->SetData(new wxTextDataObject(m_tbCdKey->GetValue()));
wxTheClipboard->Close();
}
m_tbCdKey->SetSelection(-1,-1);
}
else if (event.GetId() == m_imgCopyPart->GetId())
{
SplitInfo *info = m_vSplitKey[m_uiCurIndex];
m_uiCurIndex++;
if (m_uiCurIndex >= m_vSplitKey.size())
m_uiCurIndex = 0;
if (wxTheClipboard->Open())
{
wxTheClipboard->SetData(new wxTextDataObject(info->text));
wxTheClipboard->Close();
}
m_tbCdKey->SetSelection(info->start,info->end);
gcString label(Managers::GetString("#CDK_COPYPART"));
if (m_uiCurIndex != 0)
label = gcString(Managers::GetString("#CDK_COPYPART_X"), m_uiCurIndex+1);
m_imgCopyPart->SetToolTip(label);
}
else if (m_butLaunch && m_butLaunch->GetId() == event.GetId())
{
g_pMainApp->handleInternalLink(getItemId(), ACTION_LAUNCH, FormatArgs("cdkey", std::string("exe=") + m_szExe));
GetParent()->Close();
}
else if (m_butActivate && m_butActivate->GetId() == event.GetId())
{
UserCore::Item::ItemInfoI* info = getItemInfo();
if (info && info->isLaunchable())
info->addSFlag(UserCore::Item::ItemInfoI::STATUS_LAUNCHED);
#ifdef WIN32
UTIL::WIN::runAs("steam://open/activateproduct");
#endif
}
}
示例2: setInfo
void CDKInfo::setInfo(DesuraId id, const char* key)
{
BasePage::setInfo(id);
UserCore::Item::ItemInfoI *info = getItemInfo();
if (!info)
{
GetParent()->Close();
return;
}
m_butLaunch->Enable(info->isLaunchable());
if (checkForArma(id, key))
return;
m_tbCdKey->ChangeValue(key);
tokenizeKey(key);
UserCore::Item::BranchInfoI* cb = info->getCurrentBranch();
if (cb && cb->isSteamGame())
{
m_labInfo->SetLabel(gcWString(Managers::GetString(L"#CDK_INFO_STEAM"), info->getName()));
m_labInfo->Wrap(360);
m_butActivate = new gcButton(this, wxID_ANY, Managers::GetString(L"#CDK_ACTIVATE"));
m_pButtonSizer->Clear(false);
m_pButtonSizer->Add( 0, 0, 1, wxEXPAND, 5 );
m_pButtonSizer->Add(m_butActivate, 0, wxTOP|wxBOTTOM|wxLEFT, 5);
m_pButtonSizer->Add(m_butLaunch, 0, wxTOP|wxBOTTOM|wxLEFT, 5);
m_pButtonSizer->Add(m_butClose, 0, wxALL, 5);
Layout();
Refresh(false);
setParentSize(-1, 140);
}
}
示例3: 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);
}