mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 23:12:55 +08:00
Fix links not working due to rewrite regression
This commit is contained in:
parent
f526d66969
commit
6cd6ca432c
@ -77,6 +77,7 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
changelogContentGroup.GenerateText(changelogBuild.ChangelogEntries);
|
changelogContentGroup.GenerateText(changelogBuild.ChangelogEntries);
|
||||||
changelogContentGroup.UpdateChevronTooltips(changelogBuild.Versions.Previous?.DisplayVersion,
|
changelogContentGroup.UpdateChevronTooltips(changelogBuild.Versions.Previous?.DisplayVersion,
|
||||||
changelogBuild.Versions.Next?.DisplayVersion);
|
changelogBuild.Versions.Next?.DisplayVersion);
|
||||||
|
changelogContentGroup.BuildSelected += OnBuildSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnBuildSelected(string updateStream, string version, EventArgs args)
|
protected virtual void OnBuildSelected(string updateStream, string version, EventArgs args)
|
||||||
|
@ -26,7 +26,9 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
private readonly SpriteIcon chevron;
|
private readonly SpriteIcon chevron;
|
||||||
private readonly TextBadgePairRelease releaseStream;
|
private readonly TextBadgePairRelease releaseStream;
|
||||||
|
|
||||||
public Action ListingActivated;
|
public delegate void ListingSelectedEventHandler();
|
||||||
|
|
||||||
|
public event ListingSelectedEventHandler ListingSelected;
|
||||||
|
|
||||||
private const float cover_height = 280;
|
private const float cover_height = 280;
|
||||||
private const float title_height = 50;
|
private const float title_height = 50;
|
||||||
@ -127,7 +129,7 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
Margin = new MarginPadding
|
Margin = new MarginPadding
|
||||||
{
|
{
|
||||||
Top = 10,
|
Top = 10,
|
||||||
Left = 7,
|
Left = 15,
|
||||||
Right = 18,
|
Right = 18,
|
||||||
Bottom = 15,
|
Bottom = 15,
|
||||||
},
|
},
|
||||||
@ -157,6 +159,7 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
listing.Activated += OnListingSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowBuild(string displayName, string displayVersion)
|
public void ShowBuild(string displayName, string displayVersion)
|
||||||
@ -175,6 +178,11 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
chevron.MoveToX(-20, 100).FadeOut(100);
|
chevron.MoveToX(-20, 100).FadeOut(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual void OnListingSelected(object source, EventArgs e)
|
||||||
|
{
|
||||||
|
ListingSelected?.Invoke();
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
|
@ -20,8 +20,10 @@ namespace osu.Game.Overlays.Changelog.Header
|
|||||||
protected LineBadge LineBadge;
|
protected LineBadge LineBadge;
|
||||||
public bool IsActivated { get; protected set; }
|
public bool IsActivated { get; protected set; }
|
||||||
|
|
||||||
public Action OnActivation;
|
public delegate void ActivatedEventHandler(object source, EventArgs args);
|
||||||
public Action OnDeactivation;
|
|
||||||
|
public event ActivatedEventHandler Activated;
|
||||||
|
|
||||||
private SampleChannel sampleHover;
|
private SampleChannel sampleHover;
|
||||||
protected SampleChannel SampleActivate;
|
protected SampleChannel SampleActivate;
|
||||||
|
|
||||||
@ -120,6 +122,17 @@ namespace osu.Game.Overlays.Changelog.Header
|
|||||||
return base.OnHover(state);
|
return base.OnHover(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool OnClick(InputState state)
|
||||||
|
{
|
||||||
|
OnActivated();
|
||||||
|
return base.OnClick(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void OnActivated()
|
||||||
|
{
|
||||||
|
Activated?.Invoke(this, EventArgs.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
{
|
{
|
||||||
|
@ -32,21 +32,21 @@ namespace osu.Game.Overlays.Changelog.Header
|
|||||||
|
|
||||||
public override void Activate()
|
public override void Activate()
|
||||||
{
|
{
|
||||||
|
if (IsActivated)
|
||||||
|
return;
|
||||||
IsActivated = true;
|
IsActivated = true;
|
||||||
LineBadge.Uncollapse();
|
LineBadge.Uncollapse();
|
||||||
Text.Font = "Exo2.0-Bold";
|
Text.Font = "Exo2.0-Bold";
|
||||||
SetTextColour(Color4.White, 100);
|
SetTextColour(Color4.White, 100);
|
||||||
SampleActivate?.Play();
|
SampleActivate?.Play();
|
||||||
OnActivation?.Invoke();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Deactivate()
|
public override void Deactivate()
|
||||||
{
|
{
|
||||||
IsActivated = false;
|
IsActivated = false;
|
||||||
LineBadge.Collapse();
|
LineBadge.Collapse();
|
||||||
Text.Font = "Exo2.0-Regular"; // commented out since it makes bad resize-jumping
|
Text.Font = "Exo2.0-Regular";
|
||||||
SetTextColour(badgeColour, 100);
|
SetTextColour(badgeColour, 100);
|
||||||
OnDeactivation?.Invoke();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnClick(InputState state)
|
protected override bool OnClick(InputState state)
|
||||||
|
@ -30,14 +30,12 @@ namespace osu.Game.Overlays.Changelog.Header
|
|||||||
ShowText(transition_duration, displayText);
|
ShowText(transition_duration, displayText);
|
||||||
IsActivated = true;
|
IsActivated = true;
|
||||||
SampleActivate?.Play();
|
SampleActivate?.Play();
|
||||||
OnActivation?.Invoke();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Deactivate()
|
public override void Deactivate()
|
||||||
{
|
{
|
||||||
IsActivated = false;
|
IsActivated = false;
|
||||||
HideText(transition_duration);
|
HideText(transition_duration);
|
||||||
OnDeactivation?.Invoke();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,8 +79,9 @@ namespace osu.Game.Overlays
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
header.ListingSelected += FetchAndShowListing;
|
||||||
badges.Selected += onBuildSelected;
|
badges.Selected += onBuildSelected;
|
||||||
header.ListingActivated += FetchAndShowListing;
|
content.BuildSelected += onBuildSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
// receive input outside our bounds so we can trigger a close event on ourselves.
|
// receive input outside our bounds so we can trigger a close event on ourselves.
|
||||||
@ -152,6 +153,9 @@ namespace osu.Game.Overlays
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void FetchAndShowBuild(string updateStream, string version, bool sentByBadges = false)
|
public void FetchAndShowBuild(string updateStream, string version, bool sentByBadges = false)
|
||||||
{
|
{
|
||||||
|
//// I should probably change this to take APIChangelog as an argument,
|
||||||
|
//// instantly update the header and badge, and if it doesn't contain the
|
||||||
|
//// needed info, just subscribe to when the info will be available
|
||||||
isAtListing = false;
|
isAtListing = false;
|
||||||
var req = new GetChangelogBuildRequest(updateStream, version);
|
var req = new GetChangelogBuildRequest(updateStream, version);
|
||||||
if (!sentByBadges)
|
if (!sentByBadges)
|
||||||
|
Loading…
Reference in New Issue
Block a user