|
VoltMod
C++23 framework for CS2 server plugins
|
A spawned Panorama layout created by ScreenManager. More...
#include <Screen.hpp>
Public Member Functions | |
| Screen () | |
| ~Screen () | |
| Screen (Screen &&) noexcept | |
| Screen & | operator= (Screen &&) noexcept |
| Screen (const Screen &)=delete | |
| Screen & | operator= (const Screen &)=delete |
| operator bool () const | |
| bool | EnsureSpawned (int slot) |
| void | SetText (int slot, std::string_view variable, std::string_view value) |
| void | SetClass (int slot, std::string_view elementId, std::string_view className, bool on) |
| void | SetHidden (int slot, std::string_view elementId, bool hidden) |
| void | SetModifier (int slot, std::string_view elementId, std::string_view block, std::span< const std::string_view > names, std::string_view name) |
| void | ShowCursor (int slot, bool shown) |
| bool | HasCursor () const |
| void | Remove () |
Friends | |
| class | ScreenManager |
A spawned Panorama layout created by ScreenManager.
A screen is networked only to its owner and remains visible while the owner is dead or spectating. Writes name the owner or EveryoneSlot, which mean the same; any other slot is ignored.
Writes do not spawn the entity. Call EnsureSpawned before drawing; it also respawns after a map change. Unchanged values are not resent, and a failed write is logged once and retried on the next change. Destruction removes the entity. Operations are inert unless ScreenManager::Available succeeds.
Definition at line 22 of file Screen.hpp.
|
default |
Construct an empty screen. Writes do nothing until an entity is assigned.
Referenced by operator bool(), operator=(), operator=(), Screen(), Screen(), and ScreenManager.
|
default |
|
defaultnoexcept |
References Screen().
|
delete |
References Screen().
| bool VoltMod::Screen::EnsureSpawned | ( | int | slot | ) |
Spawn or respawn until slot can be written to. False logs why once per attempt.
Definition at line 24 of file Screen.cpp.
References EnsureSpawned().
Referenced by EnsureSpawned(), VoltMod::PlayerScreens::FindSpawned(), and operator=().
| bool VoltMod::Screen::HasCursor | ( | ) | const |
Whether ShowCursor last showed the cursor and the entity is still there.
Definition at line 59 of file Screen.cpp.
References HasCursor().
Referenced by HasCursor(), and operator=().
|
explicit |
Definition at line 19 of file Screen.cpp.
References Screen().
References EnsureSpawned(), HasCursor(), Remove(), Screen(), SetClass(), SetHidden(), SetModifier(), SetText(), and ShowCursor().
Replace the entity, removing the one previously held by this screen.
References Screen().
| void VoltMod::Screen::Remove | ( | ) |
Remove the entity now. The next EnsureSpawned creates a new one.
Definition at line 72 of file Screen.cpp.
References Remove().
Referenced by VoltMod::PlayerScreens::Close(), operator=(), and Remove().
| void VoltMod::Screen::SetClass | ( | int | slot, |
| std::string_view | elementId, | ||
| std::string_view | className, | ||
| bool | on ) |
Definition at line 37 of file Screen.cpp.
References SetClass().
Referenced by operator=(), SetClass(), SetHidden(), and VoltMod::PanoramaMenuLayout::SetPrompt().
| void VoltMod::Screen::SetHidden | ( | int | slot, |
| std::string_view | elementId, | ||
| bool | hidden ) |
Definition at line 45 of file Screen.cpp.
References SetClass(), and SetHidden().
Referenced by VoltMod::PlayerScreens::Open(), operator=(), VoltMod::PanoramaMenuLayout::SetEmpty(), VoltMod::PanoramaMenuLayout::SetFooter(), VoltMod::PanoramaMenuLayout::SetHeader(), SetHidden(), VoltMod::PanoramaMenuLayout::SetPager(), VoltMod::PanoramaMenuLayout::SetPrompt(), VoltMod::PanoramaMenuLayout::SetRow(), and VoltMod::PanoramaMenuLayout::SetTab().
| void VoltMod::Screen::SetModifier | ( | int | slot, |
| std::string_view | elementId, | ||
| std::string_view | block, | ||
| std::span< const std::string_view > | names, | ||
| std::string_view | name ) |
Turn <block>--<name> on for elementId and every other of names off, such as an icon set's shown icon or a bar's step. Only changes are sent, so these classes come from here alone, never from the markup or SetClass. names is the generated header's IconSetNames or BarNames.
Definition at line 50 of file Screen.cpp.
References SetModifier().
Referenced by operator=(), and SetModifier().
| void VoltMod::Screen::SetText | ( | int | slot, |
| std::string_view | variable, | ||
| std::string_view | value ) |
Set the text a text="{s:variable}" Label shows, for slot or EveryoneSlot.
Definition at line 29 of file Screen.cpp.
References SetText().
Referenced by operator=(), VoltMod::PanoramaMenuLayout::SetEmpty(), VoltMod::PanoramaMenuLayout::SetFooter(), VoltMod::PanoramaMenuLayout::SetHeader(), VoltMod::PanoramaMenuLayout::SetPager(), VoltMod::PanoramaMenuLayout::SetPrompt(), and SetText().
| void VoltMod::Screen::ShowCursor | ( | int | slot, |
| bool | shown ) |
Definition at line 64 of file Screen.cpp.
References ShowCursor().
Referenced by VoltMod::PlayerScreens::Close(), VoltMod::PlayerScreens::Open(), operator=(), and ShowCursor().
|
friend |
Definition at line 62 of file Screen.hpp.
References Screen(), and ScreenManager.
Referenced by ScreenManager.