-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fix replay/spectator scroll text not toggling with Ctrl+H #37027
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
166992e
Remove unused variable
peppy d00003f
Move replay overlays out of `HUD` and `Player`
peppy 8b5acf0
Ensure fades from player-wide overlays apply to all components by enf…
peppy e914576
Merge branch 'master' into fix-scrolling-text-under-skin
peppy 545e195
Upddate cinema mod implementation to handle new structure
peppy 3f60411
Fix controls always being interactive even when hidden
peppy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. | ||
| // See the LICENCE file in the repository root for full licence text. | ||
|
|
||
| using osu.Framework.Allocation; | ||
| using osu.Framework.Bindables; | ||
| using osu.Framework.Graphics; | ||
| using osu.Framework.Graphics.Containers; | ||
| using osu.Framework.Input.Bindings; | ||
| using osu.Framework.Input.Events; | ||
| using osu.Game.Configuration; | ||
| using osu.Game.Input.Bindings; | ||
|
|
||
| namespace osu.Game.Screens.Play.HUD | ||
| { | ||
| public partial class ReplayOverlay : CompositeDrawable, IKeyBindingHandler<GlobalAction> | ||
| { | ||
| public ReplaySettingsOverlay Settings { get; private set; } = null!; | ||
|
|
||
| private const int fade_duration = 200; | ||
|
|
||
| private Bindable<bool> configSettingsOverlay = null!; | ||
| private Container messageContainer = null!; | ||
|
|
||
| [BackgroundDependencyLoader] | ||
| private void load(OsuConfigManager config) | ||
| { | ||
| RelativeSizeAxes = Axes.Both; | ||
| AlwaysPresent = true; | ||
| Alpha = 0; | ||
|
|
||
| configSettingsOverlay = config.GetBindable<bool>(OsuSetting.ReplaySettingsOverlay); | ||
|
|
||
| InternalChild = new Container | ||
| { | ||
| RelativeSizeAxes = Axes.Both, | ||
| Children = new Drawable[] | ||
| { | ||
| messageContainer = new Container | ||
| { | ||
| RelativeSizeAxes = Axes.Both, | ||
| Depth = float.MaxValue, | ||
| }, | ||
| Settings = new ReplaySettingsOverlay(), | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| protected override void LoadComplete() | ||
| { | ||
| base.LoadComplete(); | ||
| configSettingsOverlay.BindValueChanged(_ => updateVisibility(), true); | ||
| } | ||
|
|
||
| private void updateVisibility() | ||
| { | ||
| if (configSettingsOverlay.Value) | ||
| Show(); | ||
| else | ||
| Hide(); | ||
| } | ||
|
|
||
| public bool OnPressed(KeyBindingPressEvent<GlobalAction> e) | ||
| { | ||
| if (e.Repeat) | ||
| return false; | ||
|
|
||
| switch (e.Action) | ||
| { | ||
| case GlobalAction.ToggleReplaySettings: | ||
| configSettingsOverlay.Value = !configSettingsOverlay.Value; | ||
| return true; | ||
| } | ||
|
|
||
| return false; | ||
| } | ||
|
|
||
| public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e) | ||
| { | ||
| } | ||
|
|
||
| public override void Show() => this.FadeIn(fade_duration, Easing.OutQuint); | ||
| public override void Hide() => this.FadeOut(fade_duration, Easing.OutQuint); | ||
|
|
||
| public void SetMessage(ScrollingMessage scrollingMessage) => messageContainer.Child = scrollingMessage; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still an issue, as it will hide not only the settings overlay but the scrolling text too, which is important because that's the only visual indication as to who's who on the screen.
is a possible alternative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or it may be easier to incorporate #37164 into this PR since the two will conflict almost instantaneously. This one is removing the virtual method that one is trying to override.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'd probably be changing that PR to make the text there always visible, not part of this overlay, or something. Will revisit once this is merged, or feel free to do so for me 😅
Can apply your patch above if you want to keep master in a good state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll just merge as is since it's not going to get lost in merge conflict resolution anyway.