From 4bf91056ffd49cd7559e59ef4f4fcf7c63acca5e Mon Sep 17 00:00:00 2001 From: CreepyCrafter24 <33260128+CreepyCrafter24@users.noreply.github.com> Date: Sun, 29 Sep 2019 18:24:45 +0200 Subject: [PATCH] Added first content to the Tutorial-form. The installation minigame is to be added. --- LaptopSimulator2015.sln | 6 + LaptopSimulator2015/FakeDesktop.Designer.cs | 46 ++- LaptopSimulator2015/FakeDesktop.cs | 45 ++- .../LaptopSimulator2015.csproj | 7 + LaptopSimulator2015/Program.cs | 10 +- LaptopSimulator2015/Tutorial.Designer.cs | 329 +++++++++++++++++- LaptopSimulator2015/Tutorial.cs | 62 +++- LaptopSimulator2015/Tutorial.resx | 3 + LaptopSimulator2015/WizardTab.cs | 40 +++ LaptopSimulator2015/strings.Designer.cs | 73 +++- LaptopSimulator2015/strings.de.resx | 31 +- LaptopSimulator2015/strings.resx | 29 +- 12 files changed, 613 insertions(+), 68 deletions(-) create mode 100644 LaptopSimulator2015/WizardTab.cs diff --git a/LaptopSimulator2015.sln b/LaptopSimulator2015.sln index bb683c3..9ab9d76 100644 --- a/LaptopSimulator2015.sln +++ b/LaptopSimulator2015.sln @@ -60,6 +60,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LevelTest", "LevelTest\Leve {DFA2FB97-D676-4B0D-B281-2685F85781EE} = {DFA2FB97-D676-4B0D-B281-2685F85781EE} EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "W32", "..\CC-Functions\W32\W32.csproj", "{23DE4AE0-5075-4CCC-8440-4D131CA0FBBA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -114,6 +116,10 @@ Global {DFD89655-00A7-4DF8-8B2E-17F5BEFE5090}.Debug|Any CPU.Build.0 = Debug|Any CPU {DFD89655-00A7-4DF8-8B2E-17F5BEFE5090}.Release|Any CPU.ActiveCfg = Release|Any CPU {DFD89655-00A7-4DF8-8B2E-17F5BEFE5090}.Release|Any CPU.Build.0 = Release|Any CPU + {23DE4AE0-5075-4CCC-8440-4D131CA0FBBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23DE4AE0-5075-4CCC-8440-4D131CA0FBBA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23DE4AE0-5075-4CCC-8440-4D131CA0FBBA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23DE4AE0-5075-4CCC-8440-4D131CA0FBBA}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/LaptopSimulator2015/FakeDesktop.Designer.cs b/LaptopSimulator2015/FakeDesktop.Designer.cs index e8ca1fb..76666f4 100644 --- a/LaptopSimulator2015/FakeDesktop.Designer.cs +++ b/LaptopSimulator2015/FakeDesktop.Designer.cs @@ -51,7 +51,7 @@ namespace LaptopSimulator2015 this.options_2 = new System.Windows.Forms.Panel(); this.levelWindow = new System.Windows.Forms.Panel(); this.levelWindowC1 = new System.Windows.Forms.Button(); - this.levelWindowContents = new System.Windows.Forms.TabControl(); + this.levelWindowContents = new LaptopSimulator2015.WizardTab(); this.levelWindow1 = new System.Windows.Forms.TabPage(); this.levelWindowText1 = new System.Windows.Forms.Label(); this.levelWindow2 = new System.Windows.Forms.TabPage(); @@ -87,6 +87,7 @@ namespace LaptopSimulator2015 this.lsdEffectT = new System.Windows.Forms.Timer(this.components); this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.devWindow = new System.Windows.Forms.Panel(); + this.devWindowOverlay = new System.Windows.Forms.Button(); this.devWindowSkip = new System.Windows.Forms.Button(); this.devWindowLevelList = new System.Windows.Forms.ListBox(); this.devWindowLevelLabel = new System.Windows.Forms.Label(); @@ -287,19 +288,15 @@ namespace LaptopSimulator2015 // // levelWindowContents // - this.levelWindowContents.Appearance = System.Windows.Forms.TabAppearance.Buttons; this.levelWindowContents.Controls.Add(this.levelWindow1); this.levelWindowContents.Controls.Add(this.levelWindow2); this.levelWindowContents.Controls.Add(this.levelWindow3); this.levelWindowContents.Dock = System.Windows.Forms.DockStyle.Fill; - this.levelWindowContents.ItemSize = new System.Drawing.Size(20, 15); this.levelWindowContents.Location = new System.Drawing.Point(0, 20); this.levelWindowContents.Name = "levelWindowContents"; this.levelWindowContents.SelectedIndex = 0; this.levelWindowContents.Size = new System.Drawing.Size(502, 248); - this.levelWindowContents.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; this.levelWindowContents.TabIndex = 2; - this.levelWindowContents.TabStop = false; // // levelWindow1 // @@ -503,17 +500,17 @@ namespace LaptopSimulator2015 // // optionsWindowCredit // - this.optionsWindowCredit.Location = new System.Drawing.Point(355, 60); + this.optionsWindowCredit.Location = new System.Drawing.Point(328, 60); this.optionsWindowCredit.Name = "optionsWindowCredit"; - this.optionsWindowCredit.Size = new System.Drawing.Size(45, 23); + this.optionsWindowCredit.Size = new System.Drawing.Size(51, 23); this.optionsWindowCredit.TabIndex = 9; - this.optionsWindowCredit.Text = "Credit"; + this.optionsWindowCredit.Text = "Credits"; this.optionsWindowCredit.UseVisualStyleBackColor = true; this.optionsWindowCredit.Click += new System.EventHandler(this.optionsWindowCredit_Click); // // devWindowOpen // - this.devWindowOpen.Location = new System.Drawing.Point(274, 60); + this.devWindowOpen.Location = new System.Drawing.Point(254, 60); this.devWindowOpen.Name = "devWindowOpen"; this.devWindowOpen.Size = new System.Drawing.Size(75, 23); this.devWindowOpen.TabIndex = 8; @@ -526,9 +523,9 @@ namespace LaptopSimulator2015 // optionsWindowReset // this.optionsWindowReset.BackColor = System.Drawing.Color.Red; - this.optionsWindowReset.Location = new System.Drawing.Point(406, 60); + this.optionsWindowReset.Location = new System.Drawing.Point(378, 60); this.optionsWindowReset.Name = "optionsWindowReset"; - this.optionsWindowReset.Size = new System.Drawing.Size(46, 23); + this.optionsWindowReset.Size = new System.Drawing.Size(81, 23); this.optionsWindowReset.TabIndex = 7; this.optionsWindowReset.TabStop = false; this.optionsWindowReset.Text = "Reset"; @@ -541,16 +538,16 @@ namespace LaptopSimulator2015 this.optionsWindowLang.Items.AddRange(new object[] { "de", "en"}); - this.optionsWindowLang.Location = new System.Drawing.Point(180, 62); + this.optionsWindowLang.Location = new System.Drawing.Point(161, 61); this.optionsWindowLang.Name = "optionsWindowLang"; - this.optionsWindowLang.Size = new System.Drawing.Size(169, 21); + this.optionsWindowLang.Size = new System.Drawing.Size(168, 21); this.optionsWindowLang.TabIndex = 6; this.optionsWindowLang.TabStop = false; // // optionsWindowSubs // this.optionsWindowSubs.AutoSize = true; - this.optionsWindowSubs.Location = new System.Drawing.Point(108, 64); + this.optionsWindowSubs.Location = new System.Drawing.Point(90, 64); this.optionsWindowSubs.Name = "optionsWindowSubs"; this.optionsWindowSubs.Size = new System.Drawing.Size(66, 17); this.optionsWindowSubs.TabIndex = 5; @@ -661,6 +658,7 @@ namespace LaptopSimulator2015 // devWindow // this.devWindow.BackColor = System.Drawing.SystemColors.Window; + this.devWindow.Controls.Add(this.devWindowOverlay); this.devWindow.Controls.Add(this.devWindowSkip); this.devWindow.Controls.Add(this.devWindowLevelList); this.devWindow.Controls.Add(this.devWindowLevelLabel); @@ -673,8 +671,20 @@ namespace LaptopSimulator2015 this.devWindow.TabIndex = 8; this.devWindow.Visible = false; // + // devWindowOverlay + // + this.devWindowOverlay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.devWindowOverlay.Location = new System.Drawing.Point(394, 227); + this.devWindowOverlay.Name = "devWindowOverlay"; + this.devWindowOverlay.Size = new System.Drawing.Size(94, 23); + this.devWindowOverlay.TabIndex = 6; + this.devWindowOverlay.Text = "Overlay Console"; + this.devWindowOverlay.UseVisualStyleBackColor = true; + this.devWindowOverlay.Click += new System.EventHandler(this.devWindowOverlay_Click); + // // devWindowSkip // + this.devWindowSkip.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.devWindowSkip.Location = new System.Drawing.Point(13, 227); this.devWindowSkip.Name = "devWindowSkip"; this.devWindowSkip.Size = new System.Drawing.Size(75, 23); @@ -686,6 +696,8 @@ namespace LaptopSimulator2015 // // devWindowLevelList // + this.devWindowLevelList.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.devWindowLevelList.FormattingEnabled = true; this.devWindowLevelList.Location = new System.Drawing.Point(51, 127); this.devWindowLevelList.Name = "devWindowLevelList"; @@ -714,6 +726,8 @@ namespace LaptopSimulator2015 // // devWindowDllList // + this.devWindowDllList.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.devWindowDllList.FormattingEnabled = true; this.devWindowDllList.Location = new System.Drawing.Point(51, 26); this.devWindowDllList.Name = "devWindowDllList"; @@ -796,6 +810,7 @@ namespace LaptopSimulator2015 this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FakeDesktop_FormClosing); this.Load += new System.EventHandler(this.FakeDesktop_Load); + this.Shown += new System.EventHandler(this.FakeDesktop_Shown); this.winMenuPanel.ResumeLayout(false); this.winTaskbar.ResumeLayout(false); this.winTaskbar.PerformLayout(); @@ -839,7 +854,7 @@ namespace LaptopSimulator2015 private System.Windows.Forms.Label levelWindowTitle; private System.Windows.Forms.Panel levelWindowIcon; private System.Windows.Forms.Label levelWindowText1; - private System.Windows.Forms.TabControl levelWindowContents; + private WizardTab levelWindowContents; private System.Windows.Forms.TabPage levelWindow1; private System.Windows.Forms.TabPage levelWindow2; private System.Windows.Forms.Button levelWindowC1; @@ -885,5 +900,6 @@ namespace LaptopSimulator2015 private System.Windows.Forms.ListBox devWindowLevelList; private System.Windows.Forms.Button devWindowSkip; private System.Windows.Forms.Button optionsWindowCredit; + private System.Windows.Forms.Button devWindowOverlay; } } \ No newline at end of file diff --git a/LaptopSimulator2015/FakeDesktop.cs b/LaptopSimulator2015/FakeDesktop.cs index b87ddb5..7f95931 100644 --- a/LaptopSimulator2015/FakeDesktop.cs +++ b/LaptopSimulator2015/FakeDesktop.cs @@ -35,7 +35,7 @@ namespace LaptopSimulator2015 _mode = value; winMenuStart.Enabled = _mode == Mode.mainMenu; winMenuStart.Visible = _mode == Mode.mainMenu; - winMenuExit.Text = strings.winMenuExit1; + winMenuExit.Text = strings.exit; winMenuPanel.Visible = false | _mode == Mode.mainMenu; winDesktop.Enabled = _mode == Mode.game; levelWindowText1.Text = ""; @@ -80,11 +80,9 @@ namespace LaptopSimulator2015 toolTip.SetToolTip(options_2, strings.optionsWindowTitle); #if DEBUG devWindowOpen.Visible = true; - optionsWindowLang.Size = new Size(88, 21); + optionsWindowLang.Size = new Size(93, 21); #endif - levelWindowContents.ItemSize = new Size(0, 1); optionsWindowLang.Text = Settings.lang.Name; - Thread.CurrentThread.CurrentUICulture = Settings.lang; optionsWindowWam.Value = Settings.wam; int NewVolume = ((ushort.MaxValue / 10) * Settings.wam); uint NewVolumeAllChannels = ((uint)NewVolume & 0x0000ffff) | ((uint)NewVolume << 16); @@ -93,8 +91,8 @@ namespace LaptopSimulator2015 optionsWindowLSD.Checked = Settings.lsd; optionsWindowSubs.Checked = Settings.subs; Text = strings.fakeDesktopTitle; - winMenuExit.Text = strings.winMenuExit1; - winMenuStart.Text = strings.winMenuStart; + winMenuExit.Text = strings.exit; + winMenuStart.Text = strings.start; winMenuText.Text = strings.winMenuText; levelWindowTitle.Text = ""; winTimeLabel.Text = DateTime.Now.ToString("hh:mm:ss", Settings.lang); @@ -200,16 +198,17 @@ namespace LaptopSimulator2015 levels[i].desktopIcon.Controls.Add(tmp1); winDesktop.Controls.Add(levels[i].desktopIcon); } + GC.Collect(); } private void FakeDesktop_Load(object sender, EventArgs e) { mode = Mode.mainMenu; - Program.splash.Close(); - GC.Collect(); tmp__mode_uiv = true; } + private void FakeDesktop_Shown(object sender, EventArgs e) => Program.splash?.Hide(); + void updateIconVisibility(bool ignoreSub = false) { for (int i = 0; i < levels.Count; i++) @@ -320,7 +319,7 @@ namespace LaptopSimulator2015 private void WinKey_Click(object sender, EventArgs e) { winMenuPanel.Visible = mode == Mode.mainMenu | !winMenuPanel.Visible; - winMenuExit.Text = strings.winMenuExit1; + winMenuExit.Text = strings.exit; } private void WinMenuExit_Click(object sender, EventArgs e) @@ -657,6 +656,15 @@ namespace LaptopSimulator2015 } } + private void optionsWindowCredit_Click(object sender, EventArgs e) + { + string tmp = Path.GetTempFileName(); + File.Move(tmp, Path.ChangeExtension(tmp, "txt")); + tmp = Path.ChangeExtension(tmp, "txt"); + File.WriteAllLines(tmp, levels.SelectMany(s => s.credits).ToArray()); + Process.Start(tmp).Exited += (object sender1, EventArgs e1) => { File.Delete(tmp); }; + } + bool devWindowMoving = false; Point devWindowDiff = Point.Empty; @@ -693,14 +701,17 @@ namespace LaptopSimulator2015 } } - private void optionsWindowCredit_Click(object sender, EventArgs e) - { - string tmp = Path.GetTempFileName(); - File.Move(tmp, Path.ChangeExtension(tmp, "txt")); - tmp = Path.ChangeExtension(tmp, "txt"); - File.WriteAllLines(tmp, levels.SelectMany(s => s.credits).ToArray()); - Process.Start(tmp).Exited += (object sender1, EventArgs e1) => { File.Delete(tmp); }; - } + private void devWindowOverlay_Click(object sender, EventArgs e) => _ = SetWindowPos(GetConsoleWindow(), HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS); + + [DllImport("kernel32.dll")] + static extern IntPtr GetConsoleWindow(); + static readonly IntPtr HWND_TOPMOST = new IntPtr(-1); + const UInt32 SWP_NOSIZE = 0x0001; + const UInt32 SWP_NOMOVE = 0x0002; + const UInt32 TOPMOST_FLAGS = SWP_NOMOVE | SWP_NOSIZE; + [DllImport("user32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); #endregion } } \ No newline at end of file diff --git a/LaptopSimulator2015/LaptopSimulator2015.csproj b/LaptopSimulator2015/LaptopSimulator2015.csproj index 9b64aaa..6786bf6 100644 --- a/LaptopSimulator2015/LaptopSimulator2015.csproj +++ b/LaptopSimulator2015/LaptopSimulator2015.csproj @@ -86,6 +86,9 @@ Tutorial.cs + + Component + @@ -120,6 +123,10 @@ + + {23de4ae0-5075-4ccc-8440-4d131ca0fbba} + W32 + {9a9561a7-dd5f-43a5-a3f5-a95f35da204d} Base diff --git a/LaptopSimulator2015/Program.cs b/LaptopSimulator2015/Program.cs index a8ac783..5120b7a 100644 --- a/LaptopSimulator2015/Program.cs +++ b/LaptopSimulator2015/Program.cs @@ -1,4 +1,5 @@ -using LaptopSimulator2015.Properties; +using CC_Functions.W32; +using LaptopSimulator2015.Properties; using System; using System.Drawing; using System.IO; @@ -19,9 +20,11 @@ namespace LaptopSimulator2015 Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Settings.Load(); + Thread.CurrentThread.CurrentUICulture = Settings.lang; Console.Title = "LaptopSimulator2015"; splash = new Splash(); splash.Show(); + Wnd32.fromForm(splash).MakeOverlay(); Thread.Sleep(2000); #if !DEBUG FileStream filestream = new FileStream(".log", FileMode.Create); @@ -34,8 +37,9 @@ namespace LaptopSimulator2015 Console.ForegroundColor = ConsoleColor.Green; Console.Clear(); Console.WriteLine(strings.consoleStarting); - while (Settings.level == -1) - Application.Run(new Tutorial()); + if (Settings.level == -1) + while (Settings.level == -1) + Application.Run(new Tutorial()); Application.Run(new FakeDesktop()); Console.WriteLine(strings.consoleQuit); Thread.Sleep(1000); diff --git a/LaptopSimulator2015/Tutorial.Designer.cs b/LaptopSimulator2015/Tutorial.Designer.cs index 6b24b9e..0d9e0ec 100644 --- a/LaptopSimulator2015/Tutorial.Designer.cs +++ b/LaptopSimulator2015/Tutorial.Designer.cs @@ -28,28 +28,327 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.skipButton = new System.Windows.Forms.Button(); + this.dialog = new System.Windows.Forms.Panel(); + this.tabs = new LaptopSimulator2015.WizardTab(); + this.p1 = new System.Windows.Forms.TabPage(); + this.p1descLabel = new System.Windows.Forms.Label(); + this.p1controlPanel = new System.Windows.Forms.Panel(); + this.p1continue = new System.Windows.Forms.Button(); + this.p1lang = new System.Windows.Forms.ComboBox(); + this.p1titleLabel = new System.Windows.Forms.Label(); + this.p2 = new System.Windows.Forms.TabPage(); + this.p2continue = new System.Windows.Forms.Button(); + this.p2privacyLabel = new System.Windows.Forms.Label(); + this.p3 = new System.Windows.Forms.TabPage(); + this.p3spacingPanel1 = new System.Windows.Forms.Panel(); + this.p3spacingPanel2 = new System.Windows.Forms.Panel(); + this.p3continue = new System.Windows.Forms.Button(); + this.progressBar = new System.Windows.Forms.ProgressBar(); + this.cancelButton = new System.Windows.Forms.Button(); + this.progressTimer = new System.Windows.Forms.Timer(this.components); + this.p4 = new System.Windows.Forms.TabPage(); + this.p5 = new System.Windows.Forms.TabPage(); + this.p5completeLabel = new System.Windows.Forms.Label(); + this.p5controlPanel = new System.Windows.Forms.Panel(); + this.p5reboot = new System.Windows.Forms.Button(); + this.p5title = new System.Windows.Forms.Label(); + this.dialog.SuspendLayout(); + this.tabs.SuspendLayout(); + this.p1.SuspendLayout(); + this.p1controlPanel.SuspendLayout(); + this.p2.SuspendLayout(); + this.p3.SuspendLayout(); + this.p5.SuspendLayout(); + this.p5controlPanel.SuspendLayout(); this.SuspendLayout(); // // skipButton // - this.skipButton.Location = new System.Drawing.Point(761, 0); + this.skipButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.skipButton.Location = new System.Drawing.Point(1220, 0); this.skipButton.Name = "skipButton"; - this.skipButton.Size = new System.Drawing.Size(39, 23); + this.skipButton.Size = new System.Drawing.Size(80, 23); this.skipButton.TabIndex = 0; this.skipButton.Text = "SKIP"; this.skipButton.UseVisualStyleBackColor = true; this.skipButton.Visible = false; this.skipButton.Click += new System.EventHandler(this.skipButton_Click); // + // dialog + // + this.dialog.Anchor = System.Windows.Forms.AnchorStyles.None; + this.dialog.BackColor = System.Drawing.Color.Silver; + this.dialog.Controls.Add(this.tabs); + this.dialog.Location = new System.Drawing.Point(450, 150); + this.dialog.Name = "dialog"; + this.dialog.Size = new System.Drawing.Size(400, 400); + this.dialog.TabIndex = 1; + // + // tabs + // + this.tabs.Appearance = System.Windows.Forms.TabAppearance.Buttons; + this.tabs.Controls.Add(this.p1); + this.tabs.Controls.Add(this.p2); + this.tabs.Controls.Add(this.p3); + this.tabs.Controls.Add(this.p4); + this.tabs.Controls.Add(this.p5); + this.tabs.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabs.ItemSize = new System.Drawing.Size(10, 21); + this.tabs.Location = new System.Drawing.Point(0, 0); + this.tabs.Name = "tabs"; + this.tabs.SelectedIndex = 0; + this.tabs.Size = new System.Drawing.Size(400, 400); + this.tabs.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; + this.tabs.TabIndex = 0; + this.tabs.TabStop = false; + // + // p1 + // + this.p1.Controls.Add(this.p1descLabel); + this.p1.Controls.Add(this.p1controlPanel); + this.p1.Controls.Add(this.p1titleLabel); + this.p1.Location = new System.Drawing.Point(4, 25); + this.p1.Name = "p1"; + this.p1.Padding = new System.Windows.Forms.Padding(3); + this.p1.Size = new System.Drawing.Size(392, 371); + this.p1.TabIndex = 0; + this.p1.UseVisualStyleBackColor = true; + // + // p1descLabel + // + this.p1descLabel.Dock = System.Windows.Forms.DockStyle.Fill; + this.p1descLabel.Location = new System.Drawing.Point(3, 65); + this.p1descLabel.Name = "p1descLabel"; + this.p1descLabel.Size = new System.Drawing.Size(386, 258); + this.p1descLabel.TabIndex = 0; + this.p1descLabel.Text = "label2"; + this.p1descLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // p1controlPanel + // + this.p1controlPanel.Controls.Add(this.p1continue); + this.p1controlPanel.Controls.Add(this.p1lang); + this.p1controlPanel.Dock = System.Windows.Forms.DockStyle.Bottom; + this.p1controlPanel.Location = new System.Drawing.Point(3, 323); + this.p1controlPanel.Name = "p1controlPanel"; + this.p1controlPanel.Size = new System.Drawing.Size(386, 45); + this.p1controlPanel.TabIndex = 1; + // + // p1continue + // + this.p1continue.Location = new System.Drawing.Point(304, 10); + this.p1continue.Name = "p1continue"; + this.p1continue.Size = new System.Drawing.Size(75, 23); + this.p1continue.TabIndex = 1; + this.p1continue.Text = "Continue"; + this.p1continue.UseVisualStyleBackColor = true; + this.p1continue.Click += new System.EventHandler(this.Continue1_Click); + // + // p1lang + // + this.p1lang.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.p1lang.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.p1lang.FormattingEnabled = true; + this.p1lang.Items.AddRange(new object[] { + "de", + "en"}); + this.p1lang.Location = new System.Drawing.Point(12, 12); + this.p1lang.Name = "p1lang"; + this.p1lang.Size = new System.Drawing.Size(121, 21); + this.p1lang.TabIndex = 0; + this.p1lang.SelectedIndexChanged += new System.EventHandler(this.lang_SelectedIndexChanged); + // + // p1titleLabel + // + this.p1titleLabel.BackColor = System.Drawing.Color.Silver; + this.p1titleLabel.Dock = System.Windows.Forms.DockStyle.Top; + this.p1titleLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.p1titleLabel.Location = new System.Drawing.Point(3, 3); + this.p1titleLabel.Name = "p1titleLabel"; + this.p1titleLabel.Size = new System.Drawing.Size(386, 62); + this.p1titleLabel.TabIndex = 0; + this.p1titleLabel.Text = "LaptopSimulator2015"; + this.p1titleLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // p2 + // + this.p2.Controls.Add(this.p2continue); + this.p2.Controls.Add(this.p2privacyLabel); + this.p2.Location = new System.Drawing.Point(4, 25); + this.p2.Name = "p2"; + this.p2.Padding = new System.Windows.Forms.Padding(3); + this.p2.Size = new System.Drawing.Size(392, 371); + this.p2.TabIndex = 1; + this.p2.UseVisualStyleBackColor = true; + // + // p2continue + // + this.p2continue.Location = new System.Drawing.Point(311, 345); + this.p2continue.Name = "p2continue"; + this.p2continue.Size = new System.Drawing.Size(75, 23); + this.p2continue.TabIndex = 1; + this.p2continue.Text = "Continue"; + this.p2continue.UseVisualStyleBackColor = true; + this.p2continue.Click += new System.EventHandler(this.continue2_Click); + // + // p2privacyLabel + // + this.p2privacyLabel.AutoSize = true; + this.p2privacyLabel.Location = new System.Drawing.Point(6, 3); + this.p2privacyLabel.Name = "p2privacyLabel"; + this.p2privacyLabel.Size = new System.Drawing.Size(209, 13); + this.p2privacyLabel.TabIndex = 0; + this.p2privacyLabel.Text = "Alan, please add random \"Privacy\"-notices"; + // + // p3 + // + this.p3.Controls.Add(this.p3spacingPanel1); + this.p3.Controls.Add(this.p3continue); + this.p3.Controls.Add(this.p3spacingPanel2); + this.p3.Location = new System.Drawing.Point(4, 25); + this.p3.Name = "p3"; + this.p3.Size = new System.Drawing.Size(392, 371); + this.p3.TabIndex = 2; + this.p3.UseVisualStyleBackColor = true; + // + // p3spacingPanel1 + // + this.p3spacingPanel1.Dock = System.Windows.Forms.DockStyle.Top; + this.p3spacingPanel1.Location = new System.Drawing.Point(0, 0); + this.p3spacingPanel1.Name = "p3spacingPanel1"; + this.p3spacingPanel1.Size = new System.Drawing.Size(392, 100); + this.p3spacingPanel1.TabIndex = 2; + // + // p3spacingPanel2 + // + this.p3spacingPanel2.Dock = System.Windows.Forms.DockStyle.Bottom; + this.p3spacingPanel2.Location = new System.Drawing.Point(0, 271); + this.p3spacingPanel2.Name = "p3spacingPanel2"; + this.p3spacingPanel2.Size = new System.Drawing.Size(392, 100); + this.p3spacingPanel2.TabIndex = 1; + // + // p3continue + // + this.p3continue.Dock = System.Windows.Forms.DockStyle.Fill; + this.p3continue.Font = new System.Drawing.Font("Microsoft Sans Serif", 37F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.p3continue.Location = new System.Drawing.Point(0, 0); + this.p3continue.Name = "p3continue"; + this.p3continue.Size = new System.Drawing.Size(392, 271); + this.p3continue.TabIndex = 0; + this.p3continue.Text = "INSTALL"; + this.p3continue.UseVisualStyleBackColor = true; + this.p3continue.Click += new System.EventHandler(this.continue3_Click); + // + // progressBar + // + this.progressBar.Dock = System.Windows.Forms.DockStyle.Bottom; + this.progressBar.Location = new System.Drawing.Point(0, 677); + this.progressBar.Name = "progressBar"; + this.progressBar.Size = new System.Drawing.Size(1300, 23); + this.progressBar.Step = 1; + this.progressBar.TabIndex = 2; + // + // cancelButton + // + this.cancelButton.Location = new System.Drawing.Point(0, 0); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(80, 23); + this.cancelButton.TabIndex = 3; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // progressTimer + // + this.progressTimer.Tick += new System.EventHandler(this.timer1_Tick); + // + // p4 + // + this.p4.Location = new System.Drawing.Point(4, 25); + this.p4.Name = "p4"; + this.p4.Size = new System.Drawing.Size(392, 371); + this.p4.TabIndex = 3; + this.p4.UseVisualStyleBackColor = true; + // + // p5 + // + this.p5.Controls.Add(this.p5completeLabel); + this.p5.Controls.Add(this.p5controlPanel); + this.p5.Controls.Add(this.p5title); + this.p5.Location = new System.Drawing.Point(4, 25); + this.p5.Name = "p5"; + this.p5.Size = new System.Drawing.Size(392, 371); + this.p5.TabIndex = 4; + this.p5.UseVisualStyleBackColor = true; + // + // p5completeLabel + // + this.p5completeLabel.Dock = System.Windows.Forms.DockStyle.Fill; + this.p5completeLabel.Location = new System.Drawing.Point(0, 62); + this.p5completeLabel.Name = "p5completeLabel"; + this.p5completeLabel.Size = new System.Drawing.Size(392, 264); + this.p5completeLabel.TabIndex = 2; + this.p5completeLabel.Text = "label2"; + this.p5completeLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // p5controlPanel + // + this.p5controlPanel.Controls.Add(this.p5reboot); + this.p5controlPanel.Dock = System.Windows.Forms.DockStyle.Bottom; + this.p5controlPanel.Location = new System.Drawing.Point(0, 326); + this.p5controlPanel.Name = "p5controlPanel"; + this.p5controlPanel.Size = new System.Drawing.Size(392, 45); + this.p5controlPanel.TabIndex = 4; + // + // p5reboot + // + this.p5reboot.Location = new System.Drawing.Point(304, 10); + this.p5reboot.Name = "p5reboot"; + this.p5reboot.Size = new System.Drawing.Size(75, 23); + this.p5reboot.TabIndex = 1; + this.p5reboot.Text = "Reboot"; + this.p5reboot.UseVisualStyleBackColor = true; + this.p5reboot.Click += new System.EventHandler(this.p5reboot_Click); + // + // p5title + // + this.p5title.BackColor = System.Drawing.Color.Silver; + this.p5title.Dock = System.Windows.Forms.DockStyle.Top; + this.p5title.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.p5title.Location = new System.Drawing.Point(0, 0); + this.p5title.Name = "p5title"; + this.p5title.Size = new System.Drawing.Size(392, 62); + this.p5title.TabIndex = 3; + this.p5title.Text = "LaptopSimulator2015"; + this.p5title.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // Tutorial // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.ClientSize = new System.Drawing.Size(1300, 700); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.progressBar); + this.Controls.Add(this.dialog); this.Controls.Add(this.skipButton); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "Tutorial"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Tutorial"; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.Shown += new System.EventHandler(this.Tutorial_Shown); + this.dialog.ResumeLayout(false); + this.tabs.ResumeLayout(false); + this.p1.ResumeLayout(false); + this.p1controlPanel.ResumeLayout(false); + this.p2.ResumeLayout(false); + this.p2.PerformLayout(); + this.p3.ResumeLayout(false); + this.p5.ResumeLayout(false); + this.p5controlPanel.ResumeLayout(false); this.ResumeLayout(false); } @@ -57,5 +356,29 @@ #endregion private System.Windows.Forms.Button skipButton; + private System.Windows.Forms.Panel dialog; + private System.Windows.Forms.ProgressBar progressBar; + private WizardTab tabs; + private System.Windows.Forms.TabPage p1; + private System.Windows.Forms.TabPage p2; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Label p1titleLabel; + private System.Windows.Forms.Label p1descLabel; + private System.Windows.Forms.Panel p1controlPanel; + private System.Windows.Forms.ComboBox p1lang; + private System.Windows.Forms.Button p1continue; + private System.Windows.Forms.Label p2privacyLabel; + private System.Windows.Forms.Button p2continue; + private System.Windows.Forms.TabPage p3; + private System.Windows.Forms.Panel p3spacingPanel1; + private System.Windows.Forms.Panel p3spacingPanel2; + private System.Windows.Forms.Button p3continue; + private System.Windows.Forms.Timer progressTimer; + private System.Windows.Forms.TabPage p4; + private System.Windows.Forms.TabPage p5; + private System.Windows.Forms.Label p5completeLabel; + private System.Windows.Forms.Panel p5controlPanel; + private System.Windows.Forms.Button p5reboot; + private System.Windows.Forms.Label p5title; } } \ No newline at end of file diff --git a/LaptopSimulator2015/Tutorial.cs b/LaptopSimulator2015/Tutorial.cs index 947de03..fae2782 100644 --- a/LaptopSimulator2015/Tutorial.cs +++ b/LaptopSimulator2015/Tutorial.cs @@ -5,8 +5,10 @@ using System.Data; using System.Drawing; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; +using System.Globalization; namespace LaptopSimulator2015 { @@ -18,11 +20,69 @@ namespace LaptopSimulator2015 #if DEBUG skipButton.Visible = true; #endif + p1lang.Text = Settings.lang.Name.Split('-')[0]; + p1descLabel.Text = strings.winMenuText; + cancelButton.Text = strings.cancel; + skipButton.Text = strings.skip; + p1continue.Text = strings._continue; + p2continue.Text = strings._continue; + p3continue.Text = strings.install.ToUpper(); + p5completeLabel.Text = strings.tutorialFinish; } - private void skipButton_Click(object sender, EventArgs e) + private void skipButton_Click(object sender, EventArgs e) => tabs.SelectedIndex = 4; + private void Tutorial_Shown(object sender, EventArgs e) => Program.splash.Hide(); + private void cancelButton_Click(object sender, EventArgs e) => Environment.Exit(0); + private void lang_SelectedIndexChanged(object sender, EventArgs e) + { + Settings.lang = CultureInfo.GetCultureInfo(p1lang.Text); + Thread.CurrentThread.CurrentUICulture = Settings.lang; + p1descLabel.Text = strings.winMenuText; + cancelButton.Text = strings.cancel; + skipButton.Text = strings.skip; + p1continue.Text = strings._continue; + p2continue.Text = strings._continue; + p3continue.Text = strings.install.ToUpper(); + p5completeLabel.Text = strings.tutorialFinish; + } + + private void Continue1_Click(object sender, EventArgs e) + { + tabs.SelectedIndex = 1; + progressBar.Value = 25; + } + + private void continue2_Click(object sender, EventArgs e) + { + tabs.SelectedIndex = 2; + progressBar.Value = 50; + } + + private void continue3_Click(object sender, EventArgs e) + { + tabs.SelectedIndex = 3; + progressTimer.Enabled = true; + } + + int timertime = 0; + private void timer1_Tick(object sender, EventArgs e) + { + if (timertime <= 50) + { + progressBar.Value = 50 + timertime; + timertime++; + } + else + { + tabs.SelectedIndex = 4; + } + } + + private void p5reboot_Click(object sender, EventArgs e) { Settings.level = 0; + Settings.Save(); + Program.splash.Show(); Close(); } } diff --git a/LaptopSimulator2015/Tutorial.resx b/LaptopSimulator2015/Tutorial.resx index 1af7de1..fffb0d8 100644 --- a/LaptopSimulator2015/Tutorial.resx +++ b/LaptopSimulator2015/Tutorial.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/LaptopSimulator2015/WizardTab.cs b/LaptopSimulator2015/WizardTab.cs new file mode 100644 index 0000000..41d5213 --- /dev/null +++ b/LaptopSimulator2015/WizardTab.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Drawing; + +namespace LaptopSimulator2015 +{ + public class WizardTab : TabControl + { + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + { + var filteredKeys = new Keys[]{(Keys.Control | Keys.Tab), + (Keys.Control | Keys.Shift | Keys.Tab), + Keys.Left, Keys.Right, Keys.Home, Keys.End}; + if (filteredKeys.Contains(keyData)) + return true; + return base.ProcessCmdKey(ref msg, keyData); + } + public const int TCM_FIRST = 0x1300; + public const int TCM_ADJUSTRECT = TCM_FIRST + 40; + public WizardTab() + { + Appearance = TabAppearance.Buttons; + ItemSize = new Size(1, 0); + SizeMode = TabSizeMode.Fixed; + TabStop = false; + } + + protected override void WndProc(ref Message m) + { + if (m.Msg == TCM_ADJUSTRECT && !DesignMode) + m.Result = (IntPtr)1; + else + base.WndProc(ref m); + } + } +} diff --git a/LaptopSimulator2015/strings.Designer.cs b/LaptopSimulator2015/strings.Designer.cs index 1836cc8..c6c0ea2 100644 --- a/LaptopSimulator2015/strings.Designer.cs +++ b/LaptopSimulator2015/strings.Designer.cs @@ -69,6 +69,15 @@ namespace LaptopSimulator2015 { } } + /// + /// Looks up a localized string similar to Cancel. + /// + internal static string cancel { + get { + return ResourceManager.GetString("cancel", resourceCulture); + } + } + /// /// Looks up a localized string similar to ABCDEFGHIJKLMNPQRSTUVWXYZ123456789. /// @@ -97,7 +106,7 @@ namespace LaptopSimulator2015 { } /// - /// Looks up a localized string similar to E X I T E D .. + /// Looks up a localized string similar to Shutting down VM.... /// internal static string consoleQuit { get { @@ -106,7 +115,7 @@ namespace LaptopSimulator2015 { } /// - /// Looks up a localized string similar to S T A R T I N G . . .. + /// Looks up a localized string similar to Starting up VM.... /// internal static string consoleStarting { get { @@ -114,6 +123,15 @@ namespace LaptopSimulator2015 { } } + /// + /// Looks up a localized string similar to Exit. + /// + internal static string exit { + get { + return ResourceManager.GetString("exit", resourceCulture); + } + } + /// /// Looks up a localized string similar to Fake Desktop. /// @@ -123,6 +141,15 @@ namespace LaptopSimulator2015 { } } + /// + /// Looks up a localized string similar to Install. + /// + internal static string install { + get { + return ResourceManager.GetString("install", resourceCulture); + } + } + /// /// Looks up a localized string similar to WARNING: We recommend you restart your game to apply these changes. Restart?. /// @@ -141,6 +168,15 @@ namespace LaptopSimulator2015 { } } + /// + /// Looks up a localized string similar to Credits. + /// + internal static string optionsWindowCredits { + get { + return ResourceManager.GetString("optionsWindowCredits", resourceCulture); + } + } + /// /// Looks up a localized string similar to LSD Mode. /// @@ -232,11 +268,29 @@ namespace LaptopSimulator2015 { } /// - /// Looks up a localized string similar to Exit. + /// Looks up a localized string similar to Skip. /// - internal static string winMenuExit1 { + internal static string skip { get { - return ResourceManager.GetString("winMenuExit1", resourceCulture); + return ResourceManager.GetString("skip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start. + /// + internal static string start { + get { + return ResourceManager.GetString("start", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Thank you for installing our OS. Please reboot your system to complete the installation!. + /// + internal static string tutorialFinish { + get { + return ResourceManager.GetString("tutorialFinish", resourceCulture); } } @@ -249,15 +303,6 @@ namespace LaptopSimulator2015 { } } - /// - /// Looks up a localized string similar to Start. - /// - internal static string winMenuStart { - get { - return ResourceManager.GetString("winMenuStart", resourceCulture); - } - } - /// /// Looks up a localized string similar to Hello and welcome to my game, I hope you'll like it. My name is CreepyCrafter24, btw. (FunFact: This game was originally created as the result of a conversation with a classmate). /// diff --git a/LaptopSimulator2015/strings.de.resx b/LaptopSimulator2015/strings.de.resx index e997bdb..1b052db 100644 --- a/LaptopSimulator2015/strings.de.resx +++ b/LaptopSimulator2015/strings.de.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Abbrechen + ABCDEFGHIJKLMNPQRSTUVWXYZ123456789 @@ -127,23 +130,32 @@ Drücken Sie eine beliebige Taste. - B E E N D E T . . . + VM wird heruntergefahren... - S T A R T E T . . . + VM wird gestartet... Fortfahren - + + Beenden + + Falscher Desktop + + Installieren + WARNUNG: Wir empfehlen, das Spiel nach der Änderung neu zu starten. Neu starten? Level + + Credits + LSD-Modus @@ -174,15 +186,18 @@ Bist du dir wirklich sicher, dass du deinen Fortschritt zurücksetzten möchtest? Dies ist deine letzte Möglichkeit, dies abzubrechen! - - Beenden + + Skip + + + Start + + + Vielen Dank, dass sie unser OS installiert haben. Bitte starten sie ihren Rechner neu, um die Installation fertigzustellen Bist du sicher? - - Start - Hallo und Willkommen in diesem Spiel. Mein Name ist CreepyCrafter24. (Im Übrigen: Dieses Spiel entstand ursprünglich aus einer Unterhaltung mit einem Klassenkameraden. Lustig, oder?) diff --git a/LaptopSimulator2015/strings.resx b/LaptopSimulator2015/strings.resx index e37cd71..87e1e89 100644 --- a/LaptopSimulator2015/strings.resx +++ b/LaptopSimulator2015/strings.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Cancel + ABCDEFGHIJKLMNPQRSTUVWXYZ123456789 @@ -127,23 +130,32 @@ Press any Key to quit. - E X I T E D . + Shutting down VM... - S T A R T I N G . . . + Starting up VM... Continue + + Exit + Fake Desktop + + Install + WARNING: We recommend you restart your game to apply these changes. Restart? Level + + Credits + LSD Mode @@ -174,15 +186,18 @@ Are you absolutly sure you want to reset you progress? This is your last chance to turn back! - - Exit + + Skip + + + Start + + + Thank you for installing our OS. Please reboot your system to complete the installation! Are you sure? - - Start - Hello and welcome to my game, I hope you'll like it. My name is CreepyCrafter24, btw. (FunFact: This game was originally created as the result of a conversation with a classmate)