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.

45 lines
1.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef BENCHMARKDIALOG_H
  7. #define BENCHMARKDIALOG_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "vgui_controls/Frame.h"
  12. //-----------------------------------------------------------------------------
  13. // Purpose: Benchmark launch dialog
  14. //-----------------------------------------------------------------------------
  15. class CBenchmarkDialog : public vgui::Frame
  16. {
  17. DECLARE_CLASS_SIMPLE( CBenchmarkDialog, vgui::Frame );
  18. public:
  19. CBenchmarkDialog(vgui::Panel *parent, const char *name);
  20. void OnKeyCodePressed( vgui::KeyCode code )
  21. {
  22. if ( code == KEY_XBUTTON_B || code == STEAMCONTROLLER_B )
  23. {
  24. Close();
  25. }
  26. else if ( code == KEY_XBUTTON_A || code == STEAMCONTROLLER_A )
  27. {
  28. RunBenchmark();
  29. }
  30. else
  31. {
  32. BaseClass::OnKeyCodePressed(code);
  33. }
  34. }
  35. private:
  36. MESSAGE_FUNC( RunBenchmark, "RunBenchmark" );
  37. };
  38. #endif // BENCHMARKDIALOG_H