Skip to content

Commit b77b874

Browse files
committed
release: Remove sponsorship & improve unsigned install support.
1 parent f3b24af commit b77b874

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/Flarial.Launcher/Controls/PromotionImageButton.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using Flarial.Launcher.Xaml;
23
using Windows.UI.Core;
34
using Windows.UI.Xaml;
@@ -11,8 +12,8 @@ namespace Flarial.Launcher.Controls;
1112

1213
abstract class PromotionImageButton : XamlElement<Image>
1314
{
14-
protected abstract string ImageUri { get; }
15-
protected abstract string NavigateUri { get; }
15+
protected abstract string? ImageUri { get; }
16+
protected abstract string? NavigateUri { get; }
1617

1718
static readonly CoreCursor _hand = new(CoreCursorType.Hand, 0);
1819
static readonly CoreCursor _arrow = new(CoreCursorType.Arrow, 0);
@@ -25,8 +26,8 @@ protected PromotionImageButton() : base(new())
2526

2627
(~this).Source = new BitmapImage
2728
{
28-
UriSource = new(ImageUri),
29-
DecodePixelType = DecodePixelType.Logical
29+
DecodePixelType = DecodePixelType.Logical,
30+
UriSource = ImageUri is { } ? new(ImageUri) : null
3031
};
3132

3233
(~this).ImageOpened += OnImageOpened;
@@ -51,12 +52,19 @@ unsafe static void OnImagePointerPressed(object sender, RoutedEventArgs args)
5152
static void OnImagePointerExited(object sender, RoutedEventArgs args) => CoreWindow.GetForCurrentThread().PointerCursor = _arrow;
5253
}
5354

55+
sealed class StubImageButton : PromotionImageButton
56+
{
57+
protected override string ImageUri => null!;
58+
protected override string NavigateUri => null!;
59+
}
60+
5461
sealed class LiteByteHostingImageButton : PromotionImageButton
5562
{
5663
protected override string ImageUri => "https://litebyte.co/images/flarial.png";
5764
protected override string NavigateUri => "https://litebyte.co/minecraft?utm_source=flarial-client&utm_medium=app&utm_campaign=bedrock-launch";
5865
}
5966

67+
[Obsolete("", true)]
6068
sealed class CollapseNetworkImageButton : PromotionImageButton
6169
{
6270
protected override string ImageUri => "https://collapsemc.com/assets/other/ad-banner.png";

src/Flarial.Launcher/Pages/HomePage.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ sealed class HomePage : Grid
5757
readonly ApplicationSettings _settings;
5858

5959
readonly PromotionImageButton _leftImageButton = new LiteByteHostingImageButton();
60-
readonly PromotionImageButton _rightImageButton = new CollapseNetworkImageButton();
61-
readonly PromotionImageButton _centerImageButton = new InfinityNetworkImageButton();
60+
readonly PromotionImageButton _centerImageButton = new StubImageButton();
61+
readonly PromotionImageButton _rightImageButton = new InfinityNetworkImageButton();
6262

6363
UnsupportedVersionDialog UnsupportedVersion
6464
{

0 commit comments

Comments
 (0)