public class InfoDlg
{
	public static bool isShow;

	private static string title;

	private static string subtitke;

	public static int delay;

	public static bool isLock;

	private static int startTick;

	public static void show(string title, string subtitle, int delay)
	{
		if (title != null)
		{
			isShow = true;
			InfoDlg.title = title;
			subtitke = subtitle;
			InfoDlg.delay = delay;
		}
	}

	public static void showWait()
	{
		startTick = CCanvas.gameTick;
		show(L.pleaseWait(), null, 1000);
		isLock = true;
	}

	public static void showWait(string str)
	{
		show(str, null, 700);
		isLock = true;
	}

	public static void paint(mGraphics g)
	{
		if (CCanvas.gameTick - startTick >= 20 && isShow && (!isLock || delay <= 4990) && CCanvas.currentDialog == null)
		{
			int num = 10;
			CScreen.paintBorderRect(g, CCanvas.hw - 75, num, 150, 55);
			if (isLock)
			{
				CCanvas.paintShukiren(CCanvas.hw - mFont.tahoma_8b.getWidth(title) / 2 - 10, num + 28, g);
				mFont.tahoma_7b_white.drawString(g, title, CCanvas.hw + 5, num + 21, 2);
			}
			else if (subtitke != null)
			{
				mFont.tahoma_8b.drawString(g, title, CCanvas.hw, num + 13, 2);
				mFont.tahoma_7_green2.drawString(g, subtitke, CCanvas.hw, num + 30, 2);
			}
			else
			{
				mFont.tahoma_8b.drawString(g, title, CCanvas.hw, num + 21, 2);
			}
		}
	}

	public static void update()
	{
		if (delay > 0)
		{
			delay--;
			if (delay == 0)
			{
				hide();
			}
		}
	}

	public static void hide()
	{
		title = string.Empty;
		subtitke = null;
		isLock = false;
		delay = 0;
		isShow = false;
	}
}
