Skip to content

Commit

Permalink
Merge branch 'master' into fix-standardised-score-conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
bdach committed Dec 19, 2023
2 parents 3f41c20 + 64b0534 commit 322cfaa
Show file tree
Hide file tree
Showing 12 changed files with 195 additions and 80 deletions.
20 changes: 5 additions & 15 deletions .github/ISSUE_TEMPLATE/bug-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,23 @@ body:
value: |
## Logs
Attaching log files is required for every reported bug. See instructions below on how to find them.
**Logs are reset when you reopen the game.** If the game crashed or has been closed since you found the bug, retrieve the logs using the file explorer instead.
Attaching log files is required for **every** issue, regardless of whether you deem them required or not. See instructions below on how to find them.
### Desktop platforms
If the game has not yet been closed since you found the bug:
1. Head on to game settings and click on "Open osu! folder"
2. Then open the `logs` folder located there
The default places to find the logs on desktop platforms are as follows:
- `%AppData%/osu/logs` *on Windows*
- `~/.local/share/osu/logs` *on Linux*
- `~/Library/Application Support/osu/logs` *on macOS*
1. Head on to game settings and click on "Export logs"
2. Click the notification to locate the file
3. Drag the generated `.zip` files into the github issue window
If you have selected a custom location for the game files, you can find the `logs` folder there.
![export logs button](https://github.com/ppy/osu/assets/191335/cbfa5550-b7ed-4c5c-8dd0-8b87cc90ad9b)
### Mobile platforms
The places to find the logs on mobile platforms are as follows:
- *On Android*, navigate to `Android/data/sh.ppy.osulazer/files/logs` using a file browser app.
- *On iOS*, connect your device to a PC and copy the `logs` directory from the app's document storage using iTunes. (https://support.apple.com/en-us/HT201301#copy-to-computer)
---
After locating the `logs` folder, select all log files inside and drag them into the "Logs" box below.
- type: textarea
attributes:
label: Logs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Linq;
using NUnit.Framework;
using osu.Framework.Screens;
using osu.Game.Audio;
using osu.Game.Beatmaps;
using osu.Game.Replays;
using osu.Game.Rulesets.Judgements;
Expand Down Expand Up @@ -160,6 +161,10 @@ private void performTest(List<ReplayFrame> frames, Action<Slider>? adjustSliderF
Position = new Vector2(256 - slider_path_length / 2, 192),
TickDistanceMultiplier = 3,
ClassicSliderBehaviour = classic,
Samples = new[]
{
new HitSampleInfo(HitSampleInfo.HIT_NORMAL)
},
Path = new SliderPath(PathType.LINEAR, new[]
{
Vector2.Zero,
Expand Down
25 changes: 12 additions & 13 deletions osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ private void load()
foreach (var drawableHitObject in NestedHitObjects)
drawableHitObject.AccentColour.Value = colour.NewValue;
}, true);

Tracking.BindValueChanged(updateSlidingSample);
}

protected override void OnApply()
Expand Down Expand Up @@ -166,14 +164,6 @@ public override void StopAllSamples()
slidingSample?.Stop();
}

private void updateSlidingSample(ValueChangedEvent<bool> tracking)
{
if (tracking.NewValue)
slidingSample?.Play();
else
slidingSample?.Stop();
}

protected override void AddNestedHitObject(DrawableHitObject hitObject)
{
base.AddNestedHitObject(hitObject);
Expand Down Expand Up @@ -238,9 +228,18 @@ protected override void Update()

Tracking.Value = SliderInputManager.Tracking;

if (Tracking.Value && slidingSample != null)
// keep the sliding sample playing at the current tracking position
slidingSample.Balance.Value = CalculateSamplePlaybackBalance(CalculateDrawableRelativePosition(Ball));
if (slidingSample != null)
{
if (Tracking.Value && Time.Current >= HitObject.StartTime)
{
// keep the sliding sample playing at the current tracking position
if (!slidingSample.IsPlaying)
slidingSample.Play();
slidingSample.Balance.Value = CalculateSamplePlaybackBalance(CalculateDrawableRelativePosition(Ball));
}
else if (slidingSample.IsPlaying)
slidingSample.Stop();
}

double completionProgress = Math.Clamp((Time.Current - HitObject.StartTime) / HitObject.Duration, 0, 1);

Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ public void TestSelectionRetainedOnBeatmapUpdate()
manager.Import(testBeatmapSetInfo);
}, 10);

AddUntilStep("has selection", () => songSelect!.Carousel.SelectedBeatmapInfo?.BeatmapSet?.OnlineID == originalOnlineSetID);
AddUntilStep("has selection", () => songSelect!.Carousel.SelectedBeatmapInfo?.BeatmapSet?.OnlineID, () => Is.EqualTo(originalOnlineSetID));

Task<Live<BeatmapSetInfo>?> updateTask = null!;

Expand All @@ -476,7 +476,7 @@ public void TestSelectionRetainedOnBeatmapUpdate()
});
AddUntilStep("wait for update completion", () => updateTask.IsCompleted);

AddUntilStep("retained selection", () => songSelect!.Carousel.SelectedBeatmapInfo?.BeatmapSet?.OnlineID == originalOnlineSetID);
AddUntilStep("retained selection", () => songSelect!.Carousel.SelectedBeatmapInfo?.BeatmapSet?.OnlineID, () => Is.EqualTo(originalOnlineSetID));
}

[Test]
Expand Down
29 changes: 27 additions & 2 deletions osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ void navigateAndClick<T>() where T : Drawable
[Test]
public void TestTextSearchActiveByDefault()
{
configManager.SetValue(OsuSetting.ModSelectTextSearchStartsActive, true);
AddStep("text search starts active", () => configManager.SetValue(OsuSetting.ModSelectTextSearchStartsActive, true));
createScreen();

AddUntilStep("search text box focused", () => modSelectOverlay.SearchTextBox.HasFocus);
Expand All @@ -587,7 +587,7 @@ public void TestTextSearchActiveByDefault()
[Test]
public void TestTextSearchNotActiveByDefault()
{
configManager.SetValue(OsuSetting.ModSelectTextSearchStartsActive, false);
AddStep("text search does not start active", () => configManager.SetValue(OsuSetting.ModSelectTextSearchStartsActive, false));
createScreen();

AddUntilStep("search text box not focused", () => !modSelectOverlay.SearchTextBox.HasFocus);
Expand All @@ -599,6 +599,31 @@ public void TestTextSearchNotActiveByDefault()
AddAssert("search text box unfocused", () => !modSelectOverlay.SearchTextBox.HasFocus);
}

[Test]
public void TestTextSearchDoesNotBlockCustomisationPanelKeyboardInteractions()
{
AddStep("text search starts active", () => configManager.SetValue(OsuSetting.ModSelectTextSearchStartsActive, true));
createScreen();

AddUntilStep("search text box focused", () => modSelectOverlay.SearchTextBox.HasFocus);

AddStep("select DT", () => SelectedMods.Value = new Mod[] { new OsuModDoubleTime() });
AddAssert("DT selected", () => modSelectOverlay.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value), () => Is.EqualTo(1));

AddStep("open customisation area", () => modSelectOverlay.CustomisationButton!.TriggerClick());
assertCustomisationToggleState(false, true);
AddStep("hover over mod settings slider", () =>
{
var slider = modSelectOverlay.ChildrenOfType<ModSettingsArea>().Single().ChildrenOfType<OsuSliderBar<double>>().First();
InputManager.MoveMouseTo(slider);
});
AddStep("press right arrow", () => InputManager.PressKey(Key.Right));
AddAssert("DT speed changed", () => !SelectedMods.Value.OfType<OsuModDoubleTime>().Single().SpeedChange.IsDefault);

AddStep("close customisation area", () => InputManager.PressKey(Key.Escape));
AddUntilStep("search text box reacquired focus", () => modSelectOverlay.SearchTextBox.HasFocus);
}

[Test]
public void TestDeselectAllViaKey()
{
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/OsuGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1190,15 +1190,15 @@ private void forwardGeneralLogsToNotifications()
}
else if (recentLogCount == short_term_display_limit)
{
string logFile = $@"{entry.Target.Value.ToString().ToLowerInvariant()}.log";
string logFile = Logger.GetLogger(entry.Target.Value).Filename;
Schedule(() => Notifications.Post(new SimpleNotification
{
Icon = FontAwesome.Solid.EllipsisH,
Text = NotificationsStrings.SubsequentMessagesLogged,
Activated = () =>
{
Storage.GetStorageForDirectory(@"logs").PresentFileExternally(logFile);
Logger.Storage.PresentFileExternally(logFile);
return true;
}
}));
Expand Down
26 changes: 19 additions & 7 deletions osu.Game/Overlays/Mods/ModSelectOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ protected virtual IEnumerable<ShearedButton> CreateFooterButtons()
protected ShearedToggleButton? CustomisationButton { get; private set; }
protected SelectAllModsButton? SelectAllModsButton { get; set; }

private bool textBoxShouldFocus;

private Sample? columnAppearSample;

private WorkingBeatmap? beatmap;
Expand Down Expand Up @@ -508,6 +510,11 @@ private void updateCustomisationVisualState()

modSettingsArea.ResizeHeightTo(modAreaHeight, transition_duration, Easing.InOutCubic);
TopLevelContent.MoveToY(-modAreaHeight, transition_duration, Easing.InOutCubic);

if (customisationVisible.Value)
SearchTextBox.KillFocus();
else
setTextBoxFocus(textBoxShouldFocus);
}

/// <summary>
Expand Down Expand Up @@ -621,8 +628,7 @@ protected override void PopIn()
nonFilteredColumnCount += 1;
}

if (textSearchStartsActive.Value)
SearchTextBox.TakeFocus();
setTextBoxFocus(textSearchStartsActive.Value);
}

protected override void PopOut()
Expand Down Expand Up @@ -761,14 +767,20 @@ protected override bool OnKeyDown(KeyDownEvent e)
return false;

// TODO: should probably eventually support typical platform search shortcuts (`Ctrl-F`, `/`)
if (SearchTextBox.HasFocus)
SearchTextBox.KillFocus();
else
SearchTextBox.TakeFocus();

setTextBoxFocus(!textBoxShouldFocus);
return true;
}

private void setTextBoxFocus(bool keepFocus)
{
textBoxShouldFocus = keepFocus;

if (textBoxShouldFocus)
SearchTextBox.TakeFocus();
else
SearchTextBox.KillFocus();
}

#endregion

#region Sample playback control
Expand Down
2 changes: 2 additions & 0 deletions osu.Game/Overlays/Mods/ModSettingsArea.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public partial class ModSettingsArea : CompositeDrawable
[Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!;

public override bool AcceptsFocus => true;

public ModSettingsArea()
{
RelativeSizeAxes = Axes.X;
Expand Down
Loading

0 comments on commit 322cfaa

Please sign in to comment.