Pause overlay#301
Conversation
… added null propogation for the sound samples for PauseButton(sometimes in the visual tests the audio doesn't load for whatever reason), added a gradient to the background of the PauseOverlay visual test(same as the one in the menu button system test), wired up the retry and quit actions in Player, made the quit action quit the map, retry still does nothing
…ing(used to allow circles to draw on top)
…me, made Pause and Play public, added proper testing for the visual test(pause button instead of auto-pause, logging actions), made PauseOverlay's fade duration a constant instead of statically typed
…roject does, moved PauseButton audio loading to PauseOverlay, much more reliable(still using placeholder assets), made it so the player can't spam pause, cools down to one second
… is now only the UI portion and doesn't do things like actually pause the game, and only calls actions and hides itself, whereas Player actually pauses the game and brings up the pause overlay in the first place
…er.Pause, added very basic implementation of the progress bar
…seButton color(why was that even there?), fixed the triangles on PauseButton not masking to the sheared container, made PauseButton call it's action on MouseUp instead of MouseDown to match stable
…lour of PauseButton to fix an issue where the background gray is visible when the pause overlay is fading out
…how the player can click through the pause menu onto the Playfield(only partially works, upstream changes need to be made for full functionality), made Retry default to Resume until retrying is implemented, minor cleanups
… it so the user couldn't double click the pause buttons and made it so the action wasn't called a second time when the mouse button was released, made PopIn and PopOut in PauseOverlay one line each, made Player.IsPaused a public getter with a private getter/setter, implemented restarting in Player
…g, made the retry counter in PauseOverlay have the number bolded, made it so if the player presses escape before the clock is started in Player then Exit is called instead of Pause
| Width = 100, | ||
| Height = 50, | ||
| Colour = Color4.Black, | ||
| Action = (delegate { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| Width = 100, | ||
| Height = 50, | ||
| Colour = Color4.Black, | ||
| Action = (() => pauseOverlay.Show()) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| }); | ||
| } | ||
|
|
||
| public PauseButton() |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| } | ||
| } | ||
|
|
||
| public enum PauseButtonType |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| flash.Expire(); | ||
| } | ||
|
|
||
| private void reapplyGlow() |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
|
||
| private void reapplyGlow() | ||
| { | ||
| if (leftGlow == null || centerGlow == null || rightGlow == null) return; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| }, | ||
| new SpriteText | ||
| { | ||
| Text = @"you're not going to do what i think you're going to do, ain't ya?", |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| Type = EdgeEffectType.Shadow, | ||
| Colour = new Color4(0, 0, 0, 150), | ||
| Radius = 50, | ||
| Offset = new Vector2(0, 0), |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| EdgeEffect = new EdgeEffect | ||
| { | ||
| Type = EdgeEffectType.Shadow, | ||
| Colour = new Color4(0, 0, 0, 150), |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| public class PauseOverlay : OverlayContainer | ||
| { | ||
| private const int transitionDuration = 200; | ||
| private const int buttonHeight = 70; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| { | ||
| public class PauseOverlay : OverlayContainer | ||
| { | ||
| private const int transitionDuration = 200; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| { | ||
| private const int transitionDuration = 200; | ||
| private const int buttonHeight = 70; | ||
| private const float backgroundAlpha = 0.75f; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| switch (args.Key) | ||
| { | ||
| case Key.Escape: | ||
| if (State == Visibility.Hidden) return false; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| { | ||
| case Key.Escape: | ||
| if (State == Visibility.Hidden) return false; | ||
| Hide(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| Height = buttonHeight, | ||
| Action = delegate | ||
| { | ||
| Hide(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| // "You've retried 1,065 times in this session" | ||
| // "You've retried 1 time in this session" | ||
|
|
||
| string leading = "You've retried "; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| SetRetries(0); | ||
| } | ||
|
|
||
| public void SetRetries(int count) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| } | ||
| } | ||
|
|
||
| public PauseOverlay() |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| { | ||
| Delay(400); | ||
| Schedule(() => | ||
| { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| Resume(); | ||
| }); | ||
| }; | ||
| pauseOverlay.OnRetry = Restart; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| switch (args.Key) | ||
| { | ||
| case Key.Escape: | ||
| if (!IsPaused && clockWasStarted) // For if the user presses escape quickly when entering the map |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| Schedule(() => | ||
| { | ||
| sourceClock.Start(); | ||
| clockWasStarted = true; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
…d pause overlay displaying be handled in OnExiting instead of OnKeyDown, removed clockWasStarted and used sourceClock.IsRunning instead
| private double pauseCooldown = 1000; | ||
| private double lastPauseActionTime = 0; | ||
|
|
||
| private bool canPause |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Adds the UI, implementation with Player and support for pausing/retrying within Player. Player can still interact with hit objects while paused but I was told to leave this for now. Progress graph will be in another PR.