Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen: Virtual methods for SDL and window resize events #3032

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

Vankata453
Copy link
Member

@Vankata453 Vankata453 commented Aug 2, 2024

The Screen abstract class now provides virtual methods for SDL and window resize events. The Editor and ParticleEditor classes now override the event(const SDL_Event& ev) method and Editor overrides on_window_resize().

Resize events in ScreenManager are now handled by all Screens in the stack. SDL events are only handled by the current (top) screen.

Additionally, OptionsMenu now calls ScreenManager::on_window_resize() on video setting changes, instead of just calling MenuManager::on_window_resize(). This fixes a bug where the game crashes on changing the "Video Resolution" and "Magnification" settings from the in-editor "Options" menu.

The `Screen` abstract class now provides virtual methods for SDL and window resize events. The `Editor` and `PartcleEditor` classes now `override` the `event(const SDL_Event& ev)` method and `Editor` `override`s `on_window_resize()`.

Resize events in `ScreenManager` are now handled by all `Screen`s in the stack. SDL events are only handled by the current (top) screen.

Additionally, `OptionsMenu` now calls `ScreenManager::on_window_resize()` on video setting changes, instead of just calling `MenuManager::on_window_resize()`. This fixes a bug where the editor crashes on changing the "Video Resolution" and "Magnification" settings from the in-editor "Options" menu.
@Vankata453 Vankata453 added category:code status:needs-review Work needs to be reviewed by other people type:bugfix Pull Requests that fix bugs. labels Aug 2, 2024
Copy link
Member

@tobbi tobbi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, code-wise.

Copy link
Member

@MatusGuy MatusGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks great. Will test later

@Vankata453 Vankata453 merged commit 36837d0 into master Aug 7, 2024
33 checks passed
@Vankata453 Vankata453 deleted the screen-sdl-events branch August 7, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:code status:needs-review Work needs to be reviewed by other people type:bugfix Pull Requests that fix bugs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants