UltimateZoneBuilder/Source/Plugins/BuilderModes/ErrorChecks/ResultUnknownThing.cs
MaxED 4632fdbe99 Visual modes: selected objects are not highlighted when "Toggle highlight" (H key) option is set to off.
Error Checks Mode: added linedef index to message text of all linedef-related errors.
UDMF: wall texture offsets are now rounded when user edits them via cursor keys or mouse dragging (because they are stored as integers anyway).
2012-10-08 13:07:56 +00:00

39 lines
1.3 KiB
C#

using System;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Rendering;
namespace CodeImp.DoomBuilder.BuilderModes.ErrorChecks {
public class ResultUnknownThing : ErrorResult {
public override int Buttons { get { return 1; } }
public override string Button1Text { get { return "Delete Thing"; } }
private Thing thing;
// Constructor
public ResultUnknownThing(Thing t) {
// Initialize
this.thing = t;
this.viewobjects.Add(t);
this.description = "This thing has unknown type (eg. it's not defined in DECORATE or current game configuration).";
}
// This must return the string that is displayed in the listbox
public override string ToString() {
return "Thing " + General.Map.Data.GetThingInfo(thing.Type).Index + " at " + thing.Position.x + ", " + thing.Position.y + " has unknown type.";
}
// Rendering
public override void RenderOverlaySelection(IRenderer2D renderer) {
renderer.RenderThing(thing, renderer.DetermineThingColor(thing), 1.0f);
}
// This removes the thing
public override bool Button1Click() {
General.Map.UndoRedo.CreateUndo("Delete thing");
thing.Dispose();
General.Map.IsChanged = true;
General.Map.ThingsFilter.Update();
return true;
}
}
}