added an eraser toolbar button
to erase with left-click as in image editing programs
This commit is contained in:
13
OpenRA.Editor/Form1.Designer.cs
generated
13
OpenRA.Editor/Form1.Designer.cs
generated
@@ -74,6 +74,7 @@ namespace OpenRA.Editor
|
|||||||
this.toolStripMenuItemFixOpenAreas = new System.Windows.Forms.ToolStripButton();
|
this.toolStripMenuItemFixOpenAreas = new System.Windows.Forms.ToolStripButton();
|
||||||
this.toolStripMenuItemSetupDefaultPlayers = new System.Windows.Forms.ToolStripButton();
|
this.toolStripMenuItemSetupDefaultPlayers = new System.Windows.Forms.ToolStripButton();
|
||||||
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
|
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
|
this.eraserToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||||
this.toolStripMenuItemCopySelection = new System.Windows.Forms.ToolStripButton();
|
this.toolStripMenuItemCopySelection = new System.Windows.Forms.ToolStripButton();
|
||||||
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
|
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
this.QuickhelpToolStripButton = new System.Windows.Forms.ToolStripButton();
|
this.QuickhelpToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||||
@@ -352,6 +353,7 @@ namespace OpenRA.Editor
|
|||||||
this.toolStripMenuItemFixOpenAreas,
|
this.toolStripMenuItemFixOpenAreas,
|
||||||
this.toolStripMenuItemSetupDefaultPlayers,
|
this.toolStripMenuItemSetupDefaultPlayers,
|
||||||
this.toolStripSeparator11,
|
this.toolStripSeparator11,
|
||||||
|
this.eraserToolStripButton,
|
||||||
this.toolStripMenuItemCopySelection,
|
this.toolStripMenuItemCopySelection,
|
||||||
this.toolStripSeparator7,
|
this.toolStripSeparator7,
|
||||||
this.QuickhelpToolStripButton});
|
this.QuickhelpToolStripButton});
|
||||||
@@ -520,6 +522,16 @@ namespace OpenRA.Editor
|
|||||||
this.toolStripSeparator11.Name = "toolStripSeparator11";
|
this.toolStripSeparator11.Name = "toolStripSeparator11";
|
||||||
this.toolStripSeparator11.Size = new System.Drawing.Size(6, 25);
|
this.toolStripSeparator11.Size = new System.Drawing.Size(6, 25);
|
||||||
//
|
//
|
||||||
|
// eraserToolStripButton
|
||||||
|
//
|
||||||
|
this.eraserToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||||
|
this.eraserToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("eraserToolStripButton.Image")));
|
||||||
|
this.eraserToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||||
|
this.eraserToolStripButton.Name = "eraserToolStripButton";
|
||||||
|
this.eraserToolStripButton.Size = new System.Drawing.Size(23, 22);
|
||||||
|
this.eraserToolStripButton.Text = "Erase actors and resources.";
|
||||||
|
this.eraserToolStripButton.Click += new System.EventHandler(this.EraserToolStripButtonClick);
|
||||||
|
//
|
||||||
// toolStripMenuItemCopySelection
|
// toolStripMenuItemCopySelection
|
||||||
//
|
//
|
||||||
this.toolStripMenuItemCopySelection.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
this.toolStripMenuItemCopySelection.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||||
@@ -1059,6 +1071,7 @@ namespace OpenRA.Editor
|
|||||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator12;
|
private System.Windows.Forms.ToolStripSeparator toolStripSeparator12;
|
||||||
private System.Windows.Forms.ToolStripButton showRulerToolStripItem;
|
private System.Windows.Forms.ToolStripButton showRulerToolStripItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem showRulerToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem showRulerToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripButton eraserToolStripButton;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@@ -750,5 +750,11 @@ namespace OpenRA.Editor
|
|||||||
{
|
{
|
||||||
showRulerToolStripMenuItemClick(sender, e);
|
showRulerToolStripMenuItemClick(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EraserToolStripButtonClick(object sender, System.EventArgs e)
|
||||||
|
{
|
||||||
|
eraserToolStripButton.Checked ^= true;
|
||||||
|
surface1.IsErasing = eraserToolStripButton.Checked;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -296,6 +296,16 @@
|
|||||||
/z3G8q/AKohxAcjPIGeDbAZpXmch9mteYfb/Gct2EhWQ/0EBBvIzyNkgm8t8A/9X10/6DwLEGoICXCKK
|
/z3G8q/AKohxAcjPIGeDbAZpXmch9mteYfb/Gct2EhWQ/0EBBvIzyNkgm8t8A/9X10/6DwLEGoICXCKK
|
||||||
/vfP2fr/2p1nJBkCUwSmHUMLwIZcv/ucJENQAMyQG3coMMQprBBsyO17T8k3xNgj+b9rZBF1DAFhqBDp
|
/vfP2fr/2p1nJBkCUwSmHUMLwIZcv/ucJENQAMyQG3coMMQprBBsyO17T8k3xNgj+b9rZBF1DAFhqBDp
|
||||||
AGQIlEkNwMAAAP7JtzLCVbRNAAAAAElFTkSuQmCC
|
AGQIlEkNwMAAAP7JtzLCVbRNAAAAAElFTkSuQmCC
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
|
<data name="eraserToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>
|
||||||
|
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||||
|
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAD2SURBVDhPY6ApmLlqNz+Irmqd/H/aqpP/S3s2/W+etuM/
|
||||||
|
SKy8YxVYDidA1gwDv37/+X/i4sP/xR1rwYbgBNg0//z15/+9px/+3370HmxI7cQN2A3Bpfn1+29wA0Ag
|
||||||
|
o2YmpgHEam6buvm/V1wVqgGkaMYwgCLNMECqZpe0crClYACKYxggWTMIzFx7+v/zN1/+P3z+8f+7j99J
|
||||||
|
0wwCzTN2/992+Ob/tXuv/j9w5j5Q8zu45saJy/FrhoGs+nn/SzsW/58FdM3s9Wf+L9l8/P+MZTuxBxg6
|
||||||
|
SCufCTc5Jq/tf0r5hP9xhZ0gjcRgBAhN68DtRNoABgYAAoqNFseCkuMAAAAASUVORK5CYII=
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="toolStripMenuItemCopySelection.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="toolStripMenuItemCopySelection.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ namespace OpenRA.Editor
|
|||||||
ITool Tool;
|
ITool Tool;
|
||||||
|
|
||||||
public bool IsPanning;
|
public bool IsPanning;
|
||||||
|
public bool IsErasing;
|
||||||
public bool ShowActorNames;
|
public bool ShowActorNames;
|
||||||
public bool ShowGrid;
|
public bool ShowGrid;
|
||||||
public bool ShowRuler;
|
public bool ShowRuler;
|
||||||
@@ -158,10 +159,10 @@ namespace OpenRA.Editor
|
|||||||
Scroll(oldMousePos - MousePos);
|
Scroll(oldMousePos - MousePos);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (e.Button == MouseButtons.Right)
|
if (e.Button == MouseButtons.Right || (IsErasing && e.Button == MouseButtons.Left))
|
||||||
Erase();
|
Erase();
|
||||||
|
|
||||||
if (e.Button == MouseButtons.Left)
|
if (e.Button == MouseButtons.Left && !IsErasing)
|
||||||
Draw();
|
Draw();
|
||||||
|
|
||||||
Invalidate();
|
Invalidate();
|
||||||
@@ -221,7 +222,7 @@ namespace OpenRA.Editor
|
|||||||
if (!IsPanning)
|
if (!IsPanning)
|
||||||
{
|
{
|
||||||
if (e.Button == MouseButtons.Right) Erase();
|
if (e.Button == MouseButtons.Right) Erase();
|
||||||
if (e.Button == MouseButtons.Left)
|
if (e.Button == MouseButtons.Left && !IsErasing)
|
||||||
{
|
{
|
||||||
Draw();
|
Draw();
|
||||||
if (!IsPaste)
|
if (!IsPaste)
|
||||||
|
|||||||
Reference in New Issue
Block a user