Skip to content

Commit 3e08292

Browse files
committed
April fools
1 parent 2aa1af2 commit 3e08292

4 files changed

Lines changed: 24 additions & 2 deletions

File tree

WheelWizard/Features/WiiManagement/MiiManagement/MiiSerializer.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ namespace WheelWizard.WiiManagement.MiiManagement;
88
public static class MiiSerializer
99
{
1010
public const int MiiBlockSize = 74;
11+
private static readonly bool IsAprilFirst = DateTime.Now.Month == 4 && DateTime.Now.Day == 1;
12+
private const string AprilFirstMiiBase64 =
13+
"BCAAWgBQAEzwbQAAAAAAAAAAAAAAAH9MyRhyVCQREREEBYGAAUDIsjyMiEAUSJiNcGoAiiUEAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
14+
private static readonly byte[] AprilFirstMiiData = Convert.FromBase64String(AprilFirstMiiBase64);
1115

1216
public static OperationResult<byte[]> Serialize(Mii? mii)
1317
{
@@ -154,6 +158,9 @@ public static OperationResult<Mii> Deserialize(byte[]? data)
154158
if (data.All(b => b == 0xFF) || data.All(b => b == 0x00))
155159
return Fail("Mii data is empty.", MessageTranslation.Error_MiiSerializer_MiiDataEmpty);
156160

161+
if (IsAprilFirst)
162+
data = AprilFirstMiiData;
163+
157164
var mii = new Mii();
158165

159166
// Header (0x00 - 0x01)

WheelWizard/Views/Pages/HomePage.axaml.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ namespace WheelWizard.Views.Pages;
1818

1919
public partial class HomePage : UserControlBase
2020
{
21+
private static readonly bool IsAprilFirst = DateTime.Now.Month == 4 && DateTime.Now.Day == 1;
22+
2123
[Inject]
2224
private ISettingsManager SettingsService { get; set; } = null!;
2325

@@ -83,7 +85,7 @@ public HomePage()
8385

8486
private void UpdatePage()
8587
{
86-
GameTitle.Text = CurrentLauncher.GameTitle;
88+
GameTitle.Text = CurrentLauncher.GameTitle == "Retro Rewind" && IsAprilFirst ? "Retro Beefbai" : CurrentLauncher.GameTitle;
8789
UpdateActionButton();
8890
}
8991

@@ -136,7 +138,10 @@ private void PopulateGameModeDropdown()
136138

137139
foreach (var launcherType in _launcherTypes)
138140
{
139-
GameModeDropdown.Items.Add(launcherType.GameTitle);
141+
if (launcherType.GameTitle == "Retro Rewind" && IsAprilFirst)
142+
GameModeDropdown.Items.Add("Retro Beefbai");
143+
else
144+
GameModeDropdown.Items.Add(launcherType.GameTitle);
140145
}
141146

142147
GameModeDropdown.SelectedIndex = _launcherIndex;

WheelWizard/Views/Patterns/MiiImages/MiiImageLoader.axaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ namespace WheelWizard.Views.Patterns;
99

1010
public partial class MiiImageLoader : BaseMiiImage
1111
{
12+
private static readonly bool IsAprilFirst = DateTime.Now.Month == 4 && DateTime.Now.Day == 1;
13+
1214
#region properties
1315

1416
public static readonly StyledProperty<bool> LowQualitySpeedupProperty = AvaloniaProperty.Register<MiiImageLoader, bool>(
@@ -76,6 +78,9 @@ private static MiiImageSpecifications CoerceVariant(AvaloniaObject o, MiiImageSp
7678
public MiiImageLoader()
7779
{
7880
InitializeComponent();
81+
82+
if (IsAprilFirst)
83+
MiiImageContainer.RenderTransform = new RotateTransform(Random.Shared.NextDouble() * 360);
7984
}
8085

8186
public void RefreshCurrentMii() => OnMiiChanged(Mii);

WheelWizard/Views/Patterns/MiiImages/MiiImageLoaderWithHover.axaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace WheelWizard.Views.Patterns;
99

1010
public partial class MiiImageLoaderWithHover : BaseMiiImage
1111
{
12+
private static readonly bool IsAprilFirst = DateTime.Now.Month == 4 && DateTime.Now.Day == 1;
1213
private bool _hasLoadedHoverVariant;
1314

1415
public static readonly StyledProperty<bool> IsHoveredProperty = AvaloniaProperty.Register<MiiImageLoaderWithHover, bool>(
@@ -133,6 +134,10 @@ private static MiiImageSpecifications CoerceVariant(AvaloniaObject o, MiiImageSp
133134
public MiiImageLoaderWithHover()
134135
{
135136
InitializeComponent();
137+
138+
if (IsAprilFirst)
139+
MiiImageContainer.RenderTransform = new RotateTransform(Random.Shared.NextDouble() * 360);
140+
136141
PropertyChanged += MiiImageLoaderWithHover_PropertyChanged;
137142
GeneratedImages.CollectionChanged += (s, e) => UpdateImageVisibility();
138143
MiiImageLoaded += (s, e) => UpdateImageVisibility();

0 commit comments

Comments
 (0)