1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 11:19:10 +00:00

Remove hsFiles in favor of plFilesystem stuff

This commit is contained in:
2013-01-20 20:17:39 -08:00
parent cc54fb07be
commit 2c028c4b07
51 changed files with 327 additions and 1249 deletions

View File

@ -60,7 +60,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plAudible.h"
#include "plCreatableIndex.h"
#include "plgDispatch.h"
#include "plFile/hsFiles.h"
#include "hsGeometry3.h"
#include "plLoadMask.h"
#include "hsMatrix44.h"

View File

@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "HeadSpin.h"
#include "plgDispatch.h"
#include "plFile/hsFiles.h"
#include "hsTemplates.h"
#include "plComponent.h"
@ -1464,19 +1463,17 @@ BOOL plGUIDialogProc::DlgProc( TimeValue t, IParamMap2 *pmap, HWND hWnd, UINT ms
case WM_INITDIALOG:
// Load the age combo box
{
int i, idx, selIdx = 0;
HWND ageCombo = GetDlgItem( hWnd, IDC_GUIDLG_AGE );
hsTArray<char *> ageList;
int i, idx, selIdx = 0;
HWND ageCombo = GetDlgItem( hWnd, IDC_GUIDLG_AGE );
plAgeDescInterface::BuildAgeFileList( ageList );
hsTArray<plFileName> ageList = plAgeDescInterface::BuildAgeFileList();
ComboBox_ResetContent( ageCombo );
for( i = 0; i < ageList.GetCount(); i++ )
{
char ageName[ _MAX_FNAME ];
_splitpath( ageList[ i ], nil, nil, ageName, nil );
plString ageName = ageList[i].GetFileNameNoExt();
idx = ComboBox_AddString( ageCombo, ageName );
if( stricmp( ageName, pmap->GetParamBlock()->GetStr( plGUIDialogComponent::kRefAgeName ) ) == 0 )
idx = ComboBox_AddString( ageCombo, ageName.c_str() );
if( ageName.CompareI( pmap->GetParamBlock()->GetStr( plGUIDialogComponent::kRefAgeName ) ) == 0 )
{
selIdx = idx;
}

View File

@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "HeadSpin.h"
#include "plCreatableIndex.h"
#include "plgDispatch.h"
#include "plFile/hsFiles.h"
#include "plComponentReg.h"
#include "plMiscComponents.h"
@ -259,8 +258,7 @@ protected:
HWND hAgeCombo = GetDlgItem(fhDlg, IDC_COMP_LOCATION_AGECOMBO);
IClearAges( hAgeCombo );
hsTArray<char *> ageFiles;
plAgeDescInterface::BuildAgeFileList( ageFiles );
hsTArray<plFileName> ageFiles = plAgeDescInterface::BuildAgeFileList();
const char *curAge = fPB->GetStr(plPageInfoComponent::kInfoAge);
if (!curAge || *curAge == '\0')
@ -268,14 +266,13 @@ protected:
for( int i = 0; i < ageFiles.GetCount(); i++ )
{
char ageName[_MAX_FNAME];
_splitpath( ageFiles[ i ], nil, nil, ageName, nil );
plString ageName = ageFiles[i].GetFileNameNoExt();
int idx = ComboBox_AddString( hAgeCombo, ageName );
int idx = ComboBox_AddString( hAgeCombo, ageName.c_str() );
// Store the pathas the item data for later (so don't free it yet!)
ComboBox_SetItemData( hAgeCombo, idx, (LPARAM)ageFiles[ i ] );
ComboBox_SetItemData( hAgeCombo, idx, (LPARAM)ageFiles[i].AsString().c_str() );
if( !strcmp( ageName, curAge ) )
if (ageName == curAge)
ComboBox_SetCurSel( hAgeCombo, idx );
}

View File

@ -41,7 +41,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
#include "plFile/hsFiles.h"
#include "hsResMgr.h"
#include "plComponentBase.h"
@ -329,18 +328,12 @@ void plResponderLinkProc::ILoadAgeFilenamesCombo(HWND hWnd, IParamBlock2 *pb)
savedName = "";
// Iterate through the age descriptions
hsFolderIterator ageFolder(agePath.AsString().c_str());
while (ageFolder.NextFileSuffix(".age"))
std::vector<plFileName> ages = plFileSystem::ListDir(agePath, "*.age");
for (auto iter = ages.begin(); iter != ages.end(); ++iter)
{
char ageFile[MAX_PATH];
ageFolder.GetPathAndName(ageFile);
int idx = SendMessage(hAge, CB_ADDSTRING, 0, (LPARAM)iter->GetFileNameNoExt().c_str());
char name[_MAX_FNAME];
_splitpath(ageFile, nil, nil, name, nil);
int idx = SendMessage(hAge, CB_ADDSTRING, 0, (LPARAM)name);
if (strcmp(name, savedName) == 0)
if (iter->GetFileNameNoExt() == savedName)
SendMessage(hAge, CB_SETCURSEL, idx, 0);
}
}
@ -364,18 +357,12 @@ void plResponderLinkProc::ILoadParentAgeFilenamesCombo(HWND hWnd, IParamBlock2 *
savedName = "<None>";
// Iterate through the age descriptions
hsFolderIterator ageFolder(agePath.AsString().c_str());
while (ageFolder.NextFileSuffix(".age"))
std::vector<plFileName> ages = plFileSystem::ListDir(agePath, "*.age");
for (auto iter = ages.begin(); iter != ages.end(); ++iter)
{
char ageFile[MAX_PATH];
ageFolder.GetPathAndName(ageFile);
int idx = SendMessage(hAge, CB_ADDSTRING, 0, (LPARAM)iter->GetFileNameNoExt().c_str());
char name[_MAX_FNAME];
_splitpath(ageFile, nil, nil, name, nil);
int idx = SendMessage(hAge, CB_ADDSTRING, 0, (LPARAM)name);
if (strcmp(name, savedName) == 0)
if (iter->GetFileNameNoExt() == savedName)
SendMessage(hAge, CB_SETCURSEL, idx, 0);
}
}