[InterfaceState] Now updates parent. This fixes a problem where client froze the game when in pause menu or chat.
This commit is contained in:
parent
7a28b8bf49
commit
27fb5e935a
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -39,8 +39,6 @@ class SettingsMenuState : public InterfaceState {
|
||||
|
||||
void onEvent(const SDL_Event &event) override;
|
||||
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
void doneButtonAction();
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user