//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

function VolumeCenterButton(name, setcallback, getcallback)
{
	this.__proto__ = new Button(name, setcallback);
	
	this.DrawText = function()
	{
		var additional = this.mouseDown ? 1 : 0;
		gDraw.menu.font	 = GetFont(this.fontSize * 0.5);
		gDraw.menu.textAlign	 = 'center';
		gDraw.menu.textBaseline	 = 'bottom';
		gDraw.menu.fillTextShadow(this.name, this.x + additional, this.y + additional - (kTileSize * 0.2), this.GetTextColor(!this.locked), this.GetTextColor(this.locked));
		
		gDraw.menu.font	 = GetFont(this.fontSize * 0.7);
		gDraw.menu.textBaseline	 = 'top';
		gDraw.menu.fillTextShadow(getcallback(), this.x + additional, this.y + additional, this.GetTextColor(!this.locked), this.GetTextColor(this.locked));
	}
}

function VolumeButton(name, setcallback, getcallback)
{
	this.__proto__ = new TripleButton(name,
		new Button("<", function(){ setcallback(-10); gOptionsMenu.Redraw(); }),
		new VolumeCenterButton(name, function(){ setcallback(10); gOptionsMenu.Redraw(); }, getcallback),
		new Button(">", function(){ setcallback(10); gOptionsMenu.Redraw(); })
	);
}
