More fixes for erroneously being able to select object multiple times when paint selecting

This commit is contained in:
biwa 2021-02-13 22:59:06 +01:00 committed by sphere
parent 914fb7ea34
commit 4794b0effc
3 changed files with 36 additions and 21 deletions

View file

@ -545,23 +545,28 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
if (General.Interface.ShiftState ^ BuilderPlug.Me.AdditivePaintSelect)
{
this.selected = true;
mode.AddSelectedObject(this);
if (!selected)
{
selected = true;
mode.AddSelectedObject(this);
}
}
else if (General.Interface.CtrlState)
{
this.selected = false;
mode.RemoveSelectedObject(this);
if (selected)
{
selected = false;
mode.RemoveSelectedObject(this);
}
}
else
{
if (this.selected)
if (selected)
mode.RemoveSelectedObject(this);
else
mode.AddSelectedObject(this);
this.selected = !this.selected;
selected = !selected;
}
}

View file

@ -1290,23 +1290,28 @@ namespace CodeImp.DoomBuilder.BuilderModes
// toggle selected state
if (General.Interface.ShiftState ^ BuilderPlug.Me.AdditivePaintSelect)
{
this.selected = true;
mode.AddSelectedObject(this);
if (!selected)
{
selected = true;
mode.AddSelectedObject(this);
}
}
else if (General.Interface.CtrlState)
{
this.selected = false;
mode.RemoveSelectedObject(this);
if (selected)
{
selected = false;
mode.RemoveSelectedObject(this);
}
}
else
{
if (this.selected)
if (selected)
mode.RemoveSelectedObject(this);
else
mode.AddSelectedObject(this);
this.selected = !this.selected;
selected = !selected;
}
}

View file

@ -901,23 +901,28 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
if (General.Interface.ShiftState ^ BuilderPlug.Me.AdditivePaintSelect)
{
this.selected = true;
mode.AddSelectedObject(this);
if (!selected)
{
selected = true;
mode.AddSelectedObject(this);
}
}
else if (General.Interface.CtrlState)
{
this.selected = false;
mode.RemoveSelectedObject(this);
if (selected)
{
selected = false;
mode.RemoveSelectedObject(this);
}
}
else
{
if (this.selected)
if (selected)
mode.RemoveSelectedObject(this);
else
mode.AddSelectedObject(this);
this.selected = !this.selected;
selected = !selected;
}
}
}