22 std::function<
void(
GameState)> changeState)
23 : _uiRegistry(UiRegistry),
25 _translationManager(translationManager),
27 _uiFactory(uiFactory),
28 _changeState(changeState)
40 "assets/fonts/title.ttf",
75 if (
const auto* kp = e.getIf<sf::Event::KeyPressed>()) {
76 if (kp->code == sf::Keyboard::Key::Escape) {
System to handle network-related operations on the client side.
void tryLeaveRoom(void)
Send a request to leave the current room on the server.
Manages game settings and preferences.
Manages game translations for all UI elements.
std::string get(const std::string &key) const
Get translated string for a key.
Factory class for creating UI components in the ECS registry.
static ecs::Entity createText(ecs::Registry ®istry, const position &position, const std::string &content, const std::string &fontPath, unsigned int fontSize, const std::uint8_t zIndex=0, const color &textColor={255, 255, 255})
static ecs::Entity createButton(ecs::Registry ®istry, const position &position, const size &size, const std::string &label, std::function< void()> onClick=nullptr)
Create a button UI component.
NetworkSyncSystem & _network
Reference to the client network.
void onEnter(void) override
Called when the scene is entered.
TranslationManager & _translationManager
Reference to the translation manager.
void update(float dt) override
Update the scene state.
void onExit(void) override
Called when the scene is exited.
void handleEvent(const sf::Event &event) override
Handle an incoming event.
PauseScene(ecs::Registry &UiRegistry, Settings &settings, TranslationManager &translationManager, NetworkSyncSystem &network, graphics::UiFactory &uiFactory, std::function< void(GameState)> changeState)
Constructor for PauseScene.
ChangeStateFn _changeState
Function to change the game state.
graphics::UiFactory & _uiFactory
UI Factory for creating UI components.
ecs::Registry & _uiRegistry
Reference to the ECS registry.
@ Playing
In-game playing state.
void info(LogFmt< std::type_identity_t< Args >... > fmt, Args &&...args) noexcept
Log an informational message.