From 3bf9df6b2785fa6d951086978a3e66f49427166a Mon Sep 17 00:00:00 2001 From: FluorescentCIAAfricanAmerican <0934gj3049fk@protonmail.com> Date: Wed, 22 Apr 2020 12:56:21 -0400 Subject: 1 --- engine/cl_txviewpanel.cpp | 120 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 engine/cl_txviewpanel.cpp (limited to 'engine/cl_txviewpanel.cpp') diff --git a/engine/cl_txviewpanel.cpp b/engine/cl_txviewpanel.cpp new file mode 100644 index 0000000..7d5b472 --- /dev/null +++ b/engine/cl_txviewpanel.cpp @@ -0,0 +1,120 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// + +#include "client_pch.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "filesystem.h" + +#include "cl_txviewpanel.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +using namespace vgui; + + +TxViewPanel *g_pTxViewPanel = NULL; + +void TxViewPanel::Install( vgui::Panel *parent ) +{ + if ( g_pTxViewPanel ) + return; + + g_pTxViewPanel = new TxViewPanel( parent ); + Assert( g_pTxViewPanel ); +} + +TxViewPanel::TxViewPanel( vgui::Panel *parent ) : vgui::Frame( parent, "TxViewPanel" ) +{ + m_pRefresh = new vgui::Button( this, "Refresh", "Refresh" ); + m_pView = new vgui::ListViewPanel( this, "Textures" ); + + vgui::ivgui()->AddTickSignal( GetVPanel(), 0 ); + + LoadControlSettings( "Resource\\TxViewPanel.res" ); + + SetVisible( false ); + SetSizeable( true ); + SetMoveable( true ); +} + +TxViewPanel::~TxViewPanel() +{ + ; +} + +void TxViewPanel::OnTick() +{ + BaseClass::OnTick(); + + if ( !IsVisible() ) + return; + + ; +} + +void TxViewPanel::OnCommand( const char *command ) +{ + if ( !Q_strcasecmp( command, "refresh" ) ) + { + ; + } + else + { + BaseClass::OnCommand( command ); + } +} + +void TxViewPanel::OnMessage( const KeyValues *params, vgui::VPANEL fromPanel ) +{ + BaseClass::OnMessage( params, fromPanel ); +} + +void TxViewPanel::OnFileSelected( const char *fullpath ) +{ + if ( !fullpath || !fullpath[0] ) + return; + + ; +} + +void TxView_f() +{ + if ( !g_pTxViewPanel ) + return; + + if ( g_pTxViewPanel->IsVisible() ) + { + g_pTxViewPanel->Close(); + } + else + { + g_pTxViewPanel->Activate(); + } +} + +// static ConCommand txview( "txview", TxView_f, "Show/hide the internal texture viewer.", FCVAR_DONTRECORD ); -- cgit v1.2.3