//Copyright (C) Ben Parbury - All Rights Reserved. Unauthorized copying of this file, via any medium is strictly prohibited. Written by Ben Parbury <ben@gridlockinteractive.com> 2014

var gOptionsFullscreen = (gIni.Get("display", "fullscreen", 1) == 1);

function FullscreenCenterButton(name, callback)
{
	this.__proto__ = new Button(name, callback);
	
	this.DrawText = function(selected)
	{
		var additional = selected ? 1 : 0;
		gDraw.menu.font	 = GetFont(this.fontSize);
		gDraw.menu.textAlign	 = 'center';
		gDraw.menu.textBaseline	 = 'middle';
		gDraw.menu.fillTextShadow(gOptionsFullscreen ? "Fullscreen" : "Windowed", this.x + additional, this.y + additional, this.GetTextColor(!this.locked), this.GetTextColor(this.locked));
	}
}

function FullscreenButton()
{
	this.__proto__ = new TripleButton("fullscreen",
		new Button("<", function(){ gOptionsFullscreen = !gOptionsFullscreen; gOptionsMenu.Redraw(); }),
		new FullscreenCenterButton(name, function(){ gOptionsFullscreen = !gOptionsFullscreen; gOptionsMenu.Redraw(); }),
		new Button(">", function(){ gOptionsFullscreen = !gOptionsFullscreen; gOptionsMenu.Redraw(); })
	);
}
