Changed: Use _T macro and TCHAR to support UNICODE

--HG--
branch : develop
This commit is contained in:
kervala 2016-11-22 12:39:44 +01:00
parent a3262bb971
commit b7ca1d224c
24 changed files with 142 additions and 142 deletions

View file

@ -852,8 +852,8 @@ BOOL CParticleTreeCtrl::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHA
nt = new CNodeType(nt->Loc, objIndex); nt = new CNodeType(nt->Loc, objIndex);
_NodeTypes.push_back(nt); _NodeTypes.push_back(nt);
// insert the element in the tree // insert the element in the tree
HTREEITEM root = InsertItem(TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM | TVIF_TEXT, "instance", PSIconLocatedInstance, PSIconLocatedInstance, 0, 0, (LPARAM) nt, GetSelectedItem(), TVI_LAST); HTREEITEM root = InsertItem(TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM | TVIF_TEXT, _T("instance"), PSIconLocatedInstance, PSIconLocatedInstance, 0, 0, (LPARAM) nt, GetSelectedItem(), TVI_LAST);
SetItemData(root, (DWORD) nt); SetItemData(root, (DWORD_PTR) nt);
Invalidate(); Invalidate();
} }
break; break;

View file

@ -125,7 +125,7 @@ float CExportNel::getScriptAppData (Animatable *node, uint32 id, float def)
// String to int // String to int
float value = 0.f; float value = 0.f;
if (toFloatMax((const char*)ap->data, value)) if (toFloatMax((const TCHAR*)ap->data, value))
return value; return value;
else else
return def; return def;

View file

@ -242,7 +242,7 @@ void CTileSetCont::build (CTileBank& bank, uint tileSet)
if (!dmwarn) if (!dmwarn)
{ {
dmwarn = true; dmwarn = true;
MessageBox(NULL, "Tile bank not loaded, or bad tile bank. Missing a displacement tile. Use the tile bank utility to load the correct tilebank.", "NeL Patch Paint", MB_OK | MB_ICONWARNING); MessageBox(NULL, _T("Tile bank not loaded, or bad tile bank. Missing a displacement tile. Use the tile bank utility to load the correct tilebank."), _T("NeL Patch Paint"), MB_OK | MB_ICONWARNING);
} }
continue; // with next displace continue; // with next displace
} }

View file

@ -72,7 +72,7 @@ class Tile_utilityClassDesc:public ClassDesc2
{ {
return &theTile_utility; return &theTile_utility;
} }
const TCHAR * ClassName() {return "NeL Tile Bank";} const TCHAR * ClassName() {return _T("NeL Tile Bank");}
SClass_ID SuperClassID() {return UTILITY_CLASS_ID;} SClass_ID SuperClassID() {return UTILITY_CLASS_ID;}
Class_ID ClassID() {return TILE_UTILITY_CLASS_ID;} Class_ID ClassID() {return TILE_UTILITY_CLASS_ID;}
const TCHAR* Category() {return _T("NeL Tools");} const TCHAR* Category() {return _T("NeL Tools");}
@ -96,7 +96,7 @@ static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam,
if (hModule) if (hModule)
{ {
// Get module file name // Get module file name
char moduldeFileName[512]; TCHAR moduldeFileName[512];
if (GetModuleFileName (hModule, moduldeFileName, 512)) if (GetModuleFileName (hModule, moduldeFileName, 512))
{ {
// Get version info size // Get version info size
@ -112,41 +112,41 @@ static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam,
{ {
uint *versionTab; uint *versionTab;
uint versionSize; uint versionSize;
if (VerQueryValue (buffer, "\\", (void**)&versionTab, &versionSize)) if (VerQueryValue (buffer, _T("\\"), (void**)&versionTab, &versionSize))
{ {
// Get the pointer on the structure // Get the pointer on the structure
VS_FIXEDFILEINFO *info=(VS_FIXEDFILEINFO*)versionTab; VS_FIXEDFILEINFO *info=(VS_FIXEDFILEINFO*)versionTab;
if (info) if (info)
{ {
// Setup version number // Setup version number
char version[512]; TCHAR version[512];
sprintf (version, "Version %d.%d.%d.%d", _tcprintf (version, "Version %d.%d.%d.%d",
info->dwFileVersionMS>>16, info->dwFileVersionMS>>16,
info->dwFileVersionMS&0xffff, info->dwFileVersionMS&0xffff,
info->dwFileVersionLS>>16, info->dwFileVersionLS>>16,
info->dwFileVersionLS&0xffff); info->dwFileVersionLS&0xffff);
SetWindowText (GetDlgItem (hWnd, IDC_VERSION), version); SetWindowText (GetDlgItem (hWnd, IDC_VERSION), version);
} }
else else
SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "VS_FIXEDFILEINFO * is NULL"); SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("VS_FIXEDFILEINFO * is NULL"));
} }
else else
SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "VerQueryValue failed"); SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("VerQueryValue failed"));
} }
else else
SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "GetFileVersionInfo failed"); SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("GetFileVersionInfo failed"));
// Free the buffer // Free the buffer
delete [] buffer; delete [] buffer;
} }
else else
SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "GetFileVersionInfoSize failed"); SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("GetFileVersionInfoSize failed"));
} }
else else
SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "GetModuleFileName failed"); SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("GetModuleFileName failed"));
} }
else else
SetWindowText (GetDlgItem (hWnd, IDC_VERSION), "hInstance NULL"); SetWindowText (GetDlgItem (hWnd, IDC_VERSION), _T("hInstance NULL"));
theTile_utility.Init(hWnd); theTile_utility.Init(hWnd);
@ -168,7 +168,7 @@ static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam,
{ {
case IDC_BANK_PATH: case IDC_BANK_PATH:
{ {
static char sPath[256]; static TCHAR sPath[256];
static bool bFirst=false; static bool bFirst=false;
if (!bFirst) if (!bFirst)
{ {
@ -178,7 +178,7 @@ static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam,
OPENFILENAME ofn; OPENFILENAME ofn;
ofn.lStructSize=sizeof (ofn); ofn.lStructSize=sizeof (ofn);
ofn.hwndOwner=NULL; ofn.hwndOwner=NULL;
ofn.lpstrFilter="Rykol bank files (*.bank)\0*.bank\0All Files (*.*)\0*.*\0"; ofn.lpstrFilter = _T("Rykol bank files (*.bank)\0*.bank\0All Files (*.*)\0*.*\0");
ofn.lpstrCustomFilter=NULL; ofn.lpstrCustomFilter=NULL;
ofn.nMaxCustFilter=0; ofn.nMaxCustFilter=0;
ofn.nFilterIndex=0; ofn.nFilterIndex=0;
@ -187,7 +187,7 @@ static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam,
ofn.lpstrFileTitle=NULL; ofn.lpstrFileTitle=NULL;
ofn.nMaxFileTitle=NULL; ofn.nMaxFileTitle=NULL;
ofn.lpstrInitialDir=NULL; ofn.lpstrInitialDir=NULL;
ofn.lpstrTitle="Choose a bank file"; ofn.lpstrTitle = _T("Choose a bank file");
ofn.Flags=OFN_ENABLESIZING|OFN_FILEMUSTEXIST; ofn.Flags=OFN_ENABLESIZING|OFN_FILEMUSTEXIST;
ofn.nFileOffset=0; ofn.nFileOffset=0;
ofn.nFileExtension=0; ofn.nFileExtension=0;
@ -223,7 +223,7 @@ static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam,
case IDC_SETUP: case IDC_SETUP:
{ {
if (!theTile_utility.SetupMaterial ()) if (!theTile_utility.SetupMaterial ())
MessageBox (NULL, "Select some nel patch object..", "Rykol tile", MB_OK|MB_ICONEXCLAMATION); MessageBox (NULL, _T("Select some nel patch object.."), _T("Rykol tile"), MB_OK|MB_ICONEXCLAMATION);
} }
} }
} }
@ -382,18 +382,18 @@ void Tile_utility::SetupUI ()
SetWindowText (hwnd, sName); SetWindowText (hwnd, sName);
// Static text // Static text
char sTmp[256]; TCHAR sTmp[256];
sprintf (sTmp, "%d diffuse tiles.", Bank.getNumBitmap (CTile::diffuse)); _tcprintf (sTmp, "%d diffuse tiles.", Bank.getNumBitmap (CTile::diffuse));
SetWindowText (hwndStatic1, sTmp); SetWindowText (hwndStatic1, sTmp);
sprintf (sTmp, "%d additive tiles.", Bank.getNumBitmap (CTile::additive)); _tcprintf (sTmp, "%d additive tiles.", Bank.getNumBitmap (CTile::additive));
SetWindowText (hwndStatic2, sTmp); SetWindowText (hwndStatic2, sTmp);
} }
else else
{ {
SetWindowText (hwnd, "Click to choose a bank.."); SetWindowText (hwnd, _T("Click to choose a bank.."));
SetWindowText (hwndStatic1, ""); SetWindowText (hwndStatic1, _T(""));
SetWindowText (hwndStatic2, ""); SetWindowText (hwndStatic2, _T(""));
SetWindowText (hwndStatic3, ""); SetWindowText (hwndStatic3, _T(""));
} }
} }
} }
@ -412,7 +412,7 @@ bool Tile_utility::SetupMaterial () const
// Multi // Multi
MultiMtl* multi=NewDefaultMultiMtl(); MultiMtl* multi=NewDefaultMultiMtl();
multi->SetNumSubMtls (Bank.getTileCount()+1); multi->SetNumSubMtls (Bank.getTileCount()+1);
multi->SetName ("Rykol Bank"); multi->SetName (_T("Rykol Bank"));
// Default mtl // Default mtl
Mtl* firstMtl=multi->GetSubMtl (0); Mtl* firstMtl=multi->GetSubMtl (0);
@ -420,7 +420,7 @@ bool Tile_utility::SetupMaterial () const
// Mtl param // Mtl param
firstMtl->SetDiffuse (Color (0.5f,0.5f,0.5f), t); firstMtl->SetDiffuse (Color (0.5f,0.5f,0.5f), t);
firstMtl->SetAmbient (Color (0,0,0), t); firstMtl->SetAmbient (Color (0,0,0), t);
firstMtl->SetName ("Rykol Tile Default"); firstMtl->SetName (_T("Rykol Tile Default"));
firstMtl->SetShininess (0.0, t); firstMtl->SetShininess (0.0, t);
firstMtl->SetSpecular (Color (0,0,0), t); firstMtl->SetSpecular (Color (0,0,0), t);
@ -439,7 +439,7 @@ bool Tile_utility::SetupMaterial () const
// Mtl param // Mtl param
mtl->SetDiffuse (Color (1.f,1.f,1.f), t); mtl->SetDiffuse (Color (1.f,1.f,1.f), t);
mtl->SetAmbient (Color (0,0,0), t); mtl->SetAmbient (Color (0,0,0), t);
mtl->SetName ("Rykol Tile"); mtl->SetName (_T("Rykol Tile"));
mtl->SetShininess (0.0, t); mtl->SetShininess (0.0, t);
mtl->SetSpecular (Color (0,0,0), t); mtl->SetSpecular (Color (0,0,0), t);

View file

@ -25,15 +25,15 @@
#include "SelectionTerritoire.h" #include "SelectionTerritoire.h"
#include "View.h" #include "View.h"
#define REGKEY_TILEDIT "Software\\Nevrax\\Nel\\Tile_Edit" #define REGKEY_TILEDIT _T("Software\\Nevrax\\Nel\\Tile_Edit")
#define REGKEY_BUTTONZOOM "Zoom button" #define REGKEY_BUTTONZOOM _T("Zoom button")
#define REGKEY_BUTTONVARIETY "Zoom variety" #define REGKEY_BUTTONVARIETY _T("Zoom variety")
#define REGKEY_BUTTONTEXTURE "Texture button" #define REGKEY_BUTTONTEXTURE _T("Texture button")
#define REGKEY_BUTTONSORT "Sort button" #define REGKEY_BUTTONSORT _T("Sort button")
#define REGKEY_BUTTONTEXTINFO "Info button" #define REGKEY_BUTTONTEXTINFO _T("Info button")
#define REGKEY_LISTCOMBOBOX "List type combo box" #define REGKEY_LISTCOMBOBOX _T("List type combo box")
#define REGKEY_WNDPL "Window placement" #define REGKEY_WNDPL _T("Window placement")
#define REGKEY_LASTPATH "Last path" #define REGKEY_LASTPATH _T("Last path")
#define SCROLL_MAX 50000 #define SCROLL_MAX 50000

View file

@ -438,14 +438,14 @@ int TileList::setDisplacement (int tile, const std::string& name)
theListDisplacement[tile].loaded=0; theListDisplacement[tile].loaded=0;
if (!_LoadBitmap(tileBank2.getAbsPath() + troncated, &theListDisplacement[tile].BmpInfo, theListDisplacement[tile].Bits, NULL, 0)) if (!_LoadBitmap(tileBank2.getAbsPath() + troncated, &theListDisplacement[tile].BmpInfo, theListDisplacement[tile].Bits, NULL, 0))
MessageBox (NULL, (tileBank2.getAbsPath() + troncated).c_str(), "Can't load file", MB_OK|MB_ICONEXCLAMATION); MessageBox (NULL, (tileBank2.getAbsPath() + troncated).c_str(), _T("Can't load file"), MB_OK|MB_ICONEXCLAMATION);
else else
{ {
// Check the size // Check the size
if ((theListDisplacement[tile].BmpInfo.bmiHeader.biWidth!=32)||(-theListDisplacement[tile].BmpInfo.bmiHeader.biHeight!=32)) if ((theListDisplacement[tile].BmpInfo.bmiHeader.biWidth!=32)||(-theListDisplacement[tile].BmpInfo.bmiHeader.biHeight!=32))
{ {
// Error message // Error message
MessageBox (NULL, "Invalid size: displacement map must be 32x32 8 bits.", troncated.c_str(), MessageBox (NULL, _T("Invalid size: displacement map must be 32x32 8 bits."), troncated.c_str(),
MB_OK|MB_ICONEXCLAMATION); MB_OK|MB_ICONEXCLAMATION);
// Free the bitmap // Free the bitmap

View file

@ -61,10 +61,10 @@ END_MESSAGE_MAP()
void CChooseVegetSet::OnBrowse() void CChooseVegetSet::OnBrowse()
{ {
// Select a veget set // Select a veget set
static char BASED_CODE szFilter[] = "NeL VegetSet Files (*.vegetset)|*.vegetset|All Files (*.*)|*.*||"; static TCHAR BASED_CODE szFilter[] = _T("NeL VegetSet Files (*.vegetset)|*.vegetset|All Files (*.*)|*.*||");
// Create a file dialog // Create a file dialog
CFileDialog dialog ( TRUE, "*.vegetset", "*.vegetset", OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter, (CWnd*)Parent); CFileDialog dialog ( TRUE, _T("*.vegetset"), _T("*.vegetset"), OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter, (CWnd*)Parent);
if (dialog.DoModal() == IDOK) if (dialog.DoModal() == IDOK)
{ {
// Get the file name // Get the file name
@ -80,7 +80,7 @@ BOOL CChooseVegetSet::OnInitDialog()
if (!FileName.empty()) if (!FileName.empty())
Name.SetWindowText (utf8ToTStr(FileName)); Name.SetWindowText (utf8ToTStr(FileName));
else else
Name.SetWindowText ("Browse..."); Name.SetWindowText (_T("Browse..."));
return TRUE; // return TRUE unless you set the focus to a control return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE // EXCEPTION: OCX Property Pages should return FALSE

View file

@ -669,7 +669,7 @@ void CBranch_patcherDlg::OnButtonExtractTokens()
m_SrcDirLabel = "Enter Token 1"; m_SrcDirLabel = "Enter Token 1";
m_TargetDirLabel = "Enter Token 2"; m_TargetDirLabel = "Enter Token 2";
m_Filename = "The tokens above were extracted from the directories."; m_Filename = "The tokens above were extracted from the directories.";
((CButton*)GetDlgItem( IDC_ButtonExtractTokens ))->SetWindowText( "Store Tokens" ); ((CButton*)GetDlgItem( IDC_ButtonExtractTokens ))->SetWindowText( _T("Store Tokens") );
GetDlgItem( IDC_TopText )->ShowWindow( SW_HIDE ); GetDlgItem( IDC_TopText )->ShowWindow( SW_HIDE );
GetDlgItem( IDC_ButtonClearTokens )->EnableWindow( FALSE ); GetDlgItem( IDC_ButtonClearTokens )->EnableWindow( FALSE );
GetDlgItem( IDC_ButtonPatch )->ShowWindow( SW_HIDE ); GetDlgItem( IDC_ButtonPatch )->ShowWindow( SW_HIDE );

View file

@ -90,7 +90,7 @@ BOOL CDfnDialog::OnInitDialog()
// Create the type combo // Create the type combo
setStaticSize (currentPos); setStaticSize (currentPos);
LabelParents.Create ("Parents:", WS_VISIBLE, currentPos, this); LabelParents.Create (_T("Parents:"), WS_VISIBLE, currentPos, this);
initWidget (LabelParents); initWidget (LabelParents);
getNextPosLabel (currentPos); getNextPosLabel (currentPos);
@ -105,7 +105,7 @@ BOOL CDfnDialog::OnInitDialog()
// Create the type combo // Create the type combo
setStaticSize (currentPos); setStaticSize (currentPos);
LabelStruct.Create ("Structure:", WS_VISIBLE, currentPos, this); LabelStruct.Create (_T("Structure:"), WS_VISIBLE, currentPos, this);
initWidget (LabelStruct); initWidget (LabelStruct);
getNextPosLabel (currentPos); getNextPosLabel (currentPos);
@ -210,10 +210,10 @@ void CDfnDialog::getFromDocument (const NLGEORGES::CFormDfn &dfn)
Struct.ListCtrl.SetItemText (elm, 4, dfn.getEntry (elm).getFilenameExt ().c_str()); Struct.ListCtrl.SetItemText (elm, 4, dfn.getEntry (elm).getFilenameExt ().c_str());
break; break;
case UFormDfn::EntryDfn: case UFormDfn::EntryDfn:
Struct.ListCtrl.SetItemText (elm, 1, dfn.getEntry (elm).getArrayFlag () ? "Dfn array" : "Dfn"); Struct.ListCtrl.SetItemText (elm, 1, dfn.getEntry (elm).getArrayFlag () ? _T("Dfn array") : _T("Dfn"));
break; break;
case UFormDfn::EntryVirtualDfn: case UFormDfn::EntryVirtualDfn:
Struct.ListCtrl.SetItemText (elm, 1, "Virtual Dfn"); Struct.ListCtrl.SetItemText (elm, 1, _T("Virtual Dfn"));
break; break;
} }
Struct.ListCtrl.SetItemText (elm, 2, dfn.getEntry (elm).getFilename ().c_str()); Struct.ListCtrl.SetItemText (elm, 2, dfn.getEntry (elm).getFilename ().c_str());
@ -435,15 +435,15 @@ void CDfnEditListCtrl::onItemChanged (uint item, uint subItem)
Dialog->Struct.ListCtrl.SetItemText (item, 2, theApp.DefaultDfn.c_str ()); Dialog->Struct.ListCtrl.SetItemText (item, 2, theApp.DefaultDfn.c_str ());
// Clear default value // Clear default value
Dialog->Struct.ListCtrl.SetItemText (item, 3, ""); Dialog->Struct.ListCtrl.SetItemText (item, 3, _T(""));
} }
else if (type == "Virtual Dfn") else if (type == "Virtual Dfn")
{ {
// Clear the value // Clear the value
Dialog->Struct.ListCtrl.SetItemText (item, 2, ""); Dialog->Struct.ListCtrl.SetItemText (item, 2, _T(""));
// Clear default value // Clear default value
Dialog->Struct.ListCtrl.SetItemText (item, 3, ""); Dialog->Struct.ListCtrl.SetItemText (item, 3, _T(""));
} }
} }
} }

View file

@ -51,7 +51,7 @@ bool CFileTreeCtrl::create( const RECT& rect, CWnd* pParentWnd, UINT nID )
LPCTSTR className = AfxRegisterWndClass( 0 ); LPCTSTR className = AfxRegisterWndClass( 0 );
// Create this window // Create this window
if (CWnd::Create (className, "empty", WS_CHILD, rect, pParentWnd, nID )) if (CWnd::Create (className, _T("empty"), WS_CHILD, rect, pParentWnd, nID ))
#if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 80 #if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 80

View file

@ -609,8 +609,7 @@ bool CBuilderZone::refresh ()
if ((sZone != STRING_UNUSED)&&(sZone != STRING_OUT_OF_BOUND)) if ((sZone != STRING_UNUSED)&&(sZone != STRING_OUT_OF_BOUND))
{ {
unload (_ZoneRegionSelected); unload (_ZoneRegionSelected);
MessageBox (NULL, "Cannot add this zone because it overlaps existing ones", MessageBox (NULL, _T("Cannot add this zone because it overlaps existing ones"), _T("Error"), MB_ICONERROR|MB_OK);
"Error", MB_ICONERROR|MB_OK);
return false; return false;
} }
} }
@ -1599,17 +1598,18 @@ void CBuilderZone::del (const CVector &worldPos)
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
bool CBuilderZone::initZoneBank (const string &sPathName) bool CBuilderZone::initZoneBank (const string &sPathName)
{ {
char sDirBackup[512]; // TODO: replace by NeL methods
TCHAR sDirBackup[512];
GetCurrentDirectory (512, sDirBackup); GetCurrentDirectory (512, sDirBackup);
SetCurrentDirectory (sPathName.c_str()); SetCurrentDirectory (sPathName.c_str());
WIN32_FIND_DATA findData; WIN32_FIND_DATA findData;
HANDLE hFind; HANDLE hFind;
hFind = FindFirstFile ("*.ligozone", &findData); hFind = FindFirstFile (_T("*.ligozone"), &findData);
while (hFind != INVALID_HANDLE_VALUE) while (hFind != INVALID_HANDLE_VALUE)
{ {
// If the name of the file is not . or .. then its a valid entry in the DataBase // If the name of the file is not . or .. then its a valid entry in the DataBase
if (!((strcmp (findData.cFileName, ".") == 0) || (strcmp (findData.cFileName, "..") == 0))) if (!((_tcscmp (findData.cFileName, _T(".")) == 0) || (_tcscmp (findData.cFileName, _T("..")) == 0)))
{ {
string error; string error;
if (!_ZoneBank.addElement (findData.cFileName, error)) if (!_ZoneBank.addElement (findData.cFileName, error))

View file

@ -49,8 +49,8 @@ using namespace NLMISC;
#define STRING_SELECT_COMBOBOX_ID 9 #define STRING_SELECT_COMBOBOX_ID 9
#define DIFFERENT_VALUE_STRING "<different values>" #define DIFFERENT_VALUE_STRING _T("<different values>")
#define DIFFERENT_VALUE_MULTI_STRING "<diff>" #define DIFFERENT_VALUE_MULTI_STRING _T("<diff>")
//CDialogProperties PropertyDialog; //CDialogProperties PropertyDialog;
std::list<CDialogProperties*> PropertiesDialogs; std::list<CDialogProperties*> PropertiesDialogs;
@ -327,12 +327,12 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter &parameter,
buttonRect.right = buttonRect.left + FILE_BUTTON_WIDTH; buttonRect.right = buttonRect.left + FILE_BUTTON_WIDTH;
// Create an edit box // Create an edit box
nlverify (widget.CheckBox.Create ("Select", BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP|(enabled?0:WS_DISABLED), buttonRect, &m_PropertyCont, id)); nlverify (widget.CheckBox.Create (_T("Select"), BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP|(enabled?0:WS_DISABLED), buttonRect, &m_PropertyCont, id));
widget.CheckBox.SetFont (GetFont ()); widget.CheckBox.SetFont (GetFont ());
} }
// Create the label // Create the label
widget.Static.Create ("", WS_VISIBLE, widgetPos, &m_PropertyCont); widget.Static.Create (_T(""), WS_VISIBLE, widgetPos, &m_PropertyCont);
widget.Static.SetFont (GetFont ()); widget.Static.SetFont (GetFont ());
// Next position // Next position
@ -372,11 +372,11 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter &parameter,
// we insert an empty string in case of a default value // we insert an empty string in case of a default value
if (!widget.Parameter.SortEntries) if (!widget.Parameter.SortEntries)
{ {
widget.ComboBox.InsertString( -1, ""); widget.ComboBox.InsertString( -1, _T(""));
} }
else else
{ {
widget.ComboBox.AddString(""); widget.ComboBox.AddString(_T(""));
} }
if (ite != widget.Parameter.ComboValues.end ()) if (ite != widget.Parameter.ComboValues.end ())
{ {
@ -431,7 +431,7 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter &parameter,
widgetPos.bottom = widgetPos.top + EDIT_HEIGHT; widgetPos.bottom = widgetPos.top + EDIT_HEIGHT;
// Create an edit box // Create an edit box
nlverify (widget.EditBox.CreateEx (WS_EX_CLIENTEDGE, _T("EDIT"), "", WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|(enabled?0:ES_READONLY), widgetPos, &m_PropertyCont, id)); nlverify (widget.EditBox.CreateEx (WS_EX_CLIENTEDGE, _T("EDIT"), _T(""), WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|(enabled?0:ES_READONLY), widgetPos, &m_PropertyCont, id));
widget.EditBox.SetFont (GetFont ()); widget.EditBox.SetFont (GetFont ());
if (widget.Parameter.FileExtension != "") if (widget.Parameter.FileExtension != "")
{ {
@ -440,7 +440,7 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter &parameter,
buttonRect.right = buttonRect.left + FILE_BUTTON_WIDTH; buttonRect.right = buttonRect.left + FILE_BUTTON_WIDTH;
// Create an edit box // Create an edit box
nlverify (widget.CheckBox.Create ("Open...", BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP|(enabled?0:WS_DISABLED), buttonRect, &m_PropertyCont, id)); nlverify (widget.CheckBox.Create (_T("Open..."), BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP|(enabled?0:WS_DISABLED), buttonRect, &m_PropertyCont, id));
widget.CheckBox.SetFont (GetFont ()); widget.CheckBox.SetFont (GetFont ());
} }
} }
@ -452,12 +452,12 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter &parameter,
// Create an edit box // Create an edit box
if (widget.Parameter.DisplayHS) if (widget.Parameter.DisplayHS)
{ {
nlverify (widget.MultiLineEditBox.CreateEx (WS_EX_CLIENTEDGE, _T("EDIT"), "", nlverify (widget.MultiLineEditBox.CreateEx (WS_EX_CLIENTEDGE, _T("EDIT"), _T(""),
WS_VSCROLL|WS_HSCROLL|ES_MULTILINE|ES_WANTRETURN|WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_AUTOVSCROLL|(enabled?0:ES_READONLY), widgetPos, &m_PropertyCont, id)); WS_VSCROLL|WS_HSCROLL|ES_MULTILINE|ES_WANTRETURN|WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_AUTOVSCROLL|(enabled?0:ES_READONLY), widgetPos, &m_PropertyCont, id));
} }
else else
{ {
nlverify (widget.MultiLineEditBox.CreateEx (WS_EX_CLIENTEDGE, _T("EDIT"), "", nlverify (widget.MultiLineEditBox.CreateEx (WS_EX_CLIENTEDGE, _T("EDIT"), _T(""),
WS_VSCROLL|ES_MULTILINE|ES_WANTRETURN|WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_AUTOVSCROLL|(enabled?0:ES_READONLY), widgetPos, &m_PropertyCont, id)); WS_VSCROLL|ES_MULTILINE|ES_WANTRETURN|WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_AUTOVSCROLL|(enabled?0:ES_READONLY), widgetPos, &m_PropertyCont, id));
} }
@ -478,7 +478,7 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter &parameter,
RECT buttonRect = widgetPos; RECT buttonRect = widgetPos;
// Create an edit box // Create an edit box
nlverify (widget.CheckBox.Create ("Edit...", BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP|(enabled?0:WS_DISABLED), buttonRect, &m_PropertyCont, id)); nlverify (widget.CheckBox.Create (_T("Edit..."), BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP|(enabled?0:WS_DISABLED), buttonRect, &m_PropertyCont, id));
widget.CheckBox.SetFont (GetFont ()); widget.CheckBox.SetFont (GetFont ());
} }
} }
@ -488,7 +488,7 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter &parameter,
widgetPos.bottom = widgetPos.top + widget.Parameter.WidgetHeight; widgetPos.bottom = widgetPos.top + widget.Parameter.WidgetHeight;
// Create an edit box // Create an edit box
nlverify (widget.ListEditBox.CreateEx (WS_EX_CLIENTEDGE, _T("LISTBOX"), "", WS_VSCROLL|WS_CHILD|WS_VISIBLE|WS_TABSTOP|LBS_NOTIFY|(enabled?0:WS_DISABLED), widgetPos, &m_PropertyCont, id)); nlverify (widget.ListEditBox.CreateEx (WS_EX_CLIENTEDGE, _T("LISTBOX"), _T(""), WS_VSCROLL|WS_CHILD|WS_VISIBLE|WS_TABSTOP|LBS_NOTIFY|(enabled?0:WS_DISABLED), widgetPos, &m_PropertyCont, id));
// Resize the column // Resize the column
RECT listRect; RECT listRect;
@ -498,7 +498,7 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter &parameter,
widget.ListEditBox.StringSelectComboBox.ResetContent (); widget.ListEditBox.StringSelectComboBox.ResetContent ();
std::map<std::string, CPrimitiveClass::CParameter::CConstStringValue>::iterator ite = widget.Parameter.ComboValues.find (doc->getContext ().c_str()); std::map<std::string, CPrimitiveClass::CParameter::CConstStringValue>::iterator ite = widget.Parameter.ComboValues.find (doc->getContext ().c_str());
// we insert an empty string in case of a default value // we insert an empty string in case of a default value
widget.ListEditBox.StringSelectComboBox.InsertString( -1, ""); widget.ListEditBox.StringSelectComboBox.InsertString( -1, _T(""));
if (ite != widget.Parameter.ComboValues.end ()) if (ite != widget.Parameter.ComboValues.end ())
{ {
vector<string> PathList; vector<string> PathList;
@ -565,7 +565,7 @@ void CDialogProperties::addWidget (const CPrimitiveClass::CParameter &parameter,
// Create an edit box // Create an edit box
//nlverify (widget.CheckBox.Create ("Open...", BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP, buttonRect, this, id)); //nlverify (widget.CheckBox.Create ("Open...", BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP, buttonRect, this, id));
nlverify (widget.CheckBox.Create ("View...", BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP|(enabled?0:WS_DISABLED), buttonRect, &m_PropertyCont, id)); nlverify (widget.CheckBox.Create (_T("View..."), BS_PUSHBUTTON|WS_VISIBLE|WS_TABSTOP|(enabled?0:WS_DISABLED), buttonRect, &m_PropertyCont, id));
widget.CheckBox.SetFont (GetFont ()); widget.CheckBox.SetFont (GetFont ());
} }
@ -661,7 +661,7 @@ BOOL CDialogProperties::OnInitDialog()
// m_PropertyFrame.ClientToScreen(&contRect); // m_PropertyFrame.ClientToScreen(&contRect);
// leave 16 px for the scroll bar // leave 16 px for the scroll bar
contRect.right-=16; contRect.right-=16;
m_PropertyCont.Create("", 0, contRect, &m_PropertyFrame); m_PropertyCont.Create(_T(""), 0, contRect, &m_PropertyFrame);
// m_PropertyCont.SetCursor() // m_PropertyCont.SetCursor()
m_PropertyCont.ShowWindow(SW_SHOW); m_PropertyCont.ShowWindow(SW_SHOW);

View file

@ -163,20 +163,20 @@ int CALLBACK expBrowseCallbackProc (HWND hwnd,UINT uMsg,LPARAM lp, LPARAM pData)
bool CExportDlg::callChoosePathDlg(CString &dest) const bool CExportDlg::callChoosePathDlg(CString &dest) const
{ {
BROWSEINFO bi; BROWSEINFO bi;
char str[MAX_PATH]; TCHAR str[MAX_PATH];
ITEMIDLIST* pidl; ITEMIDLIST* pidl;
char sTemp[1024]; TCHAR sTemp[1024];
bi.hwndOwner = this->m_hWnd; bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL; bi.pidlRoot = NULL;
bi.pidlRoot = NULL; bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;; bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path"; bi.lpszTitle = _T("Choose the path");
bi.ulFlags = 0; bi.ulFlags = 0;
bi.lpfn = expBrowseCallbackProc; bi.lpfn = expBrowseCallbackProc;
char sDir[512]; TCHAR sDir[512];
strcpy(sDir, (LPCSTR)RefZoneDir); _tcscpy(sDir, (LPCTSTR)RefZoneDir);
bi.lParam = (LPARAM)sDir; bi.lParam = (LPARAM)sDir;
bi.iImage = 0; bi.iImage = 0;
@ -218,7 +218,7 @@ void CExportDlg::OnButtonOutIGdir()
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
void CExportDlg::OnButtonTilebankfile() void CExportDlg::OnButtonTilebankfile()
{ {
CFileDialogEx dialog (BASE_REGISTRY_KEY, "bank", true, "smallbank", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "SmallBank (*.smallbank)|*.smallbank||", this); CFileDialogEx dialog (BASE_REGISTRY_KEY, _T("bank"), true, _T("smallbank"), NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, _T("SmallBank (*.smallbank)|*.smallbank||"), this);
if (dialog.DoModal() == IDOK) if (dialog.DoModal() == IDOK)
{ {
TileBankFile = dialog.GetPathName (); TileBankFile = dialog.GetPathName ();
@ -229,7 +229,7 @@ void CExportDlg::OnButtonTilebankfile()
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
void CExportDlg::OnButtonColormapfile() void CExportDlg::OnButtonColormapfile()
{ {
CFileDialogEx dialog (BASE_REGISTRY_KEY, "image", true, "tga", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "Tga Files (*.tga)|*.tga|All Files (*.*)|*.*||", this); CFileDialogEx dialog (BASE_REGISTRY_KEY, _T("image"), true, _T("tga"), NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, _T("Tga Files (*.tga)|*.tga|All Files (*.*)|*.*||"), this);
if (dialog.DoModal() == IDOK) if (dialog.DoModal() == IDOK)
{ {
ColorMapFile = dialog.GetPathName (); ColorMapFile = dialog.GetPathName ();
@ -240,7 +240,7 @@ void CExportDlg::OnButtonColormapfile()
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
void CExportDlg::OnButtonHeightmapfile() void CExportDlg::OnButtonHeightmapfile()
{ {
CFileDialogEx dialog (BASE_REGISTRY_KEY, "image", true, "tga", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "Grayscale Tga (*.tga)|*.tga||", this); CFileDialogEx dialog (BASE_REGISTRY_KEY, _T("image"), true, _T("tga"), NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, _T("Grayscale Tga (*.tga)|*.tga||"), this);
if (dialog.DoModal() == IDOK) if (dialog.DoModal() == IDOK)
{ {
HeightMapFile = dialog.GetPathName (); HeightMapFile = dialog.GetPathName ();
@ -251,7 +251,7 @@ void CExportDlg::OnButtonHeightmapfile()
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
void CExportDlg::OnButtonHeightmapfile2() void CExportDlg::OnButtonHeightmapfile2()
{ {
CFileDialogEx dialog (BASE_REGISTRY_KEY, "image", true, "tga", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "Grayscale Tga (*.tga)|*.tga||", this); CFileDialogEx dialog (BASE_REGISTRY_KEY, _T("image"), true, _T("tga"), NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, _T("Grayscale Tga (*.tga)|*.tga||"), this);
if (dialog.DoModal() == IDOK) if (dialog.DoModal() == IDOK)
{ {
HeightMapFile2 = dialog.GetPathName (); HeightMapFile2 = dialog.GetPathName ();
@ -299,7 +299,7 @@ void CExportDlg::OnButtonContinentsDir()
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
void CExportDlg::OnButtonContinentFile() void CExportDlg::OnButtonContinentFile()
{ {
CFileDialogEx dialog (BASE_REGISTRY_KEY, "continent", true, "continent", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "Continent file (*.continent)|*.continent||", this); CFileDialogEx dialog (BASE_REGISTRY_KEY, _T("continent"), true, _T("continent"), NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, _T("Continent file (*.continent)|*.continent||"), this);
if (dialog.DoModal() == IDOK) if (dialog.DoModal() == IDOK)
{ {
ContinentFile = dialog.GetPathName (); ContinentFile = dialog.GetPathName ();

View file

@ -54,7 +54,7 @@ END_MESSAGE_MAP()
INT_PTR CFileDialogEx::DoModal () INT_PTR CFileDialogEx::DoModal ()
{ {
// Get the path // Get the path
char path[512]; TCHAR path[512];
path[0] = 0; path[0] = 0;
HKEY hKey; HKEY hKey;
DWORD type = REG_SZ; DWORD type = REG_SZ;
@ -122,7 +122,7 @@ BOOL CFileDialogEx::OnCommand( WPARAM wParam, LPARAM lParam )
::GetDlgItemText (parent, edt1, s, MAX_PATH); ::GetDlgItemText (parent, edt1, s, MAX_PATH);
// Replace with the directory name // Replace with the directory name
::SendMessage (parent, CDM_SETCONTROLTEXT, edt1, (LPARAM)(const char*)text); ::SendMessage (parent, CDM_SETCONTROLTEXT, edt1, (LPARAM)(LPCTSTR)text);
// Click on the OK button // Click on the OK button
::SendMessage (parent, WM_COMMAND, IDOK, 0); ::SendMessage (parent, WM_COMMAND, IDOK, 0);
@ -148,7 +148,7 @@ BOOL CFileDialogEx::OnInitDialog()
combo.Attach (::GetDlgItem (*this, IDC_DIRLIST)); combo.Attach (::GetDlgItem (*this, IDC_DIRLIST));
// Insert the strings // Insert the strings
char text[512]; TCHAR text[512];
text[0] = 0; text[0] = 0;
HKEY hKey; HKEY hKey;
DWORD type = REG_SZ; DWORD type = REG_SZ;

View file

@ -175,7 +175,7 @@ void CFindPrimitiveDlg::OnFindNext()
} }
else else
{ {
MessageBox ("End of the document", "Find a primitive...", MB_OK|MB_ICONEXCLAMATION); MessageBox (_T("End of the document"), _T("Find a primitive..."), MB_OK|MB_ICONEXCLAMATION);
// Init locator // Init locator
_Locator.getRoot (0); _Locator.getRoot (0);

View file

@ -36,7 +36,7 @@
#include "nel/ligo/ligo_config.h" #include "nel/ligo/ligo_config.h"
// Base registry key // Base registry key
#define BASE_REGISTRY_KEY "Software\\Nevrax\\NeL World Editor" #define BASE_REGISTRY_KEY _T("Software\\Nevrax\\NeL World Editor")
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// CWorldEditorApp: // CWorldEditorApp:

View file

@ -353,7 +353,7 @@ void CPlugin::postRender(CDisplay &display)
// TODO nico This code is duplicated with world_editor_shard_monitor // TODO nico This code is duplicated with world_editor_shard_monitor
static bool createFailed = false; static bool createFailed = false;
if (createFailed) return; if (createFailed) return;
HRSRC rsc = FindResource(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_FLAG_ICONS_TGA), "TGA"); HRSRC rsc = FindResource(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_FLAG_ICONS_TGA), _T("TGA"));
if (rsc == NULL) if (rsc == NULL)
{ {
DWORD lastError = GetLastError(); DWORD lastError = GetLastError();

View file

@ -186,7 +186,7 @@ void CGraphPlugin::refreshPrimitives()
//currently using output.png as the input file... //currently using output.png as the input file...
if(!createBitmap(tmpPath)) if(!createBitmap(tmpPath))
AfxMessageBox("BEWARE: the image couldn't be loaded."); AfxMessageBox(_T("BEWARE: the image couldn't be loaded."));
} }
while (missionTreeRoot->getParent()!=NULL) while (missionTreeRoot->getParent()!=NULL)
@ -268,7 +268,7 @@ void CGraphPlugin::refreshMachine()
//currently using output.png as the input file... //currently using output.png as the input file...
if(!createBitmap(tmpPath)) if(!createBitmap(tmpPath))
AfxMessageBox("BEWARE: the image couldn't be loaded."); AfxMessageBox(_T("BEWARE: the image couldn't be loaded."));
} }
while (missionTreeRoot->getParent()!=NULL) while (missionTreeRoot->getParent()!=NULL)
@ -312,8 +312,8 @@ void CGraphPlugin::refreshMachine()
//currently using output.png as the input file... //currently using output.png as the input file...
if(!createBitmap(tmpPath)) if(!createBitmap(tmpPath))
AfxMessageBox("BEWARE: the image couldn't be loaded."); AfxMessageBox(_T("BEWARE: the image couldn't be loaded."));
} }
while (missionTreeRoot->getParent()!=NULL) while (missionTreeRoot->getParent()!=NULL)
{ {
@ -323,7 +323,7 @@ void CGraphPlugin::refreshMachine()
} }
else else
{ {
AfxMessageBox("The selected node could not be processed."); AfxMessageBox(_T("The selected node could not be processed."));
} }
} }

View file

@ -73,18 +73,18 @@ CDialogFlags::CDialogFlags(CWnd* pParent /*=NULL*/)
{ {
CEntityDisplayInfo di[] = CEntityDisplayInfo di[] =
{ {
CEntityDisplayInfo(RYZOMID::building, "Building", NLMISC::CRGBA(192, 0, 0)), CEntityDisplayInfo(RYZOMID::building, _T("Building"), NLMISC::CRGBA(192, 0, 0)),
CEntityDisplayInfo(RYZOMID::creature, "Creature", NLMISC::CRGBA(255, 127, 0), 2, 0), CEntityDisplayInfo(RYZOMID::creature, _T("Creature"), NLMISC::CRGBA(255, 127, 0), 2, 0),
CEntityDisplayInfo(RYZOMID::deposit, "Deposit", NLMISC::CRGBA(0, 255, 0)), CEntityDisplayInfo(RYZOMID::deposit, _T("Deposit"), NLMISC::CRGBA(0, 255, 0)),
CEntityDisplayInfo(RYZOMID::flora, "Flora", NLMISC::CRGBA(255, 127, 0)), CEntityDisplayInfo(RYZOMID::flora, _T("Flora"), NLMISC::CRGBA(255, 127, 0)),
CEntityDisplayInfo(RYZOMID::forageSource, "Forage Source", NLMISC::CRGBA(0, 255, 0)), CEntityDisplayInfo(RYZOMID::forageSource, _T("Forage Source"), NLMISC::CRGBA(0, 255, 0)),
CEntityDisplayInfo(RYZOMID::mount, "Mount", NLMISC::CRGBA(127, 63, 0), 3, 0), CEntityDisplayInfo(RYZOMID::mount, _T("Mount"), NLMISC::CRGBA(127, 63, 0), 3, 0),
CEntityDisplayInfo(RYZOMID::npc, "NPC", NLMISC::CRGBA(255, 0, 0), 1, 0), CEntityDisplayInfo(RYZOMID::npc, _T("NPC"), NLMISC::CRGBA(255, 0, 0), 1, 0),
CEntityDisplayInfo(RYZOMID::object, "Object", NLMISC::CRGBA(192, 255, 255)), CEntityDisplayInfo(RYZOMID::object, _T("Object"), NLMISC::CRGBA(192, 255, 255)),
CEntityDisplayInfo(RYZOMID::pack_animal, "Pack Animal", NLMISC::CRGBA(127, 63, 0), 3, 0), CEntityDisplayInfo(RYZOMID::pack_animal, _T("Pack Animal"), NLMISC::CRGBA(127, 63, 0), 3, 0),
CEntityDisplayInfo(RYZOMID::player, "Player", NLMISC::CRGBA(127, 127, 255), 0, 0), CEntityDisplayInfo(RYZOMID::player, _T("Player"), NLMISC::CRGBA(127, 127, 255), 0, 0),
CEntityDisplayInfo(RYZOMID::fx_entity, "FX Entity", NLMISC::CRGBA(0, 255, 0)), CEntityDisplayInfo(RYZOMID::fx_entity, _T("FX Entity"), NLMISC::CRGBA(0, 255, 0)),
CEntityDisplayInfo(RYZOMID::unknown, "Unknown", NLMISC::CRGBA(127, 127, 127)), CEntityDisplayInfo(RYZOMID::unknown, _T("Unknown"), NLMISC::CRGBA(127, 127, 127)),
}; };
initDisplayInfo(di, sizeofarray(di), _EntityDisplayInfo[EntityType]); initDisplayInfo(di, sizeofarray(di), _EntityDisplayInfo[EntityType]);
} }
@ -92,10 +92,10 @@ CDialogFlags::CDialogFlags(CWnd* pParent /*=NULL*/)
{ {
CEntityDisplayInfo di[] = CEntityDisplayInfo di[] =
{ {
CEntityDisplayInfo(0, "Dead", NLMISC::CRGBA(255, 0, 0)), CEntityDisplayInfo(0, _T("Dead"), NLMISC::CRGBA(255, 0, 0)),
CEntityDisplayInfo(1, "Weak", NLMISC::CRGBA(255, 255, 0)), CEntityDisplayInfo(1, _T("Weak"), NLMISC::CRGBA(255, 255, 0)),
CEntityDisplayInfo(2, "Full shape", NLMISC::CRGBA(0, 255, 0)), CEntityDisplayInfo(2, _T("Full shape"), NLMISC::CRGBA(0, 255, 0)),
CEntityDisplayInfo(3, "No Hit Points", NLMISC::CRGBA(127, 127, 127)), CEntityDisplayInfo(3, _T("No Hit Points"), NLMISC::CRGBA(127, 127, 127)),
}; };
initDisplayInfo(di, sizeofarray(di), _EntityDisplayInfo[EntityHitPoints]); initDisplayInfo(di, sizeofarray(di), _EntityDisplayInfo[EntityHitPoints]);
} }
@ -103,9 +103,9 @@ CDialogFlags::CDialogFlags(CWnd* pParent /*=NULL*/)
{ {
CEntityDisplayInfo di[] = CEntityDisplayInfo di[] =
{ {
CEntityDisplayInfo(0, "Dead", NLMISC::CRGBA(255, 0, 0)), CEntityDisplayInfo(0, _T("Dead"), NLMISC::CRGBA(255, 0, 0)),
CEntityDisplayInfo(1, "Alive", NLMISC::CRGBA(0, 0, 255)), CEntityDisplayInfo(1, _T("Alive"), NLMISC::CRGBA(0, 0, 255)),
CEntityDisplayInfo(2, "No Hit Points", NLMISC::CRGBA(127, 127, 127)), CEntityDisplayInfo(2, _T("No Hit Points"), NLMISC::CRGBA(127, 127, 127)),
}; };
initDisplayInfo(di, sizeofarray(di), _EntityDisplayInfo[EntityAlive]); initDisplayInfo(di, sizeofarray(di), _EntityDisplayInfo[EntityAlive]);
} }
@ -113,19 +113,19 @@ CDialogFlags::CDialogFlags(CWnd* pParent /*=NULL*/)
{ {
CEntityDisplayInfo di[] = CEntityDisplayInfo di[] =
{ {
CEntityDisplayInfo(MBEHAV::UNKNOWN_MODE, "Unknown", NLMISC::CRGBA(127, 127, 127)), CEntityDisplayInfo(MBEHAV::UNKNOWN_MODE, _T("Unknown"), NLMISC::CRGBA(127, 127, 127)),
CEntityDisplayInfo(MBEHAV::NORMAL, "Normal", NLMISC::CRGBA(255, 255, 255)), CEntityDisplayInfo(MBEHAV::NORMAL, _T("Normal"), NLMISC::CRGBA(255, 255, 255)),
CEntityDisplayInfo(MBEHAV::COMBAT_FLOAT, "Combat float", NLMISC::CRGBA(255, 0, 0), 0, 1), CEntityDisplayInfo(MBEHAV::COMBAT_FLOAT, _T("Combat float"), NLMISC::CRGBA(255, 0, 0), 0, 1),
CEntityDisplayInfo(MBEHAV::COMBAT, "Combat", NLMISC::CRGBA(255, 0, 0), 0, 1), CEntityDisplayInfo(MBEHAV::COMBAT, _T("Combat"), NLMISC::CRGBA(255, 0, 0), 0, 1),
CEntityDisplayInfo(MBEHAV::SWIM, "Swim", NLMISC::CRGBA(0, 0, 255)), CEntityDisplayInfo(MBEHAV::SWIM, _T("Swim"), NLMISC::CRGBA(0, 0, 255)),
CEntityDisplayInfo(MBEHAV::SIT, "Sit", NLMISC::CRGBA(0, 255, 255)), CEntityDisplayInfo(MBEHAV::SIT, _T("Sit"), NLMISC::CRGBA(0, 255, 255)),
CEntityDisplayInfo(MBEHAV::MOUNT_NORMAL, "Mount Normal", NLMISC::CRGBA(192, 128, 0)), CEntityDisplayInfo(MBEHAV::MOUNT_NORMAL, _T("Mount Normal"), NLMISC::CRGBA(192, 128, 0)),
CEntityDisplayInfo(MBEHAV::MOUNT_SWIM, "Mount Swim", NLMISC::CRGBA(0, 0, 255)), CEntityDisplayInfo(MBEHAV::MOUNT_SWIM, _T("Mount Swim"), NLMISC::CRGBA(0, 0, 255)),
CEntityDisplayInfo(MBEHAV::EAT, "Eat", NLMISC::CRGBA(0, 255, 0)), CEntityDisplayInfo(MBEHAV::EAT, _T("Eat"), NLMISC::CRGBA(0, 255, 0)),
CEntityDisplayInfo(MBEHAV::ALERT, "Alert", NLMISC::CRGBA(255, 127, 0)), CEntityDisplayInfo(MBEHAV::ALERT, _T("Alert"), NLMISC::CRGBA(255, 127, 0)),
CEntityDisplayInfo(MBEHAV::HUNGRY, "Hungry", NLMISC::CRGBA(255, 255, 0)), CEntityDisplayInfo(MBEHAV::HUNGRY, _T("Hungry"), NLMISC::CRGBA(255, 255, 0)),
CEntityDisplayInfo(MBEHAV::DEATH, "Death", NLMISC::CRGBA(0, 0, 0)), CEntityDisplayInfo(MBEHAV::DEATH, _T("Death"), NLMISC::CRGBA(0, 0, 0)),
CEntityDisplayInfo(MBEHAV::SWIM_DEATH, "SwimDeath", NLMISC::CRGBA(0, 0, 0)) CEntityDisplayInfo(MBEHAV::SWIM_DEATH, _T("SwimDeath"), NLMISC::CRGBA(0, 0, 0))
}; };
initDisplayInfo(di, sizeofarray(di), _EntityDisplayInfo[EntityMode]); initDisplayInfo(di, sizeofarray(di), _EntityDisplayInfo[EntityMode]);
} }
@ -213,7 +213,7 @@ BOOL CDialogFlags::OnInitDialog()
{ {
CDialog::OnInitDialog(); CDialog::OnInitDialog();
HRSRC rsc = FindResource(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ENTITY_ICONS_TGA), "TGA"); HRSRC rsc = FindResource(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ENTITY_ICONS_TGA), _T("TGA"));
if (rsc != NULL) if (rsc != NULL)
{ {
NLMISC::CBitmap bm; NLMISC::CBitmap bm;
@ -247,7 +247,7 @@ BOOL CDialogFlags::OnInitDialog()
::CRect shardListRect; ::CRect shardListRect;
GetDlgItem(IDC_SHARD_LIST_PLACEMENT)->GetWindowRect(shardListRect); GetDlgItem(IDC_SHARD_LIST_PLACEMENT)->GetWindowRect(shardListRect);
ScreenToClient(&shardListRect); ScreenToClient(&shardListRect);
ShardCtrl.create(WS_CHILD|WS_TABSTOP, shardListRect, this, 0, REGKEY_BASE_PATH "\\shard_list", 10); ShardCtrl.create(WS_CHILD|WS_TABSTOP, shardListRect, this, 0, REGKEY_BASE_PATH _T("\\shard_list"), 10);
ShardCtrl.ShowWindow (SW_SHOW); ShardCtrl.ShowWindow (SW_SHOW);
CFont* font = GetFont (); CFont* font = GetFont ();
ShardCtrl.SetFont(font); ShardCtrl.SetFont(font);
@ -295,7 +295,7 @@ void CDialogFlags::setCurrentEntityDisplayMode(TEntityDisplayMode edm)
#define REGKEY_ENTITY_DISPLAY_INFO REGKEY_BASE_PATH "\\entity_display_info\\" #define REGKEY_ENTITY_DISPLAY_INFO REGKEY_BASE_PATH _T("\\entity_display_info\\")
//****************************************************************************************************** //******************************************************************************************************
void CDialogFlags::loadEntityDisplayInfoToRegistry(TEntityDisplayInfoVect &infos, const std::string &regId) void CDialogFlags::loadEntityDisplayInfoToRegistry(TEntityDisplayInfoVect &infos, const std::string &regId)
@ -306,13 +306,13 @@ void CDialogFlags::loadEntityDisplayInfoToRegistry(TEntityDisplayInfoVect &infos
DWORD index = 0; DWORD index = 0;
for(;;) for(;;)
{ {
char valueStr[256] = { 0 }; TCHAR valueStr[256] = { 0 };
BYTE dataStr[256] = { 0 }; BYTE dataStr[256] = { 0 };
DWORD valueSize = sizeofarray(valueStr); DWORD valueSize = sizeofarray(valueStr);
DWORD dataSize = sizeofarray(dataStr); DWORD dataSize = sizeofarray(dataStr);
LONG result = RegEnumValue(hKey, index, valueStr, &valueSize, NULL, NULL, dataStr, &dataSize); LONG result = RegEnumValue(hKey, index, valueStr, &valueSize, NULL, NULL, dataStr, &dataSize);
if (result != ERROR_SUCCESS) break; if (result != ERROR_SUCCESS) break;
uint value = (uint) atoi(valueStr); uint value = (uint) _ttoi(valueStr);
for(uint k = 0; k < infos.size(); ++k) for(uint k = 0; k < infos.size(); ++k)
{ {
if (infos[k].Value == value) if (infos[k].Value == value)

View file

@ -46,12 +46,12 @@ class CEntityDisplayInfo
{ {
public: public:
uint Value; uint Value;
const char *Name; const TCHAR *Name;
CEntityIcon Icon; CEntityIcon Icon;
NLMISC::CRGBA Color; NLMISC::CRGBA Color;
bool Visible; bool Visible;
CEntityDisplayInfo() {} CEntityDisplayInfo() {}
CEntityDisplayInfo(uint value, const char *name, NLMISC::CRGBA color, sint iconX = -1, sint iconY = -1) CEntityDisplayInfo(uint value, const TCHAR *name, NLMISC::CRGBA color, sint iconX = -1, sint iconY = -1)
: Value(value), Name(name), Color(color), Visible(true), Icon(iconX, iconY) {} : Value(value), Name(name), Color(color), Visible(true), Icon(iconX, iconY) {}
}; };

View file

@ -43,7 +43,7 @@ CMemoryComboBox::~CMemoryComboBox()
// *************************************************************************** // ***************************************************************************
void CMemoryComboBox::create (DWORD style, const RECT &rect, CWnd *parent, UINT nId, const char *registerAdress, int memoryCount) void CMemoryComboBox::create (DWORD style, const RECT &rect, CWnd *parent, UINT nId, const TCHAR *registerAdress, int memoryCount)
{ {
// Register a window // Register a window
Id = nId; Id = nId;
@ -52,7 +52,7 @@ void CMemoryComboBox::create (DWORD style, const RECT &rect, CWnd *parent, UINT
LPCTSTR clas = AfxRegisterWndClass (0); LPCTSTR clas = AfxRegisterWndClass (0);
if (clas) if (clas)
{ {
if (Create (clas, "MemoryComboBox", style, rect, parent, nId)) if (Create (clas, _T("MemoryComboBox"), style, rect, parent, nId))
{ {
// Create the combo box // Create the combo box
RECT comboRect; RECT comboRect;
@ -582,12 +582,12 @@ LRESULT CMemoryComboBox::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
int curSel = _ComboBox.GetCurSel (); int curSel = _ComboBox.GetCurSel ();
if ((curSel == -1) || ((uint)curSel<Commands.size())) if ((curSel == -1) || ((uint)curSel<Commands.size()))
{ {
_ComboBox.GetWindowText ((char*)lParam, wParam); _ComboBox.GetWindowText ((TCHAR*)lParam, wParam);
return _ComboBox.GetWindowTextLength (); return _ComboBox.GetWindowTextLength ();
} }
else else
{ {
_ComboBox.GetLBText (curSel, (char*)lParam); _ComboBox.GetLBText (curSel, (TCHAR*)lParam);
return _ComboBox.GetLBTextLen (curSel); return _ComboBox.GetLBTextLen (curSel);
} }
} }

View file

@ -45,7 +45,7 @@ public:
void onOK (); void onOK ();
void onCancel (); void onCancel ();
void create (DWORD style, const RECT &rect, CWnd *parent, UINT nId, const char *registerAdress, int memoryCount); void create (DWORD style, const RECT &rect, CWnd *parent, UINT nId, const TCHAR *registerAdress, int memoryCount);
void create (DWORD style, const RECT &rect, CWnd *parent, UINT nId); void create (DWORD style, const RECT &rect, CWnd *parent, UINT nId);
void setRegisterAdress (const char *registerAdress); void setRegisterAdress (const char *registerAdress);
void clearCommand (); void clearCommand ();

View file

@ -1012,7 +1012,7 @@ void CPlugin::displayCloseUp(CDisplay &display)
{ {
static bool createFailed = false; static bool createFailed = false;
if (createFailed) return; if (createFailed) return;
HRSRC rsc = FindResource(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ENTITY_ICONS_TGA), "TGA"); HRSRC rsc = FindResource(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ENTITY_ICONS_TGA), _T("TGA"));
if (rsc == NULL) if (rsc == NULL)
{ {
createFailed = true; createFailed = true;

View file

@ -22,7 +22,7 @@
#include "../../../../common/src/game_share/mode_and_behaviour.h" #include "../../../../common/src/game_share/mode_and_behaviour.h"
#define REGKEY_BASE_PATH "Software\\Nevrax\\nel\\world_editor_shard_monitor_plugin" #define REGKEY_BASE_PATH _T("Software\\Nevrax\\nel\\world_editor_shard_monitor_plugin")
// //
struct CServerParams struct CServerParams