From af84d587fc12fa6fe2d52f9f2a5892d4523110a9 Mon Sep 17 00:00:00 2001 From: 644 Date: Mon, 1 Nov 2021 20:02:35 +0000 Subject: [PATCH] Add cutscene movement and other fixes --- CheckUpdates.cs | 2 +- Config/config.default.json | 1 + Config/config.json | 1 + DMC3MusicConfig.cs | 1 + DMC3Process.cs | 9 +- Form1.Designer.cs | 57 +--- Form1.cs | 657 +++++++++++++++---------------------- GetMusic.cs | 2 +- HotkeysForm.Designer.cs | 100 ------ HotkeysForm.cs | 97 ------ HotkeysForm.resx | 120 ------- KeyboardHook.cs | 152 --------- Properties/AssemblyInfo.cs | 4 +- StyleSwitcher.Designer.cs | 14 + StyleSwitcher.cs | 17 +- dmc3music.csproj | 23 +- 16 files changed, 332 insertions(+), 925 deletions(-) delete mode 100644 HotkeysForm.Designer.cs delete mode 100644 HotkeysForm.cs delete mode 100644 HotkeysForm.resx delete mode 100644 KeyboardHook.cs diff --git a/CheckUpdates.cs b/CheckUpdates.cs index d607b54..e17b112 100644 --- a/CheckUpdates.cs +++ b/CheckUpdates.cs @@ -31,7 +31,7 @@ private async void CheckUpdates_Load(object sender, EventArgs e) { await CheckGitHubNewerVersion(); } - catch (Exception err) + catch { label1.Text = "Could not check for updates"; } diff --git a/Config/config.default.json b/Config/config.default.json index eeb7a60..4b51590 100644 --- a/Config/config.default.json +++ b/Config/config.default.json @@ -258,6 +258,7 @@ }, "TrackRemapping": {}, "Shuffle": false, + "CutsceneMovement": false, "ShuffleRotation": [ "Battle_00", "Battle_0a", diff --git a/Config/config.json b/Config/config.json index 3c9d1fc..877044d 100644 --- a/Config/config.json +++ b/Config/config.json @@ -258,6 +258,7 @@ }, "TrackRemapping": {}, "Shuffle": false, + "CutsceneMovement": false, "ShuffleRotation": [ "Battle_00", "Battle_0a", diff --git a/DMC3MusicConfig.cs b/DMC3MusicConfig.cs index 5a39341..f64bbfc 100644 --- a/DMC3MusicConfig.cs +++ b/DMC3MusicConfig.cs @@ -12,6 +12,7 @@ public class DMC3MusicConfig public Dictionary> RoomTracks { get; set; } public Dictionary> AmbientTracks { get; set; } public bool Shuffle { get; set; } + public bool CutsceneMovement { get; set; } public List ShuffleRotation { get; set; } public int BattleTimer { get; set; } public int AmbientTimer { get; set; } diff --git a/DMC3Process.cs b/DMC3Process.cs index 6bc4ec3..ba4e403 100644 --- a/DMC3Process.cs +++ b/DMC3Process.cs @@ -1,11 +1,7 @@ using Microsoft.Win32.SafeHandles; using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; namespace dmc3music { @@ -61,7 +57,7 @@ public bool OpenReadOnly() Process = localProcess[0]; Handle = OpenProcess(ProcessAccessFlags.VMRead, false, Process.Id); - if(Handle == UIntPtr.Zero) + if (Handle == UIntPtr.Zero) { return false; } @@ -135,7 +131,8 @@ public void WriteInt(int intVal, int address) public void WriteExactMem(byte[] bytes, int address) { - WriteProcessMemory(Handle, new IntPtr(address), bytes, (uint)bytes.LongLength, out _); + WriteProcessMemory(Handle, new IntPtr(address), bytes, (uint)bytes.LongLength, out int bytesWritten); + Console.WriteLine(bytesWritten); } public int ReadExactMem(int address) diff --git a/Form1.Designer.cs b/Form1.Designer.cs index ed1d86c..d3fcad8 100644 --- a/Form1.Designer.cs +++ b/Form1.Designer.cs @@ -53,14 +53,13 @@ private void InitializeComponent() this.button2 = new System.Windows.Forms.Button(); this.listBox1 = new System.Windows.Forms.ListBox(); this.tabPage2 = new System.Windows.Forms.TabPage(); + this.button7 = new System.Windows.Forms.Button(); this.button6 = new System.Windows.Forms.Button(); this.button5 = new System.Windows.Forms.Button(); - this.label9 = new System.Windows.Forms.Label(); this.checkBox2 = new System.Windows.Forms.CheckBox(); this.button4 = new System.Windows.Forms.Button(); this.button9 = new System.Windows.Forms.Button(); this.label8 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.comboBox1 = new System.Windows.Forms.ComboBox(); this.button1 = new System.Windows.Forms.Button(); @@ -71,8 +70,6 @@ private void InitializeComponent() this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.tabControl1 = new System.Windows.Forms.TabControl(); - this.button7 = new System.Windows.Forms.Button(); - this.button8 = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); this.tabPage3.SuspendLayout(); @@ -273,16 +270,13 @@ private void InitializeComponent() // // tabPage2 // - this.tabPage2.Controls.Add(this.button8); this.tabPage2.Controls.Add(this.button7); this.tabPage2.Controls.Add(this.button6); this.tabPage2.Controls.Add(this.button5); - this.tabPage2.Controls.Add(this.label9); this.tabPage2.Controls.Add(this.checkBox2); this.tabPage2.Controls.Add(this.button4); this.tabPage2.Controls.Add(this.button9); this.tabPage2.Controls.Add(this.label8); - this.tabPage2.Controls.Add(this.label7); this.tabPage2.Controls.Add(this.label6); this.tabPage2.Controls.Add(this.comboBox1); this.tabPage2.Controls.Add(this.button1); @@ -295,6 +289,16 @@ private void InitializeComponent() this.tabPage2.Text = "Options"; this.tabPage2.UseVisualStyleBackColor = true; // + // button7 + // + this.button7.Location = new System.Drawing.Point(6, 215); + this.button7.Name = "button7"; + this.button7.Size = new System.Drawing.Size(93, 23); + this.button7.TabIndex = 29; + this.button7.Text = "Open Folder"; + this.button7.UseVisualStyleBackColor = true; + this.button7.Click += new System.EventHandler(this.button7_Click); + // // button6 // this.button6.Location = new System.Drawing.Point(129, 185); @@ -315,14 +319,6 @@ private void InitializeComponent() this.button5.UseVisualStyleBackColor = true; this.button5.Click += new System.EventHandler(this.button5_Click); // - // label9 - // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(3, 151); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(0, 13); - this.label9.TabIndex = 26; - // // checkBox2 // this.checkBox2.AutoSize = true; @@ -363,14 +359,6 @@ private void InitializeComponent() this.label8.TabIndex = 5; this.label8.Text = "DMC3 Path"; // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(8, 84); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(0, 13); - this.label7.TabIndex = 4; - // // label6 // this.label6.AutoSize = true; @@ -483,26 +471,6 @@ private void InitializeComponent() this.tabControl1.Size = new System.Drawing.Size(245, 273); this.tabControl1.TabIndex = 16; // - // button7 - // - this.button7.Location = new System.Drawing.Point(6, 215); - this.button7.Name = "button7"; - this.button7.Size = new System.Drawing.Size(93, 23); - this.button7.TabIndex = 29; - this.button7.Text = "Open Folder"; - this.button7.UseVisualStyleBackColor = true; - this.button7.Click += new System.EventHandler(this.button7_Click); - // - // button8 - // - this.button8.Location = new System.Drawing.Point(7, 186); - this.button8.Name = "button8"; - this.button8.Size = new System.Drawing.Size(92, 23); - this.button8.TabIndex = 30; - this.button8.Text = "Hotkeys"; - this.button8.UseVisualStyleBackColor = true; - this.button8.Click += new System.EventHandler(this.button8_Click); - // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -547,7 +515,6 @@ private void InitializeComponent() private System.Windows.Forms.TabPage tabPage2; private System.Windows.Forms.Button button9; private System.Windows.Forms.Label label8; - private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label6; private System.Windows.Forms.ComboBox comboBox1; private System.Windows.Forms.Button button1; @@ -568,11 +535,9 @@ private void InitializeComponent() private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.CheckBox checkBox2; private System.Windows.Forms.Button button4; - private System.Windows.Forms.Label label9; private System.Windows.Forms.Button button6; private System.Windows.Forms.Button button5; private System.Windows.Forms.Button button7; - private System.Windows.Forms.Button button8; } } diff --git a/Form1.cs b/Form1.cs index 1d414c8..1735694 100644 --- a/Form1.cs +++ b/Form1.cs @@ -4,8 +4,6 @@ using System.Drawing; using System.IO; using System.Linq; -using System.Runtime.InteropServices; -using System.Security; using System.Text.RegularExpressions; using System.Windows.Forms; using System.Xml; @@ -32,47 +30,10 @@ public partial class Form1 : Form private string outMaxPos { get; set; } - private KeyboardHook hook { get; set; } = new KeyboardHook(); - - private void getGamePath() - { - string steamPath = (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Valve\Steam", "InstallPath", null); - string libraryPath = Path.Combine(steamPath, "steamapps/libraryfolders.vdf"); - string[] steamLibraries = File.ReadAllLines(libraryPath); - string gamePath = ""; - string tmpGamePath = ""; - - foreach (string line in steamLibraries) - { - Match matchPath = Regex.Match(line, @"""(?\w:\\\\.*)"""); - if (matchPath.Success) - { - tmpGamePath = matchPath.Groups["path"].Value.Replace(@"\\", @"\"); - } - Match matchGame = Regex.Match(line, @"""(?<6550>\w:\\\\.*)"""); - if (matchGame.Success) - { - gamePath = tmpGamePath; - } - } - - - gamePath = Path.GetFullPath(Path.Combine(gamePath, "steamapps/common/Devil May Cry 3")); - if (Directory.Exists(gamePath)) - { - Config.DMC3Path = gamePath; - DMC3MusicConfigWriter.WriteConfig(Config); - MessageBox.Show($"Automatically set the game path to '{gamePath}'. To change this, set the path in the options tab.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - public Form1() { - try - { - InitializeComponent(); - } - catch { } + + InitializeComponent(); try { Config = DMC3MusicConfigWriter.ReadConfig(); @@ -80,6 +41,7 @@ public Form1() catch { MessageBox.Show("Error", "There was a problem opening the config", MessageBoxButtons.OK, MessageBoxIcon.Error); + Application.Exit(); } try @@ -98,7 +60,10 @@ public Form1() SongChangeTimer = new Timer(); SongProgressTimer = new Timer(); } - catch { } + catch + { + Application.Exit(); + } try { @@ -113,84 +78,21 @@ public Form1() } catch { - System.Windows.Forms.Application.Exit(); + Application.Exit(); } try { if (!Directory.Exists("tracks")) { - MessageBox.Show("You will need to download the tracks from the Options tab", "Information", MessageBoxButtons.OK, MessageBoxIcon.None); + NotifyUser(5000, "Missing Tracks", "You will need to download the tracks from the otions tab to play music"); } } catch { } - -/* hook.KeyPressed += new EventHandler(hook_KeyPressed); - hook.RegisterHotKey(dmc3music.ModifierKeys.Control | dmc3music.ModifierKeys.Alt, Keys.D); - hook.RegisterHotKey(dmc3music.ModifierKeys.Control | dmc3music.ModifierKeys.Alt, Keys.G); - hook.RegisterHotKey(dmc3music.ModifierKeys.Control | dmc3music.ModifierKeys.Alt, Keys.D0);*/ - - /* try - { - var MusicPath1 = Path.Combine(Config.DMC3Path, "native/sound"); - var MusicPath2 = Path.Combine(Config.DMC3Path, "sound"); - if (((string)Config.DMC3Path == string.Empty || Config.DMC3Path == null || !Directory.Exists(Config.DMC3Path)) && !Directory.Exists("tracks/")) - { - MessageBox.Show("You will need to set the DMC3 Path in the Options tab, or download the tracks folder from the github and add it to the root directory of this tool in order to play music", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else if (Directory.Exists(MusicPath1)) - { - Config.MusicPath = MusicPath1; - Config.ExtensionType = ".ogg"; - } - else if (Directory.Exists(MusicPath2)) - { - Config.MusicPath = MusicPath2; - Config.ExtensionType = ".bin"; - } - else - { - Config.MusicPath = "tracks"; - Config.ExtensionType = ".ogg"; - } - } - catch { }*/ } #region Form Control Methods - private void hook_KeyPressed(object sender, KeyPressedEventArgs e) - { - switch (e.Key) - { - case Keys.D: - Process.Start("steam://rungameid/6550"); - break; - case Keys.G: - using (DMC3Process DMC3RO = new DMC3Process()) - { - if (!DMC3RO.OpenReadOnly()) - { - return; - } - DMC3RO.Process.Kill(); - } - break; - case Keys.D0: - using (DMC3Process DMC3RO = new DMC3Process()) - { - if (DMC3RO.OpenReadOnly()) - { - DMC3RO.Process.Kill(); - } - } - Process.Start("steam://rungameid/6550"); - break; - default: - break; - } - } - private void Form1_Load(object sender, EventArgs e) { try @@ -203,7 +105,7 @@ private void Form1_Load(object sender, EventArgs e) } catch { - MessageBox.Show("Error", "There was a problem opening the config", MessageBoxButtons.OK, MessageBoxIcon.Error); + NotifyUser(5000, "Error", "There was a problem opening the config"); } try @@ -280,22 +182,19 @@ private void pictureBox2_Click(object sender, EventArgs e) } catch { - MessageBox.Show("Error", "There was a problem loading the Song Player", MessageBoxButtons.OK, MessageBoxIcon.Error); + NotifyUser(5000, "Error", "There was a problem loading the Song Player"); } - try - { - DMC3.Process = Process.GetProcessesByName("dmc3se")[0]; - } - catch + + DMC3 = new DMC3Process(); + if (!DMC3.OpenReadOnly()) { - MessageBox.Show("pls start game first", "dmc3se.exe not found", MessageBoxButtons.OK, MessageBoxIcon.Error); + DMC3.Dispose(); + NotifyUser(5000, "pls start game first", "dmc3se.exe not found"); return; } + try { - DMC3 = new DMC3Process(); - DMC3.OpenReadOnly(); - SongChangeTimer = new Timer { Interval = 50 @@ -325,7 +224,7 @@ private void pictureBox1_Click(object sender, EventArgs e) } catch { - MessageBox.Show("Error", "There was a problem stopping the Song Player", MessageBoxButtons.OK, MessageBoxIcon.Error); + NotifyUser(5000, "Error", "There was a problem stopping the Song Player"); } } @@ -340,268 +239,83 @@ private void button9_Click(object sender, EventArgs e) catch { } } - #endregion - - #region Functionality Methods - - public bool disableMusic { get; set; } = false; - - private void GameStart(object sender, EventArgs e) + private void button4_Click(object sender, EventArgs e) { - using(DMC3Process DMC3RO = new DMC3Process()) - { - if (DMC3RO.OpenReadOnly() == false) - { - return; - } - -/* disableMusic = false; - Version latestVers = new Version(1, 3, 0, 0); - Version oldVers = new Version(1, 0, 0, 0); - - if(DMC3RO.VersionInfo.CompareTo(latestVers) != 0) - { - if (DMC3RO.VersionInfo.CompareTo(oldVers) != 0) - { - return; - } - disableMusic = true; - }*/ - } - -/* if (disableMusic) - { - using(DMC3Process DMC3RW = new DMC3Process()) - { - if(DMC3RW.OpenReadWrite() == false) - { - return; - } - - byte[] nop = new byte[] { 144 }; - byte[] ret = new byte[] { 195 }; - - for (int i = 0x3F00; i < 0x3FD3; i++) - { - DMC3RW.WriteMem(nop, i); - } - - DMC3RW.WriteMem(ret, 0x3FD4); - } - }*/ - -/* using (DMC3Process DMC3RW = new DMC3Process()) - { - if (DMC3RW.OpenReadWrite() == false) - { - return; - } - - DMC3RW.WriteInt(2560, 0x402840); // 0x402840 - DMC3RW.WriteInt(1440, 0x402846); // 0x402846 - - DMC3RW.WriteInt(2560, 0x409C58); // 0x409C58 - DMC3RW.WriteInt(1440, 0x409C62); // 0x409C62 - - DMC3RW.WriteInt(2560, 0x77E38C); // 0x77E38C - DMC3RW.WriteInt(1440, 0x77E390); // 0x77E390 - - DMC3RW.WriteExactMem(new byte[] { 0xEB }, 0x402822); // 0x402822 - DMC3RW.WriteExactMem(new byte[] { 0xC7 }, 0x6CC667); // 0x6CC667 - - DMC3RW.WriteExactMem(new byte[] { 0x47 }, 0x6CC668); // 0x6CC668 - DMC3RW.WriteExactMem(new byte[] { 0x60 }, 0x6CC669); // 0x6CC669 - DMC3RW.WriteExactMem(new byte[] { 0x00 }, 0x6CC66A); // 0x6CC66A - DMC3RW.WriteExactMem(new byte[] { 0x00 }, 0x6CC66B); // 0x6CC66B - DMC3RW.WriteExactMem(new byte[] { 0x40 }, 0x6CC66C); // 0x6CC66C - DMC3RW.WriteExactMem(new byte[] { 0x3F }, 0x6CC66D); // 0x6CC66D - - DMC3RW.WriteExactMem(new byte[] { 0x70 }, 0x6CC699); // 0x6CC699 - }*/ - - DMC3 = new DMC3Process(); - - if(DMC3.OpenReadOnly() == false) - { - DMC3.Dispose(); - return; - } - - Player = new SongPlayer(Config); - try { - GameStartTimer.Stop(); - DisableConfigControls(); - - SongChangeTimer = new Timer - { - Interval = 50 - }; - SongChangeTimer.Tick += new EventHandler(CheckSong); - SongChangeTimer.Start(); - - SongProgressTimer = new Timer - { - Interval = 100 - }; - SongProgressTimer.Tick += new EventHandler(GetSongProgress); - SongProgressTimer.Start(); - } - catch - { - DMC3.Dispose(); - MessageBox.Show("Error", "There was a problem opening the DMC3 Process", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - - private void GetSongProgress(object sender, EventArgs e) - { - if (Player.isPlaying) - { - label2.Text = $"Playing: {Player.OldTrack}"; - TimeSpan currentPos = TimeSpan.FromMilliseconds(Player.TrackPos); - - if (newTrack) - { - newTrack = false; - TimeSpan maxPos = TimeSpan.FromSeconds(Player.TrackLength); - outMaxPos = maxPos.ToString(@"m\:ss\.ff"); - } - - string outCurrentPos; - - if (currentPos.Minutes > 0) - { - outCurrentPos = currentPos.ToString(@"m\:ss\.ff"); - } - else - { - outCurrentPos = currentPos.ToString(@"ss\.ff"); - } - - label2.Text = $"Playing : {Player.OldTrack} ({outCurrentPos}/{outMaxPos})"; - } - else - { - label2.Text = "Not Playing"; + StyleSwitcher StyleForm = new StyleSwitcher(); + DialogResult result = StyleForm.ShowDialog(); + ConfigChanged = StyleForm.ConfigChanged; + StyleForm.Dispose(); } + catch { } } - - - private void CheckSong(object sender, EventArgs e) + private void checkBox2_CheckedChanged(object sender, EventArgs e) { - if (DMC3.ProcHasExited) - { - DMC3.Dispose(); - Player.Stop(); - SongChangeTimer.Stop(); - SongProgressTimer.Stop(); - GameStartTimer.Start(); - return; - } - try { - int checkRoom = 0; - checkRoom = DMC3.ReadMem(0x20C39EC); - - if (checkRoom <= 0) + if (Config.DMC3Path == string.Empty || Config.DMC3Path == null || !Directory.Exists(Config.DMC3Path)) { - if (Player.isPlaying) - { - Player.FadeOut(); - } + NotifyUser(5000, "Error", "Please make sure the path to DMC3 is correct in the Options tab"); return; } - - int roomId = -1; - int enemyCount = -1; - int missionNumber = -1; - int isLoading = -1; - int vanguardSpawned = -1; - - roomId = DMC3.ReadMem(0x76B150); - - IntPtr tmpPtr = IntPtr.Add(DMC3.BaseAddress, 0x76B860 + 0xC40 + 0x8); - int enemyCountPtr1 = DMC3.GetIntPtr(tmpPtr); - tmpPtr = IntPtr.Add(new IntPtr(enemyCountPtr1), 0x18); - int enemyCountPtr2 = DMC3.GetIntPtr(tmpPtr); - tmpPtr = IntPtr.Add(new IntPtr(enemyCountPtr2), 0xA78); - enemyCount = DMC3.GetIntPtr(tmpPtr); - - missionNumber = DMC3.ReadMem(0x76B148); - isLoading = DMC3.ReadMem(0x205BCB8); - - if (missionNumber == 2) + if (checkBox2.Checked) { - vanguardSpawned = DMC3.ReadMem(0x5585AC); - if (vanguardSpawned == 770) + foreach (string filename in Directory.EnumerateFiles("./inputsthing")) { - roomId = 66; + string modName = filename.Split('\\').Last(); + string dest = Path.Combine(Config.DMC3Path, modName); + File.Copy(filename, dest, true); + NotifyUser(5000, "DMC3 Inputs Thing", "Successfully Installed!"); } } - - if (roomId != -1) + else { - Player.PlayRoomSong(roomId, enemyCount, missionNumber); - newTrack = true; + string dinputSrc = "./styleswitcher/dinput8.dll"; + string dest = Path.Combine(Config.DMC3Path, "dinput8.dll"); + File.Copy(dinputSrc, dest, true); + NotifyUser(5000, "DMC3 Inputs Thing", "Successfully Uninstalled!"); } } catch { - DMC3.Dispose(); - Player.Stop(); - SongChangeTimer.Stop(); - SongProgressTimer.Stop(); - GameStartTimer.Start(); - return; + NotifyUser(5000, "DMC3 Inputs Thing", "Failed To Install!"); } } - private bool SaveConfigPrompt() + private void button5_Click(object sender, EventArgs e) { try { - DialogResult result = MessageBox.Show("Would you like to save your current configuration settings?", - "Save Configuration", - MessageBoxButtons.YesNoCancel, - MessageBoxIcon.Exclamation); - - if (result == DialogResult.Yes) - { - DMC3MusicConfigWriter.WriteConfig(Config); - ConfigChanged = false; - } - return result != DialogResult.Cancel; - } - catch - { - return false; + CheckUpdates UpdateForm = new CheckUpdates(); + DialogResult result = UpdateForm.ShowDialog(); + UpdateForm.Dispose(); } + catch { } } - private void DisableConfigControls() + private void button6_Click(object sender, EventArgs e) { try { - shuffleCheckBox.Enabled = false; - changeShuffle.Enabled = false; - pictureBox2.Enabled = false; + GetMusic MusicForm = new GetMusic(); + DialogResult result = MusicForm.ShowDialog(); + MusicForm.Dispose(); } catch { } } - private void EnableConfigControls() + private void button7_Click(object sender, EventArgs e) { - try + if (Directory.Exists(Config.DMC3Path)) { - shuffleCheckBox.Enabled = true; - changeShuffle.Enabled = true; - pictureBox2.Enabled = true; + Process.Start("explorer.exe", Config.DMC3Path); + } + else + { + NotifyUser(5000, "Error", "Couldn't find the path to DMC3. Make sure it's set above."); } - catch { } } private void numericUpDown1_ValueChanged(object sender, EventArgs e) @@ -655,12 +369,11 @@ private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) string destination = Path.Combine(Config.DMC3Path, "save0.sav"); File.Copy(source, destination, true); - label7.Text = $"Copied '{fileName}' Successfully!"; - label7.MaximumSize = new Size((sender as Control).ClientSize.Width - label7.Left, 10000); + NotifyUser(5000, "Save Loader", $"Copied '{fileName}' Successfully!"); } catch { - label7.Text = "Failed To Copy!"; + NotifyUser(5000, "Save Loader", "Failed To Copy!"); } } @@ -847,92 +560,264 @@ private void button3_Click(object sender, EventArgs e) #endregion - private void button4_Click(object sender, EventArgs e) + #region Functionality Methods + + private void getGamePath() { - try + string steamPath = (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Valve\Steam", "InstallPath", null); + string libraryPath = Path.Combine(steamPath, "steamapps/libraryfolders.vdf"); + string[] steamLibraries = File.ReadAllLines(libraryPath); + string gamePath = ""; + string tmpGamePath = ""; + + foreach (string line in steamLibraries) { - StyleSwitcher StyleForm = new StyleSwitcher(); - DialogResult result = StyleForm.ShowDialog(); - StyleForm.Dispose(); + Match matchPath = Regex.Match(line, @"""(?\w:\\\\.*)"""); + if (matchPath.Success) + { + tmpGamePath = matchPath.Groups["path"].Value.Replace(@"\\", @"\"); + } + Match matchGame = Regex.Match(line, @"""(?<6550>\w:\\\\.*)"""); + if (matchGame.Success) + { + gamePath = tmpGamePath; + } + } + + + gamePath = Path.GetFullPath(Path.Combine(gamePath, "steamapps/common/Devil May Cry 3")); + if (Directory.Exists(gamePath)) + { + Config.DMC3Path = gamePath; + DMC3MusicConfigWriter.WriteConfig(Config); + MessageBox.Show($"Automatically set the game path to '{gamePath}'. To change this, set the path in the options tab.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } - catch { } } - private void checkBox2_CheckedChanged(object sender, EventArgs e) + private void GameStart(object sender, EventArgs e) { - try + using (DMC3Process DMC3RW = new DMC3Process()) { - if (Config.DMC3Path == string.Empty || Config.DMC3Path == null || !Directory.Exists(Config.DMC3Path)) + if (ConfigChanged) + { + ConfigChanged = false; + Config = DMC3MusicConfigWriter.ReadConfig(); + } + + if (!DMC3RW.OpenReadWrite()) { - MessageBox.Show("Please make sure the path to DMC3 is correct in the Options tab", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } - if (checkBox2.Checked) + + if (Config.CutsceneMovement) { - foreach (string filename in Directory.EnumerateFiles("./inputsthing")) + IntPtr cutsceneMovementPtrSS = IntPtr.Add(DMC3RW.BaseAddress, 0x1DFF20); + int cutsceneMovementPtrSS2 = DMC3RW.GetIntPtr(cutsceneMovementPtrSS); + + if (DMC3RW.ReadExactMem(cutsceneMovementPtrSS2 + 0x26) != 2) { - string modName = filename.Split('\\').Last(); - string dest = Path.Combine(Config.DMC3Path, modName); - File.Copy(filename, dest, true); - label9.Text = "Successfully Installed!"; + return; } + + DMC3RW.WriteExactMem(new byte[] { 0x00 }, cutsceneMovementPtrSS2 + 0x26); + DMC3RW.WriteMem(new byte[] { 0xC7, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x2C1A6F); + } + } + + DMC3 = new DMC3Process(); + + if (!DMC3.OpenReadOnly()) + { + DMC3.Dispose(); + return; + } + + Player = new SongPlayer(Config); + + try + { + GameStartTimer.Stop(); + DisableConfigControls(); + + SongChangeTimer = new Timer + { + Interval = 50 + }; + SongChangeTimer.Tick += new EventHandler(CheckSong); + SongChangeTimer.Start(); + + SongProgressTimer = new Timer + { + Interval = 100 + }; + SongProgressTimer.Tick += new EventHandler(GetSongProgress); + SongProgressTimer.Start(); + } + catch + { + DMC3.Dispose(); + NotifyUser(5000, "Error", "There was a problem opening the DMC3 Process"); + } + } + + private void GetSongProgress(object sender, EventArgs e) + { + if (Player.isPlaying) + { + label2.Text = $"Playing: {Player.OldTrack}"; + TimeSpan currentPos = TimeSpan.FromMilliseconds(Player.TrackPos); + + if (newTrack) + { + newTrack = false; + TimeSpan maxPos = TimeSpan.FromSeconds(Player.TrackLength); + outMaxPos = maxPos.ToString(@"m\:ss\.ff"); + } + + string outCurrentPos; + + if (currentPos.Minutes > 0) + { + outCurrentPos = currentPos.ToString(@"m\:ss\.ff"); } else { - string dinputSrc = "./styleswitcher/dinput8.dll"; - string dest = Path.Combine(Config.DMC3Path, "dinput8.dll"); - File.Copy(dinputSrc, dest, true); - label9.Text = "Successfully Uninstalled!"; + outCurrentPos = currentPos.ToString(@"ss\.ff"); } + + label2.Text = $"Playing : {Player.OldTrack} ({outCurrentPos}/{outMaxPos})"; } - catch + else { - label9.Text = "Failed To Install!"; + label2.Text = "Not Playing"; } } - private void button5_Click(object sender, EventArgs e) + private void CheckSong(object sender, EventArgs e) { + if (DMC3.ProcHasExited) + { + DMC3.Dispose(); + Player.Stop(); + SongChangeTimer.Stop(); + SongProgressTimer.Stop(); + GameStartTimer.Start(); + return; + } + try { - CheckUpdates UpdateForm = new CheckUpdates(); - DialogResult result = UpdateForm.ShowDialog(); - UpdateForm.Dispose(); + int checkRoom = 0; + checkRoom = DMC3.ReadMem(0x20C39EC); + + if (checkRoom <= 0) + { + if (Player.isPlaying) + { + Player.FadeOut(); + } + return; + } + + int roomId = -1; + int enemyCount = -1; + int missionNumber = -1; + int isLoading = -1; + int vanguardSpawned = -1; + + roomId = DMC3.ReadMem(0x76B150); + + IntPtr tmpPtr = IntPtr.Add(DMC3.BaseAddress, 0x76B860 + 0xC40 + 0x8); + int enemyCountPtr1 = DMC3.GetIntPtr(tmpPtr); + tmpPtr = IntPtr.Add(new IntPtr(enemyCountPtr1), 0x18); + int enemyCountPtr2 = DMC3.GetIntPtr(tmpPtr); + tmpPtr = IntPtr.Add(new IntPtr(enemyCountPtr2), 0xA78); + enemyCount = DMC3.GetIntPtr(tmpPtr); + + missionNumber = DMC3.ReadMem(0x76B148); + isLoading = DMC3.ReadMem(0x205BCB8); + + if (missionNumber == 2) + { + vanguardSpawned = DMC3.ReadMem(0x5585AC); + if (vanguardSpawned == 770) + { + roomId = 66; + } + } + + if (roomId != -1) + { + Player.PlayRoomSong(roomId, enemyCount, missionNumber); + newTrack = true; + } + } + catch + { + DMC3.Dispose(); + Player.Stop(); + SongChangeTimer.Stop(); + SongProgressTimer.Stop(); + GameStartTimer.Start(); + return; } - catch { } } - private void button6_Click(object sender, EventArgs e) + private bool SaveConfigPrompt() { try { - GetMusic MusicForm = new GetMusic(); - DialogResult result = MusicForm.ShowDialog(); - MusicForm.Dispose(); + DialogResult result = MessageBox.Show("Would you like to save your current configuration settings?", "Save Configuration", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation); + + if (result == DialogResult.Yes) + { + DMC3MusicConfigWriter.WriteConfig(Config); + ConfigChanged = false; + } + + return result != DialogResult.Cancel; + } + catch + { + return false; } - catch { } } - private void button7_Click(object sender, EventArgs e) + private void DisableConfigControls() { - if (Directory.Exists(Config.DMC3Path)) - { - Process.Start("explorer.exe", Config.DMC3Path); - } else + try { - MessageBox.Show("Couldn't find the path to DMC3. Make sure it's set above.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + shuffleCheckBox.Enabled = false; + changeShuffle.Enabled = false; + pictureBox2.Enabled = false; } + catch { } } - private void button8_Click(object sender, EventArgs e) + private void EnableConfigControls() { try { - HotkeysForm HotkeysFrm = new HotkeysForm(); - DialogResult result = HotkeysFrm.ShowDialog(); - HotkeysFrm.Dispose(); + shuffleCheckBox.Enabled = true; + changeShuffle.Enabled = true; + pictureBox2.Enabled = true; } catch { } } + + private void NotifyUser(int timeout, string tipTitle, string tipText) + { + NotifyIcon notifyIcon1 = new NotifyIcon(this.components); + notifyIcon1.Icon = this.Icon; + notifyIcon1.Visible = true; + notifyIcon1.ShowBalloonTip(timeout, tipTitle, tipText, ToolTipIcon.None); + notifyIcon1.BalloonTipClosed += (sender, e) => { + var thisIcon = (NotifyIcon)sender; + thisIcon.Visible = false; + thisIcon.Dispose(); + }; + } + + #endregion } } diff --git a/GetMusic.cs b/GetMusic.cs index e1e414c..6fd95f5 100644 --- a/GetMusic.cs +++ b/GetMusic.cs @@ -76,7 +76,7 @@ private void WcOnDownloadProgressChanged(object sender, DownloadProgressChangedE string readRecv = ReadableSize(e.BytesReceived); string maxRecv = ReadableSize(e.TotalBytesToReceive); - label1.Text = $"Downloaded {readRecv} of {maxRecv} ({e.ProgressPercentage}%)"; + label1.Text = $"Downloading {readRecv} of {maxRecv} ({e.ProgressPercentage}%)"; RecenterLabel1(); progressBar1.Value = e.ProgressPercentage; } diff --git a/HotkeysForm.Designer.cs b/HotkeysForm.Designer.cs deleted file mode 100644 index 6cac1d4..0000000 --- a/HotkeysForm.Designer.cs +++ /dev/null @@ -1,100 +0,0 @@ -namespace dmc3music -{ - partial class HotkeysForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.checkBox1 = new System.Windows.Forms.CheckBox(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.button1 = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // checkBox1 - // - this.checkBox1.AutoSize = true; - this.checkBox1.Location = new System.Drawing.Point(12, 12); - this.checkBox1.Name = "checkBox1"; - this.checkBox1.Size = new System.Drawing.Size(101, 17); - this.checkBox1.TabIndex = 0; - this.checkBox1.Text = "Enable Hotkeys"; - this.checkBox1.UseVisualStyleBackColor = true; - // - // textBox1 - // - this.textBox1.Location = new System.Drawing.Point(12, 72); - this.textBox1.Name = "textBox1"; - this.textBox1.ReadOnly = true; - this.textBox1.ShortcutsEnabled = false; - this.textBox1.Size = new System.Drawing.Size(171, 20); - this.textBox1.TabIndex = 1; - this.textBox1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.textBox1_MouseClick); - this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 53); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(60, 13); - this.label1.TabIndex = 2; - this.label1.Text = "Start Game"; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(12, 125); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(98, 23); - this.button1.TabIndex = 3; - this.button1.Text = "Save Hotkeys"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // HotkeysForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Controls.Add(this.button1); - this.Controls.Add(this.label1); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.checkBox1); - this.Name = "HotkeysForm"; - this.Text = "HotkeysForm"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.CheckBox checkBox1; - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Button button1; - } -} \ No newline at end of file diff --git a/HotkeysForm.cs b/HotkeysForm.cs deleted file mode 100644 index 5bde010..0000000 --- a/HotkeysForm.cs +++ /dev/null @@ -1,97 +0,0 @@ -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 dmc3music -{ - public partial class HotkeysForm : Form - { - public HotkeysForm() - { - InitializeComponent(); - } - - private bool modSet { get; set; } = false; - - public Dictionary modKeysStartGame { get; set; } = new Dictionary() - { - { Keys.Control, false }, - { Keys.Shift, false }, - { Keys.Alt, false } - }; - - private void SetText(string text) - { - if(textBox1.Text.Length == 0) - { - textBox1.Text = text; - } else - { - textBox1.Text += $"+ {text}"; - } - } - - private void textBox1_KeyDown(object sender, KeyEventArgs e) - { - if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Escape) - { - return; - } - if (textBox1.Text.Contains(e.KeyCode.ToString())){ - return; - } - - else if((Control.ModifierKeys & Keys.Control) == Keys.Control) - { - if (textBox1.Text.Contains(Keys.Control.ToString())) - { - return; - } - modSet = true; - modKeysStartGame[Keys.Control] = true; - SetText(Keys.Control.ToString()); - } - - else if ((Control.ModifierKeys & Keys.Alt) == Keys.Alt) - { - if (textBox1.Text.Contains(Keys.Alt.ToString())) - { - return; - } - modSet = true; - SetText(Keys.Alt.ToString()); - } - - else if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift) - { - if (textBox1.Text.Contains(Keys.Shift.ToString())) - { - return; - } - modSet = true; - SetText(Keys.Shift.ToString()); - } - else - { - SetText(e.KeyCode.ToString()); - } - } - - private void textBox1_MouseClick(object sender, MouseEventArgs e) - { - modSet = false; - textBox1.Text = ""; - } - - private void button1_Click(object sender, EventArgs e) - { - - } - } -} diff --git a/HotkeysForm.resx b/HotkeysForm.resx deleted file mode 100644 index 1af7de1..0000000 --- a/HotkeysForm.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/KeyboardHook.cs b/KeyboardHook.cs deleted file mode 100644 index c0b9d07..0000000 --- a/KeyboardHook.cs +++ /dev/null @@ -1,152 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace dmc3music -{ - public sealed class KeyboardHook : IDisposable - { - // Registers a hot key with Windows. - [DllImport("user32.dll")] - private static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vk); - // Unregisters the hot key with Windows. - [DllImport("user32.dll")] - private static extern bool UnregisterHotKey(IntPtr hWnd, int id); - - /// - /// Represents the window that is used internally to get the messages. - /// - private class Window : NativeWindow, IDisposable - { - private static int WM_HOTKEY = 0x0312; - - public Window() - { - // create the handle for the window. - this.CreateHandle(new CreateParams()); - } - - /// - /// Overridden to get the notifications. - /// - /// - protected override void WndProc(ref Message m) - { - base.WndProc(ref m); - - // check if we got a hot key pressed. - if (m.Msg == WM_HOTKEY) - { - // get the keys. - Keys key = (Keys)(((int)m.LParam >> 16) & 0xFFFF); - ModifierKeys modifier = (ModifierKeys)((int)m.LParam & 0xFFFF); - - // invoke the event to notify the parent. - if (KeyPressed != null) - KeyPressed(this, new KeyPressedEventArgs(modifier, key)); - } - } - - public event EventHandler KeyPressed; - - #region IDisposable Members - - public void Dispose() - { - this.DestroyHandle(); - } - - #endregion - } - - private Window _window = new Window(); - private int _currentId; - - public KeyboardHook() - { - // register the event of the inner native window. - _window.KeyPressed += delegate (object sender, KeyPressedEventArgs args) - { - if (KeyPressed != null) - KeyPressed(this, args); - }; - } - - /// - /// Registers a hot key in the system. - /// - /// The modifiers that are associated with the hot key. - /// The key itself that is associated with the hot key. - public void RegisterHotKey(ModifierKeys modifier, Keys key) - { - // increment the counter. - _currentId = _currentId + 1; - - // register the hot key. - if (!RegisterHotKey(_window.Handle, _currentId, (uint)modifier, (uint)key)) - throw new InvalidOperationException("Couldn’t register the hot key."); - } - - /// - /// A hot key has been pressed. - /// - public event EventHandler KeyPressed; - - #region IDisposable Members - - public void Dispose() - { - // unregister all the registered hot keys. - for (int i = _currentId; i > 0; i--) - { - UnregisterHotKey(_window.Handle, i); - } - - // dispose the inner native window. - _window.Dispose(); - } - - #endregion - } - - /// - /// Event Args for the event that is fired after the hot key has been pressed. - /// - public class KeyPressedEventArgs : EventArgs - { - private ModifierKeys _modifier; - private Keys _key; - - internal KeyPressedEventArgs(ModifierKeys modifier, Keys key) - { - _modifier = modifier; - _key = key; - } - - public ModifierKeys Modifier - { - get { return _modifier; } - } - - public Keys Key - { - get { return _key; } - } - } - - /// - /// The enumeration of possible modifiers. - /// - [Flags] - public enum ModifierKeys : uint - { - Alt = 1, - Control = 2, - Shift = 4, - Win = 8 - } -} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 3397e81..666b863 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,6 +32,6 @@ // 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("2.2.0.0")] -[assembly: AssemblyFileVersion("2.2.0.0")] +[assembly: AssemblyVersion("2.3.0.0")] +[assembly: AssemblyFileVersion("2.3.0.0")] [assembly: NeutralResourcesLanguage("en")] diff --git a/StyleSwitcher.Designer.cs b/StyleSwitcher.Designer.cs index d98d2ac..b4b952d 100644 --- a/StyleSwitcher.Designer.cs +++ b/StyleSwitcher.Designer.cs @@ -49,6 +49,7 @@ private void InitializeComponent() this.label6 = new System.Windows.Forms.Label(); this.volumeSlider1 = new NAudio.Gui.VolumeSlider(); this.label2 = new System.Windows.Forms.Label(); + this.checkBox9 = new System.Windows.Forms.CheckBox(); this.SuspendLayout(); // // checkBox1 @@ -307,11 +308,23 @@ private void InitializeComponent() this.label2.TabIndex = 26; this.label2.Text = "Game Volume"; // + // checkBox9 + // + this.checkBox9.AutoSize = true; + this.checkBox9.Location = new System.Drawing.Point(136, 67); + this.checkBox9.Name = "checkBox9"; + this.checkBox9.Size = new System.Drawing.Size(160, 17); + this.checkBox9.TabIndex = 27; + this.checkBox9.Text = "Enable Cutscene Movement"; + this.checkBox9.UseVisualStyleBackColor = true; + this.checkBox9.CheckedChanged += new System.EventHandler(this.checkBox9_CheckedChanged); + // // StyleSwitcher // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(398, 450); + this.Controls.Add(this.checkBox9); this.Controls.Add(this.label2); this.Controls.Add(this.volumeSlider1); this.Controls.Add(this.label6); @@ -362,5 +375,6 @@ private void InitializeComponent() private System.Windows.Forms.Label label6; private NAudio.Gui.VolumeSlider volumeSlider1; private System.Windows.Forms.Label label2; + private System.Windows.Forms.CheckBox checkBox9; } } \ No newline at end of file diff --git a/StyleSwitcher.cs b/StyleSwitcher.cs index 72af5ac..1ce6c25 100644 --- a/StyleSwitcher.cs +++ b/StyleSwitcher.cs @@ -10,6 +10,7 @@ namespace dmc3music public partial class StyleSwitcher : Form { private DMC3MusicConfig Config { get; set; } + public bool ConfigChanged { get; set; } = false; public string styleWindowed { get; set; } = "0"; public INIFile styleIni { get; set; } public Dictionary stylesDict { get; set; } = new Dictionary() @@ -56,6 +57,8 @@ public StyleSwitcher() private void getIniConfig() { + checkBox9.Checked = Config.CutsceneMovement; + styleWindowed = styleIni.GetValue("DISPLAY", "Mode"); checkBox1.Checked = (styleWindowed == "0") ? true : false; @@ -64,7 +67,7 @@ private void getIniConfig() styleSEVol = styleIni.GetValue("SOUND", "Volume.SE"); - float x = Convert.ToSingle(styleSEVol)/100f; + float x = Convert.ToSingle(styleSEVol) / 100f; float y; if (x <= 0) { @@ -118,6 +121,8 @@ private void button2_Click(object sender, EventArgs e) { try { + DMC3MusicConfigWriter.WriteConfig(Config); + string styleDll = Path.Combine(Config.DMC3Path, "StyleSwitcher.dll"); if (!File.Exists(styleDll)) { @@ -139,7 +144,7 @@ private void button2_Click(object sender, EventArgs e) float db = 20 * (float)Math.Log10(volumeSlider1.Volume); int percent = (int)Math.Round((1 - (db / -48f)) * 100f); - if(percent <= 0) + if (percent <= 0) { styleSEVol = "0"; } @@ -153,7 +158,7 @@ private void button2_Click(object sender, EventArgs e) } styleIni["SOUND"]["Volume.SE"] = styleSEVol; - + styleIni["GAME"]["BossRush"] = bossRush; styleIni["GAME"]["Arcade"] = arcadeMode; styleIni["INPUT"]["Hotkeys"] = hotKeys; @@ -169,6 +174,7 @@ private void button2_Click(object sender, EventArgs e) File.WriteAllText(styleLoc, styleIni.ToString().Replace("BGM[]={", "BGM[] = {")); label6.Text = "Installed Successfully!"; label6.Visible = true; + ConfigChanged = true; } catch { @@ -177,6 +183,11 @@ private void button2_Click(object sender, EventArgs e) } } + private void checkBox9_CheckedChanged(object sender, EventArgs e) + { + Config.CutsceneMovement = checkBox9.Checked; + } + private void checkBox1_CheckedChanged(object sender, EventArgs e) { styleWindowed = (checkBox1.Checked) ? "0" : "1"; diff --git a/dmc3music.csproj b/dmc3music.csproj index d336897..1be3a4d 100644 --- a/dmc3music.csproj +++ b/dmc3music.csproj @@ -219,13 +219,6 @@ GetMusic.cs - - Form - - - HotkeysForm.cs - - Form @@ -261,9 +254,6 @@ GetMusic.cs - - HotkeysForm.cs - MessageForm.cs @@ -354,6 +344,17 @@ - + + + False + Microsoft .NET Framework 4.7.2 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + \ No newline at end of file