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.

196 lines
4.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef MDLVIEWER_H
  7. #define MDLVIEWER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "sceneimage.h"
  12. #define IDC_FILE_LOADMODEL 1001
  13. #define IDC_FILE_LOADBACKGROUNDTEX 1002
  14. #define IDC_FILE_LOADGROUNDTEX 1003
  15. #define IDC_FILE_UNLOADGROUNDTEX 1004
  16. #define IDC_FILE_RECENTFILES1 1008
  17. #define IDC_FILE_RECENTFILES2 1009
  18. #define IDC_FILE_RECENTFILES3 1010
  19. #define IDC_FILE_RECENTFILES4 1011
  20. #define IDC_FILE_RECENTFILES5 1012
  21. #define IDC_FILE_RECENTFILES6 1013
  22. #define IDC_FILE_RECENTFILES7 1014
  23. #define IDC_FILE_RECENTFILES8 1015
  24. #define IDC_FILE_EXIT 1016
  25. #define IDC_FILE_REFRESH 1017
  26. #define IDC_FILE_SAVESOUNDSCRIPTCHANGES 1018
  27. #define IDC_FILE_REBUILDSCENESIMAGE 1019
  28. #define IDC_EXPRESSIONS_SAVE 1020
  29. #define IDC_EXPRESSIONS_LOAD 1021
  30. #define IDC_EXPRESSIONS_SAVEAS 1022
  31. #define IDC_EXPRESSIONS_EXPORT 1023
  32. #define IDC_EXPRESSIONS_CLOSE 1024
  33. #define IDC_EXPRESSIONS_CLOSEALL 1025
  34. #define IDC_EXPRESSIONS_NEW 1026
  35. #define IDC_EXPRESSIONS_REDOBITMAPS 1027
  36. #define IDC_CHOREOSCENE_NEW 1030
  37. #define IDC_CHOREOSCENE_LOAD 1031
  38. #define IDC_CHOREOSCENE_SAVE 1032
  39. #define IDC_CHOREOSCENE_SAVEAS 1033
  40. #define IDC_CHOREOSCENE_CLOSE 1034
  41. #define IDC_CHOREOSCENE_ADDACTOR 1035
  42. #define IDC_FILE_LOADMODEL_STEAM 1036
  43. #define IDC_CHOREOSCENE_LOADNEXT 1038
  44. #define IDC_OPTIONS_COLORBACKGROUND 1101
  45. #define IDC_OPTIONS_COLORGROUND 1102
  46. #define IDC_OPTIONS_COLORLIGHT 1103
  47. #define IDC_OPTIONS_CENTERVIEW 1104
  48. #define IDC_OPTIONS_MAKESCREENSHOT 1105
  49. #define IDC_OPTIONS_DUMP 1106
  50. #define IDC_OPTIONS_CENTERONFACE 1107
  51. #define IDC_OPTIONS_CLEARMODELSOUNDS 1108
  52. #define IDC_OPTIONS_LANGUAGESTART 1150
  53. #define IDC_WINDOW_FIRSTTOOL 1200
  54. #define IDC_WINDOW_LASTTOOL 1231
  55. #define IDC_WINDOW_TILE_HORIZ 1232
  56. #define IDC_WINDOW_TILE_VERT 1233
  57. #define IDC_WINDOW_CASCADE 1234
  58. #define IDC_WINDOW_HIDEALL 1235
  59. #define IDC_WINDOW_SHOWALL 1236
  60. #define IDC_WINDOW_TILE 1237
  61. #define IDC_WINDOW_TAB 1238
  62. #define IDC_MODEL_TAB 1239
  63. #define IDC_GRIDSETTINGS 1240
  64. #define IDC_HELP_GOTOHOMEPAGE 1301
  65. #define IDC_HELP_ABOUT 1302
  66. class mxMenuBar;
  67. class mxMenu;
  68. class MatSysWindow;
  69. class ControlPanel;
  70. class FlexPanel;
  71. class mxStatusWindow;
  72. class CChoreoView;
  73. class CMDLViewerWorkspace;
  74. class CMDLViewerWindowTab;
  75. class CMDLViewerModelTab;
  76. class CMDLViewerGridSettings;
  77. enum { Action, Size, Timer, Idle, Show, Hide,
  78. MouseUp, MouseDown, MouseMove, MouseDrag,
  79. KeyUp, KeyDown
  80. };
  81. class MDLViewer : public mxWindow, public ISceneCompileStatus
  82. {
  83. mxMenuBar *mb;
  84. mxMenu *menuFile;
  85. mxMenu *menuOptions;
  86. mxMenu *menuCloseCaptionLanguages;
  87. mxMenu *menuWindow;
  88. mxMenu *menuHelp;
  89. mxMenu *menuEdit;
  90. mxMenu *menuExpressions;
  91. mxMenu *menuChoreography;
  92. CMDLViewerWorkspace *workspace;
  93. CMDLViewerWindowTab *windowtab;
  94. CMDLViewerModelTab *modeltab;
  95. CMDLViewerGridSettings *gridsettings;
  96. void loadRecentFiles ();
  97. void saveRecentFiles ();
  98. void initRecentFiles ();
  99. int m_nCurrentFrame;
  100. public:
  101. // CREATORS
  102. MDLViewer ();
  103. ~MDLViewer ();
  104. virtual void OnDelete();
  105. virtual bool CanClose();
  106. virtual void UpdateStatus( char const *pchSceneName, bool bQuiet, int nIndex, int nCount );
  107. void OnFileLoaded( char const *pszFile );
  108. // MANIPULATORS
  109. virtual int handleEvent (mxEvent *event);
  110. void redraw ();
  111. virtual bool PaintBackground( void );
  112. void UpdateWindowMenu( void );
  113. void UpdateLanguageMenu( int currentLanguageId );
  114. void InitModelTab( void );
  115. void InitGridSettings( void );
  116. int GetActiveModelTab( void );
  117. void SetActiveModelTab( int modelindex );
  118. void Refresh( void );
  119. void LoadModelFile( const char *pszFile );
  120. int GetCurrentHitboxSet(void);
  121. virtual bool Closing( void );
  122. void LoadWindowPositions( void );
  123. void SaveWindowPositions( void );
  124. void OnSaveSoundScriptChanges();
  125. void OnRebuildScenesImage();
  126. void OnCascade();
  127. void OnTile();
  128. void OnTileHorizontally();
  129. void OnTileVertically();
  130. void OnHideAll();
  131. void OnShowAll();
  132. void Think( float dt );
  133. int GetCurrentFrame( void );
  134. // ACCESSORS
  135. mxMenuBar *getMenuBar () const { return mb; }
  136. void LoadModel_Steam();
  137. void OnVCDSaved();
  138. private:
  139. void DoTile( int x, int y );
  140. void LoadPosition( void );
  141. void SavePosition( void );
  142. bool AreSoundScriptsDirty();
  143. bool m_bOldSoundScriptsDirty;
  144. bool m_bVCDSaved;
  145. };
  146. const char *GetGameDirectory( );
  147. void CreatePath( const char *pPath );
  148. extern MDLViewer *g_MDLViewer;
  149. extern char g_appTitle[];
  150. #endif // MDLVIEWER_H