mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 22:22:55 +08:00
Merge pull request #24461 from Joehuu/changelog-entry-links
This commit is contained in:
commit
e13eb7588d
@ -154,7 +154,14 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
Type = ChangelogEntryType.Misc,
|
Type = ChangelogEntryType.Misc,
|
||||||
Category = "Code quality",
|
Category = "Code quality",
|
||||||
Title = "Clean up another thing"
|
Title = "Clean up another thing"
|
||||||
}
|
},
|
||||||
|
new APIChangelogEntry
|
||||||
|
{
|
||||||
|
Type = ChangelogEntryType.Add,
|
||||||
|
Category = "osu!",
|
||||||
|
Title = "Add entry with news url",
|
||||||
|
Url = "https://osu.ppy.sh/home/news/2023-07-27-summer-splash"
|
||||||
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
|
using osu.Game.Online;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
@ -29,6 +30,9 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private OverlayColourProvider colourProvider { get; set; } = null!;
|
private OverlayColourProvider colourProvider { get; set; } = null!;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private ILinkHandler? linkHandler { get; set; }
|
||||||
|
|
||||||
private FontUsage fontLarge;
|
private FontUsage fontLarge;
|
||||||
private FontUsage fontMedium;
|
private FontUsage fontMedium;
|
||||||
|
|
||||||
@ -86,11 +90,21 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(entry.Url))
|
||||||
|
{
|
||||||
title.AddText(entry.Title, t =>
|
title.AddText(entry.Title, t =>
|
||||||
{
|
{
|
||||||
t.Font = fontLarge;
|
t.Font = fontLarge;
|
||||||
t.Colour = entryColour;
|
t.Colour = entryColour;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
title.AddLink(entry.Title, () => linkHandler?.HandleLink(entry.Url), entry.Url, t =>
|
||||||
|
{
|
||||||
|
t.Font = fontLarge;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(entry.Repository) && !string.IsNullOrEmpty(entry.GithubUrl))
|
if (!string.IsNullOrEmpty(entry.Repository) && !string.IsNullOrEmpty(entry.GithubUrl))
|
||||||
addRepositoryReference(title, entryColour);
|
addRepositoryReference(title, entryColour);
|
||||||
|
Loading…
Reference in New Issue
Block a user