mirror of
https://github.com/leoetlino/project-restoration
synced 2025-10-06 00:32:43 +02:00
game/ui: Fix CheckCurrentScreen check
This changes ui::CheckCurrentScreen to also check that the screen is not closing, which fixes a softlock in the Bomber's Notebook if the map is opened while the screen is closing. Closes #129
This commit is contained in:
@@ -62,7 +62,8 @@ bool OpenScreen(ScreenType screen) {
|
||||
}
|
||||
|
||||
bool CheckCurrentScreen(ScreenType screen) {
|
||||
return GetScreenContext().active_screen == GetScreen(screen);
|
||||
auto& ctx = GetScreenContext();
|
||||
return ctx.active_screen == GetScreen(screen) && !ctx.new_screen;
|
||||
}
|
||||
|
||||
void LayoutBase::calc(float speed) {
|
||||
|
@@ -49,6 +49,7 @@ enum class ScreenType {
|
||||
};
|
||||
Screen* GetScreen(ScreenType screen);
|
||||
bool OpenScreen(ScreenType screen);
|
||||
/// Check whether the specified screen is active and not closing.
|
||||
bool CheckCurrentScreen(ScreenType screen);
|
||||
|
||||
ScreenContext& GetScreenContext();
|
||||
|
Reference in New Issue
Block a user