Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef TEXTUREBROWSER_H
  8. #define TEXTUREBROWSER_H
  9. #pragma once
  10. #include "resource.h"
  11. #include "AutoSelCombo.h"
  12. #include "texturewindow.h"
  13. class CTextureBrowser : public CDialog
  14. {
  15. public:
  16. CTextureBrowser(CWnd *pParent);
  17. //{{AFX_DATA(CTextureBrowser)
  18. enum { IDD = IDD_TEXTURES };
  19. //}}AFX_DATA
  20. void SetInitialTexture(LPCTSTR);
  21. inline CString GetCurTexture(void);
  22. void WriteSettings();
  23. void SetUsed(BOOL);
  24. void SaveAndExit();
  25. void SetFilter(const char *pszFilter);
  26. void SetTextureFormat(TEXTUREFORMAT eTextureFormat);
  27. CTextureWindow m_cTextureWindow; // dvs: make protected
  28. protected:
  29. //{{AFX_MSG(CTextureBrowser)
  30. afx_msg void OnSize(UINT nType, int cx, int cy);
  31. afx_msg void OnSelendokTexturesize();
  32. virtual BOOL OnInitDialog();
  33. afx_msg void OnClose();
  34. afx_msg void OnTimer(UINT nIDEvent);
  35. afx_msg void OnUsed();
  36. afx_msg void OnReplace();
  37. afx_msg void OnMark();
  38. afx_msg void OnFilterOpaque();
  39. afx_msg void OnFilterTranslucent();
  40. afx_msg void OnFilterSelfIllum();
  41. afx_msg void OnFilterEnvmask();
  42. afx_msg void OnShowErrors();
  43. afx_msg void OnOpenSource();
  44. afx_msg void OnReload();
  45. afx_msg void OnChangeFilterOrKeywords(void);
  46. afx_msg void OnUpdateFiltersNOW();
  47. afx_msg void OnUpdateKeywordsNOW(void);
  48. afx_msg LRESULT OnTextureWindowDblClk(WPARAM wParam, LPARAM lParam);
  49. afx_msg LRESULT OnTexturewindowSelchange(WPARAM, LPARAM);
  50. //}}AFX_MSG
  51. DECLARE_MESSAGE_MAP()
  52. afx_msg void OnCancel();
  53. static CStringArray m_FilterHistory;
  54. static int m_nFilterHistory;
  55. static char m_szLastKeywords[MAX_PATH]; // The text in the keywords combo when the user last exited the browser.
  56. CComboBox m_cSizeList;
  57. CStatic m_cCurName;
  58. CStatic m_cCurDescription;
  59. CButton m_cUsed;
  60. char szInitialTexture[128];
  61. char m_szNameFilter[128]; // Overrides the name filter history for a single browser session.
  62. DWORD m_uLastFilterChange;
  63. BOOL m_bFilterChanged;
  64. BOOL m_bUsed;
  65. CAutoSelComboBox m_cFilter;
  66. CAutoSelComboBox m_cKeywords;
  67. CButton m_FilterOpaque;
  68. CButton m_FilterTranslucent;
  69. CButton m_FilterSelfIllum;
  70. CButton m_FilterEnvMask;
  71. CButton m_ShowErrors;
  72. TextureWindowTexList m_TextureSubList; // Holds a specific sublist of textures to browse.
  73. };
  74. //-----------------------------------------------------------------------------
  75. // Purpose: Returns the name of the currently selected texture.
  76. //-----------------------------------------------------------------------------
  77. CString CTextureBrowser::GetCurTexture(void)
  78. {
  79. return(CString(m_cTextureWindow.szCurTexture));
  80. }
  81. #endif // TEXTUREBROWSER_H