Example #1
0
        public void SwitchToScreen(UIScreenType screenType)
        {
            int index = (int)screenType;

            if (screens[index] == null)
            {
                switch (screenType)
                {
                case UIScreenType.MainMenu:
                    screens[index] = new MainMenu(installedMpq);
                    break;

                case UIScreenType.Login:
                    screens[index] = new LoginScreen(playingMpq);
                    break;

                case UIScreenType.Connection:
                    screens[index] = new ConnectionScreen(playingMpq);
                    break;

                default:
                    throw new Exception();
                }
            }

            SwitchToScreen(screens[(int)screenType]);
        }
Example #2
0
		public void SwitchToScreen (UIScreenType screenType)
		{
			int index = (int)screenType;
			if (screens[index] == null) {
				switch (screenType) {
				case UIScreenType.MainMenu:
					screens[index] = new MainMenu (installedMpq);
					break;
				case UIScreenType.Login:
					screens[index] = new LoginScreen (playingMpq);
					break;
				case UIScreenType.Connection:
					screens[index] = new ConnectionScreen (playingMpq);
					break;
				default:
					throw new Exception ();
				}
			}

			SwitchToScreen (screens[(int)screenType]);
		}