diff --git a/client/include/states/ChatState.hpp b/client/include/states/ChatState.hpp index ad8b509b9..70d616bc2 100644 --- a/client/include/states/ChatState.hpp +++ b/client/include/states/ChatState.hpp @@ -41,8 +41,6 @@ class ChatState : public InterfaceState { void onEvent(const SDL_Event &event) override; - void update() override; - private: void draw(gk::RenderTarget &target, gk::RenderStates states) const override; diff --git a/client/include/states/InterfaceState.hpp b/client/include/states/InterfaceState.hpp index b85684c79..b55e44611 100644 --- a/client/include/states/InterfaceState.hpp +++ b/client/include/states/InterfaceState.hpp @@ -39,6 +39,8 @@ class InterfaceState : public gk::ApplicationState { void setup(); void onEvent(const SDL_Event &event) override; + void update() override; + void prepareDraw(gk::RenderTarget &target, gk::RenderStates &states) const; bool m_drawBackground = true; diff --git a/client/include/states/PauseMenuState.hpp b/client/include/states/PauseMenuState.hpp index 36b902ef2..3e9a7c887 100644 --- a/client/include/states/PauseMenuState.hpp +++ b/client/include/states/PauseMenuState.hpp @@ -40,8 +40,6 @@ class PauseMenuState : public InterfaceState { void onEvent(const SDL_Event &event) override; - void update() override; - private: void draw(gk::RenderTarget &target, gk::RenderStates states) const override; diff --git a/client/include/states/SettingsMenuState.hpp b/client/include/states/SettingsMenuState.hpp index 18ccceaa3..54e4e463f 100644 --- a/client/include/states/SettingsMenuState.hpp +++ b/client/include/states/SettingsMenuState.hpp @@ -39,8 +39,6 @@ class SettingsMenuState : public InterfaceState { void onEvent(const SDL_Event &event) override; - void update() override; - private: void doneButtonAction(); diff --git a/client/source/states/ChatState.cpp b/client/source/states/ChatState.cpp index 201f8988d..8e81da520 100644 --- a/client/source/states/ChatState.cpp +++ b/client/source/states/ChatState.cpp @@ -91,9 +91,6 @@ void ChatState::onEvent(const SDL_Event &event) { } } -void ChatState::update() { -} - void ChatState::draw(gk::RenderTarget &target, gk::RenderStates states) const { if (m_parent) target.draw(*m_parent, states); diff --git a/client/source/states/InterfaceState.cpp b/client/source/states/InterfaceState.cpp index 2710a0851..78c0aa641 100644 --- a/client/source/states/InterfaceState.cpp +++ b/client/source/states/InterfaceState.cpp @@ -62,6 +62,11 @@ void InterfaceState::onEvent(const SDL_Event &event) { } } +void InterfaceState::update() { + if (m_parent) + m_parent->update(); +} + void InterfaceState::prepareDraw(gk::RenderTarget &target, gk::RenderStates &states) const { states.transform *= getTransform(); states.shader = &m_shader; diff --git a/client/source/states/LuaGUIState.cpp b/client/source/states/LuaGUIState.cpp index b9d284729..272922471 100644 --- a/client/source/states/LuaGUIState.cpp +++ b/client/source/states/LuaGUIState.cpp @@ -79,8 +79,7 @@ void LuaGUIState::onEvent(const SDL_Event &event) { } void LuaGUIState::update() { - if (m_parent) - m_parent->update(); + InterfaceState::update(); for (auto &it : m_widgets) it->update(); diff --git a/client/source/states/PauseMenuState.cpp b/client/source/states/PauseMenuState.cpp index 4f373ae2b..6f4f99ef8 100644 --- a/client/source/states/PauseMenuState.cpp +++ b/client/source/states/PauseMenuState.cpp @@ -91,9 +91,6 @@ void PauseMenuState::onEvent(const SDL_Event &event) { } } -void PauseMenuState::update() { -} - void PauseMenuState::draw(gk::RenderTarget &target, gk::RenderStates states) const { if (m_parent) target.draw(*m_parent, states); diff --git a/client/source/states/SettingsMenuState.cpp b/client/source/states/SettingsMenuState.cpp index 6c0aa44c2..c250f0a6a 100644 --- a/client/source/states/SettingsMenuState.cpp +++ b/client/source/states/SettingsMenuState.cpp @@ -78,9 +78,6 @@ void SettingsMenuState::onEvent(const SDL_Event &event) { } } -void SettingsMenuState::update() { -} - void SettingsMenuState::doneButtonAction() { if (m_state != MenuState::Main) { m_state = MenuState::Main;