protected override void ResourceLoader ()
		{
			TranslucentIndex = 138;

			base.ResourceLoader ();

			for (int i = 0; i < Elements.Count; i ++)
				Console.WriteLine ("{0}: {1} '{2}' {3}", i, Elements[i].Type, Elements[i].Text, Elements[i].Flags);

			if (scenario_prefix.EndsWith ("tutorial")) {
				Elements[skiptutorial_element_index].Visible = true;
				/* XXX Activate */
			}

			Elements[cancel_element_index].Activate +=
				delegate () {
					StopBriefing ();
					Game.Instance.SwitchToScreen (UIScreenType.Login);
				};

			Elements[replay_element_index].Activate +=
				delegate () {
					StopBriefing ();
					PlayBriefing ();
				};

			Elements[start_element_index].Activate +=
				delegate () {
					StopBriefing ();
					Game.Instance.SwitchToScreen (new GameScreen (mpq, scenario_prefix, scenario));
				};

			runner = new BriefingRunner (this, scenario, scenario_prefix);

			portraits = new List<MovieElement> ();
			hframes = new List<ImageElement> ();
			frames = new List<ImageElement> ();

			for (int i = 0; i < 4; i ++) {
				MovieElement m = new MovieElement (this,
								   Elements[first_portrait_element_index + i].BinElement,
								   Elements[first_portrait_element_index + i].Palette,
								   true);

				m.X1 += 3;
				m.Y1 += 3;
				m.Width -= 6;
				m.Height -= 6;

				ImageElement f = new ImageElement (this,
								   Elements[first_portrait_element_index + i].BinElement,
								   Elements[first_portrait_element_index + i].Palette,
								   TranslucentIndex);
				f.Text = String.Format ("glue\\Ready{0}\\{0}Frame{1}.pcx",
							Util.RaceChar[(int)Game.Instance.Race],
							i + 1);

				ImageElement h = new ImageElement (this,
								   Elements[first_portrait_element_index + i].BinElement,
								   Elements[first_portrait_element_index + i].Palette,
								   TranslucentIndex);
				h.Text = String.Format ("glue\\Ready{0}\\{0}FrameH{1}.pcx",
							Util.RaceChar[(int)Game.Instance.Race],
							i + 1);

				f.Visible = false;
				h.Visible = false;
				m.Visible = false;
				
				portraits.Add (m);
				hframes.Add (h);
				frames.Add (f);

				Elements.Add (m);
				Elements.Add (h);
				Elements.Add (f);
			}
		}
Exemple #2
0
        protected override void ResourceLoader()
        {
            TranslucentIndex = 138;

            base.ResourceLoader();

            for (int i = 0; i < Elements.Count; i++)
            {
                Console.WriteLine("{0}: {1} '{2}' {3}", i, Elements[i].Type, Elements[i].Text, Elements[i].Flags);
            }

            if (scenario_prefix.EndsWith("tutorial"))
            {
                Elements[skiptutorial_element_index].Visible = true;
                /* XXX Activate */
            }

            Elements[cancel_element_index].Activate +=
                delegate() {
                StopBriefing();
                Game.Instance.SwitchToScreen(UIScreenType.Login);
            };

            Elements[replay_element_index].Activate +=
                delegate() {
                StopBriefing();
                PlayBriefing();
            };

            Elements[start_element_index].Activate +=
                delegate() {
                StopBriefing();
                Game.Instance.SwitchToScreen(new GameScreen(mpq, scenario_prefix, scenario));
            };

            runner = new BriefingRunner(this, scenario, scenario_prefix);

            portraits = new List <MovieElement> ();
            hframes   = new List <ImageElement> ();
            frames    = new List <ImageElement> ();

            for (int i = 0; i < 4; i++)
            {
                MovieElement m = new MovieElement(this,
                                                  Elements[first_portrait_element_index + i].BinElement,
                                                  Elements[first_portrait_element_index + i].Palette,
                                                  true);

                m.X1     += 3;
                m.Y1     += 3;
                m.Width  -= 6;
                m.Height -= 6;

                ImageElement f = new ImageElement(this,
                                                  Elements[first_portrait_element_index + i].BinElement,
                                                  Elements[first_portrait_element_index + i].Palette,
                                                  TranslucentIndex);
                f.Text = String.Format("glue\\Ready{0}\\{0}Frame{1}.pcx",
                                       Util.RaceChar[(int)Game.Instance.Race],
                                       i + 1);

                ImageElement h = new ImageElement(this,
                                                  Elements[first_portrait_element_index + i].BinElement,
                                                  Elements[first_portrait_element_index + i].Palette,
                                                  TranslucentIndex);
                h.Text = String.Format("glue\\Ready{0}\\{0}FrameH{1}.pcx",
                                       Util.RaceChar[(int)Game.Instance.Race],
                                       i + 1);

                f.Visible = false;
                h.Visible = false;
                m.Visible = false;

                portraits.Add(m);
                hframes.Add(h);
                frames.Add(f);

                Elements.Add(m);
                Elements.Add(h);
                Elements.Add(f);
            }
        }