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

The screen built from the menu Panorama block, as PanoramaMenu draws on it. More...

#include <PanoramaMenuLayout.hpp>

Public Member Functions

 PanoramaMenuLayout (ScreenManager &screens, std::string_view screen, std::size_t tabs, std::size_t rows, std::span< const std::string_view > iconNames)
int RowCount () const
int TabCount () const
bool Show (int slot)
void Hide (int slot)
void SetHeader (int slot, const MenuHeader &header)
void SetSidebarVisible (int slot, bool visible)
void SetHomeVisible (int slot, bool visible)
void SetTab (int slot, int index, const MenuTab *tab)
void SetRow (int slot, int index, const MenuRow *row, std::string_view pendingHint)
void SetEmpty (int slot, std::string_view text)
void SetPager (int slot, std::string_view text)
void SetPrompt (int slot, std::string_view text, std::string_view hint)
void SetFooter (int slot, std::string_view back, std::string_view cancel)
std::optional< MenuButton > FindButton (std::string_view id) const
void AddText (std::string_view variable, std::function< std::string(int slot)> text)

Detailed Description

The screen built from the menu Panorama block, as PanoramaMenu draws on it.

Knows element ids and classes and nothing about menus; every call names the player it draws for. A null tab or row hides it, and so does empty text for the empty-list line, the pager and the prompt. screen is the layout name; tabs, rows and iconNames come from its generated header (Tabs.size(), Rows.size(), IconSetNames). Each player gets their own screen, so the menu survives death and spectating. screens and iconNames must outlive this; the generated header's array does.

Definition at line 66 of file PanoramaMenuLayout.hpp.

Constructor & Destructor Documentation

◆ PanoramaMenuLayout()

VoltMod::PanoramaMenuLayout::PanoramaMenuLayout ( ScreenManager & screens,
std::string_view screen,
std::size_t tabs,
std::size_t rows,
std::span< const std::string_view > iconNames )

Definition at line 9 of file PanoramaMenuLayout.cpp.

Member Function Documentation

◆ AddText()

void VoltMod::PanoramaMenuLayout::AddText ( std::string_view variable,
std::function< std::string(int slot)> text )

Fills {s:<variable>} in markup the screen adds itself, such as its home panel. Written with every header, so it outlives a respawned screen.

Definition at line 160 of file PanoramaMenuLayout.cpp.

◆ FindButton()

std::optional< MenuButton > VoltMod::PanoramaMenuLayout::FindButton ( std::string_view id) const

The button a pressed id names, or nothing for an id outside this screen.

Definition at line 165 of file PanoramaMenuLayout.cpp.

References VoltMod::Back, VoltMod::Cancel, VoltMod::Close, VoltMod::NextPage, VoltMod::PreviousPage, VoltMod::Row, RowCount(), VoltMod::StepDown, VoltMod::StepUp, VoltMod::Tab, and TabCount().

◆ Hide()

void VoltMod::PanoramaMenuLayout::Hide ( int slot)

Definition at line 52 of file PanoramaMenuLayout.cpp.

◆ RowCount()

int VoltMod::PanoramaMenuLayout::RowCount ( ) const
inline

Rows on one page.

Definition at line 73 of file PanoramaMenuLayout.hpp.

Referenced by FindButton().

◆ SetEmpty()

void VoltMod::PanoramaMenuLayout::SetEmpty ( int slot,
std::string_view text )

◆ SetFooter()

void VoltMod::PanoramaMenuLayout::SetFooter ( int slot,
std::string_view back,
std::string_view cancel )

An empty back hides the back button: the root has nothing to go back to.

Definition at line 152 of file PanoramaMenuLayout.cpp.

References VoltMod::Screen::SetHidden(), and VoltMod::Screen::SetText().

◆ SetHeader()

◆ SetHomeVisible()

void VoltMod::PanoramaMenuLayout::SetHomeVisible ( int slot,
bool visible )

Show the home markup in the rows' place. A screen without any does nothing.

Definition at line 78 of file PanoramaMenuLayout.cpp.

◆ SetPager()

void VoltMod::PanoramaMenuLayout::SetPager ( int slot,
std::string_view text )

◆ SetPrompt()

void VoltMod::PanoramaMenuLayout::SetPrompt ( int slot,
std::string_view text,
std::string_view hint )

◆ SetRow()

◆ SetSidebarVisible()

void VoltMod::PanoramaMenuLayout::SetSidebarVisible ( int slot,
bool visible )

Definition at line 73 of file PanoramaMenuLayout.cpp.

◆ SetTab()

void VoltMod::PanoramaMenuLayout::SetTab ( int slot,
int index,
const MenuTab * tab )

◆ Show()

bool VoltMod::PanoramaMenuLayout::Show ( int slot)

Spawn if needed, unhide, and give the cursor. False when slot cannot be drawn to.

Definition at line 47 of file PanoramaMenuLayout.cpp.

◆ TabCount()

int VoltMod::PanoramaMenuLayout::TabCount ( ) const
inline

Sidebar tabs, filled from the root menu's submenus.

Definition at line 76 of file PanoramaMenuLayout.hpp.

Referenced by FindButton().


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