|
VoltMod
C++23 framework for CS2 server plugins
|
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) |
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.
| 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.
| 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.
| 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().
| void VoltMod::PanoramaMenuLayout::Hide | ( | int | slot | ) |
Definition at line 52 of file PanoramaMenuLayout.cpp.
|
inline |
| void VoltMod::PanoramaMenuLayout::SetEmpty | ( | int | slot, |
| std::string_view | text ) |
Definition at line 129 of file PanoramaMenuLayout.cpp.
References VoltMod::Screen::SetHidden(), and VoltMod::Screen::SetText().
| 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().
| void VoltMod::PanoramaMenuLayout::SetHeader | ( | int | slot, |
| const MenuHeader & | header ) |
Definition at line 57 of file PanoramaMenuLayout.cpp.
References VoltMod::MenuHeader::Brand, VoltMod::MenuHeader::BrandSubtitle, VoltMod::MenuHeader::Breadcrumb, VoltMod::Screen::SetHidden(), VoltMod::Screen::SetText(), VoltMod::MenuHeader::Subtitle, and VoltMod::MenuHeader::Title.
| 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.
| void VoltMod::PanoramaMenuLayout::SetPager | ( | int | slot, |
| std::string_view | text ) |
Definition at line 136 of file PanoramaMenuLayout.cpp.
References VoltMod::Screen::SetHidden(), and VoltMod::Screen::SetText().
| void VoltMod::PanoramaMenuLayout::SetPrompt | ( | int | slot, |
| std::string_view | text, | ||
| std::string_view | hint ) |
Definition at line 143 of file PanoramaMenuLayout.cpp.
References VoltMod::Screen::SetClass(), VoltMod::Screen::SetHidden(), and VoltMod::Screen::SetText().
| void VoltMod::PanoramaMenuLayout::SetRow | ( | int | slot, |
| int | index, | ||
| const MenuRow * | row, | ||
| std::string_view | pendingHint ) |
Definition at line 100 of file PanoramaMenuLayout.cpp.
References VoltMod::MenuRow::Enabled, VoltMod::Input, VoltMod::MenuRow::Kind, VoltMod::MenuRow::Label, VoltMod::MenuRow::Pending, VoltMod::MenuRow::Selectable, VoltMod::Screen::SetHidden(), VoltMod::MenuRow::State, VoltMod::MenuRow::Steppable, VoltMod::Submenu, VoltMod::Toggle, and VoltMod::MenuRow::Value.
| void VoltMod::PanoramaMenuLayout::SetSidebarVisible | ( | int | slot, |
| bool | visible ) |
Definition at line 73 of file PanoramaMenuLayout.cpp.
| void VoltMod::PanoramaMenuLayout::SetTab | ( | int | slot, |
| int | index, | ||
| const MenuTab * | tab ) |
Definition at line 83 of file PanoramaMenuLayout.cpp.
References VoltMod::MenuTab::Icon, VoltMod::MenuTab::Label, VoltMod::MenuTab::Selected, and VoltMod::Screen::SetHidden().
| 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.
|
inline |
Sidebar tabs, filled from the root menu's submenus.
Definition at line 76 of file PanoramaMenuLayout.hpp.
Referenced by FindButton().