Animated Menu Background/menu background.h: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
| GamerDude27 (talk | contribs)  (Moved GitHub gist over to this subpage) | m (remove orphaned page template) | ||
| (5 intermediate revisions by 4 users not shown) | |||
| Line 14: | Line 14: | ||
| #include <vguitextwindow.h> | #include <vguitextwindow.h> | ||
| #include "video/ivideoservices.h" | #include "video/ivideoservices.h" | ||
| #include <materialsystem/MaterialSystemUtil.h> | |||
| class CMainMenu : public vgui::Panel | class CMainMenu : public vgui::Panel | ||
| Line 24: | Line 25: | ||
| public: | public: | ||
| 	virtual void ApplySchemeSettings( vgui::IScheme *pScheme ); | |||
| 	bool IsVideoPlaying(); | 	bool IsVideoPlaying(); | ||
| 	void StartVideo(); | 	void StartVideo(); | ||
| 	void StopVideo(); | 	void StopVideo(); | ||
| 	void GetPanelPos( int &xpos, int &ypos ); | 	void GetPanelPos( int &xpos, int &ypos ); | ||
| Line 45: | Line 45: | ||
| 	bool m_bToolsMode; | 	bool m_bToolsMode; | ||
| 	bool m_bPaintVideo; | 	bool m_bPaintVideo; | ||
| 	CMaterialReference m_MainMenuRef; | 	CMaterialReference m_MainMenuRef; | ||
| Line 67: | Line 65: | ||
| #endif // MENU_BACKGROUND_H | #endif // MENU_BACKGROUND_H | ||
| </source> | </source> | ||
| [[Category:Programming]] | |||
Latest revision as of 04:36, 26 June 2024
//========= Copyright Jorge "BSVino" Rodriguez, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================//
#ifndef MENU_BACKGROUND_H
#define MENU_BACKGROUND_H
#ifdef _WIN32
#pragma once
#endif
#include <vguitextwindow.h>
#include "video/ivideoservices.h"
#include <materialsystem/MaterialSystemUtil.h>
class CMainMenu : public vgui::Panel
{
public:
	DECLARE_CLASS_SIMPLE( CMainMenu, vgui::Panel );
	CMainMenu( vgui::Panel *parent, const char *pElementName );
	~CMainMenu();
public:
	virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
	bool IsVideoPlaying();
	void StartVideo();
	void StopVideo();
	void GetPanelPos( int &xpos, int &ypos );
	void Paint();
	bool BeginPlayback( const char *pFilename );
	void ReleaseVideo();
	void SetBlackBackground( bool bBlack );
	void DoModal();
	MESSAGE_FUNC( OnDisconnectFromGame, "DisconnectedFromGame" );
private:
	bool m_bLoaded;
	bool m_bToolsMode;
	bool m_bPaintVideo;
	CMaterialReference m_MainMenuRef;
protected:
	IVideoMaterial *m_VideoMaterial;
	IMaterial *m_pMaterial;
	int m_nPlaybackHeight; // Calculated to address ratio changes
	int m_nPlaybackWidth;
	char m_szExitCommand[MAX_PATH]; // This call is fired at the engine when the video finishes or is interrupted
	float m_flU; // UV ranges for video on its sheet
	float m_flV;
	bool m_bBlackBackground;
	bool m_bAllowAlternateMedia;
};
#endif // MENU_BACKGROUND_H