1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 02:51:27 +00:00

Provide some sample conversions to plFormat for testing and copying

This commit is contained in:
2014-05-18 19:59:27 -07:00
parent 2cb19d3308
commit 933ae6ec17
12 changed files with 51 additions and 52 deletions

View File

@ -251,7 +251,7 @@ void plNetClientMgr::SetNullSend(bool on)
const char* plNetClientMgr::GetServerLogTimeAsString(plString& timestamp) const
{
const plUnifiedTime st=GetServerTime();
timestamp = plString::Format("{%02d/%02d %02d:%02d:%02d}",
timestamp = plFormat("{{{_02}/{_02} {_02}:{_02}:{_02}}",
st.GetMonth(), st.GetDay(), st.GetHour(), st.GetMinute(), st.GetSecond());
return timestamp.c_str();
}
@ -264,7 +264,7 @@ const char* ProcessTab(const char* fmt)
static plString s;
if (fmt && *fmt=='\t')
{
s = plString::Format(" %s", fmt);
s = plFormat(" {}", fmt);
return s.c_str();
}
return fmt;
@ -1230,7 +1230,7 @@ void plNetClientMgr::IDisableNet () {
if (!GetFlagsBit(plNetClientApp::kPlayingGame))
{
// KI may not be loaded
plString title = plString::Format("%s Error", plProduct::CoreName().c_str());
plString title = plFormat("{} Error", plProduct::CoreName());
hsMessageBox(fDisableMsg->str, title.c_str(), hsMessageBoxNormal, hsMessageBoxIconError );
plClientMsg *quitMsg = new plClientMsg(plClientMsg::kQuit);
quitMsg->Send(hsgResMgr::ResMgr()->FindKey(kClient_KEY));
@ -1356,8 +1356,8 @@ bool plNetClientMgr::IFindModifier(plSynchedObject* obj, int16_t classIdx)
cnt++;
}
hsAssert(cnt<2, plString::Format("Object %s has multiple SDL modifiers of the same kind (%s)?",
obj->GetKeyName().c_str(), plFactory::GetNameOfClass(classIdx)).c_str());
hsAssert(cnt<2, plFormat("Object {} has multiple SDL modifiers of the same kind ({})?",
obj->GetKeyName(), plFactory::GetNameOfClass(classIdx)).c_str());
return cnt==0 ? false : true;
}

View File

@ -957,9 +957,9 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
plString title;
unsigned nameLen = nc->GetPlayerName().GetSize();
if (nc->GetPlayerName().ToLower().CharAt(nameLen - 1) == 's')
title = plString::Format("%s'", nc->GetPlayerName().c_str());
title = plFormat("{}'", nc->GetPlayerName());
else
title = plString::Format("%s's", nc->GetPlayerName().c_str());
title = plFormat("{}'s", nc->GetPlayerName());
info->SetAgeUserDefinedName(title.c_str());
}
if (!info->HasAgeDescription())
@ -968,9 +968,9 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
plString desc;
unsigned nameLen = nc->GetPlayerName().GetSize();
if (nc->GetPlayerName().ToLower().CharAt(nameLen - 1) == 's')
desc = plString::Format("%s' %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName().c_str());
desc = plFormat("{}' {}", nc->GetPlayerName(), info->GetAgeInstanceName());
else
desc = plString::Format("%s's %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName().c_str());
desc = plFormat("{}'s {}", nc->GetPlayerName(), info->GetAgeInstanceName());
info->SetAgeDescription(desc.c_str());
}
if (!info->HasAgeInstanceGuid()) {
@ -996,9 +996,9 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
plString title;
unsigned nameLen = nc->GetPlayerName().GetSize();
if (nc->GetPlayerName().ToLower().CharAt(nameLen - 1) == 's')
title = plString::Format("%s'", nc->GetPlayerName().c_str());
title = plFormat("{}'", nc->GetPlayerName());
else
title = plString::Format("%s's", nc->GetPlayerName().c_str());
title = plFormat("{}'s", nc->GetPlayerName());
info->SetAgeUserDefinedName(title.c_str());
}
@ -1008,9 +1008,9 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
plString desc;
unsigned nameLen = nc->GetPlayerName().GetSize();
if (nc->GetPlayerName().ToLower().CharAt(nameLen - 1) == 's')
desc = plString::Format("%s' %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName().c_str());
desc = plFormat("{}' {}", nc->GetPlayerName(), info->GetAgeInstanceName());
else
desc = plString::Format("%s's %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName().c_str());
desc = plFormat("{}'s {}", nc->GetPlayerName(), info->GetAgeInstanceName());
info->SetAgeDescription( desc.c_str() );
}