VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::MenuSurface Class Referenceabstract

#include <MenuModel.hpp>

Inheritance diagram for VoltMod::MenuSurface:

Public Member Functions

virtual ~MenuSurface ()=default
 MenuSurface (const MenuSurface &)=delete
MenuSurface & operator= (const MenuSurface &)=delete
virtual bool OpenSession (int slot, std::shared_ptr< Menu > menu, MenuOptions options)=0
virtual void Open (int slot, std::shared_ptr< Menu > menu)=0
virtual bool IsOpen (int slot) const =0
virtual void Close (int slot)=0
virtual void CloseAll (int slot)=0
virtual void CloseAll (int slot, std::string_view replyKey)=0
virtual void Prompt (int slot, std::string prompt, std::function< bool(int slot, std::string_view text)> callback)=0
virtual std::string Translate (int slot, std::string_view key, std::string_view fallback) const =0

Protected Member Functions

 MenuSurface ()=default

Detailed Description

The surface a menu is drawn on, and what a row callback may ask of it.

Definition at line 72 of file MenuModel.hpp.

Constructor & Destructor Documentation

◆ ~MenuSurface()

virtual VoltMod::MenuSurface::~MenuSurface ( )
virtualdefault

◆ MenuSurface() [1/2]

VoltMod::MenuSurface::MenuSurface ( const MenuSurface & )
delete

◆ MenuSurface() [2/2]

VoltMod::MenuSurface::MenuSurface ( )
protecteddefault

Member Function Documentation

◆ Close()

virtual void VoltMod::MenuSurface::Close ( int slot)
pure virtual

Pops the top menu, returning to its parent when one exists.

Implemented in VoltMod::CenterHtmlMenu, VoltMod::MenuRouter, and VoltMod::PanoramaMenu.

◆ CloseAll() [1/2]

virtual void VoltMod::MenuSurface::CloseAll ( int slot)
pure virtual

Clears the stack and removes the menu from the player's screen.

Implemented in VoltMod::CenterHtmlMenu, VoltMod::MenuRouter, and VoltMod::PanoramaMenu.

◆ CloseAll() [2/2]

virtual void VoltMod::MenuSurface::CloseAll ( int slot,
std::string_view replyKey )
pure virtual

Translates and sends replyKey, then closes every menu.

Implemented in VoltMod::CenterHtmlMenu, VoltMod::MenuRouter, and VoltMod::PanoramaMenu.

◆ IsOpen()

virtual bool VoltMod::MenuSurface::IsOpen ( int slot) const
pure virtual

◆ Open()

virtual void VoltMod::MenuSurface::Open ( int slot,
std::shared_ptr< Menu > menu )
pure virtual

Pushes menu onto slot's session and shows it, starting one with default options when none is open. What a row calls.

Implemented in VoltMod::CenterHtmlMenu, VoltMod::MenuRouter, and VoltMod::PanoramaMenu.

Referenced by VoltMod::SubmenuRow::ToItem().

◆ OpenSession()

virtual bool VoltMod::MenuSurface::OpenSession ( int slot,
std::shared_ptr< Menu > menu,
MenuOptions options )
pure virtual

Opens a session for slot showing menu, closing any the player has open here. What a command calls. False when this surface cannot draw for slot; nothing is left open then.

Implemented in VoltMod::CenterHtmlMenu, VoltMod::MenuRouter, and VoltMod::PanoramaMenu.

◆ operator=()

MenuSurface & VoltMod::MenuSurface::operator= ( const MenuSurface & )
delete

References MenuSurface().

◆ Prompt()

virtual void VoltMod::MenuSurface::Prompt ( int slot,
std::string prompt,
std::function< bool(int slot, std::string_view text)> callback )
pure virtual

Routes the next chat line to callback. Closing the menu cancels it.

Implemented in VoltMod::CenterHtmlMenu, VoltMod::MenuRouter, and VoltMod::PanoramaMenu.

Referenced by VoltMod::InputRow::ToItem().

◆ Translate()

virtual std::string VoltMod::MenuSurface::Translate ( int slot,
std::string_view key,
std::string_view fallback ) const
pure virtual

Translates key for slot, using fallback when missing.

Implemented in VoltMod::CenterHtmlMenu, VoltMod::MenuRouter, and VoltMod::PanoramaMenu.


The documentation for this class was generated from the following file: