VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
CenterHtml.hpp
Go to the documentation of this file.
1#pragma once
2
8#include <cstdint>
9#include <functional>
10#include <string>
11
12namespace VoltMod
13{
14
15/**
16 * @brief Re-sends a center-HTML panel until stopped, since CS2 drops center HTML on death, a team
17 * switch and HUD updates. `render` runs on every send, so live values stay current.
18 */
20{
21public:
22 /** @p slots stops a panel when its player leaves. All must outlive this. */
24
25 /** Send `render(slot)` to @p slot every @p refreshMs, replacing any panel shown. */
26 void Show(int slot, int refreshMs, std::function<std::string(int slot)> render);
27
28 /** Stop and clear the panel; safe when nothing is shown. */
29 void Stop(int slot);
30
31 void StopAll();
32
33private:
34 Messages& _messages;
35 Scheduler& _scheduler;
37};
38
39} // namespace VoltMod
Re-sends a center-HTML panel until stopped, since CS2 drops center HTML on death, a team switch and H...
void Show(int slot, int refreshMs, std::function< std::string(int slot)> render)
void Stop(int slot)
Send chat, center print, center HTML, and alert messages.
Definition Messages.hpp:30
Per-player-slot value store that never leaks state across occupants.
Definition PerSlot.hpp:25
One-shot delays and repeating timers, run on the game thread.
Definition Scheduler.hpp:18
"The occupant of this slot changed" - raised by PlayerManager, consumed below it.
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56