-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 607b872
Showing
80 changed files
with
2,957 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<configSections> | ||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > | ||
<section name="SelectRandomCharacter.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> | ||
<section name="WindowsFormsApp1.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> | ||
</sectionGroup> | ||
</configSections> | ||
<startup> | ||
|
||
<supportedRuntime version="v2.0.50727"/></startup> | ||
<userSettings> | ||
<SelectRandomCharacter.Properties.Settings> | ||
<setting name="LastChar" serializeAs="String"> | ||
<value>0</value> | ||
</setting> | ||
<setting name="MainWindowPos" serializeAs="String"> | ||
<value>0, 0</value> | ||
</setting> | ||
<setting name="PreviewWindowPos" serializeAs="String"> | ||
<value>0, 0</value> | ||
</setting> | ||
<setting name="CurrentWinStreak" serializeAs="String"> | ||
<value>0</value> | ||
</setting> | ||
</SelectRandomCharacter.Properties.Settings> | ||
<WindowsFormsApp1.Properties.Settings> | ||
<setting name="LastChar" serializeAs="String"> | ||
<value>0</value> | ||
</setting> | ||
<setting name="MainWindowPos" serializeAs="String"> | ||
<value>0, 0</value> | ||
</setting> | ||
<setting name="PreviewWindowPos" serializeAs="String"> | ||
<value>0, 0</value> | ||
</setting> | ||
</WindowsFormsApp1.Properties.Settings> | ||
</userSettings> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Drawing; | ||
|
||
namespace SelectRandomCharacter | ||
{ | ||
public class Character | ||
{ | ||
public Bitmap image; | ||
public string name; | ||
|
||
public Character(Bitmap image, string name) { | ||
this.image = image; | ||
this.name = name; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
using System; | ||
using System.Drawing; | ||
using System.Windows.Forms; | ||
|
||
namespace SelectRandomCharacter | ||
{ | ||
public partial class Main : Form | ||
{ | ||
public Character[] chars = { | ||
new Character(Properties.Resources.Isaac, "Isaac"), | ||
new Character(Properties.Resources.Magdalene, "Magdalene"), | ||
new Character(Properties.Resources.Cain, "Cain"), | ||
new Character(Properties.Resources.Judas, "Judas"), | ||
new Character(Properties.Resources.Blue_Baby, "Blue baby"), | ||
new Character(Properties.Resources.Eve, "Eve"), | ||
new Character(Properties.Resources.Samson, "Samson"), | ||
new Character(Properties.Resources.Azazel, "Azazel"), | ||
new Character(Properties.Resources.Lazarus, "Lazarus"), | ||
new Character(Properties.Resources.Eden, "Eden"), | ||
new Character(Properties.Resources.Lost, "Lost"), | ||
new Character(Properties.Resources.Lilith, "Lilith"), | ||
new Character(Properties.Resources.Keeper, "Keeper"), | ||
new Character(Properties.Resources.Apollyon, "Apollyon"), | ||
new Character(Properties.Resources.Bethany, "Bethany"), | ||
new Character(Properties.Resources.Jacob, "Jacob"), | ||
new Character(Properties.Resources.Tainted_Isaac, "T. Isaac"), | ||
new Character(Properties.Resources.Tainted_Magdalene, "T. Magdalene"), | ||
new Character(Properties.Resources.Tainted_Cain, "T. Cain"), | ||
new Character(Properties.Resources.Tainted_Judas, "T. Judas"), | ||
new Character(Properties.Resources.Tainted_Blue_Baby, "T. Blue baby"), | ||
new Character(Properties.Resources.Tainted_Eve, "T. Eve"), | ||
new Character(Properties.Resources.Tainted_Samson, "T. Samson"), | ||
new Character(Properties.Resources.Tainted_Azazel, "T. Azazel"), | ||
new Character(Properties.Resources.Tainted_Lazarus, "T. Lazarus"), | ||
new Character(Properties.Resources.Tainted_Eden, "T. Eden"), | ||
new Character(Properties.Resources.Tainted_Lost, "T. Lost"), | ||
new Character(Properties.Resources.Tainted_Lilith, "T. Lilith"), | ||
new Character(Properties.Resources.Tainted_Keeper, "T. Keeper"), | ||
new Character(Properties.Resources.Tainted_Apollyon, "T. Apollyon"), | ||
new Character(Properties.Resources.Tainted_Bethany, "T. Bethany"), | ||
new Character(Properties.Resources.Tainted_Jacob, "T. Jacob"), | ||
}; | ||
|
||
private Preview previewWindow; | ||
private Settings settings; | ||
|
||
public Main() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void Form1_Load(object sender, EventArgs e) | ||
{ | ||
previewWindow = new Preview(); | ||
previewWindow.Show(); | ||
previewWindow.SetDesktopLocation(Properties.Settings.Default.PreviewWindowPos.Width, Properties.Settings.Default.PreviewWindowPos.Height); | ||
previewWindow.ChangeWinStreak(Properties.Settings.Default.CurrentWinStreak); | ||
|
||
settings = new Settings(this); | ||
settings.SetNumericUpDown1Value(Properties.Settings.Default.CurrentWinStreak); | ||
settings.Hide(); | ||
|
||
SetDesktopLocation(Properties.Settings.Default.MainWindowPos.Width, Properties.Settings.Default.MainWindowPos.Height); | ||
|
||
SetCharacter(Properties.Settings.Default.LastChar); | ||
} | ||
|
||
private void button1_Click(object sender, EventArgs e) | ||
{ | ||
|
||
} | ||
|
||
private void SelectRandomCharacterAndUpdatePreview() { | ||
Character rndChar = SelectRandomCharacter(); | ||
|
||
previewWindow.ChangeImage(rndChar.image); | ||
previewWindow.ChangeName(rndChar.name); | ||
} | ||
|
||
public void SetCharacter(int index) | ||
{ | ||
previewWindow.ChangeImage(chars[index].image); | ||
previewWindow.ChangeName(chars[index].name); | ||
|
||
settings.getCharactersGroupBox().Text = "Current: " + chars[index].name; | ||
|
||
Properties.Settings.Default.LastChar = index; | ||
Properties.Settings.Default.Save(); | ||
} | ||
|
||
public void SetCurrentWinStreak(int value) { | ||
Properties.Settings.Default.CurrentWinStreak = value; | ||
Properties.Settings.Default.Save(); | ||
|
||
previewWindow.ChangeWinStreak(Properties.Settings.Default.CurrentWinStreak); | ||
} | ||
|
||
private Character SelectRandomCharacter() { | ||
Random rnd = new Random(); | ||
|
||
Properties.Settings.Default.LastChar = rnd.Next(0, chars.Length); | ||
Properties.Settings.Default.Save(); | ||
|
||
return chars[Properties.Settings.Default.LastChar]; | ||
} | ||
|
||
private void Main_FormClosed(object sender, FormClosedEventArgs e) | ||
{ | ||
|
||
} | ||
|
||
private void Main_FormClosing(object sender, FormClosingEventArgs e) | ||
{ | ||
Properties.Settings.Default.MainWindowPos = new Size(this.Location.X, this.Location.Y); | ||
Properties.Settings.Default.PreviewWindowPos = new Size(previewWindow.Location.X, previewWindow.Location.Y); | ||
Properties.Settings.Default.Save(); | ||
} | ||
|
||
private void button_Win_Click(object sender, EventArgs e) | ||
{ | ||
UpCurrentWinStreak(); | ||
|
||
SelectRandomCharacterAndUpdatePreview(); | ||
} | ||
|
||
private void button_Lose_Click(object sender, EventArgs e) | ||
{ | ||
ResetCurrentWinStreak(); | ||
|
||
SelectRandomCharacterAndUpdatePreview(); | ||
} | ||
|
||
private void UpCurrentWinStreak() { | ||
Properties.Settings.Default.CurrentWinStreak += 1; | ||
Properties.Settings.Default.Save(); | ||
|
||
settings.SetNumericUpDown1Value(Properties.Settings.Default.CurrentWinStreak); | ||
previewWindow.ChangeWinStreak(Properties.Settings.Default.CurrentWinStreak); | ||
} | ||
|
||
private void ResetCurrentWinStreak() { | ||
Properties.Settings.Default.CurrentWinStreak = 0; | ||
Properties.Settings.Default.Save(); | ||
|
||
settings.SetNumericUpDown1Value(Properties.Settings.Default.CurrentWinStreak); | ||
previewWindow.ChangeWinStreak(Properties.Settings.Default.CurrentWinStreak); | ||
} | ||
|
||
private void button_Settings_Click(object sender, EventArgs e) | ||
{ | ||
if (settings.Visible == false) | ||
{ | ||
settings.Show(); | ||
} else { | ||
settings.Hide(); | ||
} | ||
} | ||
|
||
private void button_Exit_Click(object sender, EventArgs e) | ||
{ | ||
Application.Exit(); | ||
Environment.Exit(0); | ||
} | ||
} | ||
} |
Oops, something went wrong.