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

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ Screen() [1/3]

VoltMod::Screen::Screen ( )
default

Construct an empty screen. Writes do nothing until an entity is assigned.

Referenced by operator bool(), operator=(), operator=(), Screen(), Screen(), and ScreenManager.

◆ ~Screen()

VoltMod::Screen::~Screen ( )
default

◆ Screen() [2/3]

VoltMod::Screen::Screen ( Screen && )
defaultnoexcept

References Screen().

◆ Screen() [3/3]

VoltMod::Screen::Screen ( const Screen & )
delete

References Screen().

Member Function Documentation

◆ EnsureSpawned()

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=().

◆ HasCursor()

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=().

◆ operator bool()

VoltMod::Screen::operator bool ( ) const
explicit

Definition at line 19 of file Screen.cpp.

References Screen().

◆ operator=() [1/2]

Screen & VoltMod::Screen::operator= ( const Screen & )
delete

◆ operator=() [2/2]

Screen & VoltMod::Screen::operator= ( Screen && )
defaultnoexcept

Replace the entity, removing the one previously held by this screen.

References Screen().

◆ Remove()

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().

◆ SetClass()

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().

◆ SetHidden()

◆ SetModifier()

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().

◆ SetText()

void VoltMod::Screen::SetText ( int slot,
std::string_view variable,
std::string_view value )

◆ ShowCursor()

void VoltMod::Screen::ShowCursor ( int slot,
bool shown )

◆ ScreenManager

friend class ScreenManager
friend

Definition at line 62 of file Screen.hpp.

References Screen(), and ScreenManager.

Referenced by ScreenManager.


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