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

Add extra popup and notification settings #353

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JamieNyanchi
Copy link
Contributor

@JamieNyanchi JamieNyanchi commented Mar 25, 2023

Quick Explanation

This pull request implements the following two features:

1. Allows more automatic popups/visuals to be disabled. Resolves #314.
2. Allow popups/visuals to optionally show in multiplayer.

I apologize for the large PR. These changes ended up being larger than I anticipated.

Detailed Explanation

Detailed explanation of changes

1. Allows more automatic popups/visuals to be disabled. Settings for the following popups and popup movies were added:

  • Natural Wonder popup movies and audio
  • Space Race Project Completed popup movies
  • Tech/Civic Boosted popups
  • Unit Captured popup
  • Era Complete popups (The ones that say "The world enters the X Era")
  • Historical Moments popups
  • Natural Disaster popup movies
  • Rock Band popup movies
  • Secret Society Discovered/Joined popups
  • Hero Discovered/Expired popups

All of these popups are enabled by default, as this is base game behavior. In other words, the default settings follow base game behavior.


2. Allow popups/visuals to optionally show in multiplayer. I thought I saw a request for this somewhere, but I can't seem to find it anymore. In any case, this feature works properly without any impact on the multiplayer experience.

The popups and popup movies will only show if the Multiplayer Popups option is enabled. By default, this is off to follow base game behavior.

The popupmanager.lua file was modified to ensure that the multiplayer experience is not impacted by these changes. In the base game, these popups will lock the engine so nothing happens until the popup is closed. This is modified so that the engine will not lock in multiplayer so no other players will be impacted if one player has the popups enabled. Singleplayer is not affected by these changes.


Closing Comments and Notes

I have tested these changes both in Singleplayer and Multiplayer (both with and without the Heroes & Legends and Secret Societies game modes). My tests have mostly been on Gathering Storm, but I have done quick checks on the Base Game and Rise & Fall and the changes appear to work fine on those too.

As always, comments and reviews are greatly appreciated and I'm happy to make any changes necessary to move this forward!

Thanks in advance!

@Infixo
Copy link
Contributor

Infixo commented Apr 6, 2023

Can you just create a PR for #182?

@JamieNyanchi
Copy link
Contributor Author

Sure thing! I'll try to get that done sometime today or tomorrow and get that submitted as a separate PR.

@JamieNyanchi
Copy link
Contributor Author

JamieNyanchi commented Apr 7, 2023

As requested, that feature was split off into #356. I'll rebase this PR if and when that one gets merged.

Copy link
Collaborator

@the-m4a the-m4a left a comment

Choose a reason for hiding this comment

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

Well done with the comments in code and what's here! I assume you have tested it and all is well?

@JamieNyanchi
Copy link
Contributor Author

Oh, you rebased it for me, thank you! I've tested the remaining two features a bit and I haven't come across any issues so far. I think the popup settings feature is all good to go. I haven't had the chance to test every case in the multiplayer popups one, but it seems fine so far. Like I said in the original post, it's a bit hacky since the popups and movies aren't intended to show in multiplayer, but it seems to work.

For reviewing, I think the most important part to look at in regards to the multiplayer popups feature is the PopupManager.lua file and how the other popup files interact with it. The movie popups that occur when building world wonders, discovering natural wonders, performing rock concerts, etc normally all lock the engine until the popup is done. I noticed this is done by calling the UI.ReferenceCurrentEvent() function, so I purposefully have it avoid that function in multiplayer. This seems to prevent the engine from locking and the game keeps moving even when the movie popups are occurring. I'm pointing this out to hopefully help you all with reviewing if you want this feature added. It's currently set to opt-in so nothing should be different if playing with default settings.

@JamieNyanchi JamieNyanchi marked this pull request as draft April 13, 2023 19:36
@JamieNyanchi
Copy link
Contributor Author

Switching this to a draft so I can restructure the files to better match the code standards here as well as make a few more changes and test them.

@JamieNyanchi JamieNyanchi force-pushed the PopupsAndNotifications branch 2 times, most recently from f4ef2a4 to f7df325 Compare April 28, 2023 07:06
@JamieNyanchi JamieNyanchi force-pushed the PopupsAndNotifications branch 2 times, most recently from b7f6bcc to f73c73b Compare June 18, 2023 00:50
@JamieNyanchi JamieNyanchi force-pushed the PopupsAndNotifications branch from f73c73b to bb7ec57 Compare June 23, 2023 16:06
Adds the following two features:

1. Allows more automatic popups/visuals to be disabled. Added popup settings include ones for the tech/civic boosted, unit captured, natural wonder revealed, space race project completed, and rock band popups/visuals.

2. Allow popups/visuals to optionally show in multiplayer.
@JamieNyanchi JamieNyanchi force-pushed the PopupsAndNotifications branch from bb7ec57 to 3d20eb4 Compare June 23, 2023 16:30
@JamieNyanchi JamieNyanchi marked this pull request as ready for review June 23, 2023 16:33
@JamieNyanchi
Copy link
Contributor Author

I took forever to get this done, but I believe this is finally in a good state to review! Please let me know your thoughts! If you have any questions, I'd be happy to answer!

@Infixo
Copy link
Contributor

Infixo commented Jul 8, 2023

This PR has too much of a new code, and the value added is really miniscule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding the ability to disable historic moments and tech/civic boost triggering a pop-up.
3 participants