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

Re-sends a center-HTML panel until stopped, since CS2 drops center HTML on death, a team switch and HUD updates. render runs on every send, so live values stay current. More...

#include <CenterHtml.hpp>

Public Member Functions

 CenterHtml (Messages &messages, Scheduler &scheduler, SlotEvents &slots)
 
void Show (int slot, int refreshMs, std::function< std::string(int slot)> render)
 
void Stop (int slot)
 
void StopAll ()
 

Detailed Description

Re-sends a center-HTML panel until stopped, since CS2 drops center HTML on death, a team switch and HUD updates. render runs on every send, so live values stay current.

Definition at line 19 of file CenterHtml.hpp.

Constructor & Destructor Documentation

◆ CenterHtml()

VoltMod::CenterHtml::CenterHtml ( Messages &  messages,
Scheduler &  scheduler,
SlotEvents &  slots 
)

slots stops a panel when its player leaves. All must outlive this.

Definition at line 10 of file CenterHtml.cpp.

Member Function Documentation

◆ Show()

void VoltMod::CenterHtml::Show ( int  slot,
int  refreshMs,
std::function< std::string(int slot)>  render 
)

Send render(slot) to slot every refreshMs, replacing any panel shown.

Definition at line 14 of file CenterHtml.cpp.

References VoltMod::IsValidSlot(), VoltMod::ReadFile(), VoltMod::Scheduler::Repeat(), VoltMod::Messages::SendCenterHtml(), and Stop().

◆ Stop()

void VoltMod::CenterHtml::Stop ( int  slot)

Stop and clear the panel; safe when nothing is shown.

Definition at line 29 of file CenterHtml.cpp.

References VoltMod::Messages::ClearCenterHtml(), VoltMod::IsValidSlot(), and VoltMod::ReadFile().

Referenced by Show(), and StopAll().

◆ StopAll()

void VoltMod::CenterHtml::StopAll ( )

Definition at line 39 of file CenterHtml.cpp.

References VoltMod::MaxPlayers, VoltMod::ReadFile(), and Stop().


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