This commit is contained in:
Heli-o 2021-05-26 23:16:20 +02:00
commit bf13a515ea
51 changed files with 1549 additions and 0 deletions

Binary file not shown.

25
Catch the button.sln Normal file
View file

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31205.134
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Catch the button", "Catch the button\Catch the button.csproj", "{508CE3FA-02D6-4B7C-AF72-5687FA7810B2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{508CE3FA-02D6-4B7C-AF72-5687FA7810B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{508CE3FA-02D6-4B7C-AF72-5687FA7810B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{508CE3FA-02D6-4B7C-AF72-5687FA7810B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{508CE3FA-02D6-4B7C-AF72-5687FA7810B2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7AC5BAB2-0F09-4ACF-88F7-D493A4CC63A4}
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View file

@ -0,0 +1,122 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{508CE3FA-02D6-4B7C-AF72-5687FA7810B2}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Catch_the_button</RootNamespace>
<AssemblyName>Catch the button</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Leaderboard.cs" />
<Compile Include="Main.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Main.Designer.cs">
<DependentUpon>Main.cs</DependentUpon>
</Compile>
<Compile Include="LeaderDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="LeaderDialog.Designer.cs">
<DependentUpon>LeaderDialog.cs</DependentUpon>
</Compile>
<Compile Include="Game.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Main.resx">
<DependentUpon>Main.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="LeaderDialog.resx">
<DependentUpon>LeaderDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>

151
Catch the button/Game.cs Normal file
View file

@ -0,0 +1,151 @@
using System;
using System.Diagnostics;
using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;
namespace Catch_the_button {
class Game {
static internal int points;
static bool status = false;
static bool first = true;
static int miss;
static Random rng = new Random();
static Stopwatch stpwch = new Stopwatch();
static Timer timer;
static Timer etaUpdater;
static Timer formResetter;
static Label pts;
static Label hp;
static Panel menu;
static Label btn;
static Form frm;
static Label eta;
static Panel[] hp_indicators = new Panel[5];
const int delay = 2000;
static internal void Init(Label opts, Label ohp, Panel omenu, Label obutton,
Form oform, Label oeta) {
pts = opts;
hp = ohp;
menu = omenu;
btn = obutton;
frm = oform;
eta = oeta;
SetTimers();
}
static internal void HealthInit(Panel ohp1, Panel ohp2, Panel ohp3, Panel ohp4) {
hp_indicators[0] = ohp1;
hp_indicators[1] = ohp2;
hp_indicators[2] = ohp3;
hp_indicators[3] = ohp4;
hp_indicators[4] = ohp4;
}
static private void SetTimers() {
timer = new Timer();
timer.Interval = delay;
timer.Tick += Tmr_Tick;
timer.Enabled = true;
timer.Stop();
etaUpdater = new Timer();
etaUpdater.Interval = 20;
etaUpdater.Tick += Updater_Tick;
etaUpdater.Enabled = true;
etaUpdater.Stop();
formResetter = new Timer();
formResetter.Interval = 200;
formResetter.Tick += formResetter_Tick;
formResetter.Enabled = true;
formResetter.Stop();
}
static private void Tmr_Tick(object sender, EventArgs e) {
Hit(new System.Timers.Timer());
}
static private void Updater_Tick(object sender, EventArgs e) {
eta.Text = $"New Position in: {(2000 - stpwch.ElapsedMilliseconds)}ms";
}
static private void formResetter_Tick(object sender, EventArgs e) {
frm.BackColor = Color.FromArgb(240, 240, 240);
formResetter.Stop();
}
static internal void Start() { //pressed button start
points = miss = 0;
btn.Visible = btn.Enabled = true;
menu.Visible = menu.Enabled = false;
btn.Size = new Size(50, 50);
btn.Location = new Point((frm.Width - btn.Width) / 2, (frm.Height - btn.Height) / 2);
status = true;
timer.Interval = delay;
}
static void Go() { //first button hit
timer.Start();
stpwch.Start();
etaUpdater.Start();
newPos();
}
static internal void Hit(object obj = null) {
if (!status) return;
if (first) {
Go();
first = false;
return;
}
if (stpwch.ElapsedMilliseconds < 500 && !(obj is Form || obj is System.Timers.Timer)) {
points += 2;
}
else if (stpwch.ElapsedMilliseconds >= 500 && !(obj is Form || obj is System.Timers.Timer)) {
points++;
}
else if (obj is System.Timers.Timer || obj is Form) {
points--;
miss++;
formResetter.Start();
frm.BackColor = Color.FromArgb(240, 200, 200);
}
UpdateText();
if (miss > 3) {
Stop();
return;
}
stpwch.Restart();
resetTimer();
newPos();
}
static internal void Stop() {
stpwch.Stop();
timer.Stop();
etaUpdater.Stop();
first = true;
status = false;
Leaderboard.Write();
Leaderboard.Output();
points = miss = 0;
UpdateText();
btn.Visible = btn.Enabled = false;
menu.Visible = menu.Enabled = true;
eta.Text = "New Position in: ...";
}
static private void UpdateText() {
pts.Text = "Points: " + points;
hp.Text = "HP: "+(3 - miss).ToString();
}
static void newPos() {
btn.Location = new Point(
rng.Next(frm.ClientSize.Width - btn.Width),
rng.Next(40, frm.ClientSize.Height - btn.Height));
}
static private void resetTimer() {
timer.Stop();
timer.Start();
etaUpdater.Stop();
etaUpdater.Start();
}
}
}

129
Catch the button/LeaderDialog.Designer.cs generated Normal file
View file

@ -0,0 +1,129 @@

namespace Catch_the_button {
partial class LeaderDialog {
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.score = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.name = new System.Windows.Forms.TextBox();
this.submit = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// score
//
this.score.AutoSize = true;
this.score.Font = new System.Drawing.Font("SansSerif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
this.score.Location = new System.Drawing.Point(18, 110);
this.score.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.score.Name = "score";
this.score.Size = new System.Drawing.Size(193, 28);
this.score.TabIndex = 0;
this.score.Text = "Your score is: ...";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(19, 168);
this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(216, 22);
this.label1.TabIndex = 1;
this.label1.Text = "Please enter your name";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(16, 204);
this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(306, 22);
this.label2.TabIndex = 2;
this.label2.Text = "(leave blank to not save the score)";
//
// name
//
this.name.Location = new System.Drawing.Point(21, 252);
this.name.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.name.Name = "name";
this.name.Size = new System.Drawing.Size(350, 30);
this.name.TabIndex = 3;
//
// submit
//
this.submit.Location = new System.Drawing.Point(236, 294);
this.submit.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.submit.Name = "submit";
this.submit.Size = new System.Drawing.Size(135, 55);
this.submit.TabIndex = 4;
this.submit.Text = "Submit";
this.submit.UseVisualStyleBackColor = true;
this.submit.Click += new System.EventHandler(this.submit_Click);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 36F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3.Location = new System.Drawing.Point(57, 24);
this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(272, 55);
this.label3.TabIndex = 5;
this.label3.Text = "Game Over";
//
// LeaderDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 22F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(387, 372);
this.Controls.Add(this.label3);
this.Controls.Add(this.submit);
this.Controls.Add(this.name);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.score);
this.Font = new System.Drawing.Font("SansSerif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.KeyPreview = true;
this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.Name = "LeaderDialog";
this.Text = "Leaderboards";
this.Load += new System.EventHandler(this.Form2_Load);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.LeaderDialog_KeyDown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label score;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox name;
private System.Windows.Forms.Button submit;
private System.Windows.Forms.Label label3;
}
}

View file

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Catch_the_button {
public partial class LeaderDialog : Form {
int points;
Form mainForm;
public LeaderDialog(int points, Form mainForm) {
InitializeComponent();
this.points = points;
this.mainForm = mainForm;
}
private void Form2_Load(object sender, EventArgs e) {
this.Location = new Point(
mainForm.Left+mainForm.Width/2-this.Width/2,
mainForm.Top + mainForm.Height / 2 - this.Height / 2);
score.Text = $"Your score is: {points}";
}
private void submit_Click(object sender, EventArgs e) {
if (name.Text == "") { this.Close(); return; };
LeaderboardEntry newEntry = new LeaderboardEntry(name.Text.Replace(":", ""), points);
Leaderboard.Leaderboards.Add(newEntry);
this.Close();
}
private void LeaderDialog_KeyDown(object sender, KeyEventArgs e) {
if (e.KeyCode == Keys.Enter) submit_Click(null, null);
}
}
}

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using System.Diagnostics;
using System.Linq;
namespace Catch_the_button {
class Leaderboard {
static internal List<LeaderboardEntry> Leaderboards = new List<LeaderboardEntry>();
static internal LeaderboardEntry highscore = new LeaderboardEntry("",0);
static RichTextBox LeaderObject;
static Form form;
static Label highscoreLabel;
static string filename = "leaderboards.txt";
static string root = "./resources/";
static string path = root+filename;
static internal void Init(RichTextBox leaderObject, Form form, Label highscoreLabel) {
LeaderObject = leaderObject;
Leaderboard.form = form;
Leaderboard.highscoreLabel = highscoreLabel;
byte stat = Read();
if (stat == 1) return;
Output();
}
static internal byte Read() {
if (!Directory.Exists(root)) Directory.CreateDirectory(root);
if (!File.Exists(path)) { LeaderObject.Text = "Leaderboards not found"; File.Create(path); return 1; }
if (File.ReadAllLines(path).Length <1) { LeaderObject.Text = "Leaderboards empty. Be the first to place a record"; File.Create(path); return 1; }
string[] preformat = Sort(File.ReadAllLines(path));
Leaderboards.Clear();
for (int i = 0; i < preformat.Length; i++) {
string[] pars = preformat[i].Split(':');
LeaderboardEntry formatted = new LeaderboardEntry(pars[0], Int32.Parse(pars[1]));
Leaderboards.Add(formatted);
}
FindHighScore();
return 0;
}
static internal string[] Sort(string[] input) {
SortedDictionary<Int32, string> carry = new SortedDictionary<Int32, string>();
for (int i = 0; i < input.Length; i++) {
string[] pars = input[i].Split(':');
carry[Int32.Parse(pars[1])] = pars[0];
}
int j = 0;
foreach (KeyValuePair<Int32, string> item in carry) {
input[j] = $"{item.Value}:{item.Key}";
j++;
}
return input.Reverse().ToArray();
}
static private void FindHighScore() {
foreach (LeaderboardEntry entry in Leaderboards) {
if (entry.points > highscore.points) highscore = entry;
}
highscoreLabel.Text = $"{highscore.name}: {highscore.points}";
}
static internal void Output(RichTextBox leaderboardObj = null) {
if (leaderboardObj != null) {
int count = Leaderboards.Count > 5 ? 5 : Leaderboards.Count;
string output = "";
for (int i = 0; i < count; i++) {
output += Leaderboards[i] + "\n";
}
leaderboardObj.Text = output.Substring(0, output.Length - 1);
}
else {
string[] lines = new string[Leaderboards.Count];
for (int i = 0; i< Leaderboards.Count; i++) {
lines[i] = $"{Leaderboards[i].name}: {Leaderboards[i].points}";
}
LeaderObject.Lines = lines;
}
}
static internal void Write() {
Form leaderboardDialog = new LeaderDialog(Game.points, form);
leaderboardDialog.ShowDialog();
string leaderboardtxt = "";
foreach (LeaderboardEntry entry in Leaderboards) {
leaderboardtxt += $"{entry.name}:{entry.points}\n";
}
File.WriteAllText(path, leaderboardtxt.Substring(0, leaderboardtxt.Length - 1));
Read();
}
}
class LeaderboardEntry {
internal string name;
internal int points;
public LeaderboardEntry(string name, int points) {
this.name = name;
this.points = points;
}
}
}

340
Catch the button/Main.Designer.cs generated Normal file
View file

@ -0,0 +1,340 @@

namespace Catch_the_button {
partial class Main {
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.Menu = new System.Windows.Forms.Panel();
this.title = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.highscore = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.ldrboard = new System.Windows.Forms.RichTextBox();
this.quit = new System.Windows.Forms.Button();
this.start = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.ptsCount = new System.Windows.Forms.Label();
this.hp = new System.Windows.Forms.Label();
this.button = new System.Windows.Forms.Label();
this.timeleft = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.stats = new System.Windows.Forms.Panel();
this.Menu.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.stats.SuspendLayout();
this.SuspendLayout();
//
// Menu
//
this.Menu.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.Menu.Controls.Add(this.button);
this.Menu.Controls.Add(this.stats);
this.Menu.Controls.Add(this.label7);
this.Menu.Controls.Add(this.label2);
this.Menu.Controls.Add(this.groupBox1);
this.Menu.Controls.Add(this.title);
this.Menu.Controls.Add(this.label6);
this.Menu.Controls.Add(this.label5);
this.Menu.Controls.Add(this.label4);
this.Menu.Controls.Add(this.quit);
this.Menu.Controls.Add(this.start);
this.Menu.Location = new System.Drawing.Point(0, 0);
this.Menu.Margin = new System.Windows.Forms.Padding(4);
this.Menu.Name = "Menu";
this.Menu.Size = new System.Drawing.Size(961, 521);
this.Menu.TabIndex = 0;
//
// title
//
this.title.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.title.AutoSize = true;
this.title.BackColor = System.Drawing.Color.Transparent;
this.title.Font = new System.Drawing.Font("Consolas", 28.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.title.Location = new System.Drawing.Point(302, 98);
this.title.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.title.Name = "title";
this.title.Size = new System.Drawing.Size(356, 45);
this.title.TabIndex = 0;
this.title.Text = "Catch the Button";
this.title.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label6
//
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("Consolas", 127.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label6.Location = new System.Drawing.Point(388, 16);
this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(178, 200);
this.label6.TabIndex = 11;
this.label6.Text = "2";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label5
//
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(15, 396);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(216, 19);
this.label5.TabIndex = 10;
this.label5.Text = "ESC - quit to main menu";
//
// label4
//
this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(12, 367);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(90, 19);
this.label4.TabIndex = 9;
this.label4.Text = "Controls:";
//
// highscore
//
this.highscore.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.highscore.AutoSize = true;
this.highscore.Location = new System.Drawing.Point(6, 22);
this.highscore.Name = "highscore";
this.highscore.Size = new System.Drawing.Size(81, 19);
this.highscore.TabIndex = 8;
this.highscore.Text = "No Entry";
this.highscore.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label3
//
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(125, -2);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(90, 19);
this.label3.TabIndex = 7;
this.label3.Text = "Highscore";
//
// ldrboard
//
this.ldrboard.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.ldrboard.Cursor = System.Windows.Forms.Cursors.Arrow;
this.ldrboard.ImeMode = System.Windows.Forms.ImeMode.Off;
this.ldrboard.Location = new System.Drawing.Point(0, 21);
this.ldrboard.Name = "ldrboard";
this.ldrboard.ReadOnly = true;
this.ldrboard.Size = new System.Drawing.Size(216, 310);
this.ldrboard.TabIndex = 5;
this.ldrboard.TabStop = false;
this.ldrboard.Text = "...";
//
// quit
//
this.quit.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.quit.Location = new System.Drawing.Point(378, 432);
this.quit.Name = "quit";
this.quit.Size = new System.Drawing.Size(214, 41);
this.quit.TabIndex = 4;
this.quit.Text = "Quit";
this.quit.UseVisualStyleBackColor = true;
this.quit.Click += new System.EventHandler(this.quit_Click);
//
// start
//
this.start.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.start.Location = new System.Drawing.Point(338, 362);
this.start.Name = "start";
this.start.Size = new System.Drawing.Size(290, 64);
this.start.TabIndex = 3;
this.start.Text = "Start";
this.start.UseVisualStyleBackColor = true;
this.start.Click += new System.EventHandler(this.start_Click);
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(108, -1);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(108, 19);
this.label1.TabIndex = 2;
this.label1.Text = "Leaderboard";
//
// ptsCount
//
this.ptsCount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.ptsCount.AutoSize = true;
this.ptsCount.Location = new System.Drawing.Point(843, 6);
this.ptsCount.Name = "ptsCount";
this.ptsCount.Size = new System.Drawing.Size(90, 19);
this.ptsCount.TabIndex = 0;
this.ptsCount.Text = "Points: 0";
//
// hp
//
this.hp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.hp.AutoSize = true;
this.hp.Location = new System.Drawing.Point(783, 6);
this.hp.Name = "hp";
this.hp.Size = new System.Drawing.Size(54, 19);
this.hp.TabIndex = 1001;
this.hp.Text = "HP: 3";
//
// button
//
this.button.Anchor = System.Windows.Forms.AnchorStyles.None;
this.button.BackColor = System.Drawing.Color.LightGray;
this.button.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.button.Cursor = System.Windows.Forms.Cursors.Hand;
this.button.Enabled = false;
this.button.Font = new System.Drawing.Font("SansSerif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
this.button.Location = new System.Drawing.Point(443, 241);
this.button.Name = "button";
this.button.Size = new System.Drawing.Size(50, 50);
this.button.TabIndex = 6;
this.button.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.button.Visible = false;
this.button.Click += new System.EventHandler(this.button_Click);
this.button.MouseEnter += new System.EventHandler(this.button_MouseEnter);
this.button.MouseLeave += new System.EventHandler(this.button_MouseLeave);
//
// timeleft
//
this.timeleft.AutoSize = true;
this.timeleft.Location = new System.Drawing.Point(-1, 5);
this.timeleft.Name = "timeleft";
this.timeleft.Size = new System.Drawing.Size(189, 19);
this.timeleft.TabIndex = 7;
this.timeleft.Text = "New Position in: ...";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.groupBox2);
this.groupBox1.Controls.Add(this.highscore);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Location = new System.Drawing.Point(743, 120);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(215, 398);
this.groupBox1.TabIndex = 12;
this.groupBox1.TabStop = false;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Controls.Add(this.ldrboard);
this.groupBox2.Location = new System.Drawing.Point(0, 65);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(215, 333);
this.groupBox2.TabIndex = 13;
this.groupBox2.TabStop = false;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(47, 209);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(162, 19);
this.label2.TabIndex = 15;
this.label2.Text = "Click the buttons";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(538, 143);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(108, 19);
this.label7.TabIndex = 16;
this.label7.Text = "budget Osu!";
//
// stats
//
this.stats.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.stats.Controls.Add(this.timeleft);
this.stats.Controls.Add(this.hp);
this.stats.Controls.Add(this.ptsCount);
this.stats.Location = new System.Drawing.Point(3, 3);
this.stats.Name = "stats";
this.stats.Size = new System.Drawing.Size(955, 30);
this.stats.TabIndex = 1002;
//
// Main
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 19F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(963, 520);
this.Controls.Add(this.Menu);
this.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.KeyPreview = true;
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "Main";
this.Text = "Catch the Button 2";
this.Load += new System.EventHandler(this.Form1_Load);
this.Click += new System.EventHandler(this.Form1_Click);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Main_KeyDown);
this.Menu.ResumeLayout(false);
this.Menu.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.stats.ResumeLayout(false);
this.stats.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel Menu;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label title;
private System.Windows.Forms.Button quit;
private System.Windows.Forms.Button start;
internal System.Windows.Forms.Label hp;
internal System.Windows.Forms.Label ptsCount;
private System.Windows.Forms.Label button;
private System.Windows.Forms.RichTextBox ldrboard;
private System.Windows.Forms.Label timeleft;
private System.Windows.Forms.Label highscore;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Panel stats;
}
}

59
Catch the button/Main.cs Normal file
View file

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;
namespace Catch_the_button {
public partial class Main : Form {
public Main() {
InitializeComponent();
}
private void start_Click(object sender, EventArgs e) {
Game.Start();
}
private void Form1_Load(object sender, EventArgs e) {
Game.Init(ptsCount, hp, Menu, button, this, timeleft);
Leaderboard.Init(ldrboard, this, highscore);
button.Parent = stats.Parent = this;
}
private void quit_Click(object sender, EventArgs e) {
this.Close();
}
private void button_Click(object sender, EventArgs e) {
Game.Hit();
}
private void Form1_Click(object sender, EventArgs e) {
Game.Hit(obj: sender);
}
private void button_MouseEnter(object sender, EventArgs e) {
button.BackColor = Color.FromArgb(240, 240, 240);
}
private void button_MouseLeave(object sender, EventArgs e) {
button.BackColor = Color.FromArgb(211, 211, 211);
}
private void Main_KeyDown(object sender, KeyEventArgs e) {
switch (e.KeyCode) {
case Keys.Escape:
Game.Stop();
break;
default:
break;
}
}
}
}

120
Catch the button/Main.resx Normal file
View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Catch_the_button {
static class Program {
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Main());
}
}
}

View file

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Catch the button")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Catch the button")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("508ce3fa-02d6-4b7c-af72-5687fa7810b2")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Catch_the_button.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Catch_the_button.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Catch_the_button.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View file

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

Binary file not shown.

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

Binary file not shown.

View file

@ -0,0 +1 @@
test:69

View file

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]

View file

@ -0,0 +1 @@
4ec7a7f8cafda8845629d58d71d67896e75d37b3

View file

@ -0,0 +1,21 @@
C:\Users\helio\source\repos\Catch the button\Catch the button\obj\Debug\Catch_the_button.Properties.Resources.resources
C:\Users\helio\source\repos\Catch the button\Catch the button\obj\Debug\Catch the button.csproj.GenerateResource.cache
C:\Users\helio\source\repos\Catch the button\Catch the button\obj\Debug\Catch the button.csproj.CoreCompileInputs.cache
C:\Users\helio\source\repos\Catch the button\Catch the button\bin\Debug\Catch the button.exe.config
C:\Users\helio\source\repos\Catch the button\Catch the button\bin\Debug\Catch the button.exe
C:\Users\helio\source\repos\Catch the button\Catch the button\bin\Debug\Catch the button.pdb
C:\Users\helio\source\repos\Catch the button\Catch the button\obj\Debug\Catch the button.exe
C:\Users\helio\source\repos\Catch the button\Catch the button\obj\Debug\Catch the button.pdb
C:\Users\vasik\Desktop\Catch the button\Catch the button\obj\Debug\Catch the button.csproj.AssemblyReference.cache
C:\Users\vasik\Desktop\Catch the button\Catch the button\obj\Debug\Catch_the_button.Form1.resources
C:\Users\vasik\Desktop\Catch the button\Catch the button\obj\Debug\Catch_the_button.Properties.Resources.resources
C:\Users\vasik\Desktop\Catch the button\Catch the button\obj\Debug\Catch the button.csproj.GenerateResource.cache
C:\Users\vasik\Desktop\Catch the button\Catch the button\obj\Debug\Catch the button.csproj.CoreCompileInputs.cache
C:\Users\vasik\Desktop\Catch the button\Catch the button\obj\Debug\Catch the button.exe
C:\Users\vasik\Desktop\Catch the button\Catch the button\obj\Debug\Catch the button.pdb
C:\Users\vasik\Desktop\Catch the button\Catch the button\bin\Debug\Catch the button.exe.config
C:\Users\vasik\Desktop\Catch the button\Catch the button\bin\Debug\Catch the button.exe
C:\Users\vasik\Desktop\Catch the button\Catch the button\bin\Debug\Catch the button.pdb
C:\Users\helio\source\repos\Catch the button\Catch the button\obj\Debug\Catch the button.csproj.AssemblyReference.cache
C:\Users\helio\source\repos\Catch the button\Catch the button\obj\Debug\Catch_the_button.Main.resources
C:\Users\helio\source\repos\Catch the button\Catch the button\obj\Debug\Catch_the_button.LeaderDialog.resources

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]

View file

@ -0,0 +1 @@
aabdfd7f744b6ad22ce51304f1c72f99ab00735e

View file

@ -0,0 +1,11 @@
C:\Users\helio\source\repos\Catch the button\Catch the button\bin\Release\Catch the button.exe.config
C:\Users\helio\source\repos\Catch the button\Catch the button\bin\Release\Catch the button.exe
C:\Users\helio\source\repos\Catch the button\Catch the button\bin\Release\Catch the button.pdb
C:\Users\helio\source\repos\Catch the button\Catch the button\obj\Release\Catch the button.csproj.AssemblyReference.cache
C:\Users\helio\source\repos\Catch the button\Catch the button\obj\Release\Catch_the_button.Main.resources
C:\Users\helio\source\repos\Catch the button\Catch the button\obj\Release\Catch_the_button.LeaderDialog.resources
C:\Users\helio\source\repos\Catch the button\Catch the button\obj\Release\Catch_the_button.Properties.Resources.resources
C:\Users\helio\source\repos\Catch the button\Catch the button\obj\Release\Catch the button.csproj.GenerateResource.cache
C:\Users\helio\source\repos\Catch the button\Catch the button\obj\Release\Catch the button.csproj.CoreCompileInputs.cache
C:\Users\helio\source\repos\Catch the button\Catch the button\obj\Release\Catch the button.exe
C:\Users\helio\source\repos\Catch the button\Catch the button\obj\Release\Catch the button.pdb

Binary file not shown.

Binary file not shown.