本文整理汇总了C++中CGString::FormatUVal方法的典型用法代码示例。如果您正苦于以下问题:C++ CGString::FormatUVal方法的具体用法?C++ CGString::FormatUVal怎么用?C++ CGString::FormatUVal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGString
的用法示例。
在下文中一共展示了CGString::FormatUVal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: r_WriteVal
bool CItemMessage::r_WriteVal(LPCTSTR pszKey, CGString &sVal, CTextConsole *pSrc)
{
ADDTOCALLSTACK("CItemMessage::r_WriteVal");
EXC_TRY("WriteVal");
// Load the message body for a book or a bboard message.
if ( !strnicmp(pszKey, "BODY", 4) )
{
pszKey += 4;
size_t iPage = Exp_GetVal(pszKey);
if ( m_sBodyLines.IsValidIndex(iPage) == false )
return false;
sVal = *m_sBodyLines[iPage];
return true;
}
switch ( FindTableSorted(pszKey, sm_szLoadKeys, COUNTOF(sm_szLoadKeys) - 1) )
{
case CIC_AUTHOR:
sVal = m_sAuthor;
return true;
case CIC_BODY: // handled above
return false;
case CIC_PAGES: // not settable (used for resource stuff)
sVal.FormatUVal(GetPageCount());
return true;
case CIC_TITLE:
sVal = GetName();
return true;
}
return CItemVendable::r_WriteVal(pszKey, sVal, pSrc);
EXC_CATCH;
EXC_DEBUG_START;
EXC_ADD_KEYRET(pSrc);
EXC_DEBUG_END;
return false;
}
示例2: r_WriteVal
//.........这里部分代码省略.........
sVal.FormatVal(GetHeight());
break;
case OBC_HITLEECHLIFE:
sVal.FormatVal(m_HitLifeLeech);
break;
case OBC_HITLEECHMANA:
sVal.FormatVal(m_HitManaLeech);
break;
case OBC_HITLEECHSTAM:
sVal.FormatVal(m_HitStaminaLeech);
break;
case OBC_HITMANADRAIN:
sVal.FormatVal(m_HitManaDrain);
break;
case OBC_INCREASEDAM:
sVal.FormatVal(m_DamIncrease);
break;
case OBC_INCREASEDEFCHANCE:
sVal.FormatVal(m_DefChanceIncrease);
break;
case OBC_INCREASEDEFCHANCEMAX:
sVal.FormatVal(m_DefChanceIncreaseMax);
break;
case OBC_INCREASEHITCHANCE:
sVal.FormatVal(m_HitChanceIncrease);
break;
case OBC_INCREASESPELLDAM:
sVal.FormatVal(m_SpellDamIncrease);
break;
case OBC_INCREASESWINGSPEED:
sVal.FormatVal(m_SwingSpeedIncrease);
break;
case OBC_INSTANCES:
sVal.FormatUVal(GetRefInstances());
break;
case OBC_LOWERMANACOST:
sVal.FormatVal(m_LowerManaCost);
break;
case OBC_LOWERREAGENTCOST:
sVal.FormatVal(m_LowerReagentCost);
break;
case OBC_LUCK:
sVal.FormatVal(m_Luck);
break;
case OBC_NAME:
sVal = GetName();
break;
case OBC_NIGHTSIGHT:
sVal.FormatVal(m_NightSight);
break;
case OBC_REFLECTPHYSICALDAM:
sVal.FormatVal(m_ReflectPhysicalDamage);
break;
case OBC_RANGE:
if ( GetRangeH() == 0 )
sVal.Format("%hhu", GetRangeL());
else
sVal.Format("%hhu,%hhu", GetRangeH(), GetRangeL());
break;
case OBC_RANGEH:
sVal.FormatUVal(GetRangeL());
break;
case OBC_RANGEL:
sVal.FormatUVal(GetRangeH());
break;
case OBC_RESCOLD:
示例3: r_WriteVal
bool CClient::r_WriteVal(LPCTSTR pszKey, CGString &sVal, CTextConsole *pSrc)
{
ADDTOCALLSTACK("CClient::r_WriteVal");
EXC_TRY("WriteVal");
if ( !strnicmp("CTAG.", pszKey, 5) )
{
if ( pszKey[4] != '.' )
return false;
pszKey += 5;
CVarDefCont *pVar = m_TagDefs.GetKey(pszKey);
sVal = pVar ? pVar->GetValStr() : "";
return true;
}
if ( !strnicmp("CTAG0.", pszKey, 6) )
{
if ( pszKey[5] != '.' )
return false;
pszKey += 6;
CVarDefCont *pVar = m_TagDefs.GetKey(pszKey);
sVal = pVar ? pVar->GetValStr() : "0";
return true;
}
int index;
if ( !strnicmp("TARGP", pszKey, 5) && ((pszKey[5] == '\0') || (pszKey[5] == '.')) )
index = CC_TARGP;
else if ( !strnicmp("SCREENSIZE", pszKey, 10) && ((pszKey[10] == '\0') || (pszKey[10] == '.')) )
index = CC_SCREENSIZE;
else if ( !strnicmp("REPORTEDCLIVER", pszKey, 14) && ((pszKey[14] == '\0') || (pszKey[14] == '.')) )
index = CC_REPORTEDCLIVER;
else
index = FindTableSorted(pszKey, sm_szLoadKeys, COUNTOF(sm_szLoadKeys) - 1);
switch ( index )
{
case CC_ALLMOVE:
sVal.FormatVal(IsPriv(PRIV_ALLMOVE));
break;
case CC_ALLSHOW:
sVal.FormatVal(IsPriv(PRIV_ALLSHOW));
break;
case CC_CLIENTIS3D:
sVal.FormatVal(m_NetState->isClient3D());
break;
case CC_CLIENTISKR:
sVal.FormatVal(m_NetState->isClientKR());
break;
case CC_CLIENTISSA:
sVal.FormatVal(m_NetState->isClientEnhanced());
break;
case CC_CLIENTVERSION:
{
TCHAR szVersion[128];
sVal = m_Crypt.WriteClientVerString(m_Crypt.GetClientVer(), szVersion);
break;
}
case CC_DEBUG:
sVal.FormatVal(IsPriv(PRIV_DEBUG));
break;
case CC_DETAIL:
sVal.FormatVal(IsPriv(PRIV_DETAIL));
break;
case CC_GM:
sVal.FormatVal(IsPriv(PRIV_GM));
break;
case CC_HEARALL:
sVal.FormatVal(IsPriv(PRIV_HEARALL));
break;
case CC_LASTEVENT:
sVal.FormatLLVal(m_timeLastEvent.GetTimeRaw());
break;
case CC_PRIVSHOW:
sVal.FormatVal(!IsPriv(PRIV_PRIV_NOSHOW));
break;
case CC_REPORTEDCLIVER:
{
pszKey += 14;
GETNONWHITESPACE(pszKey);
DWORD dwCliVer = m_NetState->getReportedVersion();
if ( pszKey[0] == '\0' )
{
// Return full version string (eg: 5.0.2d)
TCHAR szVersion[128];
sVal = CCrypt::WriteClientVerString(dwCliVer, szVersion);
}
else
{
// Return raw version number (eg: 5.0.2d = 5000204)
sVal.FormatUVal(dwCliVer);
}
break;
}
case CC_SCREENSIZE:
{
if ( pszKey[10] == '.' )
{
pszKey += 10;
//.........这里部分代码省略.........