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

Run menu sessions on a plugin's PanoramaMenuLayout. More...

#include <PanoramaMenu.hpp>

Inheritance diagram for VoltMod::PanoramaMenu:

Classes

struct  Services

Public Member Functions

 PanoramaMenu (const Services &services, PanoramaMenuLayout &layout)
bool CanShow (int slot) const
bool OpenSession (int slot, std::shared_ptr< Menu > menu, MenuOptions options) override
void Open (int slot, std::shared_ptr< Menu > menu) override
bool IsOpen (int slot) const override
void Close (int slot) override
void CloseAll (int slot) override
void CloseAll (int slot, std::string_view replyKey) override
void Prompt (int slot, std::string prompt, std::function< bool(int slot, std::string_view text)> callback) override
std::string Translate (int slot, std::string_view key, std::string_view fallback) const override
Public Member Functions inherited from VoltMod::MenuSurface
virtual ~MenuSurface ()=default
 MenuSurface (const MenuSurface &)=delete
MenuSurface & operator= (const MenuSurface &)=delete

Additional Inherited Members

Protected Member Functions inherited from VoltMod::MenuSurface
 MenuSurface ()=default

Detailed Description

Run menu sessions on a plugin's PanoramaMenuLayout.

Uses the same MenuStack behavior as CenterHtmlMenu. Root submenus become sidebar tabs. Pass the menu to runtime.Menus.Prefer when Panorama should be the preferred surface.

Definition at line 33 of file PanoramaMenu.hpp.

Constructor & Destructor Documentation

◆ PanoramaMenu()

VoltMod::PanoramaMenu::PanoramaMenu ( const Services & services,
PanoramaMenuLayout & layout )

layout must outlive this.

Definition at line 11 of file PanoramaMenu.cpp.

Member Function Documentation

◆ CanShow()

bool VoltMod::PanoramaMenu::CanShow ( int slot) const

Whether slot can see the layout and has every required addon.

Definition at line 23 of file PanoramaMenu.cpp.

References VoltMod::IsValidSlot().

Referenced by OpenSession().

◆ Close()

void VoltMod::PanoramaMenu::Close ( int slot)
overridevirtual

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

Implements VoltMod::MenuSurface.

Definition at line 74 of file PanoramaMenu.cpp.

References IsOpen().

◆ CloseAll() [1/2]

void VoltMod::PanoramaMenu::CloseAll ( int slot)
overridevirtual

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

Implements VoltMod::MenuSurface.

Definition at line 97 of file PanoramaMenu.cpp.

References IsOpen().

Referenced by CloseAll(), and OpenSession().

◆ CloseAll() [2/2]

void VoltMod::PanoramaMenu::CloseAll ( int slot,
std::string_view replyKey )
overridevirtual

Translates and sends replyKey, then closes every menu.

Implements VoltMod::MenuSurface.

Definition at line 108 of file PanoramaMenu.cpp.

References CloseAll().

◆ IsOpen()

bool VoltMod::PanoramaMenu::IsOpen ( int slot) const
overridevirtual

Implements VoltMod::MenuSurface.

Definition at line 69 of file PanoramaMenu.cpp.

Referenced by Close(), CloseAll(), Open(), and OpenSession().

◆ Open()

void VoltMod::PanoramaMenu::Open ( int slot,
std::shared_ptr< Menu > menu )
overridevirtual

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

Implements VoltMod::MenuSurface.

Definition at line 52 of file PanoramaMenu.cpp.

References IsOpen(), and OpenSession().

◆ OpenSession()

bool VoltMod::PanoramaMenu::OpenSession ( int slot,
std::shared_ptr< Menu > menu,
MenuOptions options )
overridevirtual

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.

Implements VoltMod::MenuSurface.

Definition at line 29 of file PanoramaMenu.cpp.

References CanShow(), CloseAll(), VoltMod::MenuOptions::FreezeMovement, VoltMod::MenuOptions::HomePage, and IsOpen().

Referenced by Open().

◆ Prompt()

void VoltMod::PanoramaMenu::Prompt ( int slot,
std::string prompt,
std::function< bool(int slot, std::string_view text)> callback )
overridevirtual

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

Implements VoltMod::MenuSurface.

Definition at line 119 of file PanoramaMenu.cpp.

◆ Translate()

std::string VoltMod::PanoramaMenu::Translate ( int slot,
std::string_view key,
std::string_view fallback ) const
overridevirtual

Translates key for slot, using fallback when missing.

Implements VoltMod::MenuSurface.

Definition at line 125 of file PanoramaMenu.cpp.


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