diff --git a/HotkeysDialog.Designer.cs b/HotkeysDialog.Designer.cs new file mode 100644 index 0000000..c7dba34 --- /dev/null +++ b/HotkeysDialog.Designer.cs @@ -0,0 +1,85 @@ +namespace MLLE +{ + partial class HotkeysDialog + { + /// + /// 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.dataGridViewHotkeys = new System.Windows.Forms.DataGridView(); + this.buttonClose = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewHotkeys)).BeginInit(); + this.SuspendLayout(); + // + // dataGridViewHotkeys + // + this.dataGridViewHotkeys.AllowUserToAddRows = false; + this.dataGridViewHotkeys.AllowUserToDeleteRows = false; + this.dataGridViewHotkeys.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridViewHotkeys.Location = new System.Drawing.Point(12, 12); + this.dataGridViewHotkeys.Name = "dataGridViewHotkeys"; + this.dataGridViewHotkeys.ReadOnly = true; + this.dataGridViewHotkeys.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridViewHotkeys.Size = new System.Drawing.Size(660, 400); + this.dataGridViewHotkeys.TabIndex = 0; + // + // buttonClose + // + this.buttonClose.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonClose.Location = new System.Drawing.Point(597, 418); + this.buttonClose.Name = "buttonClose"; + this.buttonClose.Size = new System.Drawing.Size(75, 23); + this.buttonClose.TabIndex = 1; + this.buttonClose.Text = "Close"; + this.buttonClose.UseVisualStyleBackColor = true; + this.buttonClose.Click += new System.EventHandler(this.ButtonClose_Click); + // + // HotkeysDialog + // + this.AcceptButton = this.buttonClose; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.buttonClose; + this.ClientSize = new System.Drawing.Size(684, 451); + this.Controls.Add(this.buttonClose); + this.Controls.Add(this.dataGridViewHotkeys); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "HotkeysDialog"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "MLLE Hotkeys"; + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewHotkeys)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.DataGridView dataGridViewHotkeys; + private System.Windows.Forms.Button buttonClose; + } +} \ No newline at end of file diff --git a/HotkeysDialog.cs b/HotkeysDialog.cs new file mode 100644 index 0000000..a238987 --- /dev/null +++ b/HotkeysDialog.cs @@ -0,0 +1,171 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace MLLE +{ + public class HotkeyInfo + { + public string Category { get; set; } + public string Action { get; set; } + public string Hotkey { get; set; } + public string Context { get; set; } + public bool IsCustomizable { get; set; } + } + + public partial class HotkeysDialog : Form + { + public HotkeysDialog() + { + InitializeComponent(); + PopulateHotkeyData(); + } + + private void PopulateHotkeyData() + { + var hotkeyData = new List + { + // File Operations + new HotkeyInfo { Category = "File Operations", Action = "New Level", Hotkey = "Ctrl+N", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "File Operations", Action = "Open Level", Hotkey = "Ctrl+O", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "File Operations", Action = "Save Level", Hotkey = "Ctrl+S", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "File Operations", Action = "Save & Run", Hotkey = "Ctrl+R", Context = "Global", IsCustomizable = false }, + + // Edit Operations + new HotkeyInfo { Category = "Edit Operations", Action = "Undo", Hotkey = "Ctrl+Z", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Edit Operations", Action = "Redo", Hotkey = "Ctrl+Y", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Edit Operations", Action = "Copy Selection", Hotkey = "Ctrl+C", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Edit Operations", Action = "Cut Selection", Hotkey = "Ctrl+X", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Edit Operations", Action = "Deselect All", Hotkey = "Ctrl+D", Context = "Global", IsCustomizable = false }, + + // Layer Navigation + new HotkeyInfo { Category = "Layer Navigation", Action = "View Layer 1", Hotkey = "1", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "View Layer 2", Hotkey = "2", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "View Layer 3", Hotkey = "3", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "View Layer 4", Hotkey = "4", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "View Layer 5", Hotkey = "5", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "View Layer 6", Hotkey = "6", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "View Layer 7", Hotkey = "7", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "View Layer 8", Hotkey = "8", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "Edit Layer Properties 1", Hotkey = "Ctrl+1", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "Edit Layer Properties 2", Hotkey = "Ctrl+2", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "Edit Layer Properties 3", Hotkey = "Ctrl+3", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "Edit Layer Properties 4", Hotkey = "Ctrl+4", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "Edit Layer Properties 5", Hotkey = "Ctrl+5", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "Edit Layer Properties 6", Hotkey = "Ctrl+6", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "Edit Layer Properties 7", Hotkey = "Ctrl+7", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "Edit Layer Properties 8", Hotkey = "Ctrl+8", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "Previous Layer", Hotkey = "Ctrl+L", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Layer Navigation", Action = "Next Layer", Hotkey = "Shift+L", Context = "Global", IsCustomizable = false }, + + // Display Controls + new HotkeyInfo { Category = "Display Controls", Action = "Zoom In", Hotkey = "Ctrl+Plus", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Display Controls", Action = "Zoom Out", Hotkey = "Ctrl+Minus", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Display Controls", Action = "Toggle Mask Mode", Hotkey = "Ctrl+M", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Display Controls", Action = "View Partial Mask (hold)", Hotkey = "M", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Display Controls", Action = "Toggle Parallax Mode", Hotkey = "Ctrl+P", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Display Controls", Action = "View Partial Parallax (hold)", Hotkey = "P", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Display Controls", Action = "Toggle Event View", Hotkey = "Ctrl+V", Context = "Global", IsCustomizable = false }, + + // Tile Operations + new HotkeyInfo { Category = "Tile Operations", Action = "Flip Tiles Horizontally", Hotkey = "F", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Operations", Action = "Smart Flip Horizontally", Hotkey = "Ctrl+F", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Operations", Action = "Flip Tiles Vertically (JJ2+ only)", Hotkey = "I", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Operations", Action = "Smart Flip Vertically (JJ2+ only)", Hotkey = "Ctrl+I", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Operations", Action = "Copy Current Tile", Hotkey = "Comma (,)", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Operations", Action = "Copy Tile + Event", Hotkey = "Shift+Comma", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Operations", Action = "Use Blank Tile", Hotkey = "Backspace", Context = "Global", IsCustomizable = false }, + + // Tile Types (JJ2+ Tileset Editing) + new HotkeyInfo { Category = "Tile Types", Action = "Assign Transparent Tiletype", Hotkey = "Shift+T", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Types", Action = "Assign Tiletype 0", Hotkey = "Shift+0", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Types", Action = "Assign Tiletype 1", Hotkey = "Shift+1", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Types", Action = "Assign Tiletype 2", Hotkey = "Shift+2", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Types", Action = "Assign Tiletype 3", Hotkey = "Shift+3", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Types", Action = "Assign Tiletype 4", Hotkey = "Shift+4", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Types", Action = "Assign Tiletype 5", Hotkey = "Shift+5", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Types", Action = "Assign Tiletype 6", Hotkey = "Shift+6", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Types", Action = "Assign Tiletype 7", Hotkey = "Shift+7", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Types", Action = "Assign Tiletype 8", Hotkey = "Shift+8", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Types", Action = "Assign Tiletype 9", Hotkey = "Shift+9", Context = "Global", IsCustomizable = false }, + + // Selection Tools + new HotkeyInfo { Category = "Selection Tools", Action = "Begin/End Selection", Hotkey = "B", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Selection Tools", Action = "Add to Selection", Hotkey = "Shift+B", Context = "Global", IsCustomizable = true }, + new HotkeyInfo { Category = "Selection Tools", Action = "Subtract from Selection", Hotkey = "Ctrl+B", Context = "Global", IsCustomizable = true }, + new HotkeyInfo { Category = "Selection Tools", Action = "Clear Layer/Selection", Hotkey = "Delete", Context = "Global", IsCustomizable = false }, + + // Event Operations + new HotkeyInfo { Category = "Event Operations", Action = "Select Event at Mouse", Hotkey = "E", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Event Operations", Action = "Copy Event at Mouse", Hotkey = "Ctrl+E", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Event Operations", Action = "Paste Event at Mouse", Hotkey = "Shift+E", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Event Operations", Action = "Copy Event", Hotkey = "Ctrl+Left-click", Context = "Level Editor", IsCustomizable = false }, + new HotkeyInfo { Category = "Event Operations", Action = "Copy Event", Hotkey = "Ctrl+Right-click", Context = "Level Editor", IsCustomizable = false }, + new HotkeyInfo { Category = "Event Operations", Action = "Select Event", Hotkey = "Middle-click", Context = "Level Editor", IsCustomizable = false }, + + // Navigation + new HotkeyInfo { Category = "Navigation", Action = "Scroll Left", Hotkey = "Left Arrow", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Navigation", Action = "Scroll Right", Hotkey = "Right Arrow", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Navigation", Action = "Pan View", Hotkey = "Middle-click", Context = "Level Editor", IsCustomizable = false }, + new HotkeyInfo { Category = "Navigation", Action = "Pan View", Hotkey = "Tab+Drag", Context = "Level Editor", IsCustomizable = false }, + new HotkeyInfo { Category = "Navigation", Action = "Scroll", Hotkey = "Mouse Wheel", Context = "Level/Tileset Editors", IsCustomizable = false }, + + // Special Functions + new HotkeyInfo { Category = "Special Functions", Action = "Save & Run from Mouse Position", Hotkey = "Ctrl+Shift+R", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Special Functions", Action = "Special X Mode (hold)", Hotkey = "X", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Special Functions", Action = "Special X Mode with Shift (hold)", Hotkey = "Shift+X", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Special Functions", Action = "Special Y Mode (hold)", Hotkey = "Y", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Special Functions", Action = "Special Y Mode with Shift (hold)", Hotkey = "Shift+Y", Context = "Global", IsCustomizable = false }, + new HotkeyInfo { Category = "Special Functions", Action = "Tab Mode (hold)", Hotkey = "Tab", Context = "Global", IsCustomizable = false }, + + // Palette Form + new HotkeyInfo { Category = "Palette Form", Action = "Select None", Hotkey = "Ctrl+D", Context = "Palette Editor", IsCustomizable = false }, + new HotkeyInfo { Category = "Palette Form", Action = "Select 1 Color", Hotkey = "Ctrl+1", Context = "Palette Editor", IsCustomizable = false }, + new HotkeyInfo { Category = "Palette Form", Action = "Select 8 Colors", Hotkey = "Ctrl+8", Context = "Palette Editor", IsCustomizable = false }, + new HotkeyInfo { Category = "Palette Form", Action = "Select 16 Colors", Hotkey = "Ctrl+6", Context = "Palette Editor", IsCustomizable = false }, + new HotkeyInfo { Category = "Palette Form", Action = "Gradient", Hotkey = "Ctrl+G", Context = "Palette Editor", IsCustomizable = false }, + + // Sprite Recolor Form + new HotkeyInfo { Category = "Sprite Recolor Form", Action = "Select None", Hotkey = "Ctrl+D", Context = "Sprite Recolor Dialog", IsCustomizable = false }, + + // Tile Image Editor Form + new HotkeyInfo { Category = "Tile Image Editor", Action = "Flip", Hotkey = "F", Context = "Tile Image Editor", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Image Editor", Action = "Invert", Hotkey = "I", Context = "Tile Image Editor", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Image Editor", Action = "Rotate", Hotkey = "R", Context = "Tile Image Editor", IsCustomizable = false }, + new HotkeyInfo { Category = "Tile Image Editor", Action = "Eyedropper Tool", Hotkey = "Ctrl+Left-click", Context = "Tile Image Editor", IsCustomizable = false }, + + // Animation Editing + new HotkeyInfo { Category = "Animation Editing", Action = "Delete Animation Frame", Hotkey = "Delete", Context = "Animation Editor", IsCustomizable = false }, + new HotkeyInfo { Category = "Animation Editing", Action = "Flip Animation Frame", Hotkey = "F", Context = "Animation Editor", IsCustomizable = false }, + new HotkeyInfo { Category = "Animation Editing", Action = "Invert Animation Frame (JJ2+ only)", Hotkey = "I", Context = "Animation Editor", IsCustomizable = false }, + new HotkeyInfo { Category = "Animation Editing", Action = "Insert Animation Frame", Hotkey = "Ctrl+Click", Context = "Animation Editor", IsCustomizable = false } + }; + + // Bind to DataGridView + dataGridViewHotkeys.DataSource = hotkeyData; + + // Configure columns + dataGridViewHotkeys.Columns["Category"].Width = 120; + dataGridViewHotkeys.Columns["Action"].Width = 200; + dataGridViewHotkeys.Columns["Hotkey"].Width = 120; + dataGridViewHotkeys.Columns["Context"].Width = 100; + dataGridViewHotkeys.Columns["IsCustomizable"].Visible = false; // Hide for MVP + + // Make read-only + dataGridViewHotkeys.ReadOnly = true; + dataGridViewHotkeys.AllowUserToAddRows = false; + dataGridViewHotkeys.AllowUserToDeleteRows = false; + dataGridViewHotkeys.SelectionMode = DataGridViewSelectionMode.FullRowSelect; + } + + private void ButtonClose_Click(object sender, EventArgs e) + { + Dispose(); + } + } +} \ No newline at end of file diff --git a/Mainframe.Designer.cs b/Mainframe.Designer.cs index cbe0cc6..0086c0e 100644 --- a/Mainframe.Designer.cs +++ b/Mainframe.Designer.cs @@ -103,6 +103,7 @@ private void InitializeComponent() this.setDeadspaceColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.readmeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.hotkeysToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.levelmakingTipsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.angelScriptAPIToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -814,6 +815,7 @@ private void InitializeComponent() this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.readmeToolStripMenuItem, this.toolStripSeparator4, + this.hotkeysToolStripMenuItem, this.levelmakingTipsToolStripMenuItem, this.angelScriptAPIToolStripMenuItem, this.angelScriptSyntaxToolStripMenuItem, @@ -829,12 +831,19 @@ private void InitializeComponent() this.readmeToolStripMenuItem.Name = "readmeToolStripMenuItem"; this.readmeToolStripMenuItem.Size = new System.Drawing.Size(173, 22); this.readmeToolStripMenuItem.Text = "Contents"; - // + // + // hotkeysToolStripMenuItem + // + this.hotkeysToolStripMenuItem.Name = "hotkeysToolStripMenuItem"; + this.hotkeysToolStripMenuItem.Size = new System.Drawing.Size(173, 22); + this.hotkeysToolStripMenuItem.Text = "Hotkeys"; + this.hotkeysToolStripMenuItem.Click += new System.EventHandler(this.hotkeysToolStripMenuItem_Click); + // // toolStripSeparator4 - // + // this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Size = new System.Drawing.Size(170, 6); - // + // // levelmakingTipsToolStripMenuItem // this.levelmakingTipsToolStripMenuItem.Name = "levelmakingTipsToolStripMenuItem"; @@ -2045,6 +2054,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem readmeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem hotkeysToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem aboutMLLEToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem levelPropertiesToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem passwordToolStripMenuItem; diff --git a/Mainframe.cs b/Mainframe.cs index d056df2..934a60d 100644 --- a/Mainframe.cs +++ b/Mainframe.cs @@ -4707,6 +4707,10 @@ private void Mainframe_DragDrop(object sender, DragEventArgs e) } } + private void hotkeysToolStripMenuItem_Click(object sender, EventArgs e) + { + new HotkeysDialog().ShowDialog(); + } } class Program diff --git a/Renderer1.csproj b/Renderer1.csproj index b215b45..ce73d7b 100644 --- a/Renderer1.csproj +++ b/Renderer1.csproj @@ -97,6 +97,12 @@ Arguments.cs + + Form + + + HotkeysDialog.cs + Form