18 :
Pressed({.OnFirst = [
this] {
return WatchPresses(); }, .OnLast = [
this] { _host.Reset(); }}),
22 _visibility(visibility),
24 _connect(std::move(connect))
27bool ScreenManager::WatchPresses()
31 Log::Warn(
"Screens: the client filter table did not bind; button presses will not arrive.");
34 _host = _connect(*
this);
40 Pressed.Raise({.Slot = slot, .ButtonId = std::string(buttonId)});
47 return std::unexpected(
Error::Invalid(std::format(
"slot {} is not a player slot", slot)));
53 return std::unexpected(path.error());
57 std::make_unique<ScreenEntity>(_entities, _slots, _visibility, _clients, _live, std::move(*path), slot));
62 return std::ranges::any_of(
68 const std::pair<bool, std::string_view> needed[] = {
69 {
static_cast<bool>(_bindings.CustomHudSetHasClass),
"CCSCustomHudLayout::SetHasClass"},
70 {
static_cast<bool>(_bindings.CustomHudSetDialogVariable),
"CCSCustomHudLayout::SetDialogVariableString"},
71 {
static_cast<bool>(_bindings.CustomHudSetInputCapture),
"CCSCustomHudLayout::SetInputCaptureEnabled"},
72 {
static_cast<bool>(_bindings.ClientFilterTable),
"CServerSideClient::INetworkMessageProcessingPreFilter"},
74 for (
const auto& [bound, key] : needed)
78 return std::unexpected(
Error::Unsupported(std::format(
"gamedata '{}' did not bind", key)));
runtime.Entities: finds and creates entities. Everything it returns is valid for this frame only; see...
static Result< LayoutPath > Parse(std::string_view layout)
Per-client network access: latency, userids, usercmd status and the client's replicated userinfo cvar...
The custom_hud_layout entity behind a Screen: spawning, removal, and every write.
int Owner() const noexcept
bool HasCursor(int slot) const
ScreenManager(EntitySystem &entities, const Bindings &bindings, SlotEvents &slots, Visibility &visibility, const NetChannels &clients, Connector connect)
Event< const ButtonPress & > Pressed
void OnPress(int slot, std::string_view buttonId)
std::function< Subscription(ScreenManager &)> Connector
Result< Screen > Create(std::string_view layout, int slot)
A spawned Panorama layout created by ScreenManager.
"The occupant of this slot changed" - raised by PlayerManager, consumed below it.
Which clients receive which entities, filtered after CheckTransmit.
void Warn(std::format_string< Args... > fmt, Args &&... args)
std::expected< void, Error > Status
std::expected< T, Error > Result
constexpr bool IsValidSlot(int slot)
ClassTable ClientFilterTable
static Error Invalid(std::string detail)
static Error Unsupported(std::string detail)