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.

59 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef BUYSUBMENU_H
  8. #define BUYSUBMENU_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui_controls/WizardSubPanel.h>
  13. #include <vgui_controls/Button.h>
  14. #include <utlvector.h>
  15. #include "mouseoverpanelbutton.h"
  16. class CBuyMenu;
  17. //-----------------------------------------------------------------------------
  18. // Purpose: Draws the class menu
  19. //-----------------------------------------------------------------------------
  20. class CBuySubMenu : public vgui::WizardSubPanel
  21. {
  22. private:
  23. DECLARE_CLASS_SIMPLE( CBuySubMenu, vgui::WizardSubPanel );
  24. public:
  25. CBuySubMenu(vgui::Panel *parent,const char *name = "BuySubMenu");
  26. ~CBuySubMenu();
  27. virtual void SetVisible( bool state );
  28. virtual void DeleteSubPanels();
  29. protected:
  30. // command callbacks
  31. virtual void OnCommand( const char *command );
  32. virtual vgui::WizardSubPanel *GetNextSubPanel(); // this is the last menu in the list
  33. virtual vgui::Panel *CreateControlByName(const char *controlName);
  34. virtual CBuySubMenu* CreateNewSubMenu();
  35. virtual MouseOverPanelButton* CreateNewMouseOverPanelButton(vgui::EditablePanel *panel);
  36. typedef struct
  37. {
  38. char filename[_MAX_PATH];
  39. CBuySubMenu *panel;
  40. } SubMenuEntry_t;
  41. vgui::EditablePanel *m_pPanel;
  42. MouseOverPanelButton *m_pFirstButton;
  43. CUtlVector<SubMenuEntry_t> m_SubMenus; // a cache of buy submenus, so we don't need to construct them each time
  44. vgui::WizardSubPanel *m_NextPanel;
  45. };
  46. #endif // BUYSUBMENU_H