本文整理汇总了C++中usercore::item::ItemInfoI::getBranch方法的典型用法代码示例。如果您正苦于以下问题:C++ ItemInfoI::getBranch方法的具体用法?C++ ItemInfoI::getBranch怎么用?C++ ItemInfoI::getBranch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类usercore::item::ItemInfoI
的用法示例。
在下文中一共展示了ItemInfoI::getBranch方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
PreloadButtonHelper(DesuraId id)
{
m_Id = id;
UserCore::Item::ItemInfoI* item = GetUserCore()->getItemManager()->findItemInfo(id);
if (!item)
return;
for (size_t x=0; x<item->getBranchCount(); x++)
{
uint32 flags = item->getBranch(x)->getFlags();
if (HasAllFlags(flags, UserCore::Item::BranchInfoI::BF_NORELEASES))
continue;
if (item->getBranch(x)->isPreOrder())
continue;
bool isDemo = HasAnyFlags(flags, UserCore::Item::BranchInfoI::BF_DEMO|UserCore::Item::BranchInfoI::BF_TEST);
bool onAccount = HasAnyFlags(flags, UserCore::Item::BranchInfoI::BF_FREE|UserCore::Item::BranchInfoI::BF_ONACCOUNT);
bool isLocked = HasAnyFlags(flags, UserCore::Item::BranchInfoI::BF_REGIONLOCK|UserCore::Item::BranchInfoI::BF_MEMBERLOCK);
if (isDemo)
m_DemoBranch = item->getBranch(x)->getBranchId();
else if (onAccount && !isLocked)
m_bOtherBranches = true;
}
}
示例2: showPreorderPrompt
void InternalLink::showPreorderPrompt(DesuraId id, bool isPreload)
{
UserCore::Item::ItemInfoI* item = GetUserCore()->getItemManager()->findItemInfo( id );
if (!item)
return;
UserCore::Item::BranchInfoI* bi = item->getCurrentBranch();
if (!bi)
{
for (size_t x=0; x<item->getBranchCount(); x++)
{
UserCore::Item::BranchInfoI *temp = item->getBranch(x);
if (temp->isPreOrder())
{
bi = temp;
break;
}
}
}
if (!bi)
return;
const char* str = bi->getPreOrderExpDate();
uint32 days;
uint32 hours;
std::string time_available = UTIL::MISC::dateTimeToDisplay(str);
UTIL::MISC::getTimeDiffFromNow(str, days, hours);
gcString title(Managers::GetString("#IF_PRELOADLAUNCH_TITLE"), item->getName());
gcString msg(Managers::GetString("#IF_PRELOADLAUNCH"), item->getName(),
days,
Managers::GetString(isPreload?"#IF_PRELOADLAUNCH_PRELOADED":"#IF_PRELOADLAUNCH_PREORDERED"),
time_available,
Managers::GetString(days == 1 ? "#IF_PRELOADLAUNCH_WORD_DAY":"#IF_PRELOADLAUNCH_WORD_DAYS"));
PreloadButtonHelper pobh(id);
if (pobh.m_bOtherBranches)
msg += gcString(Managers::GetString("#IF_PRELOADLAUNCH_INSTALLOTHER_INFO"), item->getName());
gcMessageBox(g_pMainApp->getMainWindow(), msg, title, wxICON_EXCLAMATION|wxCLOSE, &pobh);
}
示例3: checkForPreorder
bool InternalLink::checkForPreorder(DesuraId id)
{
UserCore::Item::ItemInfoI* item = GetUserCore()->getItemManager()->findItemInfo( id );
if (!item)
return false;
if (item->getCurrentBranch())
return item->getCurrentBranch()->isPreOrderAndNotPreload();
for (size_t x=0; x<item->getBranchCount(); x++)
{
if (item->getBranch(x)->isPreOrderAndNotPreload())
return true;
}
return false;
}
示例4: init
void UninstallInfoPage::init()
{
UserCore::Item::ItemInfoI *info = getItemInfo();
if (!info)
{
Close();
return;
}
bool hasPaidBranch = false;
for (size_t x=0; x<info->getBranchCount(); x++)
{
UserCore::Item::BranchInfoI* b = info->getBranch(x);
if (b && HasAnyFlags(b->getFlags(), UserCore::Item::BranchInfoI::BF_ONACCOUNT) && !HasAnyFlags(b->getFlags(), UserCore::Item::BranchInfoI::BF_DEMO|UserCore::Item::BranchInfoI::BF_FREE|UserCore::Item::BranchInfoI::BF_TEST))
hasPaidBranch = true;
}
if (hasPaidBranch)
{
m_cbAccount->Enable(false);
m_cbAccount->SetValue(false);
}
if (info->getId().getType() == DesuraId::TYPE_LINK)
{
m_cbAccount->Enable(false);
m_cbAccount->SetValue(true);
m_cbComplete->Enable(false);
m_cbComplete->SetValue(true);
}
m_labInfo->SetLabel(gcWString(Managers::GetString(L"#UNF_CONFIRM"), info->getName()));
m_labInfo->Wrap( 360 );
}
示例5: setInfo
int InstallBranch::setInfo(DesuraId id, bool selectBranch)
{
m_bSelectBranch = selectBranch;
UserCore::Item::ItemInfoI* pItemInfo = GetUserCore()->getItemManager()->findItemInfo(id);
if (!pItemInfo)
return 1;
m_bIsMod = id.getType() == DesuraId::TYPE_MOD;
m_bIsExpansion = m_bIsMod == false && pItemInfo->getParentId().getType() == DesuraId::TYPE_GAME;
m_Item = id;
gcWString parName;
gcWString itemName = pItemInfo->getName();
DesuraId par = pItemInfo->getParentId();
UserCore::Item::ItemInfoI *parInfo = NULL;
if (par.isOk())
{
parInfo = GetUserCore()->getItemManager()->findItemInfo(par);
if (parInfo)
parName = gcWString(parInfo->getName());
}
fixName(parName);
fixName(itemName);
if (selectBranch == false && m_bIsMod)
{
m_labInfo->SetLabel(gcWString(Managers::GetString(L"#IF_NOTFOUND"), itemName, parName));
m_labInfo->Wrap( 350 );
}
else if (selectBranch == false && m_bIsExpansion)
{
m_labInfo->SetLabel(gcWString(Managers::GetString(L"#IF_NOTFOUND_GAME"), itemName, parName));
m_labInfo->Wrap( 350 );
}
else
{
m_labInfo->SetLabel(gcWString(Managers::GetString(L"#IF_BRANCHINFO"), itemName));
m_labInfo->Wrap( 350 );
}
uint32 count = 0;
int32 full = -1;
uint32 fullReadyCount = 0;
m_bBuy = true;
UserCore::Item::ItemInfoI *i = pItemInfo;
bool isCheckingParent = (m_bIsMod || m_bIsExpansion) && !selectBranch;
if (isCheckingParent)
{
if (!parInfo)
{
gcMessageBox(GetParent(), Managers::GetString(L"#IF_IIPARENT"), Managers::GetString(L"#IF_IIERRTITLE"));
return 1;
}
i = parInfo;
}
std::vector<UserCore::Item::BranchInfoI*> bList;
for (uint32 x=0; x<i->getBranchCount(); x++)
{
UserCore::Item::BranchInfoI* bi = i->getBranch(x);
if (!bi)
continue;
uint32 flags = bi->getFlags();
bool noRelease = HasAllFlags(flags, UserCore::Item::BranchInfoI::BF_NORELEASES);
bool isPreorder = bi->isPreOrder();
bool isDemo = HasAnyFlags(flags, UserCore::Item::BranchInfoI::BF_DEMO);
bool onAccount = HasAllFlags(flags, UserCore::Item::BranchInfoI::BF_ONACCOUNT);
bool locked = HasAnyFlags(flags, UserCore::Item::BranchInfoI::BF_MEMBERLOCK|UserCore::Item::BranchInfoI::BF_REGIONLOCK);
bool test = HasAnyFlags(flags, UserCore::Item::BranchInfoI::BF_TEST);
bool free = HasAnyFlags(flags, UserCore::Item::BranchInfoI::BF_FREE);
if (noRelease && !isPreorder)
continue;
if (!onAccount && locked)
continue;
if (!selectBranch && (isDemo || test))
continue;
if ((free || onAccount) && isPreorder && !selectBranch)
continue;
bool globalFound = false;
for (size_t x=0; x<bList.size(); x++)
{
//.........这里部分代码省略.........