From 0d4c2a8f323fb9ec003fb4e6c2c52c484f1a0cea Mon Sep 17 00:00:00 2001 From: MaxED Date: Tue, 14 Jul 2015 23:34:31 +0000 Subject: [PATCH] UDMF: Added "Comment" tab to Edit Sector / Linedef / Thing forms. Sectors, Linedefs, Things modes: comment icons for appropriate map elements with comments are now rendered in these modes. This can be disabled using either the new "Toggle Comments" action, "View -> Show Comments" menu item, or "Show Comments" button on the main toolbar. --- Source/Core/Builder.csproj | 16 ++ Source/Core/Config/ProgramConfiguration.cs | 4 + .../Core/Controls/CommentEditor.Designer.cs | 211 ++++++++++++++++++ Source/Core/Controls/CommentEditor.cs | 135 +++++++++++ Source/Core/Controls/CommentEditor.resx | 120 ++++++++++ Source/Core/Data/DataManager.cs | 22 ++ Source/Core/Properties/Resources.Designer.cs | 44 +++- Source/Core/Properties/Resources.resx | 138 +++++++----- Source/Core/Rendering/CommentType.cs | 13 ++ Source/Core/Rendering/Renderer2D.cs | 4 +- Source/Core/Resources/Actions.cfg | 10 + Source/Core/Resources/Comment.png | Bin 0 -> 217 bytes Source/Core/Resources/CommentInfo.png | Bin 0 -> 207 bytes Source/Core/Resources/CommentProblem.png | Bin 0 -> 213 bytes Source/Core/Resources/CommentQuestion.png | Bin 0 -> 230 bytes Source/Core/Resources/CommentRegular.png | Bin 0 -> 200 bytes Source/Core/Resources/CommentSmile.png | Bin 0 -> 236 bytes Source/Core/Resources/UDMF_UI.cfg | 3 + .../Windows/LinedefEditFormUDMF.Designer.cs | 28 +++ Source/Core/Windows/LinedefEditFormUDMF.cs | 6 + Source/Core/Windows/LinedefEditFormUDMF.resx | 8 +- Source/Core/Windows/MainForm.Designer.cs | 110 +++++---- Source/Core/Windows/MainForm.cs | 22 +- .../Windows/SectorEditFormUDMF.Designer.cs | 47 +++- Source/Core/Windows/SectorEditFormUDMF.cs | 12 + Source/Core/Windows/SectorEditFormUDMF.resx | 27 +++ .../Windows/ThingEditFormUDMF.Designer.cs | 29 +++ Source/Core/Windows/ThingEditFormUDMF.cs | 6 + .../BuilderModes/ClassicModes/LinedefsMode.cs | 44 +++- .../BuilderModes/ClassicModes/SectorsMode.cs | 57 +++-- .../BuilderModes/ClassicModes/ThingsMode.cs | 56 ++++- 31 files changed, 1025 insertions(+), 147 deletions(-) create mode 100644 Source/Core/Controls/CommentEditor.Designer.cs create mode 100644 Source/Core/Controls/CommentEditor.cs create mode 100644 Source/Core/Controls/CommentEditor.resx create mode 100644 Source/Core/Rendering/CommentType.cs create mode 100644 Source/Core/Resources/Comment.png create mode 100644 Source/Core/Resources/CommentInfo.png create mode 100644 Source/Core/Resources/CommentProblem.png create mode 100644 Source/Core/Resources/CommentQuestion.png create mode 100644 Source/Core/Resources/CommentRegular.png create mode 100644 Source/Core/Resources/CommentSmile.png diff --git a/Source/Core/Builder.csproj b/Source/Core/Builder.csproj index 9bb5ea2d..c1587c02 100644 --- a/Source/Core/Builder.csproj +++ b/Source/Core/Builder.csproj @@ -697,6 +697,12 @@ Component + + UserControl + + + CommentEditor.cs + UserControl @@ -868,6 +874,7 @@ + @@ -974,6 +981,9 @@ ActionSpecialHelpButton.cs + + CommentEditor.cs + DebugConsole.cs @@ -1039,6 +1049,12 @@ + + + + + + diff --git a/Source/Core/Config/ProgramConfiguration.cs b/Source/Core/Config/ProgramConfiguration.cs index 23df1875..18b95bae 100644 --- a/Source/Core/Config/ProgramConfiguration.cs +++ b/Source/Core/Config/ProgramConfiguration.cs @@ -116,6 +116,7 @@ namespace CodeImp.DoomBuilder.Config private bool autoClearSideTextures; private bool storeSelectedEditTab; private bool checkforupdates; + private bool rendercomments; // These are not stored in the configuration, only used at runtime private int defaultbrightness; @@ -203,6 +204,7 @@ namespace CodeImp.DoomBuilder.Config public bool AutoClearSidedefTextures { get { return autoClearSideTextures; } internal set { autoClearSideTextures = value; } } public bool StoreSelectedEditTab { get { return storeSelectedEditTab; } internal set { storeSelectedEditTab = value; } } internal bool CheckForUpdates { get { return checkforupdates; } set { checkforupdates = value; } } //mxd + public bool RenderComments { get { return rendercomments; } internal set { rendercomments = value; } } //mxd //mxd. Left here for compatibility reasons... public string DefaultTexture { get { return General.Map != null ? General.Map.Options.DefaultWallTexture : "-"; } set { if(General.Map != null) General.Map.Options.DefaultWallTexture = value; } } @@ -313,6 +315,7 @@ namespace CodeImp.DoomBuilder.Config autoClearSideTextures = cfg.ReadSetting("autoclearsidetextures", true); storeSelectedEditTab = cfg.ReadSetting("storeselectededittab", true); checkforupdates = cfg.ReadSetting("checkforupdates", true); //mxd + rendercomments = cfg.ReadSetting("rendercomments", true); //mxd //mxd. Sector defaults defaultceilheight = cfg.ReadSetting("defaultceilheight", 128); @@ -407,6 +410,7 @@ namespace CodeImp.DoomBuilder.Config cfg.WriteSetting("autoclearsidetextures", autoClearSideTextures); cfg.WriteSetting("storeselectededittab", storeSelectedEditTab); cfg.WriteSetting("checkforupdates", checkforupdates); //mxd + cfg.WriteSetting("rendercomments", rendercomments); //mxd //mxd. Sector defaults cfg.WriteSetting("defaultceilheight", defaultceilheight); diff --git a/Source/Core/Controls/CommentEditor.Designer.cs b/Source/Core/Controls/CommentEditor.Designer.cs new file mode 100644 index 00000000..165f0544 --- /dev/null +++ b/Source/Core/Controls/CommentEditor.Designer.cs @@ -0,0 +1,211 @@ +namespace CodeImp.DoomBuilder.Controls +{ + partial class CommentEditor + { + /// + /// 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 Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() { + this.textbox = new System.Windows.Forms.TextBox(); + this.clear = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.radioButton1 = new System.Windows.Forms.RadioButton(); + this.radioButton2 = new System.Windows.Forms.RadioButton(); + this.radioButton3 = new System.Windows.Forms.RadioButton(); + this.radioButton4 = new System.Windows.Forms.RadioButton(); + this.radioButton5 = new System.Windows.Forms.RadioButton(); + this.panel1 = new System.Windows.Forms.Panel(); + this.tip = new System.Windows.Forms.PictureBox(); + this.hintlabel = new System.Windows.Forms.Label(); + this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tip)).BeginInit(); + this.SuspendLayout(); + // + // textbox + // + this.textbox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textbox.Location = new System.Drawing.Point(3, 29); + this.textbox.Multiline = true; + this.textbox.Name = "textbox"; + this.textbox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.textbox.Size = new System.Drawing.Size(481, 239); + this.textbox.TabIndex = 0; + this.textbox.TabStop = false; + this.textbox.TextChanged += new System.EventHandler(this.textbox_TextChanged); + this.textbox.Leave += new System.EventHandler(this.textbox_Leave); + this.textbox.Enter += new System.EventHandler(this.textbox_Enter); + // + // clear + // + this.clear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.clear.Image = global::CodeImp.DoomBuilder.Properties.Resources.Clear; + this.clear.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.clear.Location = new System.Drawing.Point(394, 274); + this.clear.Name = "clear"; + this.clear.Size = new System.Drawing.Size(90, 23); + this.clear.TabIndex = 1; + this.clear.Text = "Clear"; + this.clear.UseVisualStyleBackColor = true; + this.clear.Click += new System.EventHandler(this.clear_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(6, 8); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(80, 13); + this.label1.TabIndex = 2; + this.label1.Text = "Comment type: "; + // + // radioButton1 + // + this.radioButton1.Image = global::CodeImp.DoomBuilder.Properties.Resources.CommentRegular; + this.radioButton1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.radioButton1.Location = new System.Drawing.Point(3, -1); + this.radioButton1.Name = "radioButton1"; + this.radioButton1.Size = new System.Drawing.Size(36, 24); + this.radioButton1.TabIndex = 3; + this.radioButton1.TabStop = true; + this.radioButton1.Tag = 0; + this.radioButton1.UseVisualStyleBackColor = true; + this.radioButton1.CheckedChanged += new System.EventHandler(this.radiobutton_CheckedChanged); + // + // radioButton2 + // + this.radioButton2.Image = global::CodeImp.DoomBuilder.Properties.Resources.CommentInfo; + this.radioButton2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.radioButton2.Location = new System.Drawing.Point(45, -1); + this.radioButton2.Name = "radioButton2"; + this.radioButton2.Size = new System.Drawing.Size(36, 24); + this.radioButton2.TabIndex = 4; + this.radioButton2.TabStop = true; + this.radioButton2.Tag = 1; + this.radioButton2.UseVisualStyleBackColor = true; + this.radioButton2.CheckedChanged += new System.EventHandler(this.radiobutton_CheckedChanged); + // + // radioButton3 + // + this.radioButton3.Image = global::CodeImp.DoomBuilder.Properties.Resources.CommentQuestion; + this.radioButton3.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.radioButton3.Location = new System.Drawing.Point(87, -1); + this.radioButton3.Name = "radioButton3"; + this.radioButton3.Size = new System.Drawing.Size(36, 24); + this.radioButton3.TabIndex = 5; + this.radioButton3.TabStop = true; + this.radioButton3.Tag = 2; + this.radioButton3.UseVisualStyleBackColor = true; + this.radioButton3.CheckedChanged += new System.EventHandler(this.radiobutton_CheckedChanged); + // + // radioButton4 + // + this.radioButton4.Image = global::CodeImp.DoomBuilder.Properties.Resources.CommentProblem; + this.radioButton4.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.radioButton4.Location = new System.Drawing.Point(129, -1); + this.radioButton4.Name = "radioButton4"; + this.radioButton4.Size = new System.Drawing.Size(36, 24); + this.radioButton4.TabIndex = 6; + this.radioButton4.TabStop = true; + this.radioButton4.Tag = 3; + this.radioButton4.UseVisualStyleBackColor = true; + this.radioButton4.CheckedChanged += new System.EventHandler(this.radiobutton_CheckedChanged); + // + // radioButton5 + // + this.radioButton5.Image = global::CodeImp.DoomBuilder.Properties.Resources.CommentSmile; + this.radioButton5.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.radioButton5.Location = new System.Drawing.Point(171, -1); + this.radioButton5.Name = "radioButton5"; + this.radioButton5.Size = new System.Drawing.Size(36, 24); + this.radioButton5.TabIndex = 7; + this.radioButton5.TabStop = true; + this.radioButton5.Tag = 4; + this.radioButton5.UseVisualStyleBackColor = true; + this.radioButton5.CheckedChanged += new System.EventHandler(this.radiobutton_CheckedChanged); + // + // panel1 + // + this.panel1.Controls.Add(this.radioButton1); + this.panel1.Controls.Add(this.radioButton2); + this.panel1.Controls.Add(this.radioButton3); + this.panel1.Controls.Add(this.radioButton4); + this.panel1.Controls.Add(this.radioButton5); + this.panel1.Location = new System.Drawing.Point(88, 4); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(396, 23); + this.panel1.TabIndex = 8; + // + // tip + // + this.tip.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.tip.Image = global::CodeImp.DoomBuilder.Properties.Resources.Lightbulb; + this.tip.Location = new System.Drawing.Point(3, 277); + this.tip.Name = "tip"; + this.tip.Size = new System.Drawing.Size(16, 16); + this.tip.TabIndex = 9; + this.tip.TabStop = false; + // + // hintlabel + // + this.hintlabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.hintlabel.AutoSize = true; + this.hintlabel.Location = new System.Drawing.Point(21, 279); + this.hintlabel.Name = "hintlabel"; + this.hintlabel.Size = new System.Drawing.Size(170, 13); + this.hintlabel.TabIndex = 10; + this.hintlabel.Text = "Press Ctrl-Enter to add a line break"; + // + // CommentEditor + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.hintlabel); + this.Controls.Add(this.tip); + this.Controls.Add(this.clear); + this.Controls.Add(this.panel1); + this.Controls.Add(this.label1); + this.Controls.Add(this.textbox); + this.Name = "CommentEditor"; + this.Size = new System.Drawing.Size(487, 300); + this.panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.tip)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox textbox; + private System.Windows.Forms.Button clear; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.RadioButton radioButton1; + private System.Windows.Forms.RadioButton radioButton2; + private System.Windows.Forms.RadioButton radioButton3; + private System.Windows.Forms.RadioButton radioButton4; + private System.Windows.Forms.RadioButton radioButton5; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.PictureBox tip; + private System.Windows.Forms.Label hintlabel; + } +} diff --git a/Source/Core/Controls/CommentEditor.cs b/Source/Core/Controls/CommentEditor.cs new file mode 100644 index 00000000..fdbbea47 --- /dev/null +++ b/Source/Core/Controls/CommentEditor.cs @@ -0,0 +1,135 @@ +#region ================== Copyright + +/* + * Made by MaxED, mkay? + */ + +#endregion + +#region ================== Namespaces + +using System; +using System.Drawing; +using System.Windows.Forms; +using CodeImp.DoomBuilder.Map; +using CodeImp.DoomBuilder.GZBuilder.Tools; +using CodeImp.DoomBuilder.Rendering; + +#endregion + +namespace CodeImp.DoomBuilder.Controls +{ + public partial class CommentEditor : UserControl + { + #region ================== Variables + + private const string DEFAULT_TEXT = "Click to enter a comment..."; + private bool mixedvalues; + private int commenttype; + + #endregion + + #region ================== Constructor / Disposer + + public CommentEditor() + { + InitializeComponent(); + } + + #endregion + + #region ================== Methods + + public void SetValues(UniFields fields, bool first) + { + if(mixedvalues) return; + string c = fields.GetValue("comment", string.Empty); + if(first) + { + textbox.Text = c; + } + else if(textbox.Text != c) + { + textbox.Clear(); + mixedvalues = true; + } + } + + public void FinishSetup() + { + if(mixedvalues) return; + + if(string.IsNullOrEmpty(textbox.Text)) + { + textbox.Text = DEFAULT_TEXT; + textbox.ForeColor = SystemColors.InactiveCaptionText; + radioButton1.Checked = true; + } + else if(textbox.Text.Length > 2) + { + string type = textbox.Text.Substring(0, 3); + int index = Array.IndexOf(CommentType.Types, type); + commenttype = (index > 0 ? index : 0); + if(commenttype > 0) textbox.Text = textbox.Text.TrimStart(type.ToCharArray()); + + // Isn't there a better way to do this?.. + switch(commenttype) + { + case 0: radioButton1.Checked = true; break; + case 1: radioButton2.Checked = true; break; + case 2: radioButton3.Checked = true; break; + case 3: radioButton4.Checked = true; break; + case 4: radioButton5.Checked = true; break; + } + } + } + + public void Apply(UniFields fields) + { + if(mixedvalues) return; + string text = (!string.IsNullOrEmpty(textbox.Text) && textbox.Text != DEFAULT_TEXT ? CommentType.Types[commenttype] + textbox.Text : String.Empty); + UDMFTools.SetString(fields, "comment", text, string.Empty); + } + + #endregion + + #region ================== Events + + private void clear_Click(object sender, EventArgs e) + { + textbox.Text = DEFAULT_TEXT; + textbox.ForeColor = SystemColors.InactiveCaptionText; + mixedvalues = false; + } + + private void textbox_Enter(object sender, EventArgs e) + { + if(textbox.Text == DEFAULT_TEXT) + { + textbox.Clear(); + textbox.ForeColor = SystemColors.WindowText; + } + } + + private void textbox_Leave(object sender, EventArgs e) + { + if(string.IsNullOrEmpty(textbox.Text) && !mixedvalues) + { + textbox.Text = DEFAULT_TEXT; + textbox.ForeColor = SystemColors.InactiveCaptionText; + } + } + + private void textbox_TextChanged(object sender, EventArgs e) + { + mixedvalues = false; + } + + private void radiobutton_CheckedChanged(object sender, EventArgs e) + { + commenttype = (int)((Control)sender).Tag; + } + + #endregion + } +} diff --git a/Source/Core/Controls/CommentEditor.resx b/Source/Core/Controls/CommentEditor.resx new file mode 100644 index 00000000..ff31a6db --- /dev/null +++ b/Source/Core/Controls/CommentEditor.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Source/Core/Data/DataManager.cs b/Source/Core/Data/DataManager.cs index cd42a4c1..2bcb5002 100644 --- a/Source/Core/Data/DataManager.cs +++ b/Source/Core/Data/DataManager.cs @@ -90,6 +90,9 @@ namespace CodeImp.DoomBuilder.Data private ImageData crosshairbusy; private Dictionary internalsprites; private ImageData whitetexture; + + //mxd. Comment icons + private ImageData[] commenttextures; // Used images private Dictionary usedimages; @@ -131,6 +134,7 @@ namespace CodeImp.DoomBuilder.Data public ImageData Crosshair3D { get { return crosshair; } } public ImageData CrosshairBusy3D { get { return crosshairbusy; } } public ImageData WhiteTexture { get { return whitetexture; } } + public ImageData[] CommentTextures { get { return commenttextures; } } //mxd public List ThingCategories { get { return thingcategories; } } public ICollection ThingTypes { get { return thingtypes.Values; } } public DecorateParser Decorate { get { return decorate; } } @@ -181,6 +185,23 @@ namespace CodeImp.DoomBuilder.Data whitetexture.LoadImage(); whitetexture.CreateTexture(); unknownimage = new UnknownImage(Properties.Resources.UnknownImage); //mxd. There should be only one! + + //mxd. Create comment icons + commenttextures = new ImageData[] + { + new ResourceImage("CodeImp.DoomBuilder.Resources.CommentRegular.png"), + new ResourceImage("CodeImp.DoomBuilder.Resources.CommentInfo.png"), + new ResourceImage("CodeImp.DoomBuilder.Resources.CommentQuestion.png"), + new ResourceImage("CodeImp.DoomBuilder.Resources.CommentProblem.png"), + new ResourceImage("CodeImp.DoomBuilder.Resources.CommentSmile.png"), + }; + + //mxd. Load comment icons + foreach (ImageData data in commenttextures) + { + data.LoadImage(); + data.CreateTexture(); + } } // Disposer @@ -205,6 +226,7 @@ namespace CodeImp.DoomBuilder.Data whitetexture = null; unknownimage.Dispose(); //mxd unknownimage = null; //mxd + foreach (ImageData data in commenttextures) data.Dispose(); //mxd modeldefentries = null;//mxd mapinfo = null; diff --git a/Source/Core/Properties/Resources.Designer.cs b/Source/Core/Properties/Resources.Designer.cs index d8db9aab..9017dd2a 100644 --- a/Source/Core/Properties/Resources.Designer.cs +++ b/Source/Core/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.5420 +// Runtime Version:2.0.50727.5485 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -144,6 +144,48 @@ namespace CodeImp.DoomBuilder.Properties { } } + internal static System.Drawing.Bitmap Comment { + get { + object obj = ResourceManager.GetObject("Comment", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap CommentInfo { + get { + object obj = ResourceManager.GetObject("CommentInfo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap CommentProblem { + get { + object obj = ResourceManager.GetObject("CommentProblem", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap CommentQuestion { + get { + object obj = ResourceManager.GetObject("CommentQuestion", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap CommentRegular { + get { + object obj = ResourceManager.GetObject("CommentRegular", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap CommentSmile { + get { + object obj = ResourceManager.GetObject("CommentSmile", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap Copy { get { object obj = ResourceManager.GetObject("Copy", resourceCulture); diff --git a/Source/Core/Properties/Resources.resx b/Source/Core/Properties/Resources.resx index 5a6fd822..5cedaa77 100644 --- a/Source/Core/Properties/Resources.resx +++ b/Source/Core/Properties/Resources.resx @@ -118,6 +118,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\Zoom.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Clear.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -127,8 +130,8 @@ ..\Resources\ArrowUp.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\ClearTextures.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\CommentQuestion.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Keyboard.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -178,15 +181,12 @@ ..\Resources\Marine.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\InfoPanelCollapse.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Splash3_small.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\TagStatistics.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Model.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\Screenshot.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -196,8 +196,14 @@ ..\Resources\ScriptHelp.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Search.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Light_animate.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\CommentSmile.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\KnownTextureSet.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Splash3_trans.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -211,24 +217,24 @@ ..\Resources\Expand.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Unpin.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Redo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Grid2_arrowup.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Grid2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Status0.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\ViewBrightness.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Zoom.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Model.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\mergegeometry.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ScriptSnippet.xpm;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\CommentProblem.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\List_Images.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -271,6 +277,12 @@ ..\Resources\Question.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\CommentInfo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\CommentRegular.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Cursor.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -283,6 +295,9 @@ ..\Resources\treeview.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Status1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\ArrowDown.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -319,6 +334,9 @@ ..\Resources\ErrorLarge.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Lightbulb.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\MCrash.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -328,6 +346,9 @@ ..\Resources\ModelDisabled.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ModelFiltered.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Zoom_arrowup.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -358,17 +379,14 @@ ..\Resources\Status10.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Properties.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\ScreenshotActiveWindow.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Status0.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Script2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Redo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ClearTextures.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Prefab.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -385,6 +403,9 @@ ..\Resources\Folder.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\GZDB2.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\VisualVertices.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -397,17 +418,17 @@ ..\Resources\Status2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Add.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Link.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Light.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\TagStatistics.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\ScriptSnippet.xpm;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Add.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Properties.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Test.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -415,11 +436,11 @@ ..\Resources\Undo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\SlimDX_small.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\InfoPanelExpand.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\KnownTextureSet.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Unpin.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Angle.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -427,8 +448,8 @@ ..\Resources\ViewTextureFloor.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Light_animate.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Grid2_arrowup.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Pin.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -439,6 +460,9 @@ ..\Resources\ScriptKeyword.xpm;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\MissingThing.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Monster3.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -448,11 +472,11 @@ ..\Resources\Copy.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Grid2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ViewBrightness.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Lightbulb.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Light.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Help.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -460,20 +484,20 @@ ..\Resources\OpenScript.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\MissingThing.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\SlimDX_small.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Status11.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Status1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ScreenshotActiveWindow.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\WarningLarge.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\GZDB2.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Search.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Text.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -481,13 +505,7 @@ ..\Resources\Check.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\InfoPanelCollapse.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\InfoPanelExpand.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\ModelFiltered.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Comment.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/Source/Core/Rendering/CommentType.cs b/Source/Core/Rendering/CommentType.cs new file mode 100644 index 00000000..ec0639a0 --- /dev/null +++ b/Source/Core/Rendering/CommentType.cs @@ -0,0 +1,13 @@ +namespace CodeImp.DoomBuilder.Rendering +{ + public struct CommentType + { + private const string REGULAR = ""; + private const string INFO = "[i]"; + private const string QUESTION = "[?]"; + private const string PROBLEM = "[!]"; + private const string SMILE = "[:]"; + + public static readonly string[] Types = new[] { REGULAR, INFO, QUESTION, PROBLEM, SMILE }; + } +} diff --git a/Source/Core/Rendering/Renderer2D.cs b/Source/Core/Rendering/Renderer2D.cs index 0d447612..88364c4e 100644 --- a/Source/Core/Rendering/Renderer2D.cs +++ b/Source/Core/Rendering/Renderer2D.cs @@ -47,7 +47,7 @@ namespace CodeImp.DoomBuilder.Rendering private const float FSAA_FACTOR = 0.6f; private const float THING_ARROW_SIZE = 1.5f; private const float THING_ARROW_SHRINK = 2f; - private const float THING_CIRCLE_SIZE = 1f; + //private const float THING_CIRCLE_SIZE = 1f; private const float THING_SPRITE_SHRINK = 2f; private const int THING_BUFFER_SIZE = 100; private const float MINIMUM_THING_RADIUS = 1.5f; //mxd @@ -946,7 +946,7 @@ namespace CodeImp.DoomBuilder.Rendering if(t.Size * scale < MINIMUM_THING_RADIUS) return false; //mxd. Don't render tiny little things // Determine size - float circlesize = (t.FixedSize && (scale > 1.0f) ? t.Size * THING_CIRCLE_SIZE : t.Size * scale * THING_CIRCLE_SIZE); + float circlesize = (t.FixedSize && (scale > 1.0f) ? t.Size /* * THING_CIRCLE_SIZE*/ : t.Size * scale /* * THING_CIRCLE_SIZE*/); // Transform to screen coordinates Vector2D screenpos = ((Vector2D)t.Position).GetTransformed(translatex, translatey, scale, -scale); diff --git a/Source/Core/Resources/Actions.cfg b/Source/Core/Resources/Actions.cfg index 8eab18ab..ec802e88 100644 --- a/Source/Core/Resources/Actions.cfg +++ b/Source/Core/Resources/Actions.cfg @@ -982,6 +982,16 @@ viewmodeceilings allowscroll = false; } +togglecomments //mxd +{ + title = "Toggle Comments"; + category = "view"; + description = "Toggles rendering of comment icons in Sectors, Things and Linedefs modes (UDMF only)."; + allowkeys = true; + allowmouse = false; + allowscroll = false; +} + togglebrightness //mxd { title = "Toggle Full Brightness"; diff --git a/Source/Core/Resources/Comment.png b/Source/Core/Resources/Comment.png new file mode 100644 index 0000000000000000000000000000000000000000..15abdc12491356a78fe700fafa34333a588b11f1 GIT binary patch literal 217 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xsy$sCLn>}1{js0?(4LvKp|jD+;0=#~UvomzPlp2?Lfn}F z&vb+p3dK6lb6nzmGT-r$GXr;5VS4&OiHw>R5?u1Lx!uxCjQ-gt`&jUtQ)1Oou{+3- zbfA9Gp%3;pSqFcmH(g>@){IMFSmdKI;Vst08SG~4*&oF literal 0 HcmV?d00001 diff --git a/Source/Core/Resources/CommentInfo.png b/Source/Core/Resources/CommentInfo.png new file mode 100644 index 0000000000000000000000000000000000000000..27385c5be5e4af22c432e339fa804777a180a298 GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5X3O!vMLn>}1{rUgjo>{el_1KCPD-=#H>FeWj+rg-CHrvPB zbF=2}uhCHawUd68E`n0VDJK)<*M&M-C}1s;M!Wf|iY~bKV{E z=KMU$r>Q|%N(%`DEUMhOOi1O~qQCV2}K%0Mn;@O1TaS?83{1ORs+ BMwkEq literal 0 HcmV?d00001 diff --git a/Source/Core/Resources/CommentProblem.png b/Source/Core/Resources/CommentProblem.png new file mode 100644 index 0000000000000000000000000000000000000000..13d394f2940fcce8428261833f94d8af7bb69d1d GIT binary patch literal 213 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5X$~|2iLn>}1{rUgjo>{el_1KCPD-=#H>FeWj+rg-CR#x47 zLQ1hK>*4wdiasxddf4-t4DHN}5|S1O@Gvt+TwwiYy+SzUaVg`FVdQ I&MBb@0RG@ZivR!s literal 0 HcmV?d00001 diff --git a/Source/Core/Resources/CommentQuestion.png b/Source/Core/Resources/CommentQuestion.png new file mode 100644 index 0000000000000000000000000000000000000000..815bd99f55bf9a8bc09019b025b4541bf46b12eb GIT binary patch literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XIy_w*Ln>}1{rUgjo>{el_1KCPD-=#H>FeWj+rg-CcIvFv zo||?qYI$UKe*|yR$Bm4gSWC`U1=h bOgs$l?41@%%=Od;x{1Nl)z4*}Q$iB}eIig_ literal 0 HcmV?d00001 diff --git a/Source/Core/Resources/CommentRegular.png b/Source/Core/Resources/CommentRegular.png new file mode 100644 index 0000000000000000000000000000000000000000..62890a5b497ef68773fa571615b6448509c188be GIT binary patch literal 200 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XvOHZJLn>}1{rUgjo>{el_1KCPD-=#H>FeWjGhlww^y$;5 z|4W!w$g!!haWQi5Vz{8)GN942*0HNk=Eud6#iE0c~aQboFyt=akR{0JM@sGXMYp literal 0 HcmV?d00001 diff --git a/Source/Core/Resources/CommentSmile.png b/Source/Core/Resources/CommentSmile.png new file mode 100644 index 0000000000000000000000000000000000000000..581ad9663e25444228905534b5c5014b223fd944 GIT binary patch literal 236 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5X`aE46Ln>}1{rUgjo>{el_1KCPD-=#H>FeWj+rg-CcInJ) zk4-xlH9fRHA)uBsNr|icpoF-*q=8`oN5lrseU%G(ru&DAKj2|bI`W~4F_u{`f5U?! zDZBb$Qyz&#PswmE7r%tNmz@oQl$cL2#O&C!=a2mb?F62rW`kW)i}o;Vmdw-EOl True - - True - 17, 17 @@ -155,7 +152,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADM - CAAAAk1TRnQBSQFMAgEBAgEAAagBAAGoAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CAAAAk1TRnQBSQFMAgEBAgEAAbABAAGwAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -195,7 +192,4 @@ BAAB/wKAAQEEAAH/AcECgQQAAf8B4wLDBAAC/wLnBAAE/wQACw== - - 17, 17 - \ No newline at end of file diff --git a/Source/Core/Windows/MainForm.Designer.cs b/Source/Core/Windows/MainForm.Designer.cs index a744db69..9a64e7f7 100644 --- a/Source/Core/Windows/MainForm.Designer.cs +++ b/Source/Core/Windows/MainForm.Designer.cs @@ -98,6 +98,8 @@ namespace CodeImp.DoomBuilder.Windows this.menufullbrightness = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.menuzoom = new System.Windows.Forms.ToolStripMenuItem(); + this.item2zoom800 = new System.Windows.Forms.ToolStripMenuItem(); + this.item2zoom400 = new System.Windows.Forms.ToolStripMenuItem(); this.item2zoom200 = new System.Windows.Forms.ToolStripMenuItem(); this.item2zoom100 = new System.Windows.Forms.ToolStripMenuItem(); this.item2zoom50 = new System.Windows.Forms.ToolStripMenuItem(); @@ -134,9 +136,9 @@ namespace CodeImp.DoomBuilder.Windows this.itemhelprefmanual = new System.Windows.Forms.ToolStripMenuItem(); this.itemShortcutReference = new System.Windows.Forms.ToolStripMenuItem(); this.itemhelpeditmode = new System.Windows.Forms.ToolStripMenuItem(); + this.itemhelpcheckupdates = new System.Windows.Forms.ToolStripMenuItem(); this.seperatorhelpmanual = new System.Windows.Forms.ToolStripSeparator(); this.itemhelpabout = new System.Windows.Forms.ToolStripMenuItem(); - this.itemhelpcheckupdates = new System.Windows.Forms.ToolStripMenuItem(); this.toolbar = new System.Windows.Forms.ToolStrip(); this.toolbarContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.toggleFile = new System.Windows.Forms.ToolStripMenuItem(); @@ -173,6 +175,7 @@ namespace CodeImp.DoomBuilder.Windows this.buttonsnaptogrid = new System.Windows.Forms.ToolStripButton(); this.buttonautomerge = new System.Windows.Forms.ToolStripButton(); this.buttonautoclearsidetextures = new System.Windows.Forms.ToolStripButton(); + this.buttontogglecomments = new System.Windows.Forms.ToolStripButton(); this.seperatorgeometry = new System.Windows.Forms.ToolStripSeparator(); this.buttontogglefx = new System.Windows.Forms.ToolStripButton(); this.dynamiclightmode = new System.Windows.Forms.ToolStripSplitButton(); @@ -208,6 +211,7 @@ namespace CodeImp.DoomBuilder.Windows this.itemgridcustom = new System.Windows.Forms.ToolStripMenuItem(); this.zoomlabel = new System.Windows.Forms.ToolStripStatusLabel(); this.buttonzoom = new System.Windows.Forms.ToolStripDropDownButton(); + this.itemzoom800 = new System.Windows.Forms.ToolStripMenuItem(); this.itemzoom400 = new System.Windows.Forms.ToolStripMenuItem(); this.itemzoom200 = new System.Windows.Forms.ToolStripMenuItem(); this.itemzoom100 = new System.Windows.Forms.ToolStripMenuItem(); @@ -241,9 +245,7 @@ namespace CodeImp.DoomBuilder.Windows this.dockerscollapser = new System.Windows.Forms.Timer(this.components); this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); this.modecontrolsloolbar = new System.Windows.Forms.ToolStrip(); - this.item2zoom400 = new System.Windows.Forms.ToolStripMenuItem(); - this.item2zoom800 = new System.Windows.Forms.ToolStripMenuItem(); - this.itemzoom800 = new System.Windows.Forms.ToolStripMenuItem(); + this.itemtogglecomments = new System.Windows.Forms.ToolStripMenuItem(); toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); @@ -722,6 +724,7 @@ namespace CodeImp.DoomBuilder.Windows this.menugotocoords, this.itemfittoscreen, this.itemtoggleinfo, + this.itemtogglecomments, this.seperatorviewzoom, this.itemscripteditor}); this.menuview.Name = "menuview"; @@ -815,6 +818,22 @@ namespace CodeImp.DoomBuilder.Windows this.menuzoom.Size = new System.Drawing.Size(209, 22); this.menuzoom.Text = "&Zoom"; // + // item2zoom800 + // + this.item2zoom800.Name = "item2zoom800"; + this.item2zoom800.Size = new System.Drawing.Size(102, 22); + this.item2zoom800.Tag = "800"; + this.item2zoom800.Text = "800%"; + this.item2zoom800.Click += new System.EventHandler(this.itemzoomto_Click); + // + // item2zoom400 + // + this.item2zoom400.Name = "item2zoom400"; + this.item2zoom400.Size = new System.Drawing.Size(102, 22); + this.item2zoom400.Tag = "400"; + this.item2zoom400.Text = "400%"; + this.item2zoom400.Click += new System.EventHandler(this.itemzoomto_Click); + // // item2zoom200 // this.item2zoom200.Name = "item2zoom200"; @@ -1080,7 +1099,7 @@ namespace CodeImp.DoomBuilder.Windows this.itemhelprefmanual, this.itemShortcutReference, this.itemhelpeditmode, - this.itemhelpcheckupdates, + this.itemhelpcheckupdates, this.seperatorhelpmanual, this.itemhelpabout}); this.menuhelp.Name = "menuhelp"; @@ -1112,6 +1131,13 @@ namespace CodeImp.DoomBuilder.Windows this.itemhelpeditmode.Text = "About this &Editing Mode"; this.itemhelpeditmode.Click += new System.EventHandler(this.itemhelpeditmode_Click); // + // itemhelpcheckupdates + // + this.itemhelpcheckupdates.Name = "itemhelpcheckupdates"; + this.itemhelpcheckupdates.Size = new System.Drawing.Size(232, 22); + this.itemhelpcheckupdates.Text = "&Check for updates..."; + this.itemhelpcheckupdates.Click += new System.EventHandler(this.itemhelpcheckupdates_Click); + // // seperatorhelpmanual // this.seperatorhelpmanual.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3); @@ -1125,13 +1151,6 @@ namespace CodeImp.DoomBuilder.Windows this.itemhelpabout.Text = "&About GZDoom Builder..."; this.itemhelpabout.Click += new System.EventHandler(this.itemhelpabout_Click); // - // itemhelpcheckupdates - // - this.itemhelpcheckupdates.Name = "itemhelpcheckupdates"; - this.itemhelpcheckupdates.Size = new System.Drawing.Size(232, 22); - this.itemhelpcheckupdates.Text = "&Check for updates..."; - this.itemhelpcheckupdates.Click += new System.EventHandler(this.itemhelpcheckupdates_Click); - // // toolbar // this.toolbar.AutoSize = false; @@ -1165,6 +1184,7 @@ namespace CodeImp.DoomBuilder.Windows this.buttonviewfloors, this.buttonviewceilings, this.seperatorviews, + this.buttontogglecomments, this.buttonsnaptogrid, this.buttonautomerge, this.buttonautoclearsidetextures, @@ -1538,6 +1558,19 @@ namespace CodeImp.DoomBuilder.Windows this.buttonautoclearsidetextures.Text = "Auto Clear Sidedef Textures"; this.buttonautoclearsidetextures.Click += new System.EventHandler(this.InvokeTaggedAction); // + // buttontogglecomments + // + this.buttontogglecomments.Checked = true; + this.buttontogglecomments.CheckState = System.Windows.Forms.CheckState.Checked; + this.buttontogglecomments.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.buttontogglecomments.Image = global::CodeImp.DoomBuilder.Properties.Resources.Comment; + this.buttontogglecomments.ImageTransparentColor = System.Drawing.Color.Magenta; + this.buttontogglecomments.Name = "buttontogglecomments"; + this.buttontogglecomments.Size = new System.Drawing.Size(23, 22); + this.buttontogglecomments.Tag = "builder_togglecomments"; + this.buttontogglecomments.Text = "Show Comments"; + this.buttontogglecomments.Click += new System.EventHandler(this.InvokeTaggedAction); + // // seperatorgeometry // this.seperatorgeometry.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); @@ -1608,7 +1641,7 @@ namespace CodeImp.DoomBuilder.Windows this.modelrendermode.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.modelsdontshow, this.modelsshowselection, - this.modelsshowfiltered, + this.modelsshowfiltered, this.modelsshowall}); this.modelrendermode.Enabled = false; this.modelrendermode.Image = global::CodeImp.DoomBuilder.Properties.Resources.Model; @@ -1624,7 +1657,7 @@ namespace CodeImp.DoomBuilder.Windows this.modelsdontshow.CheckOnClick = true; this.modelsdontshow.Image = global::CodeImp.DoomBuilder.Properties.Resources.ModelDisabled; this.modelsdontshow.Name = "modelsdontshow"; - this.modelsdontshow.Size = new System.Drawing.Size(271, 22); + this.modelsdontshow.Size = new System.Drawing.Size(293, 22); this.modelsdontshow.Tag = 0; this.modelsdontshow.Text = "Don\'t show models"; this.modelsdontshow.Click += new System.EventHandler(this.ChangeModelRenderingMode); @@ -1634,7 +1667,7 @@ namespace CodeImp.DoomBuilder.Windows this.modelsshowselection.CheckOnClick = true; this.modelsshowselection.Image = global::CodeImp.DoomBuilder.Properties.Resources.Model_selected; this.modelsshowselection.Name = "modelsshowselection"; - this.modelsshowselection.Size = new System.Drawing.Size(271, 22); + this.modelsshowselection.Size = new System.Drawing.Size(293, 22); this.modelsshowselection.Tag = 1; this.modelsshowselection.Text = "Show models for selected things only"; this.modelsshowselection.Click += new System.EventHandler(this.ChangeModelRenderingMode); @@ -1644,7 +1677,7 @@ namespace CodeImp.DoomBuilder.Windows this.modelsshowfiltered.CheckOnClick = true; this.modelsshowfiltered.Image = global::CodeImp.DoomBuilder.Properties.Resources.ModelFiltered; this.modelsshowfiltered.Name = "modelsshowfiltered"; - this.modelsshowfiltered.Size = new System.Drawing.Size(271, 22); + this.modelsshowfiltered.Size = new System.Drawing.Size(293, 22); this.modelsshowfiltered.Tag = 2; this.modelsshowfiltered.Text = "Show models for current things filter only"; this.modelsshowfiltered.Click += new System.EventHandler(this.ChangeModelRenderingMode); @@ -1654,7 +1687,7 @@ namespace CodeImp.DoomBuilder.Windows this.modelsshowall.CheckOnClick = true; this.modelsshowall.Image = global::CodeImp.DoomBuilder.Properties.Resources.Model; this.modelsshowall.Name = "modelsshowall"; - this.modelsshowall.Size = new System.Drawing.Size(271, 22); + this.modelsshowall.Size = new System.Drawing.Size(293, 22); this.modelsshowall.Tag = 3; this.modelsshowall.Text = "Always show models"; this.modelsshowall.Click += new System.EventHandler(this.ChangeModelRenderingMode); @@ -1923,6 +1956,14 @@ namespace CodeImp.DoomBuilder.Windows this.buttonzoom.Size = new System.Drawing.Size(29, 21); this.buttonzoom.Text = "Zoom"; // + // itemzoom800 + // + this.itemzoom800.Name = "itemzoom800"; + this.itemzoom800.Size = new System.Drawing.Size(156, 22); + this.itemzoom800.Tag = "800"; + this.itemzoom800.Text = "800%"; + this.itemzoom800.Click += new System.EventHandler(this.itemzoomto_Click); + // // itemzoom400 // this.itemzoom400.Name = "itemzoom400"; @@ -2066,7 +2107,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelcollapsedinfo.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.labelcollapsedinfo.Location = new System.Drawing.Point(2, 2); this.labelcollapsedinfo.Name = "labelcollapsedinfo"; - this.labelcollapsedinfo.Size = new System.Drawing.Size(137, 13); + this.labelcollapsedinfo.Size = new System.Drawing.Size(155, 13); this.labelcollapsedinfo.TabIndex = 6; this.labelcollapsedinfo.Text = "Collapsed Descriptions"; this.labelcollapsedinfo.Visible = false; @@ -2078,7 +2119,7 @@ namespace CodeImp.DoomBuilder.Windows this.modename.ForeColor = System.Drawing.SystemColors.GrayText; this.modename.Location = new System.Drawing.Point(12, 20); this.modename.Name = "modename"; - this.modename.Size = new System.Drawing.Size(244, 59); + this.modename.Size = new System.Drawing.Size(476, 59); this.modename.TabIndex = 8; this.modename.Text = "Hi. I missed you."; this.modename.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -2246,29 +2287,14 @@ namespace CodeImp.DoomBuilder.Windows this.modecontrolsloolbar.Text = "toolStrip1"; this.modecontrolsloolbar.Visible = false; // - // item2zoom400 + // itemtogglecomments // - this.item2zoom400.Name = "item2zoom400"; - this.item2zoom400.Size = new System.Drawing.Size(102, 22); - this.item2zoom400.Tag = "400"; - this.item2zoom400.Text = "400%"; - this.item2zoom400.Click += new System.EventHandler(this.itemzoomto_Click); - // - // item2zoom800 - // - this.item2zoom800.Name = "item2zoom800"; - this.item2zoom800.Size = new System.Drawing.Size(102, 22); - this.item2zoom800.Tag = "800"; - this.item2zoom800.Text = "800%"; - this.item2zoom800.Click += new System.EventHandler(this.itemzoomto_Click); - // - // itemzoom800 - // - this.itemzoom800.Name = "itemzoom800"; - this.itemzoom800.Size = new System.Drawing.Size(156, 22); - this.itemzoom800.Tag = "800"; - this.itemzoom800.Text = "800%"; - this.itemzoom800.Click += new System.EventHandler(this.itemzoomto_Click); + this.itemtogglecomments.Name = "itemtogglecomments"; + this.itemtogglecomments.Size = new System.Drawing.Size(209, 22); + this.itemtogglecomments.Tag = "builder_togglecomments"; + this.itemtogglecomments.Text = "Show Comments"; + this.itemtogglecomments.CheckOnClick = true; + this.itemtogglecomments.Click += new System.EventHandler(this.InvokeTaggedAction); // // MainForm // @@ -2521,5 +2547,7 @@ namespace CodeImp.DoomBuilder.Windows private ToolStripMenuItem item2zoom400; private ToolStripMenuItem item2zoom800; private ToolStripMenuItem itemzoom800; + private ToolStripButton buttontogglecomments; + private ToolStripMenuItem itemtogglecomments; } } \ No newline at end of file diff --git a/Source/Core/Windows/MainForm.cs b/Source/Core/Windows/MainForm.cs index bd10b197..73fbbb59 100644 --- a/Source/Core/Windows/MainForm.cs +++ b/Source/Core/Windows/MainForm.cs @@ -1872,7 +1872,7 @@ namespace CodeImp.DoomBuilder.Windows preventupdateseperators = true; // Show/hide items based on preferences - bool maploaded = General.Map != null; //mxd + bool maploaded = (General.Map != null); //mxd buttonnewmap.Visible = General.Settings.ToolbarFile; buttonopenmap.Visible = General.Settings.ToolbarFile; buttonsavemap.Visible = General.Settings.ToolbarFile; @@ -1893,6 +1893,9 @@ namespace CodeImp.DoomBuilder.Windows buttonviewceilings.Visible = General.Settings.ToolbarViewModes && maploaded; buttonviewfloors.Visible = General.Settings.ToolbarViewModes && maploaded; buttonviewnormal.Visible = General.Settings.ToolbarViewModes && maploaded; + buttontogglecomments.Visible = General.Settings.ToolbarViewModes && maploaded; //mxd + buttontogglecomments.Enabled = maploaded && General.Map.UDMF; //mxd + buttontogglecomments.Checked = General.Settings.RenderComments; //mxd buttonsnaptogrid.Visible = General.Settings.ToolbarGeometry && maploaded; buttonautomerge.Visible = General.Settings.ToolbarGeometry && maploaded; buttonautoclearsidetextures.Visible = General.Settings.ToolbarGeometry && maploaded; //mxd @@ -2634,6 +2637,19 @@ namespace CodeImp.DoomBuilder.Windows clearGroup.Enabled = clearGroup.DropDownItems.Count > 0; } + //mxd. Action to toggle comments rendering + [BeginAction("togglecomments")] + internal void ToggleComments() + { + buttontogglecomments.Checked = !buttontogglecomments.Checked; + itemtogglecomments.Checked = buttontogglecomments.Checked; + General.Settings.RenderComments = buttontogglecomments.Checked; + DisplayStatus(StatusType.Action, "Comment icons are " + (buttontogglecomments.Checked ? "SHOWN" : "HIDDEN")); + + // Redraw display to show changes + RedrawDisplay(); + } + // Action to toggle snap to grid [BeginAction("togglesnap")] internal void ToggleSnapToGrid() @@ -2707,6 +2723,8 @@ namespace CodeImp.DoomBuilder.Windows menufullbrightness.Enabled = (General.Map != null); //mxd itemtoggleinfo.Enabled = (General.Map != null); //mxd itemtoggleinfo.Checked = IsInfoPanelExpanded; + itemtogglecomments.Enabled = (General.Map != null && General.Map.UDMF); //mxd + itemtogglecomments.Checked = General.Settings.RenderComments; //mxd // View mode items for(int i = 0; i < Renderer2D.NUM_VIEW_MODES; i++) @@ -2888,7 +2906,7 @@ namespace CodeImp.DoomBuilder.Windows //open file DisplayStatus(StatusType.Info, "Shortcut reference saved to '" + path + "'"); - System.Diagnostics.Process.Start(path); + Process.Start(path); } #endregion diff --git a/Source/Core/Windows/SectorEditFormUDMF.Designer.cs b/Source/Core/Windows/SectorEditFormUDMF.Designer.cs index 8aeebd66..bbec191b 100644 --- a/Source/Core/Windows/SectorEditFormUDMF.Designer.cs +++ b/Source/Core/Windows/SectorEditFormUDMF.Designer.cs @@ -41,6 +41,7 @@ System.Windows.Forms.Label label6; System.Windows.Forms.Label label5; this.tagSelector = new CodeImp.DoomBuilder.GZBuilder.Controls.TagSelector(); + this.soundsequence = new System.Windows.Forms.ComboBox(); this.resetsoundsequence = new System.Windows.Forms.Button(); this.fadeColor = new CodeImp.DoomBuilder.GZBuilder.Controls.ColorFieldsControl(); this.lightColor = new CodeImp.DoomBuilder.GZBuilder.Controls.ColorFieldsControl(); @@ -98,12 +99,13 @@ this.floorslopecontrol = new CodeImp.DoomBuilder.Controls.SectorSlopeControl(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.ceilingslopecontrol = new CodeImp.DoomBuilder.Controls.SectorSlopeControl(); + this.tabcomment = new System.Windows.Forms.TabPage(); this.tabcustom = new System.Windows.Forms.TabPage(); this.fieldslist = new CodeImp.DoomBuilder.Controls.FieldsEditorControl(); this.cancel = new System.Windows.Forms.Button(); this.apply = new System.Windows.Forms.Button(); this.tooltip = new System.Windows.Forms.ToolTip(this.components); - this.soundsequence = new System.Windows.Forms.ComboBox(); + this.commenteditor = new CodeImp.DoomBuilder.Controls.CommentEditor(); groupaction = new System.Windows.Forms.GroupBox(); groupeffect = new System.Windows.Forms.GroupBox(); label14 = new System.Windows.Forms.Label(); @@ -127,6 +129,7 @@ this.tabslopes.SuspendLayout(); this.groupBox5.SuspendLayout(); this.groupBox4.SuspendLayout(); + this.tabcomment.SuspendLayout(); this.tabcustom.SuspendLayout(); this.SuspendLayout(); // @@ -174,6 +177,16 @@ groupeffect.TabStop = false; groupeffect.Text = " Effects "; // + // soundsequence + // + this.soundsequence.FormattingEnabled = true; + this.soundsequence.Location = new System.Drawing.Point(125, 54); + this.soundsequence.Name = "soundsequence"; + this.soundsequence.Size = new System.Drawing.Size(325, 21); + this.soundsequence.TabIndex = 32; + this.soundsequence.MouseDown += new System.Windows.Forms.MouseEventHandler(this.soundsequence_MouseDown); + this.soundsequence.TextChanged += new System.EventHandler(this.soundsequence_TextChanged); + // // resetsoundsequence // this.resetsoundsequence.Image = global::CodeImp.DoomBuilder.Properties.Resources.Reset; @@ -458,6 +471,7 @@ this.tabs.Controls.Add(this.tabproperties); this.tabs.Controls.Add(this.tabSurfaces); this.tabs.Controls.Add(this.tabslopes); + this.tabs.Controls.Add(this.tabcomment); this.tabs.Controls.Add(this.tabcustom); this.tabs.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this.tabs.Location = new System.Drawing.Point(10, 10); @@ -576,7 +590,7 @@ // // floorAngleControl // - this.floorAngleControl.Angle = 0; + this.floorAngleControl.Angle = -180; this.floorAngleControl.AngleOffset = 90; this.floorAngleControl.Location = new System.Drawing.Point(6, 132); this.floorAngleControl.Name = "floorAngleControl"; @@ -810,7 +824,7 @@ // // ceilAngleControl // - this.ceilAngleControl.Angle = 0; + this.ceilAngleControl.Angle = -180; this.ceilAngleControl.AngleOffset = 90; this.ceilAngleControl.Location = new System.Drawing.Point(6, 132); this.ceilAngleControl.Name = "ceilAngleControl"; @@ -1040,6 +1054,17 @@ this.ceilingslopecontrol.OnAnglesChanged += new System.EventHandler(this.ceilingslopecontrol_OnAnglesChanged); this.ceilingslopecontrol.OnPivotModeChanged += new System.EventHandler(this.ceilingslopecontrol_OnPivotModeChanged); // + // tabcomment + // + this.tabcomment.Controls.Add(this.commenteditor); + this.tabcomment.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.tabcomment.Location = new System.Drawing.Point(4, 22); + this.tabcomment.Name = "tabcomment"; + this.tabcomment.Size = new System.Drawing.Size(503, 419); + this.tabcomment.TabIndex = 4; + this.tabcomment.Text = "Comment"; + this.tabcomment.UseVisualStyleBackColor = true; + // // tabcustom // this.tabcustom.Controls.Add(this.fieldslist); @@ -1102,15 +1127,12 @@ this.tooltip.InitialDelay = 10; this.tooltip.ReshowDelay = 100; // - // soundsequence + // commenteditor // - this.soundsequence.FormattingEnabled = true; - this.soundsequence.Location = new System.Drawing.Point(125, 54); - this.soundsequence.Name = "soundsequence"; - this.soundsequence.Size = new System.Drawing.Size(325, 21); - this.soundsequence.TabIndex = 32; - this.soundsequence.MouseDown += new System.Windows.Forms.MouseEventHandler(this.soundsequence_MouseDown); - this.soundsequence.TextChanged += new System.EventHandler(this.soundsequence_TextChanged); + this.commenteditor.Location = new System.Drawing.Point(3, 3); + this.commenteditor.Name = "commenteditor"; + this.commenteditor.Size = new System.Drawing.Size(497, 413); + this.commenteditor.TabIndex = 0; // // SectorEditFormUDMF // @@ -1149,6 +1171,7 @@ this.tabslopes.ResumeLayout(false); this.groupBox5.ResumeLayout(false); this.groupBox4.ResumeLayout(false); + this.tabcomment.ResumeLayout(false); this.tabcustom.ResumeLayout(false); this.ResumeLayout(false); @@ -1220,5 +1243,7 @@ private System.Windows.Forms.Label labelCeilScale; private System.Windows.Forms.Button resetsoundsequence; private System.Windows.Forms.ComboBox soundsequence; + private System.Windows.Forms.TabPage tabcomment; + private CodeImp.DoomBuilder.Controls.CommentEditor commenteditor; } } \ No newline at end of file diff --git a/Source/Core/Windows/SectorEditFormUDMF.cs b/Source/Core/Windows/SectorEditFormUDMF.cs index 2f4d44c7..c8a50cc4 100644 --- a/Source/Core/Windows/SectorEditFormUDMF.cs +++ b/Source/Core/Windows/SectorEditFormUDMF.cs @@ -329,6 +329,9 @@ namespace CodeImp.DoomBuilder.Windows // Custom fields fieldslist.SetValues(sc.Fields, true); + //mxd. Comments + commenteditor.SetValues(sc.Fields, true); + anglesteps = new StepsList(); //////////////////////////////////////////////////////////////////////// @@ -432,6 +435,9 @@ namespace CodeImp.DoomBuilder.Windows // Custom fields fieldslist.SetValues(s.Fields, false); + //mxd. Comments + commenteditor.SetValues(s.Fields, false); + //mxd. Angle steps int angle; foreach(Sidedef side in s.Sidedefs) @@ -465,6 +471,9 @@ namespace CodeImp.DoomBuilder.Windows if(useCeilSlopeLineAngles) ceilingslopecontrol.StepValues = anglesteps; if(useFloorSlopeLineAngles) floorslopecontrol.StepValues = anglesteps; + //mxd. Comments + commenteditor.FinishSetup(); + preventchanges = false; //mxd } @@ -678,6 +687,9 @@ namespace CodeImp.DoomBuilder.Windows // Fields fieldslist.Apply(s.Fields); + //mxd. Comments + commenteditor.Apply(s.Fields); + // Alpha if(!string.IsNullOrEmpty(ceilAlpha.Text)) { diff --git a/Source/Core/Windows/SectorEditFormUDMF.resx b/Source/Core/Windows/SectorEditFormUDMF.resx index 2f82d0ae..b149e7f6 100644 --- a/Source/Core/Windows/SectorEditFormUDMF.resx +++ b/Source/Core/Windows/SectorEditFormUDMF.resx @@ -138,12 +138,36 @@ False + + False + + + False + + + False + + + False + + + False + False False + + False + + + False + + + False + 17, 17 @@ -162,4 +186,7 @@ True + + 17, 17 + \ No newline at end of file diff --git a/Source/Core/Windows/ThingEditFormUDMF.Designer.cs b/Source/Core/Windows/ThingEditFormUDMF.Designer.cs index 60ae8c75..c243488f 100644 --- a/Source/Core/Windows/ThingEditFormUDMF.Designer.cs +++ b/Source/Core/Windows/ThingEditFormUDMF.Designer.cs @@ -106,6 +106,8 @@ this.hint = new System.Windows.Forms.PictureBox(); this.hintlabel = new System.Windows.Forms.Label(); this.tooltip = new System.Windows.Forms.ToolTip(this.components); + this.tabcomment = new System.Windows.Forms.TabPage(); + this.commenteditor = new CodeImp.DoomBuilder.Controls.CommentEditor(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.tabs.SuspendLayout(); @@ -124,6 +126,7 @@ this.groupBox3.SuspendLayout(); this.tabcustom.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.hint)).BeginInit(); + this.tabcomment.SuspendLayout(); this.SuspendLayout(); // // groupBox1 @@ -314,6 +317,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.tabs.Controls.Add(this.tabproperties); this.tabs.Controls.Add(this.tabeffects); + this.tabs.Controls.Add(this.tabcomment); this.tabs.Controls.Add(this.tabcustom); this.tabs.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tabs.ItemSize = new System.Drawing.Size(120, 19); @@ -698,6 +702,7 @@ this.scale.ButtonStepSmall = 0.01F; this.scale.ButtonStepsUseModifierKeys = true; this.scale.DefaultValue = 1F; + this.scale.LinkValues = false; this.scale.Location = new System.Drawing.Point(89, 22); this.scale.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3); this.scale.Name = "scale"; @@ -1042,6 +1047,27 @@ this.hintlabel.TabIndex = 4; this.hintlabel.Text = "Select categories or several thing types to randomly assign them to selection"; // + // tabcomment + // + this.tabcomment.Controls.Add(this.commenteditor); + this.tabcomment.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tabcomment.Location = new System.Drawing.Point(4, 23); + this.tabcomment.Name = "tabcomment"; + this.tabcomment.Size = new System.Drawing.Size(627, 402); + this.tabcomment.TabIndex = 3; + this.tabcomment.Text = "Comment"; + this.tabcomment.UseVisualStyleBackColor = true; + // + // commenteditor + // + this.commenteditor.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.commenteditor.Location = new System.Drawing.Point(3, 3); + this.commenteditor.Name = "commenteditor"; + this.commenteditor.Size = new System.Drawing.Size(621, 396); + this.commenteditor.TabIndex = 0; + // // ThingEditFormUDMF // this.AcceptButton = this.apply; @@ -1087,6 +1113,7 @@ this.groupBox3.ResumeLayout(false); this.tabcustom.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.hint)).EndInit(); + this.tabcomment.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -1171,5 +1198,7 @@ private System.Windows.Forms.CheckBox cbrandomangle; private System.Windows.Forms.CheckBox cbrandomroll; private System.Windows.Forms.CheckBox cbrandompitch; + private System.Windows.Forms.TabPage tabcomment; + private CodeImp.DoomBuilder.Controls.CommentEditor commenteditor; } } \ No newline at end of file diff --git a/Source/Core/Windows/ThingEditFormUDMF.cs b/Source/Core/Windows/ThingEditFormUDMF.cs index 061c120e..d16e455d 100644 --- a/Source/Core/Windows/ThingEditFormUDMF.cs +++ b/Source/Core/Windows/ThingEditFormUDMF.cs @@ -211,6 +211,7 @@ namespace CodeImp.DoomBuilder.Windows // Custom fields fieldslist.SetValues(ft.Fields, true); + commenteditor.SetValues(ft.Fields, true); //mxd. Comments conversationID.Text = ft.Fields.GetValue("conversation", 0).ToString(); gravity.Text = ft.Fields.GetValue("gravity", 1.0f).ToString(); score.Text = ft.Fields.GetValue("score", 0).ToString(); @@ -288,6 +289,7 @@ namespace CodeImp.DoomBuilder.Windows //mxd. Custom fields fieldslist.SetValues(t.Fields, false); + commenteditor.SetValues(t.Fields, false); //mxd. Comments if (t.Fields.GetValue("conversation", 0).ToString() != conversationID.Text) conversationID.Text = ""; if (t.Fields.GetValue("gravity", 1.0f).ToString() != gravity.Text) gravity.Text = ""; if (t.Fields.GetValue("score", 0).ToString() != score.Text) score.Text = ""; @@ -337,6 +339,7 @@ namespace CodeImp.DoomBuilder.Windows UpdateScriptControls(); //mxd actionhelp.UpdateAction(action.GetValue()); //mxd labelScale.Enabled = scale.NonDefaultValue; //mxd + commenteditor.FinishSetup(); //mxd //mxd. Set intial script-related values, if required if(Array.IndexOf(GZBuilder.GZGeneral.ACS_SPECIALS, action.Value) != -1) @@ -670,6 +673,9 @@ namespace CodeImp.DoomBuilder.Windows color.ApplyTo(t.Fields, t.Fields.GetValue("fillcolor", 0)); + //mxd. Comments + commenteditor.Apply(t.Fields); + // Update settings t.UpdateConfiguration(); } diff --git a/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs index 671fe07e..83cf30d1 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs @@ -150,6 +150,7 @@ namespace CodeImp.DoomBuilder.BuilderModes if(renderer.StartPlotter(false)) { // Undraw previous highlight + Linedef possiblecommentline = l ?? highlighted; //mxd if((highlighted != null) && !highlighted.IsDisposed) { renderer.PlotLinedef(highlighted, renderer.DetermineLinedefColor(highlighted)); @@ -168,8 +169,18 @@ namespace CodeImp.DoomBuilder.BuilderModes renderer.PlotVertex(highlighted.End, renderer.DetermineVertexColor(highlighted.End)); } - // Done + // Done with highlight renderer.Finish(); + + //mxd. Update comment highlight? + if(General.Map.UDMF && General.Settings.RenderComments + && possiblecommentline != null && !possiblecommentline.IsDisposed + && renderer.StartOverlay(false)) + { + RenderComment(possiblecommentline); + renderer.Finish(); + } + renderer.Present(); } } @@ -417,6 +428,10 @@ namespace CodeImp.DoomBuilder.BuilderModes } renderer.RenderArrows(eventlines); //mxd + + //mxd. Render comments + if(General.Map.UDMF && General.Settings.RenderComments) foreach(Linedef l in General.Map.Map.Linedefs) RenderComment(l); + renderer.Finish(); } @@ -648,6 +663,12 @@ namespace CodeImp.DoomBuilder.BuilderModes if(General.Map.UDMF && mouselastpos != mousepos && highlighted != null && !highlighted.IsDisposed && highlighted.Fields.ContainsKey("comment")) { string comment = highlighted.Fields.GetValue("comment", string.Empty); + if(comment.Length > 2) + { + string type = comment.Substring(0, 3); + int index = Array.IndexOf(CommentType.Types, type); + if(index > 0) comment = comment.TrimStart(type.ToCharArray()); + } General.Interface.Display.ShowToolTip("Comment:", comment, (int)(mousepos.x + 32 * MainForm.DPIScaler.Width), (int)(mousepos.y + 8 * MainForm.DPIScaler.Height)); } } @@ -839,6 +860,27 @@ namespace CodeImp.DoomBuilder.BuilderModes General.Interface.DisplayStatus(StatusType.Selection, string.Empty); } + //mxd + private void RenderComment(Linedef l) + { + if(l.Fields.ContainsKey("comment")) + { + int iconindex = 0; + string comment = l.Fields.GetValue("comment", string.Empty); + if(comment.Length > 2) + { + string type = comment.Substring(0, 3); + int index = Array.IndexOf(CommentType.Types, type); + if(index != -1) iconindex = index; + } + + Vector2D center = l.GetCenterPoint(); + RectangleF rect = new RectangleF(center.x - 8 / renderer.Scale, center.y + 18 / renderer.Scale, 16 / renderer.Scale, -16 / renderer.Scale); + PixelColor c = (l == highlighted ? General.Colors.Highlight : (l.Selected ? General.Colors.Selection : PixelColor.FromColor(Color.White))); + renderer.RenderRectangleFilled(rect, c, true, General.Map.Data.CommentTextures[iconindex]); + } + } + #endregion #region ================== Actions diff --git a/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs index a34290dc..755960b2 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs @@ -213,6 +213,9 @@ namespace CodeImp.DoomBuilder.BuilderModes if(!BuilderPlug.Me.ViewSelectionNumbers) RenderEffectLabels(selectedEffectLabels); RenderEffectLabels(unselectedEffectLabels); } + + //mxd. Render comments + if(General.Map.UDMF && General.Settings.RenderComments) foreach(Sector s in General.Map.Map.Sectors) RenderComment(s); renderer.Finish(); } @@ -422,18 +425,12 @@ namespace CodeImp.DoomBuilder.BuilderModes else { // Update display + Sector possiblecommentsector = s ?? highlighted; //mxd if(renderer.StartPlotter(false)) { // Undraw previous highlight if((highlighted != null) && !highlighted.IsDisposed) renderer.PlotSector(highlighted); - - /* - // Undraw highlighted things - if(highlighted != null) - foreach(Thing t in highlighted.Things) - renderer.RenderThing(t, renderer.DetermineThingColor(t)); - */ // Set new highlight highlighted = s; @@ -441,19 +438,22 @@ namespace CodeImp.DoomBuilder.BuilderModes // Render highlighted item if((highlighted != null) && !highlighted.IsDisposed) renderer.PlotSector(highlighted, General.Colors.Highlight); - - /* - // Render highlighted things - if(highlighted != null) - foreach(Thing t in highlighted.Things) - renderer.RenderThing(t, General.Colors.Highlight); - */ - + // Done renderer.Finish(); } UpdateOverlay(); + + //mxd. Update comment highlight? + if(General.Map.UDMF && General.Settings.RenderComments + && possiblecommentsector != null && !possiblecommentsector.IsDisposed + && renderer.StartOverlay(false)) + { + RenderComment(possiblecommentsector); + renderer.Finish(); + } + renderer.Present(); } @@ -1038,6 +1038,12 @@ namespace CodeImp.DoomBuilder.BuilderModes if(General.Map.UDMF && mouselastpos != mousepos && highlighted != null && !highlighted.IsDisposed && highlighted.Fields.ContainsKey("comment")) { string comment = highlighted.Fields.GetValue("comment", string.Empty); + if(comment.Length > 2) + { + string type = comment.Substring(0, 3); + int index = Array.IndexOf(CommentType.Types, type); + if(index > 0) comment = comment.TrimStart(type.ToCharArray()); + } General.Interface.Display.ShowToolTip("Comment:", comment, (int)(mousepos.x + 32 * MainForm.DPIScaler.Width), (int)(mousepos.y + 8 * MainForm.DPIScaler.Height)); } } @@ -1326,6 +1332,27 @@ namespace CodeImp.DoomBuilder.BuilderModes else General.Interface.DisplayStatus(StatusType.Selection, string.Empty); } + + //mxd + private void RenderComment(Sector s) + { + if(s.Fields.ContainsKey("comment")) + { + int iconindex = 0; + string comment = s.Fields.GetValue("comment", string.Empty); + if(comment.Length > 2) + { + string type = comment.Substring(0, 3); + int index = Array.IndexOf(CommentType.Types, type); + if(index != -1) iconindex = index; + } + + Vector2D center = new Vector2D(s.BBox.Left + s.BBox.Width / 2, s.BBox.Top + s.BBox.Height / 2); + RectangleF rect = new RectangleF(center.x - 8 / renderer.Scale, center.y + 16 * renderer.Scale + 16 / renderer.Scale, 16 / renderer.Scale, -16 / renderer.Scale); + PixelColor c = (s == highlighted ? General.Colors.Highlight : (s.Selected ? General.Colors.Selection : PixelColor.FromColor(Color.White))); + renderer.RenderRectangleFilled(rect, c, true, General.Map.Data.CommentTextures[iconindex]); + } + } #endregion diff --git a/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs index 93e94969..4f324c14 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs @@ -18,6 +18,7 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Windows.Forms; using CodeImp.DoomBuilder.Actions; using CodeImp.DoomBuilder.Config; @@ -198,14 +199,15 @@ namespace CodeImp.DoomBuilder.BuilderModes } // Selecting? - if(selecting) + if(renderer.StartOverlay(true)) { // Render selection - if(renderer.StartOverlay(true)) - { - RenderMultiSelection(); - renderer.Finish(); - } + if(selecting) RenderMultiSelection(); + + //mxd. Render comments + if(General.Map.UDMF && General.Settings.RenderComments) foreach(Thing t in General.Map.Map.Things) RenderComment(t); + + renderer.Finish(); } renderer.Present(); @@ -274,6 +276,7 @@ namespace CodeImp.DoomBuilder.BuilderModes if(renderer.StartThings(false)) { // Undraw previous highlight + Thing possiblecommentthing = t ?? highlighted; //mxd if((highlighted != null) && !highlighted.IsDisposed) renderer.RenderThing(highlighted, renderer.DetermineThingColor(highlighted), 1.0f); @@ -284,8 +287,18 @@ namespace CodeImp.DoomBuilder.BuilderModes if((highlighted != null) && !highlighted.IsDisposed) renderer.RenderThing(highlighted, General.Colors.Highlight, 1.0f); - // Done + // Done with highlight renderer.Finish(); + + //mxd. Update comment highlight? + if(General.Map.UDMF && General.Settings.RenderComments + && possiblecommentthing != null && !possiblecommentthing.IsDisposed + && renderer.StartOverlay(false)) + { + RenderComment(possiblecommentthing); + renderer.Finish(); + } + renderer.Present(); } } @@ -537,6 +550,12 @@ namespace CodeImp.DoomBuilder.BuilderModes if(General.Map.UDMF && mouselastpos != mousepos && highlighted != null && !highlighted.IsDisposed && highlighted.Fields.ContainsKey("comment")) { string comment = highlighted.Fields.GetValue("comment", string.Empty); + if(comment.Length > 2) + { + string type = comment.Substring(0, 3); + int index = Array.IndexOf(CommentType.Types, type); + if(index > 0) comment = comment.TrimStart(type.ToCharArray()); + } General.Interface.Display.ShowToolTip("Comment:", comment, (int)(mousepos.x + 32 * MainForm.DPIScaler.Width), (int)(mousepos.y + 8 * MainForm.DPIScaler.Height)); } @@ -716,6 +735,29 @@ namespace CodeImp.DoomBuilder.BuilderModes General.Interface.DisplayStatus(StatusType.Selection, string.Empty); } + //mxd + private void RenderComment(Thing t) + { + if(t.Fields.ContainsKey("comment")) + { + float size = ((t.FixedSize && renderer.Scale > 1.0f) ? t.Size / renderer.Scale : t.Size); + if(size * renderer.Scale < 1.5f) return; // Thing is too small to render + + int iconindex = 0; + string comment = t.Fields.GetValue("comment", string.Empty); + if(comment.Length > 2) + { + string type = comment.Substring(0, 3); + int index = Array.IndexOf(CommentType.Types, type); + if(index != -1) iconindex = index; + } + + RectangleF rect = new RectangleF(t.Position.x + size - 10 / renderer.Scale, t.Position.y + size + 18 / renderer.Scale, 16 / renderer.Scale, -16 / renderer.Scale); + PixelColor c = (t == highlighted ? General.Colors.Highlight : (t.Selected ? General.Colors.Selection : PixelColor.FromColor(Color.White))); + renderer.RenderRectangleFilled(rect, c, true, General.Map.Data.CommentTextures[iconindex]); + } + } + #endregion #region ================== Actions