Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Dec 19, 2023
2 parents a0ae56f + 1ebb626 commit dd9496a
Show file tree
Hide file tree
Showing 15 changed files with 169 additions and 64 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
29 changes: 16 additions & 13 deletions osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,26 @@ public static int GetColumnCount(LegacyBeatmapConversionDifficultyInfo difficult
{
double roundedCircleSize = Math.Round(difficulty.CircleSize);

if (new ManiaRuleset().RulesetInfo.Equals(difficulty.SourceRuleset))
if (difficulty.SourceRuleset.ShortName == ManiaRuleset.SHORT_NAME)
return (int)Math.Max(1, roundedCircleSize);

double roundedOverallDifficulty = Math.Round(difficulty.OverallDifficulty);

int countSliderOrSpinner = difficulty.EndTimeObjectCount;

// In osu!stable, this division appears as if it happens on floats, but due to release-mode
// optimisations, it actually ends up happening on doubles.
double percentSpecialObjects = (double)countSliderOrSpinner / difficulty.TotalObjectCount;

if (percentSpecialObjects < 0.2)
return 7;
if (percentSpecialObjects < 0.3 || roundedCircleSize >= 5)
return roundedOverallDifficulty > 5 ? 7 : 6;
if (percentSpecialObjects > 0.6)
return roundedOverallDifficulty > 4 ? 5 : 4;
if (difficulty.TotalObjectCount > 0 && difficulty.EndTimeObjectCount >= 0)
{
int countSliderOrSpinner = difficulty.EndTimeObjectCount;

// In osu!stable, this division appears as if it happens on floats, but due to release-mode
// optimisations, it actually ends up happening on doubles.
double percentSpecialObjects = (double)countSliderOrSpinner / difficulty.TotalObjectCount;

if (percentSpecialObjects < 0.2)
return 7;
if (percentSpecialObjects < 0.3 || roundedCircleSize >= 5)
return roundedOverallDifficulty > 5 ? 7 : 6;
if (percentSpecialObjects > 0.6)
return roundedOverallDifficulty > 4 ? 5 : 4;
}

return Math.Max(4, Math.Min((int)roundedOverallDifficulty + 1, 7));
}
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: 0 additions & 4 deletions osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,6 @@ public void TestSelectionRetainedOnBeatmapUpdate()
manager.Import(testBeatmapSetInfo);
}, 10);

AddStep("Force realm refresh", () => Realm.Run(r => r.Refresh()));

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

Task<Live<BeatmapSetInfo>?> updateTask = null!;
Expand All @@ -478,8 +476,6 @@ public void TestSelectionRetainedOnBeatmapUpdate()
});
AddUntilStep("wait for update completion", () => updateTask.IsCompleted);

AddStep("Force realm refresh", () => Realm.Run(r => r.Refresh()));

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

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
2 changes: 1 addition & 1 deletion osu.Game/BackgroundDataStoreProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private void processBeatmapsWithMissingObjectCounts()

realmAccess.Run(r =>
{
foreach (var b in r.All<BeatmapInfo>().Where(b => b.TotalObjectCount == 0))
foreach (var b in r.All<BeatmapInfo>().Where(b => b.TotalObjectCount < 0 || b.EndTimeObjectCount < 0))
beatmapIds.Add(b.ID);
});

Expand Down
4 changes: 2 additions & 2 deletions osu.Game/Beatmaps/BeatmapInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ public BeatmapOnlineStatus Status
[JsonIgnore]
public bool Hidden { get; set; }

public int EndTimeObjectCount { get; set; }
public int EndTimeObjectCount { get; set; } = -1;

public int TotalObjectCount { get; set; }
public int TotalObjectCount { get; set; } = -1;

/// <summary>
/// Reset any fetched online linking information (and history).
Expand Down
3 changes: 3 additions & 0 deletions osu.Game/Beatmaps/IBeatmapInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ public interface IBeatmapInfo : IHasOnlineID<int>, IEquatable<IBeatmapInfo>

/// <summary>
/// The basic star rating for this beatmap (with no mods applied).
/// Defaults to -1 (meaning not-yet-calculated).
/// </summary>
double StarRating { get; }

/// <summary>
/// The number of hitobjects in the beatmap with a distinct end time.
/// Defaults to -1 (meaning not-yet-calculated).
/// </summary>
/// <remarks>
/// Canonically, these are hitobjects are either sliders or spinners.
Expand All @@ -72,6 +74,7 @@ public interface IBeatmapInfo : IHasOnlineID<int>, IEquatable<IBeatmapInfo>

/// <summary>
/// The total number of hitobjects in the beatmap.
/// Defaults to -1 (meaning not-yet-calculated).
/// </summary>
int TotalObjectCount { get; }
}
Expand Down
17 changes: 16 additions & 1 deletion osu.Game/Database/RealmAccess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ public class RealmAccess : IDisposable
/// 35 2023-10-16 Clear key combinations of keybindings that are assigned to more than one action in a given settings section.
/// 36 2023-10-26 Add LegacyOnlineID to ScoreInfo. Move osu_scores_*_high IDs stored in OnlineID to LegacyOnlineID. Reset anomalous OnlineIDs.
/// 38 2023-12-10 Add EndTimeObjectCount and TotalObjectCount to BeatmapInfo.
/// 39 2023-12-19 Migrate any EndTimeObjectCount and TotalObjectCount values of 0 to -1 to better identify non-calculated values.
/// </summary>
private const int schema_version = 38;
private const int schema_version = 39;

/// <summary>
/// Lock object which is held during <see cref="BlockAllOperations"/> sections, blocking realm retrieval during blocking periods.
Expand Down Expand Up @@ -1095,6 +1096,20 @@ void convertOnlineIDs<T>() where T : RealmObject

break;
}

case 39:
foreach (var b in migration.NewRealm.All<BeatmapInfo>())
{
// Either actually no objects, or processing ran and failed.
// Reset to -1 so the next time they become zero we know that processing was attempted.
if (b.TotalObjectCount == 0 && b.EndTimeObjectCount == 0)
{
b.TotalObjectCount = -1;
b.EndTimeObjectCount = -1;
}
}

break;
}

Logger.Log($"Migration completed in {stopwatch.ElapsedMilliseconds}ms");
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
23 changes: 16 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 @@ -510,9 +512,9 @@ private void updateCustomisationVisualState()
TopLevelContent.MoveToY(-modAreaHeight, transition_duration, Easing.InOutCubic);

if (customisationVisible.Value)
GetContainingInputManager().ChangeFocus(modSettingsArea);
SearchTextBox.KillFocus();
else
Scheduler.Add(() => GetContainingInputManager().ChangeFocus(null));
setTextBoxFocus(textBoxShouldFocus);
}

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

if (textSearchStartsActive.Value)
SearchTextBox.HoldFocus = true;
setTextBoxFocus(textSearchStartsActive.Value);
}

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

// TODO: should probably eventually support typical platform search shortcuts (`Ctrl-F`, `/`)
SearchTextBox.HoldFocus = !SearchTextBox.HoldFocus;
if (SearchTextBox.HoldFocus)
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
Loading

0 comments on commit dd9496a

Please sign in to comment.