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.

120 lines
2.3 KiB

  1. //====== Copyright c 1996-2007, Valve Corporation, All rights reserved. =======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #include "client_pch.h"
  9. #include <vgui/ISystem.h>
  10. #include <vgui/ISurface.h>
  11. #include <vgui/IVGui.h>
  12. #include <keyvalues.h>
  13. #include <vgui_controls/BuildGroup.h>
  14. #include <vgui_controls/Tooltip.h>
  15. #include <vgui_controls/TextImage.h>
  16. #include <vgui_controls/CheckButton.h>
  17. #include <vgui_controls/Label.h>
  18. #include <vgui_controls/PropertySheet.h>
  19. #include <vgui_controls/FileOpenDialog.h>
  20. #include <vgui_controls/ProgressBar.h>
  21. #include <vgui_controls/Slider.h>
  22. #include <vgui_controls/Controls.h>
  23. #include <vgui_controls/TextEntry.h>
  24. #include <vgui_controls/ListViewPanel.h>
  25. #include <vgui/IInput.h>
  26. #include "filesystem.h"
  27. #include "cl_txviewpanel.h"
  28. // memdbgon must be the last include file in a .cpp file!!!
  29. #include "tier0/memdbgon.h"
  30. using namespace vgui;
  31. TxViewPanel *g_pTxViewPanel = NULL;
  32. void TxViewPanel::Install( vgui::Panel *parent )
  33. {
  34. if ( g_pTxViewPanel )
  35. return;
  36. g_pTxViewPanel = new TxViewPanel( parent );
  37. Assert( g_pTxViewPanel );
  38. }
  39. TxViewPanel::TxViewPanel( vgui::Panel *parent ) : vgui::Frame( parent, "TxViewPanel" )
  40. {
  41. m_pRefresh = new vgui::Button( this, "Refresh", "Refresh" );
  42. m_pView = new vgui::ListViewPanel( this, "Textures" );
  43. vgui::ivgui()->AddTickSignal( GetVPanel(), 0 );
  44. LoadControlSettings( "Resource\\TxViewPanel.res" );
  45. SetVisible( false );
  46. SetSizeable( true );
  47. SetMoveable( true );
  48. }
  49. TxViewPanel::~TxViewPanel()
  50. {
  51. ;
  52. }
  53. void TxViewPanel::OnTick()
  54. {
  55. BaseClass::OnTick();
  56. if ( !IsVisible() )
  57. return;
  58. ;
  59. }
  60. void TxViewPanel::OnCommand( const char *command )
  61. {
  62. if ( !Q_strcasecmp( command, "refresh" ) )
  63. {
  64. ;
  65. }
  66. else
  67. {
  68. BaseClass::OnCommand( command );
  69. }
  70. }
  71. void TxViewPanel::OnMessage( const KeyValues *params, vgui::VPANEL fromPanel )
  72. {
  73. BaseClass::OnMessage( params, fromPanel );
  74. }
  75. void TxViewPanel::OnFileSelected( const char *fullpath )
  76. {
  77. if ( !fullpath || !fullpath[0] )
  78. return;
  79. ;
  80. }
  81. void TxView_f()
  82. {
  83. if ( !g_pTxViewPanel )
  84. return;
  85. if ( g_pTxViewPanel->IsVisible() )
  86. {
  87. g_pTxViewPanel->Close();
  88. }
  89. else
  90. {
  91. g_pTxViewPanel->Activate();
  92. }
  93. }
  94. // static ConCommand txview( "txview", TxView_f, "Show/hide the internal texture viewer.", FCVAR_DONTRECORD );