mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-30 15:41:30 +00:00
4632fdbe99
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).
39 lines
1.3 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|