@Override
	public void actionPerformed(GuiButton button)
	{
		if(button.id == 0)
		{
			try
			{
				R2DFileManager manager = new R2DFileManager(animSave.text,animation);
				manager.write();
				lastMessageTime = System.currentTimeMillis();
				message = "File "+manager.getFile().getName()+" saved.";
			} catch(Exception e)
			{
				message = "Error in saving file!";
			}
			//Remote2D.guiList.pop();
		} else if(button.id == 1)
		{
			Remote2D.guiList.pop();
		} else if(button.id == 2)
		{
			if(isReady())
			{
				animation = new Animation(
						texID.text,
						new Vector2(Integer.parseInt(startX.text),Integer.parseInt(startY.text)),
						new Vector2(Integer.parseInt(dimX.text),Integer.parseInt(dimY.text)),
						new Vector2(Integer.parseInt(paddingX.text),Integer.parseInt(paddingY.text)),
						new Vector2(Integer.parseInt(framesX.text),Integer.parseInt(framesY.text)),
						Integer.parseInt(frameLength.text)
				);
			}
		}
	}