protected override void ResourceLoader() { base.ResourceLoader(); for (int i = 0; i < Elements.Count; i++) { Console.WriteLine("{0}: {1} '{2}'", i, Elements[i].Type, Elements[i].Text); } Elements[RETURNTOGAME_ELEMENT_INDEX].Activate += delegate() { if (ReturnToGame != null) { ReturnToGame(); } }; Elements[MISSIONOBJECTIVES_ELEMENT_INDEX].Activate += delegate() { ObjectivesDialog d = new ObjectivesDialog(this, mpq); d.Previous += delegate() { DismissDialog(); }; ShowDialog(d); }; Elements[ENDMISSION_ELEMENT_INDEX].Activate += delegate() { EndMissionDialog d = new EndMissionDialog(this, mpq); d.Previous += delegate() { DismissDialog(); }; #if false d.Quit += delegate() { DismissDialog(); /* XXX hack just to get things looking right */ parent.DismissDialog(); Game.Instance.SwitchToScreen(UIScreenType.MainMenu); }; #endif ShowDialog(d); }; Elements[OPTIONS_ELEMENT_INDEX].Activate += delegate() { OptionsDialog d = new OptionsDialog(this, mpq); d.Previous += delegate() { DismissDialog(); }; ShowDialog(d); }; Elements[HELP_ELEMENT_INDEX].Activate += delegate() { HelpDialog d = new HelpDialog(this, mpq); d.Previous += delegate() { DismissDialog(); }; ShowDialog(d); }; }
protected override void ResourceLoader () { base.ResourceLoader (); for (int i = 0; i < Elements.Count; i ++) Console.WriteLine ("{0}: {1} '{2}'", i, Elements[i].Type, Elements[i].Text); Elements[RETURNTOGAME_ELEMENT_INDEX].Activate += delegate () { if (ReturnToGame != null) ReturnToGame (); }; Elements[MISSIONOBJECTIVES_ELEMENT_INDEX].Activate += delegate () { ObjectivesDialog d = new ObjectivesDialog (this, mpq); d.Previous += delegate () { DismissDialog (); }; ShowDialog (d); }; Elements[ENDMISSION_ELEMENT_INDEX].Activate += delegate () { EndMissionDialog d = new EndMissionDialog (this, mpq); d.Previous += delegate () { DismissDialog (); }; #if false d.Quit += delegate () { DismissDialog (); /* XXX hack just to get things looking right */ parent.DismissDialog (); Game.Instance.SwitchToScreen (UIScreenType.MainMenu); }; #endif ShowDialog (d); }; Elements[OPTIONS_ELEMENT_INDEX].Activate += delegate () { OptionsDialog d = new OptionsDialog (this, mpq); d.Previous += delegate () { DismissDialog (); }; ShowDialog (d); }; Elements[HELP_ELEMENT_INDEX].Activate += delegate () { HelpDialog d = new HelpDialog (this, mpq); d.Previous += delegate () { DismissDialog (); }; ShowDialog (d); }; }