From 61bf5d56860702cfb9d785c49b8b36410525769f Mon Sep 17 00:00:00 2001 From: jvyden Date: Mon, 18 Oct 2021 14:20:46 -0400 Subject: [PATCH] Add easter egg --- UnionPatcher.Gui/EasterEgg.cs | 16 ++++++++++++++++ UnionPatcher.Gui/MainForm.cs | 4 ++-- UnionPatcher.sln.DotSettings | 3 ++- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 UnionPatcher.Gui/EasterEgg.cs diff --git a/UnionPatcher.Gui/EasterEgg.cs b/UnionPatcher.Gui/EasterEgg.cs new file mode 100644 index 0000000..04d487c --- /dev/null +++ b/UnionPatcher.Gui/EasterEgg.cs @@ -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; + } + } + } +} \ No newline at end of file diff --git a/UnionPatcher.Gui/MainForm.cs b/UnionPatcher.Gui/MainForm.cs index 8501223..9746058 100644 --- a/UnionPatcher.Gui/MainForm.cs +++ b/UnionPatcher.Gui/MainForm.cs @@ -48,7 +48,7 @@ namespace UnionPatcher.Gui { public Control CreatePatchButton(int tabIndex = 0) { Button control = new() { - Text = "Patch!", + Text = EasterEgg.Restitch ? "Restitch!" : "Patch!", TabIndex = tabIndex, }; @@ -100,7 +100,7 @@ namespace UnionPatcher.Gui { } public MainForm() { - this.Title = "Union Patcher"; + this.Title = EasterEgg.Restitch ? "Union Restitcher" : "Union Patcher"; this.ClientSize = new Size(500, -1); this.Content = new TableLayout { Spacing = new Size(5,5), diff --git a/UnionPatcher.sln.DotSettings b/UnionPatcher.sln.DotSettings index 0be9dcc..a0493fc 100644 --- a/UnionPatcher.sln.DotSettings +++ b/UnionPatcher.sln.DotSettings @@ -1,2 +1,3 @@  - True \ No newline at end of file + True + True \ No newline at end of file