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)
 
void Remove ()
 

Friends

class ScreenManager
 

Detailed Description

A spawned Panorama layout created by ScreenManager.

Shared screens write for EveryoneSlot or a selected player. Player screens are networked only to their owner and remain visible while the owner is dead or spectating.

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 per slot 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.

◆ ~Screen()

VoltMod::Screen::~Screen ( )
default

◆ Screen() [2/3]

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

◆ Screen() [3/3]

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

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 25 of file Screen.cpp.

References EnsureSpawned().

Referenced by EnsureSpawned().

◆ operator bool()

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

Definition at line 20 of file Screen.cpp.

◆ 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.

◆ Remove()

void VoltMod::Screen::Remove ( )

Remove the entity now. The next EnsureSpawned creates a new one.

Definition at line 70 of file Screen.cpp.

◆ SetClass()

void VoltMod::Screen::SetClass ( int  slot,
std::string_view  elementId,
std::string_view  className,
bool  on 
)

◆ SetHidden()

void VoltMod::Screen::SetHidden ( int  slot,
std::string_view  elementId,
bool  hidden 
)

◆ 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. names is the generated header's IconSetNames or BarNames.

Definition at line 51 of file Screen.cpp.

◆ SetText()

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

◆ ShowCursor()

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

Definition at line 62 of file Screen.cpp.

Referenced by VoltMod::PanoramaMenuLayout::Hide().

Friends And Related Symbol Documentation

◆ ScreenManager

Definition at line 58 of file Screen.hpp.


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