added an eraser toolbar button

to erase with left-click as in image editing programs
This commit is contained in:
Matthias Mailänder
2013-04-02 11:48:19 +02:00
parent 58bdfb90e3
commit 7a143d94f9
4 changed files with 33 additions and 3 deletions

View File

@@ -36,6 +36,7 @@ namespace OpenRA.Editor
ITool Tool;
public bool IsPanning;
public bool IsErasing;
public bool ShowActorNames;
public bool ShowGrid;
public bool ShowRuler;
@@ -158,10 +159,10 @@ namespace OpenRA.Editor
Scroll(oldMousePos - MousePos);
else
{
if (e.Button == MouseButtons.Right)
if (e.Button == MouseButtons.Right || (IsErasing && e.Button == MouseButtons.Left))
Erase();
if (e.Button == MouseButtons.Left)
if (e.Button == MouseButtons.Left && !IsErasing)
Draw();
Invalidate();
@@ -221,7 +222,7 @@ namespace OpenRA.Editor
if (!IsPanning)
{
if (e.Button == MouseButtons.Right) Erase();
if (e.Button == MouseButtons.Left)
if (e.Button == MouseButtons.Left && !IsErasing)
{
Draw();
if (!IsPaste)