Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ void HideQuitMenu( void )
//-------------------------------------------------------------------------------------------------
void ToggleQuitMenu()
{
if (TheGameLogic->isIntroMoviePlaying() || TheGameLogic->isLoadingGame() ||TheScriptEngine->isGameEnding())
if (TheGameLogic->isIntroMoviePlaying() || TheGameLogic->isLoadingGame())
return;

// BGC- If we are currently in the disconnect screen, don't let the quit menu come up.
Expand Down Expand Up @@ -346,6 +346,7 @@ void ToggleQuitMenu()
{

TheMouse->setCursor( Mouse::ARROW );
TheMouse->setVisibility(true);
Copy link

Choose a reason for hiding this comment

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

Instead of doing that, perhaps we should not hide mouse in victory screen?

Because now when toggling Quit Menu, then Mouse will be visible anyway, right?

Copy link
Author

Choose a reason for hiding this comment

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

The cursor is hidden as part of the ScriptActions::doDisableInput method. It's preferable not to touch this as it may be used in other pathways (such as via script commands or during cinematic playback).

While we could simply re-enable the mouse after doDisableInput is called, it does not feel as clean. It makes sense to enforce cursor visibility when showing the quit menu to remove the responsibility from other call sites.

Additionally, as the control bar is also disabled on match outcome, it makes sense to leave the cursor hidden to further communicate to the user that they cannot access it. Pressing ESC will of course reveal the cursor, but by then the user will no longer have any reason to access the control bar.

We can create a follow-up task if we want to try and figure a way to have only the options button on the control bar available during the match outcome and leave the cursor visible. I expect such a task will be a lot more involved.

Choose a reason for hiding this comment

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

If I cancel the QuitMenu (using Esc key), the mouse stays visible. Shouldn't it be hidden again?

Copy link

Choose a reason for hiding this comment

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

Either that or never hidden at all I would say.

If mouse visibility is difficult to control with just a single boolean flag, then perhaps it requires flags similar to how we do it for the cursor capture (see CursorCaptureBlockReason).

The core principle of using the flags approach is that multiple systems can ask for hiding a cursor but do not conflict with each other.


TheControlBar->hidePurchaseScience();
if ( TheGameLogic->isInMultiplayerGame() || TheGameLogic->isInReplayGame() )
Expand Down Expand Up @@ -431,6 +432,7 @@ void ToggleQuitMenu()
HideDiplomacy();
HideInGameChat();
TheControlBar->hidePurchaseScience();
quitMenuLayout->bringForward();
isVisible = TRUE;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ void HideQuitMenu( void )
//-------------------------------------------------------------------------------------------------
void ToggleQuitMenu()
{
if (TheGameLogic->isIntroMoviePlaying() || TheGameLogic->isLoadingMap() ||TheScriptEngine->isGameEnding())
if (TheGameLogic->isIntroMoviePlaying() || TheGameLogic->isLoadingMap())
return;

// BGC- If we are currently in the disconnect screen, don't let the quit menu come up.
Expand Down Expand Up @@ -346,6 +346,7 @@ void ToggleQuitMenu()
{

TheMouse->setCursor( Mouse::ARROW );
TheMouse->setVisibility(true);

TheControlBar->hidePurchaseScience();
if ( TheGameLogic->isInMultiplayerGame() || TheGameLogic->isInReplayGame() )
Expand Down Expand Up @@ -431,6 +432,7 @@ void ToggleQuitMenu()
HideDiplomacy();
HideInGameChat();
TheControlBar->hidePurchaseScience();
quitMenuLayout->bringForward();
isVisible = TRUE;
}

Expand Down
Loading