Exemple #1
0
 /// <summary>
 /// Activates target subscreen
 /// </summary>
 /// <param id="screen">Screen id</param>
 /// <param id="screenParams">Parameters passed to the new screen OnActivate method</param>
 public void CallSubscreen(string screen, params object[] screenParams)
 {
   if (activeSubscreen != null)
   {
     activeSubscreen.OnDeactivate();
   }
   activeSubscreen = screens[screen];
   activeSubscreen.OnActivate(screenParams);
 }
Exemple #2
0
    /// <summary>
    /// Updates the active screen and active subscreen,
    /// </summary>
    public void Update()
    {
      if (activeScreen == null)
      {
        activeScreen = screens.First().Value;
        activeScreen.OnActivate(null);
      }

      if (activeSubscreen == null)
      {
        activeScreen.Update();
      }
      else
      {
        activeScreen.BackgroundUpdate();
        activeSubscreen.Update();
      }
    }
Exemple #3
0
 /// <summary>
 /// Closes the active subscreen
 /// </summary>
 /// <param id="screenParams">Parameters passed to the underlaying OnSubscreenExit method</param>
 public void CloseSubscreen(params object[] screenParams)
 {
   activeSubscreen.OnDeactivate();
   activeSubscreen = null;
   activeScreen.OnSubscreenExit(screenParams);
 }
Exemple #4
0
 /// <summary>
 /// Switches between screens
 /// </summary>
 /// <param id="screen">Name of the new screen</param>
 /// <param id="screenParams">Parameters passed to the new screen OnActivate method</param>
 public void SwitchScreen(string screen, params object[] screenParams)
 {
   activeScreen.OnDeactivate();
   activeScreen = screens[screen];
   activeScreen.OnActivate(screenParams);
 }
Exemple #5
0
 /// <summary>
 /// Adds a screen to the dictionary of available screens
 /// </summary>
 /// <param id="screen">New screen</param>
 public void Add(Screen screen)
 {
   screens.Add(screen.Id, screen);
 }