Пример #1
0
        static void Cycle_Implementation(float newMetricValue, long newEntityId, Vector3D position)
        {
            m_metricValue = newMetricValue;
            m_entityId    = newEntityId;
            bool cameraAttached = false;

            if (m_entityId != 0)
            {
                cameraAttached = TryAttachCamera(m_entityId);
                if (!cameraAttached)
                {
                    // When camera not attached, move it to expected object position and wait for replication
                    MySession.Static.SetCameraController(MyCameraControllerEnum.Spectator, null, position + Vector3.One * 50);
                }
            }

            var menu = MyScreenManager.GetFirstScreenOfType <MyGuiScreenAdminMenu>();

            if (menu != null)
            {
                UpdateRemoveAndDepowerButton(menu, m_entityId);

                menu.m_attachCamera = m_entityId;
                menu.m_labelCurrentIndex.TextToDraw.Clear().AppendFormat(MyTexts.GetString(MyCommonTexts.ScreenDebugAdminMenu_CurrentValue), m_entityId == 0 ? "-" : m_metricValue.ToString());
            }
        }
Пример #2
0
 public static void ReturnToMainMenu()
 {
     if (MyScreenManager.GetFirstScreenOfType <MyGuiScreenMainMenu>() == null)
     {
         UnloadAndExitToMenu();
     }
 }
Пример #3
0
 protected static void Refresh()
 {
     if (!MySandboxGame.IsDedicated)
     {
         var playerScreen = MyScreenManager.GetFirstScreenOfType <MyGuiScreenPlayers>();
         if (playerScreen != null)
         {
             playerScreen.RecreateControls(false);
         }
     }
 }