Add easter egg

This commit is contained in:
jvyden 2021-10-18 14:20:46 -04:00
commit 61bf5d5686
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
3 changed files with 20 additions and 3 deletions

View file

@ -0,0 +1,16 @@
using System;
namespace UnionPatcher.Gui {
public static class EasterEgg {
private static bool? restitch = null;
public static bool Restitch {
get {
if(restitch == null) {
return (bool)(restitch = new Random().Next(1, 10_000) == 1);
}
return (bool)restitch;
}
}
}
}

View file

@ -48,7 +48,7 @@ namespace UnionPatcher.Gui {
public Control CreatePatchButton(int tabIndex = 0) { public Control CreatePatchButton(int tabIndex = 0) {
Button control = new() { Button control = new() {
Text = "Patch!", Text = EasterEgg.Restitch ? "Restitch!" : "Patch!",
TabIndex = tabIndex, TabIndex = tabIndex,
}; };
@ -100,7 +100,7 @@ namespace UnionPatcher.Gui {
} }
public MainForm() { public MainForm() {
this.Title = "Union Patcher"; this.Title = EasterEgg.Restitch ? "Union Restitcher" : "Union Patcher";
this.ClientSize = new Size(500, -1); this.ClientSize = new Size(500, -1);
this.Content = new TableLayout { this.Content = new TableLayout {
Spacing = new Size(5,5), Spacing = new Size(5,5),

View file

@ -1,2 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=EBOOT/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> <s:Boolean x:Key="/Default/UserDictionary/Words/=EBOOT/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Restitcher/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>