mirror of
https://github.com/ppy/osu.git
synced 2025-03-10 22:17:20 +08:00
Merge pull request #32222 from zihadmahiuddin/feat/window-title-current-map
Add current beatmap info to window title
This commit is contained in:
commit
97749e188d
@ -421,6 +421,7 @@ namespace osu.Game
|
|||||||
|
|
||||||
SelectedMods.BindValueChanged(modsChanged);
|
SelectedMods.BindValueChanged(modsChanged);
|
||||||
Beatmap.BindValueChanged(beatmapChanged, true);
|
Beatmap.BindValueChanged(beatmapChanged, true);
|
||||||
|
configUserActivity.BindValueChanged(_ => updateWindowTitle());
|
||||||
|
|
||||||
applySafeAreaConsiderations = LocalConfig.GetBindable<bool>(OsuSetting.SafeAreaConsiderations);
|
applySafeAreaConsiderations = LocalConfig.GetBindable<bool>(OsuSetting.SafeAreaConsiderations);
|
||||||
applySafeAreaConsiderations.BindValueChanged(apply => SafeAreaContainer.SafeAreaOverrideEdges = apply.NewValue ? SafeAreaOverrideEdges : Edges.All, true);
|
applySafeAreaConsiderations.BindValueChanged(apply => SafeAreaContainer.SafeAreaOverrideEdges = apply.NewValue ? SafeAreaOverrideEdges : Edges.All, true);
|
||||||
@ -828,6 +829,35 @@ namespace osu.Game
|
|||||||
{
|
{
|
||||||
beatmap.OldValue?.CancelAsyncLoad();
|
beatmap.OldValue?.CancelAsyncLoad();
|
||||||
beatmap.NewValue?.BeginAsyncLoad();
|
beatmap.NewValue?.BeginAsyncLoad();
|
||||||
|
updateWindowTitle();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateWindowTitle()
|
||||||
|
{
|
||||||
|
if (Host.Window == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
string newTitle;
|
||||||
|
|
||||||
|
switch (configUserActivity.Value)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
newTitle = Name;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case UserActivity.InGame:
|
||||||
|
case UserActivity.TestingBeatmap:
|
||||||
|
case UserActivity.WatchingReplay:
|
||||||
|
newTitle = $"{Name} - {Beatmap.Value.BeatmapInfo.GetDisplayTitleRomanisable(true, false)}";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case UserActivity.EditingBeatmap:
|
||||||
|
newTitle = $"{Name} - {Beatmap.Value.BeatmapInfo.Path ?? "new beatmap"}";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newTitle != Host.Window.Title)
|
||||||
|
Host.Window.Title = newTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void modsChanged(ValueChangedEvent<IReadOnlyList<Mod>> mods)
|
private void modsChanged(ValueChangedEvent<IReadOnlyList<Mod>> mods)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user