Counter Strike : Global Offensive Source Code
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.

206 lines
4.9 KiB

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