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.

76 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "resource.h"
  8. #include "ActorProperties.h"
  9. #include "ChoreoView.h"
  10. #include "choreoactor.h"
  11. #include "mdlviewer.h"
  12. static CActorParams g_Params;
  13. //-----------------------------------------------------------------------------
  14. // Purpose:
  15. // Input : hwndDlg -
  16. // uMsg -
  17. // wParam -
  18. // lParam -
  19. // Output : static BOOL CALLBACK
  20. //-----------------------------------------------------------------------------
  21. static BOOL CALLBACK ActorPropertiesDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
  22. {
  23. switch(uMsg)
  24. {
  25. case WM_INITDIALOG:
  26. // Insert code here to put the string (to find and replace with)
  27. // into the edit controls.
  28. // ...
  29. {
  30. g_Params.PositionSelf( hwndDlg );
  31. SetDlgItemText( hwndDlg, IDC_ACTORNAME, g_Params.m_szName );
  32. SetWindowText( hwndDlg, g_Params.m_szDialogTitle );
  33. SetFocus( GetDlgItem( hwndDlg, IDC_ACTORNAME ) );
  34. }
  35. return FALSE;
  36. case WM_COMMAND:
  37. switch (LOWORD(wParam))
  38. {
  39. case IDOK:
  40. g_Params.m_szName[ 0 ] = 0;
  41. GetDlgItemText( hwndDlg, IDC_ACTORNAME, g_Params.m_szName, 256 );
  42. EndDialog( hwndDlg, 1 );
  43. break;
  44. case IDCANCEL:
  45. EndDialog( hwndDlg, 0 );
  46. break;
  47. }
  48. return TRUE;
  49. }
  50. return FALSE;
  51. }
  52. //-----------------------------------------------------------------------------
  53. // Purpose:
  54. // Input : *view -
  55. // *actor -
  56. // Output : int
  57. //-----------------------------------------------------------------------------
  58. int ActorProperties( CActorParams *params )
  59. {
  60. g_Params = *params;
  61. int retval = DialogBox( (HINSTANCE)GetModuleHandle( 0 ),
  62. MAKEINTRESOURCE( IDD_ACTORPROPERTIES ),
  63. (HWND)g_MDLViewer->getHandle(),
  64. (DLGPROC)ActorPropertiesDialogProc );
  65. *params = g_Params;
  66. return retval;
  67. }