GZDB can now save keyboard shortcuts reference to html file (Help -> Keyboard Shortcuts Reference).

"Clear Group" 2-10 actions had incorrect default shortcuts.
This commit is contained in:
MaxED 2013-06-06 12:37:37 +00:00
parent aea360adb9
commit 82c547f673
4 changed files with 145 additions and 70 deletions

View file

@ -14,7 +14,7 @@ categories
classic = "Classic Modes";
visual = "Visual Modes";
selecting = "Selecting";
gzdoombuilder = "GZDoom Builder";
gzdoombuilder = "Rendering";
}
// This just defines which actions there are, what description they have and
@ -172,6 +172,17 @@ saveeditareascreenshot
default = 131195; //Ctrl-F12
}
//mxd
saveshortcutsreference
{
title = "Save Shortcuts Reference";
category = "tools";
description = "Saves keyboard shortcuts reference to a html file.";
allowkeys = true;
allowmouse = false;
allowscroll = false;
}
//mxd
viewusedtags
{
@ -773,7 +784,7 @@ cleargroup2
allowkeys = true;
allowmouse = true;
allowscroll = false;
default = 196659;
default = 196658;
}
//mxd
@ -785,7 +796,7 @@ cleargroup3
allowkeys = true;
allowmouse = true;
allowscroll = false;
default = 196660;
default = 196659;
}
//mxd
@ -797,7 +808,7 @@ cleargroup4
allowkeys = true;
allowmouse = true;
allowscroll = false;
default = 196661;
default = 196660;
}
//mxd
@ -809,7 +820,7 @@ cleargroup5
allowkeys = true;
allowmouse = true;
allowscroll = false;
default = 196662;
default = 196661;
}
//mxd
@ -821,7 +832,7 @@ cleargroup6
allowkeys = true;
allowmouse = true;
allowscroll = false;
default = 196663;
default = 196662;
}
//mxd
@ -833,7 +844,7 @@ cleargroup7
allowkeys = true;
allowmouse = true;
allowscroll = false;
default = 196664;
default = 196663;
}
//mxd
@ -845,7 +856,7 @@ cleargroup8
allowkeys = true;
allowmouse = true;
allowscroll = false;
default = 196665;
default = 196664;
}
//mxd
@ -857,7 +868,7 @@ cleargroup9
allowkeys = true;
allowmouse = true;
allowscroll = false;
default = 196656;
default = 196665;
}
//mxd
@ -869,7 +880,7 @@ cleargroup10
allowkeys = true;
allowmouse = true;
allowscroll = false;
default = 196658;
default = 196656;
}
openscripteditor

View file

@ -146,6 +146,9 @@ namespace CodeImp.DoomBuilder.Windows
this.configurationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.preferencesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.seperatortoolsconfig = new System.Windows.Forms.ToolStripSeparator();
this.screenshotToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editAreaScreenshotToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.separatortoolsscreenshots = new System.Windows.Forms.ToolStripSeparator();
this.itemtestmap = new System.Windows.Forms.ToolStripMenuItem();
this.menuhelp = new System.Windows.Forms.ToolStripMenuItem();
this.itemhelprefmanual = new System.Windows.Forms.ToolStripMenuItem();
@ -240,9 +243,7 @@ namespace CodeImp.DoomBuilder.Windows
this.dockersspace = new System.Windows.Forms.Panel();
this.dockerspanel = new CodeImp.DoomBuilder.Controls.DockersControl();
this.dockerscollapser = new System.Windows.Forms.Timer(this.components);
this.separatortoolsscreenshots = new System.Windows.Forms.ToolStripSeparator();
this.screenshotToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editAreaScreenshotToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.itemShortcutReference = new System.Windows.Forms.ToolStripMenuItem();
toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator();
@ -1182,7 +1183,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemreloadresources
//
this.itemreloadresources.Name = "itemreloadresources";
this.itemreloadresources.Size = new System.Drawing.Size(196, 22);
this.itemreloadresources.Size = new System.Drawing.Size(215, 22);
this.itemreloadresources.Tag = "builder_reloadresources";
this.itemreloadresources.Text = "&Reload Resources";
this.itemreloadresources.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -1190,7 +1191,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemReloadModedef
//
this.itemReloadModedef.Name = "itemReloadModedef";
this.itemReloadModedef.Size = new System.Drawing.Size(196, 22);
this.itemReloadModedef.Size = new System.Drawing.Size(215, 22);
this.itemReloadModedef.Tag = "builder_gzreloadmodeldef";
this.itemReloadModedef.Text = "Reload MODELDEF";
this.itemReloadModedef.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -1198,7 +1199,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemReloadGldefs
//
this.itemReloadGldefs.Name = "itemReloadGldefs";
this.itemReloadGldefs.Size = new System.Drawing.Size(196, 22);
this.itemReloadGldefs.Size = new System.Drawing.Size(215, 22);
this.itemReloadGldefs.Tag = "builder_gzreloadgldefs";
this.itemReloadGldefs.Text = "Reload GLDEFS";
this.itemReloadGldefs.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -1206,7 +1207,7 @@ namespace CodeImp.DoomBuilder.Windows
// itemReloadMapinfo
//
this.itemReloadMapinfo.Name = "itemReloadMapinfo";
this.itemReloadMapinfo.Size = new System.Drawing.Size(196, 22);
this.itemReloadMapinfo.Size = new System.Drawing.Size(215, 22);
this.itemReloadMapinfo.Tag = "builder_gzreloadmapinfo";
this.itemReloadMapinfo.Text = "Reload (Z)MAPINFO";
this.itemReloadMapinfo.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -1215,7 +1216,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.itemshowerrors.Image = global::CodeImp.DoomBuilder.Properties.Resources.Warning;
this.itemshowerrors.Name = "itemshowerrors";
this.itemshowerrors.Size = new System.Drawing.Size(196, 22);
this.itemshowerrors.Size = new System.Drawing.Size(215, 22);
this.itemshowerrors.Tag = "builder_showerrors";
this.itemshowerrors.Text = "&Errors and Warnings...";
this.itemshowerrors.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -1224,12 +1225,12 @@ namespace CodeImp.DoomBuilder.Windows
//
this.seperatortoolsresources.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.seperatortoolsresources.Name = "seperatortoolsresources";
this.seperatortoolsresources.Size = new System.Drawing.Size(193, 6);
this.seperatortoolsresources.Size = new System.Drawing.Size(212, 6);
//
// configurationToolStripMenuItem
//
this.configurationToolStripMenuItem.Name = "configurationToolStripMenuItem";
this.configurationToolStripMenuItem.Size = new System.Drawing.Size(196, 22);
this.configurationToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
this.configurationToolStripMenuItem.Tag = "builder_configuration";
this.configurationToolStripMenuItem.Text = "&Game Configurations...";
this.configurationToolStripMenuItem.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -1237,7 +1238,7 @@ namespace CodeImp.DoomBuilder.Windows
// preferencesToolStripMenuItem
//
this.preferencesToolStripMenuItem.Name = "preferencesToolStripMenuItem";
this.preferencesToolStripMenuItem.Size = new System.Drawing.Size(196, 22);
this.preferencesToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
this.preferencesToolStripMenuItem.Tag = "builder_preferences";
this.preferencesToolStripMenuItem.Text = "Preferences...";
this.preferencesToolStripMenuItem.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -1246,13 +1247,34 @@ namespace CodeImp.DoomBuilder.Windows
//
this.seperatortoolsconfig.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.seperatortoolsconfig.Name = "seperatortoolsconfig";
this.seperatortoolsconfig.Size = new System.Drawing.Size(193, 6);
this.seperatortoolsconfig.Size = new System.Drawing.Size(212, 6);
//
// screenshotToolStripMenuItem
//
this.screenshotToolStripMenuItem.Name = "screenshotToolStripMenuItem";
this.screenshotToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
this.screenshotToolStripMenuItem.Tag = "builder_savescreenshot";
this.screenshotToolStripMenuItem.Text = "Save Screenshot";
this.screenshotToolStripMenuItem.Click += new System.EventHandler(this.InvokeTaggedAction);
//
// editAreaScreenshotToolStripMenuItem
//
this.editAreaScreenshotToolStripMenuItem.Name = "editAreaScreenshotToolStripMenuItem";
this.editAreaScreenshotToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
this.editAreaScreenshotToolStripMenuItem.Tag = "builder_saveeditareascreenshot";
this.editAreaScreenshotToolStripMenuItem.Text = "Save Screenshot (edit area)";
this.editAreaScreenshotToolStripMenuItem.Click += new System.EventHandler(this.InvokeTaggedAction);
//
// separatortoolsscreenshots
//
this.separatortoolsscreenshots.Name = "separatortoolsscreenshots";
this.separatortoolsscreenshots.Size = new System.Drawing.Size(212, 6);
//
// itemtestmap
//
this.itemtestmap.Image = global::CodeImp.DoomBuilder.Properties.Resources.Test;
this.itemtestmap.Name = "itemtestmap";
this.itemtestmap.Size = new System.Drawing.Size(196, 22);
this.itemtestmap.Size = new System.Drawing.Size(215, 22);
this.itemtestmap.Tag = "builder_testmap";
this.itemtestmap.Text = "&Test Map";
this.itemtestmap.Click += new System.EventHandler(this.InvokeTaggedAction);
@ -1261,6 +1283,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.menuhelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.itemhelprefmanual,
this.itemShortcutReference,
this.itemhelpeditmode,
this.seperatorhelpmanual,
this.itemhelpabout});
@ -1272,7 +1295,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.itemhelprefmanual.Image = global::CodeImp.DoomBuilder.Properties.Resources.Help;
this.itemhelprefmanual.Name = "itemhelprefmanual";
this.itemhelprefmanual.Size = new System.Drawing.Size(203, 22);
this.itemhelprefmanual.Size = new System.Drawing.Size(232, 22);
this.itemhelprefmanual.Text = "Reference &Manual";
this.itemhelprefmanual.Click += new System.EventHandler(this.itemhelprefmanual_Click);
//
@ -1280,7 +1303,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.itemhelpeditmode.Image = global::CodeImp.DoomBuilder.Properties.Resources.Question;
this.itemhelpeditmode.Name = "itemhelpeditmode";
this.itemhelpeditmode.Size = new System.Drawing.Size(203, 22);
this.itemhelpeditmode.Size = new System.Drawing.Size(232, 22);
this.itemhelpeditmode.Text = "About this &Editing Mode";
this.itemhelpeditmode.Click += new System.EventHandler(this.itemhelpeditmode_Click);
//
@ -1288,12 +1311,12 @@ namespace CodeImp.DoomBuilder.Windows
//
this.seperatorhelpmanual.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.seperatorhelpmanual.Name = "seperatorhelpmanual";
this.seperatorhelpmanual.Size = new System.Drawing.Size(200, 6);
this.seperatorhelpmanual.Size = new System.Drawing.Size(229, 6);
//
// itemhelpabout
//
this.itemhelpabout.Name = "itemhelpabout";
this.itemhelpabout.Size = new System.Drawing.Size(203, 22);
this.itemhelpabout.Size = new System.Drawing.Size(232, 22);
this.itemhelpabout.Text = "&About Doom Builder...";
this.itemhelpabout.Click += new System.EventHandler(this.itemhelpabout_Click);
//
@ -2245,26 +2268,13 @@ namespace CodeImp.DoomBuilder.Windows
this.dockerscollapser.Interval = 200;
this.dockerscollapser.Tick += new System.EventHandler(this.dockerscollapser_Tick);
//
// separatortoolsscreenshots
// itemShortcutReference
//
this.separatortoolsscreenshots.Name = "separatortoolsscreenshots";
this.separatortoolsscreenshots.Size = new System.Drawing.Size(193, 6);
//
// screenshotToolStripMenuItem
//
this.screenshotToolStripMenuItem.Name = "screenshotToolStripMenuItem";
this.screenshotToolStripMenuItem.Size = new System.Drawing.Size(196, 22);
this.screenshotToolStripMenuItem.Tag = "builder_savescreenshot";
this.screenshotToolStripMenuItem.Text = "Save Screenshot";
this.screenshotToolStripMenuItem.Click += new System.EventHandler(this.InvokeTaggedAction);
//
// editAreaScreenshotToolStripMenuItem
//
this.editAreaScreenshotToolStripMenuItem.Name = "editAreaScreenshotToolStripMenuItem";
this.editAreaScreenshotToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
this.editAreaScreenshotToolStripMenuItem.Tag = "builder_saveeditareascreenshot";
this.editAreaScreenshotToolStripMenuItem.Text = "Save Screenshot (edit area)";
this.editAreaScreenshotToolStripMenuItem.Click += new System.EventHandler(this.InvokeTaggedAction);
this.itemShortcutReference.Name = "itemShortcutReference";
this.itemShortcutReference.Size = new System.Drawing.Size(232, 22);
this.itemShortcutReference.Tag = "builder_saveshortcutsreference";
this.itemShortcutReference.Text = "Keyboard Shortcuts Reference";
this.itemShortcutReference.Click += new System.EventHandler(this.InvokeTaggedAction);
//
// MainForm
//
@ -2518,5 +2528,6 @@ namespace CodeImp.DoomBuilder.Windows
private System.Windows.Forms.ToolStripSeparator separatortoolsscreenshots;
private System.Windows.Forms.ToolStripMenuItem screenshotToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem editAreaScreenshotToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem itemShortcutReference;
}
}

View file

@ -2615,6 +2615,83 @@ namespace CodeImp.DoomBuilder.Windows
}
}
}
//mxd
[BeginAction("saveshortcutsreference")]
internal void SaveShortcutsReference() {
string columnLabels = "<tr><td width=\"240px;\"><strong>Action</strong></td><td width=\"120px;\"><div align=\"center\"><strong>Shortcut</strong></div></td><td width=\"120px;\"><div align=\"center\"><strong>Modifiers</strong></div></td><td><strong>Description</strong></td></tr>";
string categoryPadding = "<tr><td colspan=\"4\"></td></tr>";
string categoryStart = "<tr><td colspan=\"4\" bgcolor=\"#333333\"><strong style=\"color:#FFFFFF\">";
string categoryEnd = "</strong></td></tr>";
string fileName = "GZDB Keyboard Reference.html";
CodeImp.DoomBuilder.Actions.Action[] actions = General.Actions.GetAllActions();
Dictionary<string, List<CodeImp.DoomBuilder.Actions.Action>> sortedActions = new Dictionary<string, List<CodeImp.DoomBuilder.Actions.Action>>();
foreach(CodeImp.DoomBuilder.Actions.Action action in actions) {
if(!sortedActions.ContainsKey(action.Category))
sortedActions.Add(action.Category, new List<CodeImp.DoomBuilder.Actions.Action>());
sortedActions[action.Category].Add(action);
}
System.Text.StringBuilder html = new System.Text.StringBuilder();
//head
html.AppendLine("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" +
"<html xmlns=\"http://www.w3.org/1999/xhtml\">" +
"<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /></head>" +
"<body bgcolor=\"#666666\">" +
"<div style=\"padding-left:60px; padding-right:60px; padding-top:20px; padding-bottom:20px;\">" +
"<table bgcolor=\"#FFFFFF\" width=\"100%\" border=\"0\" cellspacing=\"6\" cellpadding=\"6\" style=\"font-family: 'Trebuchet MS',georgia,Verdana,Sans-serif;\">" +
"<tr><td colspan=\"4\" bgcolor=\"#333333\"><span style=\"font-size: 24px\"><strong style=\"color:#FFFFFF\">GZDoom Builder Shortcut Reference</strong></span></td></tr>");
//add descriptions
foreach(KeyValuePair<string, List<CodeImp.DoomBuilder.Actions.Action>> category in sortedActions) {
//add category title
html.AppendLine(categoryPadding);
html.AppendLine(categoryStart + General.Actions.Categories[category.Key] + categoryEnd);
html.AppendLine(columnLabels);
Dictionary<string, CodeImp.DoomBuilder.Actions.Action> actionsByTitle = new Dictionary<string, CodeImp.DoomBuilder.Actions.Action>();
List<string> actionTitles = new List<string>();
foreach(CodeImp.DoomBuilder.Actions.Action action in category.Value) {
actionsByTitle.Add(action.Title, action);
actionTitles.Add(action.Title);
}
actionTitles.Sort();
CodeImp.DoomBuilder.Actions.Action a;
foreach(string title in actionTitles) {
a = actionsByTitle[title];
List<string> modifiers = new List<string>();
html.AppendLine("<tr>");
html.AppendLine("<td>" + title + "</td>");
html.AppendLine("<td><div align=\"center\">" + Actions.Action.GetShortcutKeyDesc(a.ShortcutKey) + "</div></td>");
if(a.DisregardControl) modifiers.Add("Ctrl");
if(a.DisregardShift) modifiers.Add("Shift");
html.AppendLine("<td><div align=\"center\">" + string.Join(", ", modifiers.ToArray()) + "</div></td>");
html.AppendLine("<td>" + a.Description + "</td>");
html.AppendLine("</tr>");
}
}
//add bottom
html.AppendLine("</table></div></body></html>");
//write
using(StreamWriter writer = File.CreateText(fileName)) {
writer.Write(html.ToString());
}
//open file
string path = Path.Combine(General.AppPath, fileName);
DisplayStatus(StatusType.Info, "Shortcut reference saved to '" + path + "'");
System.Diagnostics.Process.Start(path);
}
#endregion

View file

@ -201,30 +201,6 @@
<metadata name="sectorinfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="heightpanel1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="vertexinfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="labelcollapsedinfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="buttontoggleinfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="modename.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="linedefinfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="thinginfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="sectorinfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="redrawtimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>433, 17</value>
</metadata>