blob: bf0b5826bcf521b2fe84bafcc1572954367d47c4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Histacom2.Engine;
namespace Histacom2
{
public partial class AchievementBox : Form {
private bool stayOnScreen = false;
public AchievementBox(int type) {
InitializeComponent();
BringToFront();
switch (type) {
case 0: //Piracy Ending
BackgroundImage = Properties.Resources.EndingPiracy;
stayOnScreen = true;
break;
case 1:
BackgroundImage = Properties.Resources.EndingDestruction;
stayOnScreen = true;
break;
case 20:
BackgroundImage = Properties.Resources.AchievementMines;
button1.Hide();
break;
}
Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - 202, -102);
Show();
while (Location.Y != 0) {
Thread.Sleep(5);
Location = new Point(Location.X, Location.Y + 1);
}
if (!stayOnScreen) {
Thread.Sleep(3000);
while (Location.Y != -102) {
Thread.Sleep(5);
Location = new Point(Location.X, Location.Y - 1);
}
Close();
}
}
private void button1_Click(object sender, EventArgs e) {
Program.title.Show();
SaveSystem.CurrentSave = null;
SaveSystem.currentTheme = null;
Application.OpenForms.Cast<Form>().Where(x => !(x is TitleScreen | x is AchievementBox)).ToList().ForEach(x => x.Close());
//foreach (Form f in Application.OpenForms) if (!(f is TitleScreen) && !(f is AchievementBox)) f.Close();
this.Close();
}
}
}
|