develop
kaetemi 4 years ago
parent 5a470a7b16
commit ecabc00ec5

@ -168,7 +168,7 @@ extern NLMISC::CCmdArgs Args;
// Tips of the day count
#define RZ_NUM_TIPS 17
ucstring TipsOfTheDay;
std::string TipsOfTheDay;
uint TipsOfTheDayIndex;
// includes for following register classes
@ -272,19 +272,19 @@ static INT_PTR CALLBACK ExitClientErrorDialogProc(HWND hwndDlg, UINT uMsg, WPARA
{
if (CI18N::hasTranslation("TheSagaOfRyzom"))
{
if (!SetWindowTextW(hwndDlg, (WCHAR*)CI18N::get ("TheSagaOfRyzom").c_str ()))
if (!SetWindowTextW(hwndDlg, nlUtf8ToWide(CI18N::get("TheSagaOfRyzom").c_str())))
{
nlwarning("SetWindowText failed: %s", formatErrorMessage(getLastError()).c_str());
}
}
SetDlgItemTextW(hwndDlg, IDC_ERROR_MSG_TEXT, (WCHAR*) CurrentErrorMessage.c_str ());
SetDlgItemTextW(hwndDlg, IDC_ERROR_MSG_TEXT, (WCHAR*)CurrentErrorMessage.c_str());
if (CI18N::hasTranslation("uiRyzomErrorMsgBoxExit"))
{
SetDlgItemTextW(hwndDlg, IDOK, (WCHAR*)CI18N::get ("uiRyzomErrorMsgBoxExit").c_str ());
SetDlgItemTextW(hwndDlg, IDOK, nlUtf8ToWide(CI18N::get("uiRyzomErrorMsgBoxExit").c_str()));
}
if (CI18N::hasTranslation("uiRyzomErrorMsgBoxHelp"))
{
SetDlgItemTextW(hwndDlg, IDC_RYZOM_ERROR_HELP, (WCHAR*)CI18N::get ("uiRyzomErrorMsgBoxHelp").c_str ());
SetDlgItemTextW(hwndDlg, IDC_RYZOM_ERROR_HELP, nlUtf8ToWide(CI18N::get("uiRyzomErrorMsgBoxHelp").c_str()));
}
RECT rect;
RECT rectDesktop;
@ -343,7 +343,7 @@ void ExitClientError (const char *format, ...)
/*
ucstring ucstr;
ucstr.fromUtf8 (str);
MessageBoxW (NULL, (WCHAR*)ucstr.c_str(), (WCHAR*)CI18N::get ("TheSagaOfRyzom").c_str (), MB_OK|MB_ICONERROR);
MessageBoxW (NULL, (WCHAR *)ucstr.c_str(), nlUtf8ToWide(CI18N::get("TheSagaOfRyzom").c_str()), MB_OK|MB_ICONERROR);
*/
#else
fprintf (stderr, "%s\n", str);
@ -360,7 +360,7 @@ void ExitClientError (const char *format, ...)
void ClientInfo (const ucstring &message)
{
#ifdef NL_OS_WINDOWS
MessageBoxW (NULL, (WCHAR*)message.c_str(), (WCHAR*)CI18N::get ("TheSagaOfRyzom").c_str (), MB_OK|MB_ICONINFORMATION);
MessageBoxW(NULL, (WCHAR *)message.c_str(), nlUtf8ToWide(CI18N::get("TheSagaOfRyzom").c_str()), MB_OK|MB_ICONINFORMATION);
#endif
}
@ -368,7 +368,7 @@ void ClientInfo (const ucstring &message)
bool ClientQuestion (const ucstring &message)
{
#ifdef NL_OS_WINDOWS
return MessageBoxW (NULL, (WCHAR*)message.c_str(), (WCHAR*)CI18N::get ("TheSagaOfRyzom").c_str (), MB_YESNO|MB_ICONQUESTION) != IDNO;
return MessageBoxW(NULL, (WCHAR *)message.c_str(), nlUtf8ToWide(CI18N::get("TheSagaOfRyzom").c_str()), MB_YESNO|MB_ICONQUESTION) != IDNO;
#else
return false;
#endif

@ -200,9 +200,9 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity)
// Names
const char *templateName;
ucstring theTribeName;
ucstring entityName = entity->getDisplayName();
ucstring entityTitle = entity->getTitle();
const char *theTribeName = "";
std::string entityName = entity->getDisplayName();
std::string entityTitle = entity->getTitle().toUtf8();
// For some NPC's the name is empty and only a title is given,
// in that case, treat the title as the name.
@ -780,19 +780,19 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity)
// Set player name
if (info->_Name)
{
info->_Name->setText(entityName.toUtf8());
info->_Name->setText(entityName);
info->_Name->setModulateGlobalColor(false);
}
// Set player title
if (info->_Title)
info->_Title->setText(entityTitle.toUtf8());
info->_Title->setText(entityTitle);
// Set tribe name
if (info->_TribeName)
{
nlassert(info->_GuildName == NULL);
info->_TribeName->setText(theTribeName.toUtf8());
info->_TribeName->setText(theTribeName);
}
// Init user leaf nodes

@ -2530,19 +2530,19 @@ void CGroupMap::createLMWidgets(const std::vector<CContLandMark> &lms)
NLMISC::CVector2f mapPos;
worldToMap(mapPos, rCLM.Pos);
const ucstring ucsTmp(CStringManagerClient::getPlaceLocalizedName(rCLM.TitleTextID));
const ucstring lcTitle = toLower(ucsTmp);
const char *ucsTmp = CStringManagerClient::getPlaceLocalizedName(rCLM.TitleTextID);
const std::string lcTitle = toLower(ucsTmp);
bool searchMatch = notWorldMode && _LandmarkFilter.size() > 0 && filterLandmark(lcTitle);
if (searchMatch)
_MatchedLandmarks.push_back(SMatchedLandmark(rCLM.Pos, ucsTmp, _ContinentLMOptions));
_MatchedLandmarks.push_back(SMatchedLandmark(rCLM.Pos, ucstring::makeFromUtf8(ucsTmp), _ContinentLMOptions));
// Add button if not a region nor a place
if ((rCLM.Type != CContLandMark::Region) && (rCLM.Type != CContLandMark::Place) &&
(rCLM.Type != CContLandMark::Street))
{
if (rCLM.Type != CContLandMark::Stable)
addLandMark(_ContinentLM, mapPos, ucsTmp, _ContinentLMOptions);
addLandMark(_ContinentLM, mapPos, ucstring::makeFromUtf8(ucsTmp), _ContinentLMOptions);
else
addLandMark(_ContinentLM, mapPos, CI18N::get("uiStable"), _ContinentLMOptions);
_ContinentLM.back()->Type = rCLM.Type;
@ -2551,7 +2551,7 @@ void CGroupMap::createLMWidgets(const std::vector<CContLandMark> &lms)
else // just add a text
{
CLandMarkText *pNewText = new CLandMarkText(CViewBase::TCtorParam());
pNewText->setText(ucsTmp.toUtf8());
pNewText->setText(ucsTmp);
pNewText->Pos = mapPos;
pNewText->setParent(this);
pNewText->setParentPosRef(Hotspot_BL);

@ -50,7 +50,7 @@ extern NL3D::UMaterial LoadingMaterialFull;
extern std::vector<UTextureFile*> LogoBitmaps;
extern uint TipsOfTheDayIndex;
extern ucstring TipsOfTheDay;
extern string TipsOfTheDay;
extern bool UseEscapeDuringLoading;
CProgress::CProgress ()
@ -287,8 +287,8 @@ void CProgress::internalProgress (float value)
// Display the tips of the day.
TextContext->setFontSize((uint)(16.f * fontFactor));
TextContext->setHotSpot(UTextContext::MiddleTop);
ucstring::size_type index = 0;
ucstring::size_type end = TipsOfTheDay.find((ucchar)'\n');
string::size_type index = 0;
string::size_type end = TipsOfTheDay.find('\n');
if (end == string::npos)
end = TipsOfTheDay.size();
float fY = ClientCfg.TipsY;
@ -297,15 +297,15 @@ void CProgress::internalProgress (float value)
while (index < end)
{
// Get the line
ucstring line = TipsOfTheDay.substr (index, end-index);
string line = TipsOfTheDay.substr (index, end-index);
// Draw the line
TextContext->printAt(0.5f, fY, line);
fY = nextLine (TextContext->getFontSize(), Driver->getWindowHeight(), fY);
index=end+1;
end = TipsOfTheDay.find((ucchar)'\n', index);
if (end == ucstring::npos)
end = TipsOfTheDay.find('\n', index);
if (end == string::npos)
end = TipsOfTheDay.size();
}
@ -338,7 +338,7 @@ void CProgress::internalProgress (float value)
TextContext->setFontSize((uint)(15.f * fontFactor));
TextContext->setHotSpot(UTextContext::BottomLeft);
ucstring uc = CI18N::get("uiR2EDTPEscapeToInteruptLoading") + " (" + _TPCancelText + ") - " + CI18N::get("uiDelayedTPCancel");
string uc = CI18N::get("uiR2EDTPEscapeToInteruptLoading") + " (" + _TPCancelText.toUtf8() + ") - " + CI18N::get("uiDelayedTPCancel");
UTextContext::CStringInfo info = TextContext->getStringInfo(uc);
float stringX = 0.5f - info.StringWidth/(ClientCfg.Width*2);
TextContext->printAt(stringX, 7.f / ClientCfg.Height, uc);
@ -386,13 +386,13 @@ void CProgress::internalProgress (float value)
TextContext->setFontSize( (uint)(16.f * fontFactor));
// build the ucstr(s)
ucstring ucstr = CI18N::get((*itpc).Text);
vector<ucstring> vucstr;
ucstring sep("\n");
splitUCString(ucstr,sep,vucstr);
string ucstr = CI18N::get((*itpc).Text);
vector<string> vucstr;
string sep("\n");
splitString(ucstr,sep,vucstr);
// Letter size
UTextContext::CStringInfo si = TextContext->getStringInfo(ucstring("|"));
UTextContext::CStringInfo si = TextContext->getStringInfo("|");
uint fontHeight = (uint) si.StringHeight + 2; // we add 2 pixels for the gap
uint i;

@ -279,12 +279,12 @@ void CAutoGroup::group(CObject *newEntityDesc, const NLMISC::CVectorD &createPos
getEditor().getDMC().flushActions();
return;
}
ucstring readableName;
string readableName;
CLuaState &ls = getEditor().getLua();
R2::getEditor().getEnv()["PaletteIdToGroupTranslation"][newEntityDesc->getAttr("Base")->toString()].push();
if (ls.isString(-1))
readableName.fromUtf8(ls.toString(-1));
ucstring ucGroupName = ucstring(readableName + " " + CI18N::get("uiR2EDNameGroup"));
readableName = ls.toString(-1);
string ucGroupName = readableName + " " + CI18N::get("uiR2EDNameGroup");
newGroup->set("Name", getEditor().genInstanceName(ucGroupName).toUtf8());
getEditor().getDMC().requestInsertNode(destGroup->getParentAct()->getId(),

@ -1571,12 +1571,12 @@ int CEditor::luaGetUserEntityName(CLuaState &ls)
CLuaIHM::checkArgCount(ls, funcName, 1); // this is a method
if (UserEntity)
{
ucstring name = UserEntity->getEntityName()+PlayerSelectedHomeShardNameWithParenthesis;
ls.push( name.toUtf8() );
string name = UserEntity->getEntityName()+PlayerSelectedHomeShardNameWithParenthesis;
ls.push( name );
}
else
{
ls.push(std::string(""));
ls.push(std::string());
}
return 1;

@ -551,9 +551,9 @@ void CToolDrawPrim::commit()
if (!_Extending)
{
// set readable name
ucstring readableName = NLMISC::CI18N::get(_PrimType == Road ? "uiR2EDNameBotRoad" : "uiR2EDNameBotRegion");
readableName = getEditor().genInstanceName(readableName);
desc->set("Name", readableName.toUtf8());
string readableName = NLMISC::CI18N::get(_PrimType == Road ? "uiR2EDNameBotRoad" : "uiR2EDNameBotRegion");
readableName = getEditor().genInstanceName(readableName).toUtf8();
desc->set("Name", readableName);
// send creation command
// tmp : static npc counter
// add in component list of default feature

Loading…
Cancel
Save