|
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 > | ButtonFor (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.
References VoltMod::ReadFile().
| 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 176 of file PanoramaMenuLayout.cpp.
References VoltMod::ReadFile().
| std::optional< MenuButton > VoltMod::PanoramaMenuLayout::ButtonFor | ( | std::string_view | id | ) | const |
The button a pressed id names, or nothing for an id outside this screen.
Definition at line 181 of file PanoramaMenuLayout.cpp.
References VoltMod::Back, VoltMod::Cancel, VoltMod::Close, VoltMod::NextPage, VoltMod::PreviousPage, VoltMod::ReadFile(), VoltMod::Row, RowCount(), VoltMod::StepDown, VoltMod::StepUp, VoltMod::Tab, and TabCount().
Definition at line 60 of file PanoramaMenuLayout.cpp.
References VoltMod::PlayerScreens::Find(), VoltMod::ReadFile(), and VoltMod::Screen::ShowCursor().
|
inline |
Definition at line 145 of file PanoramaMenuLayout.cpp.
References VoltMod::PlayerScreens::For(), VoltMod::ReadFile(), 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 168 of file PanoramaMenuLayout.cpp.
References VoltMod::PlayerScreens::For(), VoltMod::ReadFile(), and VoltMod::Screen::SetText().
| void VoltMod::PanoramaMenuLayout::SetHeader | ( | int | slot, |
| const MenuHeader & | header | ||
| ) |
Definition at line 73 of file PanoramaMenuLayout.cpp.
References VoltMod::PlayerScreens::For(), VoltMod::ReadFile(), and VoltMod::Screen::SetText().
Show the home markup in the rows' place. A screen without any does nothing.
Definition at line 94 of file PanoramaMenuLayout.cpp.
References VoltMod::PlayerScreens::For(), VoltMod::ReadFile(), and VoltMod::Screen::SetClass().
Definition at line 152 of file PanoramaMenuLayout.cpp.
References VoltMod::PlayerScreens::For(), VoltMod::ReadFile(), and VoltMod::Screen::SetText().
| void VoltMod::PanoramaMenuLayout::SetPrompt | ( | int | slot, |
| std::string_view | text, | ||
| std::string_view | hint | ||
| ) |
Definition at line 159 of file PanoramaMenuLayout.cpp.
References VoltMod::PlayerScreens::For(), VoltMod::ReadFile(), and VoltMod::Screen::SetText().
| void VoltMod::PanoramaMenuLayout::SetRow | ( | int | slot, |
| int | index, | ||
| const MenuRow * | row, | ||
| std::string_view | pendingHint | ||
| ) |
Definition at line 116 of file PanoramaMenuLayout.cpp.
References VoltMod::PlayerScreens::For(), VoltMod::Input, VoltMod::ReadFile(), VoltMod::Screen::SetHidden(), VoltMod::Submenu, and VoltMod::Toggle.
Definition at line 89 of file PanoramaMenuLayout.cpp.
References VoltMod::PlayerScreens::For(), VoltMod::ReadFile(), and VoltMod::Screen::SetClass().
Definition at line 99 of file PanoramaMenuLayout.cpp.
References VoltMod::PlayerScreens::For(), VoltMod::ReadFile(), and VoltMod::Screen::SetHidden().
Spawn if needed, unhide, and give the cursor. False when slot cannot be drawn to.
Definition at line 47 of file PanoramaMenuLayout.cpp.
References VoltMod::PlayerScreens::For(), VoltMod::ReadFile(), and VoltMod::Screen::SetHidden().
|
inline |
Sidebar tabs, filled from the root menu's submenus.
Definition at line 76 of file PanoramaMenuLayout.hpp.
Referenced by ButtonFor().