public void paintComponent(Graphics g)
	{
		super.paintComponent(g);

		if(titleScreen)
		{
			if(VERSION.equals("Peaches"))
			{
				g.setColor(Color.BLACK);
				g.fillRect(0,0,getWidth(),getHeight());
			}
			else
			{
				g.setColor(Color.CYAN);
				g.fillRect(0,0,getWidth(),getHeight());
			}
			title.paintTitle(g);

			return;
		}
		
		if(showCredits)
		{
			g.setColor(new Color(255,126,0,title.creditInt%256));
			g.fillRect(0,0,getWidth(),getHeight());
			title.paintCredits(g);
			return;
		}

		if(CONNECTED)
		{
			drawTrade(g);
			return;
		}

		g.setColor(Color.BLACK);
		g.fillRect(0,0,getWidth(),getHeight());

		if (!encounter&&!transition&&!trainerEnc)
		{
			drawMap(g);
			if(drawPoison)
			{
				g.setColor(Color.MAGENTA);
				g.fillRect(0,0,getWidth(),getHeight());
			}
		}

		if(transition)
		{
			g.setColor(Color.WHITE);
			g.setFont(new Font("Sanserif",Font.BOLD,36));
			String str=""+area;
			str=str.replace("_"," ");
			g.drawString(str,400-(str.length()*10),300);

			g.drawImage(loading,0,0,this);
			g.drawImage(loading,0,600-148,this);
			g.drawImage(loading,800-148,0,this);
			g.drawImage(loading,800-148,600-148,this);
		}

		if(cartographer)
		{
			g.setColor(new Color(0,0,200,100));
			g.fillRect(64*6,64*4,64,64);
			switch (tileSet)
			{
				case OUTDOORS:
					g.drawImage(tileImgOutdoors[assignTileIntOutdoors],64*6+16,64*4+16,32,32,this);
					break;
				case INDOORS:
					g.drawImage(tileImgIndoors[assignTileIntIndoors],64*6+16,64*4+16,32,32,this);
					break;
			}


			for(int i=0; i<5; i++)
			{
				try
				{
					g.setColor(new Color(50,50,50,50));
					g.fillRect(64*7,64*3,32,32*5);
					if(i!=2)
					{
						switch (tileSet)
						{
							case OUTDOORS:
								g.drawImage(tileImgOutdoors[assignTileIntOutdoors-(2-i)],64*7,64*3+36*i,32,32,this);
								break;
							case INDOORS:
								g.drawImage(tileImgIndoors[assignTileIntIndoors-(2-i)],64*7,64*3+36*i,32,32,this);
								break;
						}
					}
				}
				catch(Exception ignored){}
			}
		}
		else if(!transition)
			drawCharacter(g);

		if (!transition)
		{
			for(int i = 0; i<numTrainers; i++)
			{
				if (trainer[i] != null)
				trainer[i].drawTrainer(g);
			}

			for(int i = 0; i<numItems; i++)
			{
				if (mapItems[i] != null)
				mapItems[i].drawItem(g);
			}
		}

		if(paused)
			drawPauseMenu(g);
		else if(onComp)
			drawComputer(g);
		else if(flyMenu)
			drawFlyMenu(g);
		else if(playingMinigame)
			drawMinigameMenu(g);

	}