From 3a98f7a048c044ce0d870320fc0b1def0db4f7fb Mon Sep 17 00:00:00 2001 From: oy Date: Wed, 6 Oct 2010 23:07:35 +0200 Subject: added mod system. Closes #34 --- src/game/editor/ed_editor.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/game/editor/ed_editor.h') diff --git a/src/game/editor/ed_editor.h b/src/game/editor/ed_editor.h index 30ec7203..225ff4ab 100644 --- a/src/game/editor/ed_editor.h +++ b/src/game/editor/ed_editor.h @@ -459,7 +459,7 @@ public: m_aFileName[0] = 0; - m_FileDialogDirTypes = 0; + m_FileDialogStorageType = 0; m_pFileDialogTitle = 0; m_pFileDialogButtonText = 0; m_pFileDialogUser = 0; @@ -508,7 +508,7 @@ public: virtual void UpdateAndRender(); void FilelistPopulate(); - void InvokeFileDialog(int ListdirType, const char *pTitle, const char *pButtonText, + void InvokeFileDialog(int StorageType, const char *pTitle, const char *pButtonText, const char *pBasepath, const char *pDefaultName, void (*pfnFunc)(const char *pFilename, void *pUser), void *pUser); @@ -531,7 +531,7 @@ public: char m_aFileName[512]; - int m_FileDialogDirTypes; + int m_FileDialogStorageType; const char *m_pFileDialogTitle; const char *m_pFileDialogButtonText; void (*m_pfnFileDialogFunc)(const char *pFileName, void *pUser); @@ -540,7 +540,19 @@ public: char m_aFileDialogPath[512]; char m_aFileDialogCompleteFilename[512]; int m_FilesNum; - sorted_array m_FileList; + + struct CFilelistItem + { + char m_aFilename[128]; + char m_aName[128]; + bool m_IsDir; + int m_StorageType; + + bool operator<(const CFilelistItem &Other) { return !str_comp(m_aFilename, "..") ? true : !str_comp(Other.m_aFilename, "..") ? false : + m_IsDir && !Other.m_IsDir ? true : !m_IsDir && Other.m_IsDir ? false : + str_comp_filenames(m_aFilename, Other.m_aFilename) < 0; } + }; + sorted_array m_FileList; int m_FilesStartAt; int m_FilesCur; int m_FilesStopAt; @@ -643,7 +655,7 @@ public: void RenderMenubar(CUIRect Menubar); void RenderFileDialog(); - void AddFileDialogEntry(const char *pName, CUIRect *pView); + void AddFileDialogEntry(const CFilelistItem *pItem, CUIRect *pView); void SortImages(); }; -- cgit 1.4.1