29 #include "../../idlib/precompiled.h"
40 extern HTREEITEM
FindTreeItem(CTreeCtrl *tree, HTREEITEM root,
const char *text, HTREEITEM forceParent);
49 disablePreview =
false;
58 CDialog::DoDataExchange(pDX);
66 ON_NOTIFY(TVN_SELCHANGED,
IDC_TREE_MEDIA, OnTvnSelchangedTreeMedia)
77 CDialog::OnInitDialog();
80 treeMedia.SetImageList(&m_image, TVSIL_NORMAL);
81 if ( disablePreview ) {
82 wndPreview.ShowWindow( SW_HIDE );
84 wndPreview.setDrawable(&m_testDrawable);
90 if ( mediaName.Length() ) {
91 HTREEITEM root = treeMedia.GetRootItem();
94 treeMedia.SelectItem(sel);
145 path = (
currentMode ==
GUIS) ?
"guis/guis.commented" :
"models/models.commented";
150 idToken token, tok1, tok2, tok3;
169 for (
int i = 0;
i <
c;
i++) {
181 HTREEITEM base =
treeMedia.GetRootItem();
194 HTREEITEM item = base;
210 index = name.
Last(
'/');
212 name.
Left(index, last);
234 index = name.
Find(
'/');
236 HTREEITEM newItem =
NULL;
237 HTREEITEM *check =
NULL;
238 name.
Left( index, out );
247 if (newItem ==
NULL) {
248 newItem =
treeMedia.InsertItem(out, item);
281 LPNMTREEVIEW pNMTreeView =
reinterpret_cast<LPNMTREEVIEW
>(pNMHDR);
282 HTREEITEM item =
treeMedia.GetSelectedItem();
290 editInfo.SetWindowText(
"No comments for this item");
296 HTREEITEM parent =
treeMedia.GetParentItem( item );
297 while ( parent !=
NULL ) {
302 parent =
treeMedia.GetParentItem( parent );
307 }
else if (
id ==
WAVES) {
312 }
else if (
id ==
SKINS ) {
323 int dw = abs((
int )
treeMedia.GetItemData( item )) - 1;
327 work +=
items[dw].Comments;
341 if ( modelMedia.
Length() ) {
344 if ( strstr( modelMedia,
".lwo" ) ) {
350 if ( size > lsize ) {
351 if ( MessageBox(
"Model appears to be quite large, are you sure you want to preview it?",
"High Poly Model?", MB_YESNO ) == IDNO ) {
411 BOOL b = CDialog::Create(lpszTemplateName, pParentWnd);
420 g_qeglobals.sw->StopAllSounds();
432 g_qeglobals.sw->StopAllSounds();
441 AfxGetApp()->PumpMessage();
451 g_qeglobals.sw->StopAllSounds();
456 HTREEITEM item =
treeMedia.GetSelectedItem();
470 path = (
currentMode ==
GUIS) ?
"guis/guis.commented" :
"models/models.commented";
474 str = (
char *) buffer;
476 str +=
"\r\n\r\n{\r\n\t\"";
482 str +=
"\"\r\n}\r\n";
494 HTREEITEM base =
treeMedia.InsertItem(
"Sound Shaders");
502 for ( i = 0; i < list.
Num(); i++ ) {
503 HTREEITEM child =
treeMedia.InsertItem(list[i], base);
514 for (j = 0; j < list2.
Num(); j++) {
515 HTREEITEM child2 =
treeMedia.InsertItem( list2[j], child );
534 if (GetSafeHwnd() ==
NULL) {
547 wnd->ShowWindow(SW_HIDE);
551 wnd->ShowWindow(SW_SHOW);
555 wnd->ShowWindow(SW_SHOW);
562 wnd->ShowWindow(SW_HIDE);
566 wnd->ShowWindow(SW_HIDE);
570 wnd->ShowWindow(SW_HIDE);
578 wnd->ShowWindow(SW_SHOW);
582 wnd->ShowWindow(SW_HIDE);
586 wnd->ShowWindow(SW_HIDE);
593 g_qeglobals.sw->PlayShaderDirectly(
mediaName);
647 if (
data.Length() ) {
651 if (
data.Cmp(str) == 0 ) {
#define IDC_BUTTON_RELOAD
assert(prefInfo.fullscreenBtn)
void AddMaterials(bool rootItems)
virtual void setMedia(const char *name)
virtual void setMedia(const char *name)
const char * GetFileName(void) const
virtual const idDeclSkin * SkinByIndex(int index, bool forceParse=true)=0
void AddParticles(bool rootItems)
CONST PIXELFORMATDESCRIPTOR UINT
virtual int ReadFile(const char *relativePath, void **buffer, ID_TIME_T *timestamp=NULL)=0
const idStrList & GetList(void) const
idFileSystem * fileSystem
virtual void DoDataExchange(CDataExchange *pDX)
const char * GetName(void) const
idGLDrawableModel m_drawModel
const char * Left(int len, idStr &result) const
int LoadMemory(const char *ptr, int length, const char *name)
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
void SetMode(int mode, const char *preSelect=NULL)
#define IDB_BITMAP_MATERIAL
idUserInterfaceManager * uiManager
virtual void FreeFile(void *buffer)=0
virtual const char * Comment() const =0
int Icmp(const char *text) const
virtual int WriteFile(const char *relativePath, const void *buffer, int size, const char *basePath="fs_savepath")=0
idStr & BackSlashesToSlashes(void)
void AddSounds(bool rootItems)
virtual idUserInterface * FindGui(const char *qpath, bool autoLoad=false, bool needUnique=false, bool forceUnique=false)=0
void RebuildTree(const char *data)
int Icmpn(const char *text, int n) const
int ReadToken(idToken *token)
void Set(const char *key, Type &value)
void Sort(cmp_t *compare=(cmp_t *)&idListSortCompare< type >)
GLuint GLuint GLsizei count
void AddStrList(const char *root, const idStrList &list, int type)
GLsizei GLsizei GLenum GLenum const GLvoid * data
virtual BOOL Create(LPCTSTR lpszTemplateName, CWnd *pParentWnd=NULL)
const char * Right(int len, idStr &result) const
int Find(const char c, int start=0, int end=-1) const
virtual void FreeFileList(idFileList *fileList)=0
void AddSkins(bool rootItems)
virtual const idSoundShader * SoundByIndex(int index, bool forceParse=true)=0
idDeclManager * declManager
virtual int GetNumDecls(declType_t type)=0
bool Get(const char *key, Type **value=NULL) const
void SetSkin(const char *skin)
afx_msg void OnBnClickedButtonAdd()
int Append(const type &obj)
int AddUnique(const type &obj)
virtual const idDecl * DeclByIndex(declType_t type, int index, bool forceParse=true)=0
virtual idFileList * ListFilesTree(const char *relativePath, const char *extension, bool sort=false, const char *gamedir=NULL)=0
virtual const idMaterial * MaterialByIndex(int index, bool forceParse=true)=0
MFnDagNode * GetParent(MFnDagNode *joint)
int Last(const char c) const
afx_msg void OnBnClickedButtonPlay()
void SetGui(const char *_gui) const
HTREEITEM FindTreeItem(CTreeCtrl *tree, HTREEITEM root, const char *text, HTREEITEM forceParent)
idHashTable< HTREEITEM > quickTree
const int GetNumModelAssociations() const
afx_msg void OnTvnSelchangedTreeMedia(NMHDR *pNMHDR, LRESULT *pResult)
void Replace(const char *old, const char *nw)
idList< CommentedItem > items
idGLDrawableMaterial m_drawMaterial
const char * GetAssociatedModel(int index) const
afx_msg void OnBnClickedButtonReload()
virtual void OnShowWindow(BOOL bShow, UINT status)