2014-01-10 15:08:39 +00:00
|
|
|
|
#region ================== Namespaces
|
|
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using CodeImp.DoomBuilder.Map;
|
|
|
|
|
using CodeImp.DoomBuilder.Rendering;
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.BuilderModes
|
|
|
|
|
{
|
|
|
|
|
//mxd. Encapsulates boring stuff
|
|
|
|
|
internal class BaseFindThing : FindReplaceType
|
|
|
|
|
{
|
|
|
|
|
#region ================== Methods
|
|
|
|
|
|
|
|
|
|
// This is called when a specific object is selected from the list
|
2014-12-03 23:15:26 +00:00
|
|
|
|
public override void ObjectSelected(FindReplaceObject[] selection)
|
|
|
|
|
{
|
|
|
|
|
if(selection.Length == 1)
|
|
|
|
|
{
|
2014-01-10 15:08:39 +00:00
|
|
|
|
ZoomToSelection(selection);
|
|
|
|
|
General.Interface.ShowThingInfo(selection[0].Thing);
|
2014-12-03 23:15:26 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-01-10 15:08:39 +00:00
|
|
|
|
General.Interface.HideInfo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
General.Map.Map.ClearAllSelected();
|
|
|
|
|
foreach(FindReplaceObject obj in selection) obj.Thing.Selected = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Render selection
|
2014-12-03 23:15:26 +00:00
|
|
|
|
public override void RenderThingsSelection(IRenderer2D renderer, FindReplaceObject[] selection)
|
|
|
|
|
{
|
|
|
|
|
foreach(FindReplaceObject o in selection)
|
2015-08-03 22:02:39 +00:00
|
|
|
|
renderer.RenderThing(o.Thing, General.Colors.Selection, Presentation.THINGS_ALPHA);
|
2014-01-10 15:08:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Edit objects
|
2014-12-03 23:15:26 +00:00
|
|
|
|
public override void EditObjects(FindReplaceObject[] selection)
|
|
|
|
|
{
|
2014-01-10 15:08:39 +00:00
|
|
|
|
List<Thing> things = new List<Thing>(selection.Length);
|
|
|
|
|
foreach(FindReplaceObject o in selection) things.Add(o.Thing);
|
|
|
|
|
General.Interface.ShowEditThings(things);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|