using System;
using System.Drawing;

using Icarus.Graphics.Animation;
using Icarus.LUCIE;

namespace TuxHunter.GameStates
{
	/// <summary>
	/// This thing displays a splash screen and when the user clicks, goes on to the main menu.
	/// </summary>
	public class SplashScreenState : MenuState
	{
		public SplashScreenState()
		{
			//Get the image of the splash screen:
			Bitmap ssimage = FramesetManager.getInstance().loadImageFromId("ui/SplashScreen/Placeholder.gif");

			//Make an image component:
			ImageComponent ssc = new ImageComponent(ssimage);
			ssc.Location = new Point(0, 0);
			ssc.IsVisible = true;

			//Add the image to the UI:
			this.UserInterface.AddChild(ssc);

			//Listen to clicks:
			ssc.Click += new ClickCallback(ssc_Click);
		}

		/// <summary>
		/// Called when the splash screen is clicked. Moves on to the main menu.
		/// </summary>
		/// <param name="sender"></param>
		private void ssc_Click(AbstractComponent sender)
		{
			//TODO: Implement. :)

			//For now, just go to level list:
			Icarus.Logic.GameEngine.GameEngine.Instance.PushState(new LevelListState());

			//For now, just go on to the test level:
			//Icarus.Logic.GameEngine.GameEngine.Instance.PushState(new TuxHunter.GameStates.GameplayState(Icarus.Logic.GameEngine.LevelLoader.Instance.LoadLevelXML("../../base_tux/levels/TestLevelCurrent.xml")));
		}
	}
}
