2015-08-24 21:49:15 +00:00
#region = = = = = = = = = = = = = = = = = = Namespaces
using System.Drawing ;
using CodeImp.DoomBuilder.Geometry ;
#endregion
namespace CodeImp.DoomBuilder.BuilderModes.ErrorChecks
{
public class ResultMapTooBig : ErrorResult
{
#region = = = = = = = = = = = = = = = = = = Variables
private readonly bool toowide ;
private readonly bool toohigh ;
private readonly Vector2D min ;
private readonly Vector2D max ;
#endregion
#region = = = = = = = = = = = = = = = = = = Properties
public override int Buttons { get { return 0 ; } }
#endregion
#region = = = = = = = = = = = = = = = = = = Constructor / Destructor
public ResultMapTooBig ( Vector2D min , Vector2D max )
{
// Initialize
this . min = min ;
this . max = max ;
2016-05-18 23:31:12 +00:00
this . toowide = max . x - min . x > General . Map . Config . SafeBoundary ;
this . toohigh = max . y - min . y > General . Map . Config . SafeBoundary ;
2015-08-24 21:49:15 +00:00
description = "Map is too big." ;
}
#endregion
#region = = = = = = = = = = = = = = = = = = Methods
public override RectangleF GetZoomArea ( )
{
const float scaler = 0.5f ;
2020-05-21 12:20:02 +00:00
return new RectangleF ( ( float ) min . x * scaler , ( float ) min . y * scaler , ( float ) ( max . x - min . x ) * scaler , ( float ) ( max . y - min . y ) * scaler ) ;
2015-08-24 21:49:15 +00:00
}
// This sets if this result is displayed in ErrorCheckForm (mxd)
internal override void Hide ( bool hide )
{
hidden = hide ;
}
// This must return the string that is displayed in the listbox
public override string ToString ( )
{
2016-05-18 23:31:12 +00:00
if ( toowide & & toohigh ) return "Map's width and height is bigger than " + General . Map . Config . SafeBoundary + " m.u. This can cause rendering and physics issues." ;
if ( toowide ) return "Map is wider than " + General . Map . Config . SafeBoundary + " m.u. This can cause rendering and physics issues." ;
return "Map is taller than " + General . Map . Config . SafeBoundary + " m.u. This can cause rendering and physics issues." ;
2015-08-24 21:49:15 +00:00
}
#endregion
}
}