17 : Pressed({.OnFirst = [
this] {
return ListenForPresses(); }, .OnLast = [
this] { _host.
Reset(); }}),
25bool ScreenManager::ListenForPresses()
29 Log::Warn(
"Screens: the FilterMessage bindings are missing; button presses will not arrive.");
32 _host = _connect(*
this);
50 return std::unexpected(
Error::Invalid(std::format(
"slot {} is not a player slot",
slot)));
55 return std::unexpected(
64 const std::pair<bool, std::string_view>
needed[] = {
69 "CCSCustomHudLayout::SetDialogVariableStringForPlayer"},
71 {
static_cast<bool>(_bindings.
FilterMessage),
"INetworkMessageProcessingPreFilter::FilterMessage"},
72 {
static_cast<bool>(_bindings.
ClientMessageFilter),
"CServerSideClient::INetworkMessageProcessingPreFilter"},
73 {
static_cast<bool>(_bindings.
ClientSlot),
"CServerSideClientBase::m_nClientSlot"},
90 return std::unexpected(path.error());
93 return Screen(std::make_unique<ScreenEntity>(_entities, _slots, _visibility, std::move(*path),
owner));
runtime.Entities: finds and creates entities. Everything it returns is valid for this frame only; see...
static Result< LayoutPath > Parse(std::string_view layout)
Result< Screen > Shared(std::string_view layout)
Event< const ButtonPress & > Pressed
Result< Screen > ForPlayer(std::string_view layout, int slot)
void OnPress(int slot, std::string_view buttonId)
std::function< Subscription(ScreenManager &)> Connector
ScreenManager(EntitySystem &entities, const Bindings &bindings, SlotEvents &slots, Visibility &visibility, Connector connect)
"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)
static std::string ReadFile(const std::filesystem::path &path)
constexpr bool IsValidSlot(int slot)
std::expected< void, Error > Status
constexpr int EveryoneSlot
std::expected< T, Error > Result
Fn< void(void *, int32_t, bool)> CustomHudSetInputCapture
Fn< void(void *, int32_t, const CUtlString *, const CUtlString *, int32_t)> CustomHudSetHasClassForPlayer
VirtualFn< bool(INetworkMessageProcessingPreFilter *, const CNetMessage *, INetChannel *)> FilterMessage
Fn< void(void *, const CUtlString *, const CUtlString *, int32_t)> CustomHudSetHasClass
Offset< void > ClientMessageFilter
Fn< void(void *, const CUtlString *, const CUtlString *, const CUtlString *)> CustomHudSetDialogVariable
Fn< void(void *, int32_t, const CUtlString *, const CUtlString *, const CUtlString *)> CustomHudSetDialogVariableForPlayer
static Error Invalid(std::string detail)
static Error Unsupported(std::string detail)