Beispiel #1
0
 private void ShowDiskSelect()
 {
     if (m_diskSelector == null)
     {
         m_diskSelector           = new DiskSelector(Game.Screen, (m_activeDisk != null) ? m_activeDisk.Path : null, m_activeDiskMod, Game.User.Progress);
         m_diskSelector.OnSelect += delegate(object o, DiskSelectEventArgs args)
         {
             // Reboot computer with new disk
             m_computer.TurnOff();
             SelectDisk(args.Disk, args.Mod);
             m_computer.TurnOn();
             UpdateDisplay();
         };
         m_diskSelector.OnBrowseWorkshop += delegate(object o, EventArgs args)
         {
             Game.Network.OpenWorkshopHub(new string[] { "Arcade Games" });
         };
         m_diskSelector.OnClose += delegate(object o, EventArgs args)
         {
             if (m_diskSelector == o)
             {
                 Game.Screen.Elements.Remove(m_diskSelector);
                 m_diskSelector.Dispose();
                 m_diskSelector = null;
             }
         };
         Game.Screen.Elements.Add(m_diskSelector);
     }
 }
Beispiel #2
0
        protected override void OnShutdown()
        {
            base.OnShutdown();

            // Steam controller
            if (Game.ActiveSteamController != null)
            {
                Game.ActiveSteamController.ActionSet = SteamControllerActionSet.Menu.GetID();
            }

            // Shutdown the computer
            m_computer.Dispose();
            m_computer = null;

            // Stop audio
            if (m_speakerOutput != null)
            {
                m_speakerOutput.Stop();
            }

            // Dispose elements
            m_displayTexture.Dispose();
            m_displayBitmap.Dispose();

            Game.Screen.Elements.Remove(m_backPrompt);
            m_backPrompt.Dispose();

            Game.Screen.Elements.Remove(m_diskSelectPrompt);
            m_diskSelectPrompt.Dispose();

            Game.Screen.Elements.Remove(m_aPrompt);
            m_aPrompt.Dispose();

            Game.Screen.Elements.Remove(m_bPrompt);
            m_bPrompt.Dispose();

            // Remove disk selector
            if (m_diskSelector != null)
            {
                Game.Screen.Elements.Remove(m_diskSelector);
                m_diskSelector.Dispose();
                m_diskSelector = null;
            }
        }