public override string OnUpdate(Keyboard keyboard, Mouse mouse, GameCore.Timing.Timer timer) { if (!Bingo.instance.TopMost) { Bingo.instance.TopMost = true; } switch (loadingPart) // "...Loading Sounds..." { case 0: lblAction.Text = "...Loading Sounds..."; break; case 1: mediaObjs.LoadFile("Sounds.txt"); lblAction.Text = "...Loading Fonts..."; break; case 2: mediaObjs.LoadFile("Fonts.txt"); lblAction.Text = "...Loading Animations..."; break; case 3: mediaObjs.LoadFile("Animations.txt"); lblAction.Text = "...Loading Bitmaps..."; break; case 4: mediaObjs.LoadFile("Bitmaps.txt"); lblAction.Text = "...Loading Main State..."; break; case 5: stateMachine.Add(new StateMain()); break; /* * case 6: stateMachine.Add(new StateTitle()); lblAction.Text = "...Loading PIN State..."; * break; * case 7: stateMachine.Add(new StatePIN()); lblAction.Text = "...Loading Main State..."; * break; * case 8: stateMachine.Add(new StateDemo()); lblAction.Text = "...Loading Attraction State..."; * break; * case 9: stateMachine.Add(new StateAttraction()); lblAction.Text = "...Loading Game Menu State..."; * break; * case 10: stateMachine.Add(new StateGameMenu()); * break; */ default: { return("Main"); } } loadingPart++; guiManager.Update(keyboard, mouse, timer); return("NoChange"); }
/// <summary> /// First loading sequence.. only called once from ApplicationBase:Load() /// </summary> /// <returns>returns true if load is succesful</returns> public override bool OnFirstLoad() { Logger.Log("\n*** -- BEGIN LOADING -- ***\n"); // SETS THE DEFAULT STARTING SEARCH DIRECTORY // BASED ON THE GAME BEING PLAYED.... // FileSearch.SetStartingSearchDirectory(FileSearch.GetApplicationDirectory() + "\\Media\\"); almMachineStatus.Enable(); try { MultiMediaLoader ml = new MultiMediaLoader("Bingo"); ml.LoadFile("Bingo.txt"); guiManager.Add(ml); //////////////////////////////////////// un-Comment out for testing // lblFps = (GuiLabel)guiManager.Get("lbl_fps"); // lblMessage = (GuiLabel)guiManager.Get("lbl_message"); // add the 'StateLoading' state top the Bingo.stateMachine stateMachine.Add(new StateLoading(stateMachine)); // change to (display) the 'Loading' state stateMachine.ChangeActiveState("Loading"); } catch (Exception e) { Logger.Log("Exception Loading Loading State \n" + e.ToString()); MessageBox.Show("Error Loading"); return(false); } // Logger.Log("Finished 'OnFirstLoad()' \n"); return(true); }