|
VoltMod
C++23 framework for CS2 server plugins
|
Menus drawn as center HTML and driven with W/S/A/D/E/R. It needs no client addon, so runtime.Menus falls back to it for a player another surface cannot draw for.
More...
#include <CenterHtmlMenu.hpp>
Inheritance diagram for VoltMod::CenterHtmlMenu:Classes | |
| struct | Services |
Public Member Functions | |
| CenterHtmlMenu (const Services &services) | |
| bool | OpenSession (int slot, std::shared_ptr< Menu > menu, MenuOptions options) override |
| void | Open (int slot, std::shared_ptr< Menu > menu) override |
| bool | IsOpen (int slot) const override |
| void | Close (int slot) override |
| void | CloseAll (int slot) override |
| void | CloseAll (int slot, std::string_view replyKey) override |
| void | Prompt (int slot, std::string prompt, std::function< bool(int slot, std::string_view text)> callback) override |
| std::string | Translate (int slot, std::string_view key, std::string_view fallback) const override |
Public Member Functions inherited from VoltMod::MenuSurface | |
| virtual | ~MenuSurface ()=default |
| MenuSurface (const MenuSurface &)=delete | |
| MenuSurface & | operator= (const MenuSurface &)=delete |
Additional Inherited Members | |
Protected Member Functions inherited from VoltMod::MenuSurface | |
| MenuSurface ()=default | |
Menus drawn as center HTML and driven with W/S/A/D/E/R. It needs no client addon, so runtime.Menus falls back to it for a player another surface cannot draw for.
Definition at line 28 of file CenterHtmlMenu.hpp.
Definition at line 27 of file CenterHtmlMenu.cpp.
Pops the top menu, returning to its parent when one exists.
Implements VoltMod::MenuSurface.
Definition at line 101 of file CenterHtmlMenu.cpp.
References VoltMod::ChatInput::CancelCapture(), VoltMod::CenterHtmlMenu::Services::ChatInput, VoltMod::Messages::ClearCenterHtml(), VoltMod::MenuFreeze::Close(), VoltMod::CenterHtmlMenu::Services::Freeze, VoltMod::MenuStack::IsOpen(), VoltMod::IsValidSlot(), VoltMod::CenterHtmlMenu::Services::Messages, VoltMod::MenuStack::Pop(), and VoltMod::ReadFile().
Clears the stack and removes the menu from the player's screen.
Implements VoltMod::MenuSurface.
Definition at line 129 of file CenterHtmlMenu.cpp.
References VoltMod::ChatInput::CancelCapture(), VoltMod::CenterHtmlMenu::Services::ChatInput, VoltMod::MenuStack::Clear(), VoltMod::Messages::ClearCenterHtml(), VoltMod::MenuFreeze::Close(), VoltMod::CenterHtmlMenu::Services::Freeze, VoltMod::MenuStack::IsOpen(), VoltMod::IsValidSlot(), VoltMod::CenterHtmlMenu::Services::Messages, and VoltMod::ReadFile().
Referenced by CloseAll(), and OpenSession().
Translates and sends replyKey, then closes every menu.
Implements VoltMod::MenuSurface.
Definition at line 149 of file CenterHtmlMenu.cpp.
References CloseAll(), VoltMod::Translations::Get(), VoltMod::CenterHtmlMenu::Services::Policy, VoltMod::ReadFile(), VoltMod::Policy::Reply, and VoltMod::CenterHtmlMenu::Services::Translations.
Implements VoltMod::MenuSurface.
Definition at line 170 of file CenterHtmlMenu.cpp.
References VoltMod::MenuStack::IsOpen(), and VoltMod::ReadFile().
Pushes menu onto slot's session and shows it, starting one with default options when none is open. What a row calls.
Implements VoltMod::MenuSurface.
Definition at line 48 of file CenterHtmlMenu.cpp.
References VoltMod::MenuStack::IsOpen(), VoltMod::IsValidSlot(), OpenSession(), and VoltMod::ReadFile().
|
overridevirtual |
Opens a session for slot showing menu, closing any the player has open here. What a command calls. False when this surface cannot draw for slot; nothing is left open then.
Implements VoltMod::MenuSurface.
Definition at line 33 of file CenterHtmlMenu.cpp.
References CloseAll(), VoltMod::CenterHtmlMenu::Services::Freeze, VoltMod::IsValidSlot(), VoltMod::MenuFreeze::Open(), and VoltMod::ReadFile().
Referenced by Open().
|
overridevirtual |
Routes the next chat line to callback. Closing the menu cancels it.
Implements VoltMod::MenuSurface.
Definition at line 159 of file CenterHtmlMenu.cpp.
References VoltMod::ChatInput::BeginCapture(), VoltMod::CenterHtmlMenu::Services::ChatInput, and VoltMod::ReadFile().
|
overridevirtual |
Translates key for slot, using fallback when missing.
Implements VoltMod::MenuSurface.
Definition at line 165 of file CenterHtmlMenu.cpp.
References VoltMod::Translations::GetOr(), VoltMod::ReadFile(), and VoltMod::CenterHtmlMenu::Services::Translations.