mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-16 17:11:28 +00:00
@ commants panel update
This commit is contained in:
parent
16eb821571
commit
6fd04509dd
6 changed files with 291 additions and 102 deletions
20
Builder.sln
20
Builder.sln
|
@ -67,16 +67,16 @@ Global
|
|||
{CBD14608-D467-458A-97B3-CA767CA85203}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{CBD14608-D467-458A-97B3-CA767CA85203}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{CBD14608-D467-458A-97B3-CA767CA85203}.Release|x86.ActiveCfg = Release|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|x86.Build.0 = Debug|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|x86.ActiveCfg = Release|x86
|
||||
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -80,12 +80,18 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
{
|
||||
base.Dispose();
|
||||
}
|
||||
|
||||
// When a map is created
|
||||
public override void OnMapNewEnd()
|
||||
{
|
||||
OnMapOpenEnd();
|
||||
}
|
||||
|
||||
// This is called after a map has been successfully opened
|
||||
public override void OnMapOpenEnd()
|
||||
{
|
||||
// If we just opened a UDMF format map, we want to create the Comments panel!
|
||||
//if(General.Map.Config.FormatInterface == "UniversalMapSetIO")
|
||||
if(General.Map.Config.FormatInterface == "UniversalMapSetIO")
|
||||
{
|
||||
dockerpanel = new CommentsDocker();
|
||||
commentsdocker = new Docker("commentsdockerpanel", "Comments", dockerpanel);
|
||||
|
|
104
Source/Plugins/CommentsPanel/CommentsDocker.Designer.cs
generated
104
Source/Plugins/CommentsPanel/CommentsDocker.Designer.cs
generated
|
@ -16,8 +16,9 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.optionsgroup = new System.Windows.Forms.GroupBox();
|
||||
this.clickselects = new System.Windows.Forms.CheckBox();
|
||||
this.filtermode = new System.Windows.Forms.CheckBox();
|
||||
this.grid = new System.Windows.Forms.DataGridView();
|
||||
this.iconcolumn = new System.Windows.Forms.DataGridViewImageColumn();
|
||||
|
@ -30,10 +31,14 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
this.selectadditiveitem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.removecommentsitem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.clickselects = new System.Windows.Forms.CheckBox();
|
||||
this.addcomment = new System.Windows.Forms.Button();
|
||||
this.addcommentgroup = new System.Windows.Forms.GroupBox();
|
||||
this.addcommenttext = new System.Windows.Forms.TextBox();
|
||||
this.enabledtimer = new System.Windows.Forms.Timer(this.components);
|
||||
this.optionsgroup.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.grid)).BeginInit();
|
||||
this.contextmenu.SuspendLayout();
|
||||
this.addcommentgroup.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// optionsgroup
|
||||
|
@ -47,16 +52,26 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
this.optionsgroup.Size = new System.Drawing.Size(244, 93);
|
||||
this.optionsgroup.TabIndex = 1;
|
||||
this.optionsgroup.TabStop = false;
|
||||
this.optionsgroup.Text = " Options ";
|
||||
//
|
||||
// clickselects
|
||||
//
|
||||
this.clickselects.AutoSize = true;
|
||||
this.clickselects.Location = new System.Drawing.Point(15, 57);
|
||||
this.clickselects.Name = "clickselects";
|
||||
this.clickselects.Size = new System.Drawing.Size(95, 18);
|
||||
this.clickselects.TabIndex = 1;
|
||||
this.clickselects.Text = "Select on click";
|
||||
this.clickselects.UseVisualStyleBackColor = true;
|
||||
this.clickselects.CheckedChanged += new System.EventHandler(this.clickselects_CheckedChanged);
|
||||
//
|
||||
// filtermode
|
||||
//
|
||||
this.filtermode.AutoSize = true;
|
||||
this.filtermode.Location = new System.Drawing.Point(15, 29);
|
||||
this.filtermode.Location = new System.Drawing.Point(15, 25);
|
||||
this.filtermode.Name = "filtermode";
|
||||
this.filtermode.Size = new System.Drawing.Size(169, 17);
|
||||
this.filtermode.Size = new System.Drawing.Size(173, 18);
|
||||
this.filtermode.TabIndex = 0;
|
||||
this.filtermode.Text = "Only comments from this mode";
|
||||
this.filtermode.Text = "Comments from this mode only";
|
||||
this.filtermode.UseVisualStyleBackColor = true;
|
||||
this.filtermode.CheckedChanged += new System.EventHandler(this.filtermode_CheckedChanged);
|
||||
//
|
||||
|
@ -85,19 +100,20 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
this.grid.Name = "grid";
|
||||
this.grid.ReadOnly = true;
|
||||
this.grid.RowHeadersVisible = false;
|
||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft;
|
||||
dataGridViewCellStyle2.Padding = new System.Windows.Forms.Padding(2, 4, 2, 5);
|
||||
this.grid.RowsDefaultCellStyle = dataGridViewCellStyle2;
|
||||
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft;
|
||||
dataGridViewCellStyle1.Padding = new System.Windows.Forms.Padding(2, 4, 2, 5);
|
||||
this.grid.RowsDefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.grid.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.grid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.grid.ShowCellErrors = false;
|
||||
this.grid.ShowCellToolTips = false;
|
||||
this.grid.ShowEditingIcon = false;
|
||||
this.grid.ShowRowErrors = false;
|
||||
this.grid.Size = new System.Drawing.Size(250, 555);
|
||||
this.grid.Size = new System.Drawing.Size(250, 465);
|
||||
this.grid.StandardTab = true;
|
||||
this.grid.TabIndex = 6;
|
||||
this.grid.MouseDown += new System.Windows.Forms.MouseEventHandler(this.grid_MouseDown);
|
||||
this.grid.Leave += new System.EventHandler(this.grid_Leave);
|
||||
this.grid.MouseUp += new System.Windows.Forms.MouseEventHandler(this.grid_MouseUp);
|
||||
//
|
||||
// iconcolumn
|
||||
|
@ -131,13 +147,13 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
this.toolStripMenuItem2,
|
||||
this.removecommentsitem});
|
||||
this.contextmenu.Name = "contextMenuStrip1";
|
||||
this.contextmenu.Size = new System.Drawing.Size(175, 116);
|
||||
this.contextmenu.Size = new System.Drawing.Size(173, 116);
|
||||
this.contextmenu.Closed += new System.Windows.Forms.ToolStripDropDownClosedEventHandler(this.contextmenu_Closed);
|
||||
//
|
||||
// editobjectitem
|
||||
//
|
||||
this.editobjectitem.Name = "editobjectitem";
|
||||
this.editobjectitem.Size = new System.Drawing.Size(174, 22);
|
||||
this.editobjectitem.Size = new System.Drawing.Size(172, 22);
|
||||
this.editobjectitem.Text = "Edit Objects";
|
||||
this.editobjectitem.Click += new System.EventHandler(this.editobjectitem_Click);
|
||||
//
|
||||
|
@ -145,19 +161,19 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
//
|
||||
this.toolStripMenuItem1.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
|
||||
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(171, 6);
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(169, 6);
|
||||
//
|
||||
// selectitem
|
||||
//
|
||||
this.selectitem.Name = "selectitem";
|
||||
this.selectitem.Size = new System.Drawing.Size(174, 22);
|
||||
this.selectitem.Size = new System.Drawing.Size(172, 22);
|
||||
this.selectitem.Text = "Select";
|
||||
this.selectitem.Click += new System.EventHandler(this.selectitem_Click);
|
||||
//
|
||||
// selectadditiveitem
|
||||
//
|
||||
this.selectadditiveitem.Name = "selectadditiveitem";
|
||||
this.selectadditiveitem.Size = new System.Drawing.Size(174, 22);
|
||||
this.selectadditiveitem.Size = new System.Drawing.Size(172, 22);
|
||||
this.selectadditiveitem.Text = "Select Additive";
|
||||
this.selectadditiveitem.Click += new System.EventHandler(this.selectadditiveitem_Click);
|
||||
//
|
||||
|
@ -165,38 +181,70 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
//
|
||||
this.toolStripMenuItem2.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
|
||||
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
|
||||
this.toolStripMenuItem2.Size = new System.Drawing.Size(171, 6);
|
||||
this.toolStripMenuItem2.Size = new System.Drawing.Size(169, 6);
|
||||
//
|
||||
// removecommentsitem
|
||||
//
|
||||
this.removecommentsitem.Name = "removecommentsitem";
|
||||
this.removecommentsitem.Size = new System.Drawing.Size(174, 22);
|
||||
this.removecommentsitem.Size = new System.Drawing.Size(172, 22);
|
||||
this.removecommentsitem.Text = "Remove Comment";
|
||||
this.removecommentsitem.Click += new System.EventHandler(this.removecommentsitem_Click);
|
||||
//
|
||||
// clickselects
|
||||
// addcomment
|
||||
//
|
||||
this.clickselects.AutoSize = true;
|
||||
this.clickselects.Location = new System.Drawing.Point(15, 61);
|
||||
this.clickselects.Name = "clickselects";
|
||||
this.clickselects.Size = new System.Drawing.Size(96, 17);
|
||||
this.clickselects.TabIndex = 1;
|
||||
this.clickselects.Text = "Select on click";
|
||||
this.clickselects.UseVisualStyleBackColor = true;
|
||||
this.clickselects.CheckedChanged += new System.EventHandler(this.clickselects_CheckedChanged);
|
||||
this.addcomment.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.addcomment.Location = new System.Drawing.Point(6, 45);
|
||||
this.addcomment.Name = "addcomment";
|
||||
this.addcomment.Size = new System.Drawing.Size(232, 31);
|
||||
this.addcomment.TabIndex = 7;
|
||||
this.addcomment.Text = "Set Selection Comment";
|
||||
this.addcomment.UseVisualStyleBackColor = true;
|
||||
this.addcomment.Click += new System.EventHandler(this.addcomment_Click);
|
||||
//
|
||||
// addcommentgroup
|
||||
//
|
||||
this.addcommentgroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.addcommentgroup.Controls.Add(this.addcommenttext);
|
||||
this.addcommentgroup.Controls.Add(this.addcomment);
|
||||
this.addcommentgroup.Location = new System.Drawing.Point(3, 471);
|
||||
this.addcommentgroup.Name = "addcommentgroup";
|
||||
this.addcommentgroup.Size = new System.Drawing.Size(244, 84);
|
||||
this.addcommentgroup.TabIndex = 8;
|
||||
this.addcommentgroup.TabStop = false;
|
||||
//
|
||||
// addcommenttext
|
||||
//
|
||||
this.addcommenttext.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.addcommenttext.Location = new System.Drawing.Point(6, 19);
|
||||
this.addcommenttext.Name = "addcommenttext";
|
||||
this.addcommenttext.Size = new System.Drawing.Size(232, 20);
|
||||
this.addcommenttext.TabIndex = 8;
|
||||
this.addcommenttext.KeyDown += new System.Windows.Forms.KeyEventHandler(this.addcommenttext_KeyDown);
|
||||
//
|
||||
// enabledtimer
|
||||
//
|
||||
this.enabledtimer.Interval = 333;
|
||||
this.enabledtimer.Tick += new System.EventHandler(this.enabledtimer_Tick);
|
||||
//
|
||||
// CommentsDocker
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.Controls.Add(this.addcommentgroup);
|
||||
this.Controls.Add(this.grid);
|
||||
this.Controls.Add(this.optionsgroup);
|
||||
this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.Name = "CommentsDocker";
|
||||
this.Size = new System.Drawing.Size(250, 657);
|
||||
this.optionsgroup.ResumeLayout(false);
|
||||
this.optionsgroup.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.grid)).EndInit();
|
||||
this.contextmenu.ResumeLayout(false);
|
||||
this.addcommentgroup.ResumeLayout(false);
|
||||
this.addcommentgroup.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
@ -217,5 +265,9 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
private System.Windows.Forms.ToolStripMenuItem removecommentsitem;
|
||||
private System.Windows.Forms.ToolStripMenuItem editobjectitem;
|
||||
private System.Windows.Forms.CheckBox clickselects;
|
||||
private System.Windows.Forms.Button addcomment;
|
||||
private System.Windows.Forms.GroupBox addcommentgroup;
|
||||
private System.Windows.Forms.TextBox addcommenttext;
|
||||
private System.Windows.Forms.Timer enabledtimer;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ using System.Globalization;
|
|||
using System.Threading;
|
||||
using CodeImp.DoomBuilder.Editing;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using CodeImp.DoomBuilder.Types;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -46,6 +47,7 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
Dictionary<string, CommentInfo> l_comments = new Dictionary<string, CommentInfo>();
|
||||
Dictionary<string, CommentInfo> s_comments = new Dictionary<string, CommentInfo>();
|
||||
Dictionary<string, CommentInfo> t_comments = new Dictionary<string, CommentInfo>();
|
||||
bool preventupdate = false;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -86,7 +88,9 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
this.ParentForm.Activated += ParentForm_Activated;
|
||||
}
|
||||
|
||||
grid.CurrentCell = null;
|
||||
updatetimer.Start();
|
||||
enabledtimer.Start();
|
||||
}
|
||||
|
||||
// Before detached from the docker
|
||||
|
@ -98,11 +102,13 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
}
|
||||
|
||||
updatetimer.Stop();
|
||||
enabledtimer.Stop();
|
||||
}
|
||||
|
||||
// This sends the focus back to the display and removes grid selection
|
||||
private void LoseFocus()
|
||||
{
|
||||
preventupdate = false;
|
||||
grid.CurrentCell = null;
|
||||
grid.ClearSelection();
|
||||
General.Interface.FocusDisplay();
|
||||
|
@ -164,42 +170,52 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
// This finds all comments and updates the list
|
||||
public void UpdateList()
|
||||
{
|
||||
// Update vertices
|
||||
Dictionary<string, CommentInfo> newcomments = new Dictionary<string, CommentInfo>();
|
||||
if(!filtermode.Checked || (General.Editing.Mode.GetType().Name == "VerticesMode"))
|
||||
//bool firstitem = (grid.Rows.Count == 0);
|
||||
|
||||
if(!preventupdate)
|
||||
{
|
||||
foreach(Vertex v in General.Map.Map.Vertices) AddComments(v, newcomments);
|
||||
// Update vertices
|
||||
Dictionary<string, CommentInfo> newcomments = new Dictionary<string, CommentInfo>();
|
||||
if(!filtermode.Checked || (General.Editing.Mode.GetType().Name == "VerticesMode"))
|
||||
{
|
||||
foreach(Vertex v in General.Map.Map.Vertices) AddComments(v, newcomments);
|
||||
}
|
||||
UpdateGroupList(newcomments, v_comments, Properties.Resources.VerticesMode);
|
||||
|
||||
// Update linedefs/sidedefs
|
||||
newcomments.Clear();
|
||||
if(!filtermode.Checked || (General.Editing.Mode.GetType().Name == "LinedefsMode"))
|
||||
{
|
||||
foreach(Linedef l in General.Map.Map.Linedefs) AddComments(l, newcomments);
|
||||
foreach(Sidedef sd in General.Map.Map.Sidedefs) AddComments(sd, newcomments);
|
||||
}
|
||||
UpdateGroupList(newcomments, l_comments, Properties.Resources.LinesMode);
|
||||
|
||||
// Update sectors
|
||||
newcomments.Clear();
|
||||
if(!filtermode.Checked || (General.Editing.Mode.GetType().Name == "SectorsMode"))
|
||||
{
|
||||
foreach(Sector s in General.Map.Map.Sectors) AddComments(s, newcomments);
|
||||
}
|
||||
UpdateGroupList(newcomments, s_comments, Properties.Resources.SectorsMode);
|
||||
|
||||
// Update things
|
||||
newcomments.Clear();
|
||||
if(!filtermode.Checked || (General.Editing.Mode.GetType().Name == "ThingsMode"))
|
||||
{
|
||||
foreach(Thing t in General.Map.Map.Things) AddComments(t, newcomments);
|
||||
}
|
||||
UpdateGroupList(newcomments, t_comments, Properties.Resources.ThingsMode);
|
||||
|
||||
// Sort grid
|
||||
grid.Sort(grid.Columns[1], ListSortDirection.Ascending);
|
||||
|
||||
// Update
|
||||
grid.Update();
|
||||
|
||||
grid.CurrentCell = null;
|
||||
grid.ClearSelection();
|
||||
}
|
||||
UpdateGroupList(newcomments, v_comments, Properties.Resources.VerticesMode);
|
||||
|
||||
// Update linedefs/sidedefs
|
||||
newcomments.Clear();
|
||||
if(!filtermode.Checked || (General.Editing.Mode.GetType().Name == "LinedefsMode"))
|
||||
{
|
||||
foreach(Linedef l in General.Map.Map.Linedefs) AddComments(l, newcomments);
|
||||
foreach(Sidedef sd in General.Map.Map.Sidedefs) AddComments(sd, newcomments);
|
||||
}
|
||||
UpdateGroupList(newcomments, l_comments, Properties.Resources.LinesMode);
|
||||
|
||||
// Update sectors
|
||||
newcomments.Clear();
|
||||
if(!filtermode.Checked || (General.Editing.Mode.GetType().Name == "SectorsMode"))
|
||||
{
|
||||
foreach(Sector s in General.Map.Map.Sectors) AddComments(s, newcomments);
|
||||
}
|
||||
UpdateGroupList(newcomments, s_comments, Properties.Resources.SectorsMode);
|
||||
|
||||
// Update things
|
||||
newcomments.Clear();
|
||||
if(!filtermode.Checked || (General.Editing.Mode.GetType().Name == "ThingsMode"))
|
||||
{
|
||||
foreach(Thing t in General.Map.Map.Things) AddComments(t, newcomments);
|
||||
}
|
||||
UpdateGroupList(newcomments, t_comments, Properties.Resources.ThingsMode);
|
||||
|
||||
grid.Sort(grid.Columns[1], ListSortDirection.Ascending);
|
||||
|
||||
grid.Update();
|
||||
}
|
||||
|
||||
// This adds comments from a MapElement
|
||||
|
@ -292,22 +308,28 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
private void SelectComment(CommentInfo c, bool clear)
|
||||
{
|
||||
string editmode = "";
|
||||
|
||||
// Unfortunately we must switch to the mode of the objects
|
||||
// we're selecting to make it work right (mainly for sectors)
|
||||
if(c.Elements[0] is Vertex)
|
||||
editmode = "VerticesMode";
|
||||
else if((c.Elements[0] is Linedef) || (c.Elements[0] is Sidedef))
|
||||
editmode = "LinedefsMode";
|
||||
else if(c.Elements[0] is Sector)
|
||||
editmode = "SectorsMode";
|
||||
else if(c.Elements[0] is Thing)
|
||||
editmode = "ThingsMode";
|
||||
|
||||
bool selectinggeometry;
|
||||
|
||||
if(c.Elements[0] is Thing)
|
||||
selectinggeometry = false;
|
||||
else
|
||||
selectinggeometry = true;
|
||||
|
||||
// Leave any volatile mode
|
||||
General.Editing.CancelVolatileMode();
|
||||
|
||||
if(clear)
|
||||
General.Map.Map.ClearAllSelected();
|
||||
|
||||
General.Editing.ChangeMode(editmode);
|
||||
|
||||
if(selectinggeometry)
|
||||
{
|
||||
// Sectors mode is a bitch because it deals with selections somewhat aggressively
|
||||
// so we have to switch to linedefs to make this work right
|
||||
if((General.Editing.Mode.GetType().Name == "VerticesMode") ||
|
||||
(General.Editing.Mode.GetType().Name == "SectorsMode") ||
|
||||
(General.Editing.Mode.GetType().Name == "MakeSectorMode"))
|
||||
General.Editing.ChangeMode("LinedefsMode");
|
||||
}
|
||||
|
||||
// Select the map elements
|
||||
foreach(MapElement obj in c.Elements)
|
||||
|
@ -323,8 +345,8 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
General.Editing.ChangeMode(editmode);
|
||||
|
||||
General.Interface.RedrawDisplay();
|
||||
}
|
||||
|
||||
// This removes the comments from elements in a comment
|
||||
|
@ -361,7 +383,7 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Events
|
||||
|
@ -385,6 +407,8 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
// Mouse pressed
|
||||
private void grid_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
preventupdate = true;
|
||||
|
||||
if(e.Button == MouseButtons.Right)
|
||||
{
|
||||
DataGridView.HitTestInfo h = grid.HitTest(e.X, e.Y);
|
||||
|
@ -496,9 +520,11 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
foreach(MapElement m in c.Elements) things.Add((Thing)m);
|
||||
General.Interface.ShowEditThings(things);
|
||||
}
|
||||
|
||||
|
||||
General.Map.Map.Update();
|
||||
UpdateList();
|
||||
LoseFocus();
|
||||
General.Interface.RedrawDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -520,6 +546,87 @@ namespace CodeImp.DoomBuilder.CommentsPanel
|
|||
{
|
||||
LoseFocus();
|
||||
}
|
||||
|
||||
// This sets the comment on the current selection
|
||||
private void addcomment_Click(object sender, EventArgs e)
|
||||
{
|
||||
List<MapElement> elements = new List<MapElement>();
|
||||
|
||||
if(General.Editing.Mode.GetType().Name == "VerticesMode")
|
||||
{
|
||||
ICollection<Vertex> vs = General.Map.Map.GetSelectedVertices(true);
|
||||
foreach(Vertex v in vs) elements.Add(v);
|
||||
}
|
||||
|
||||
if(General.Editing.Mode.GetType().Name == "LinedefsMode")
|
||||
{
|
||||
ICollection<Linedef> ls = General.Map.Map.GetSelectedLinedefs(true);
|
||||
foreach(Linedef l in ls) elements.Add(l);
|
||||
}
|
||||
|
||||
if(General.Editing.Mode.GetType().Name == "SectorsMode")
|
||||
{
|
||||
ICollection<Sector> ss = General.Map.Map.GetSelectedSectors(true);
|
||||
foreach(Sector s in ss) elements.Add(s);
|
||||
}
|
||||
|
||||
if(General.Editing.Mode.GetType().Name == "ThingsMode")
|
||||
{
|
||||
ICollection<Thing> ts = General.Map.Map.GetSelectedThings(true);
|
||||
foreach(Thing t in ts) elements.Add(t);
|
||||
}
|
||||
|
||||
if(elements.Count > 0)
|
||||
{
|
||||
// Create undo
|
||||
if(elements.Count == 1)
|
||||
General.Map.UndoRedo.CreateUndo("Add comment");
|
||||
else
|
||||
General.Map.UndoRedo.CreateUndo("Add " + elements.Count + " comments");
|
||||
|
||||
// Set comment on elements
|
||||
foreach(MapElement el in elements)
|
||||
{
|
||||
el.Fields.BeforeFieldsChange();
|
||||
el.Fields["comment"] = new UniValue((int)UniversalType.String, addcommenttext.Text);
|
||||
}
|
||||
}
|
||||
|
||||
addcommenttext.Text = "";
|
||||
UpdateList();
|
||||
LoseFocus();
|
||||
General.Interface.RedrawDisplay();
|
||||
}
|
||||
|
||||
// Text typed in add comment box
|
||||
private void addcommenttext_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if((e.KeyCode == Keys.Enter) && (e.Modifiers == Keys.None) && addcomment.Enabled)
|
||||
{
|
||||
addcomment.PerformClick();
|
||||
e.Handled = true;
|
||||
e.SuppressKeyPress = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the add comment box should be enabled
|
||||
private void enabledtimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if(General.Editing.Mode.GetType().Name == "VerticesMode")
|
||||
addcommentgroup.Enabled = (General.Map.Map.SelectedVerticessCount > 0);
|
||||
else if(General.Editing.Mode.GetType().Name == "LinedefsMode")
|
||||
addcommentgroup.Enabled = (General.Map.Map.SelectedLinedefsCount > 0);
|
||||
else if(General.Editing.Mode.GetType().Name == "SectorsMode")
|
||||
addcommentgroup.Enabled = (General.Map.Map.SelectedSectorsCount > 0);
|
||||
else if(General.Editing.Mode.GetType().Name == "ThingsMode")
|
||||
addcommentgroup.Enabled = (General.Map.Map.SelectedThingsCount > 0);
|
||||
}
|
||||
|
||||
// Focus lost
|
||||
private void grid_Leave(object sender, EventArgs e)
|
||||
{
|
||||
preventupdate = false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -117,6 +117,18 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="optionsgroup.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="clickselects.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="filtermode.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="grid.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="iconcolumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -129,4 +141,19 @@
|
|||
<metadata name="contextmenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>136, 17</value>
|
||||
</metadata>
|
||||
<metadata name="addcomment.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="addcommentgroup.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="addcommenttext.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="enabledtimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>252, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -2,7 +2,7 @@
|
|||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{58BD8A5B-1B48-435D-8473-A92F27D06C49}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
|
@ -30,25 +30,22 @@
|
|||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\Build\Plugins\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<OutputPath>..\..\..\Build\Plugins\</OutputPath>
|
||||
<DefineConstants>
|
||||
</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
|
Loading…
Reference in a new issue