public void Show(Mission mission)
        {
            lblMissionName.Text = mission.GUIName.ToUpper();

            string difficultyName = ProgramConstants.DifficultyRankToName(mission.Rank);

            if (mission.DifficultyLabels != null)
            {
                difficultyName = mission.DifficultyLabels[(int)mission.Rank - 1];
            }

            if (difficultyName.Length > 1)
            {
                difficultyName = difficultyName[0].ToString() + difficultyName.ToLower().Substring(1);
            }

            lblDescription.Text = "Completed on " + difficultyName;

            starIconPanel.BackgroundTexture = rankTextures[(int)mission.Rank];

            X         = WindowManager.RenderResolutionX;
            xPos      = WindowManager.RenderResolutionX;
            lifetime  = 0.0;
            Alpha     = 1.0f;
            AlphaRate = 0f;
            WindowManager.ReorderControls();

            Enable();
        }
        private void ListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lbSaveGameList.SelectedIndex == -1)
            {
                btnLaunch.AllowClick = false;
                btnDelete.AllowClick = false;
                ClearSaveInformation(string.Empty);
                return;
            }

            btnLaunch.AllowClick = true;
            btnDelete.AllowClick = true;

            SavedGame sg = savedGames[lbSaveGameList.SelectedIndex];

            if (sg.SessionInfo == null)
            {
                ClearSaveInformation(string.Empty);
                lblSessionTypeValue.Text = "Unknown";
                return;
            }

            switch (sg.SessionInfo.SessionType)
            {
            case GameSessionType.SKIRMISH:
                ClearSaveInformation(string.Empty);
                lblSessionTypeValue.Text = "Skirmish";
                break;

            case GameSessionType.MULTIPLAYER:
                ClearSaveInformation(string.Empty);
                lblSessionTypeValue.Text = "Multiplayer";
                break;

            case GameSessionType.SINGLEPLAYER:
                var mission = CampaignHandler.Instance.Missions.Find(m => m.InternalName == sg.SessionInfo.MissionInternalName);
                if (mission == null)
                {
                    ClearSaveInformation("Unknown");
                }
                else
                {
                    string difficultyName = ProgramConstants.DifficultyRankToName(sg.SessionInfo.Difficulty);
                    if (mission.DifficultyLabels != null)
                    {
                        difficultyName = mission.DifficultyLabels[(int)sg.SessionInfo.Difficulty - 1];
                    }

                    if (difficultyName.Length > 1)
                    {
                        difficultyName = difficultyName[0].ToString() + difficultyName.ToLower().Substring(1);
                    }

                    string globalFlagInfo;

                    if (sg.SessionInfo.GlobalFlagValues != null)
                    {
                        globalFlagInfo = string.Empty;

                        foreach (var kvp in sg.SessionInfo.GlobalFlagValues)
                        {
                            int  globalFlagIndex = kvp.Key;
                            bool enabled         = kvp.Value;

                            if (CampaignHandler.Instance.GlobalVariables.Count > globalFlagIndex)
                            {
                                var globalVariable = CampaignHandler.Instance.GlobalVariables[globalFlagIndex];
                                globalFlagInfo += globalVariable.UIName + ": " + (enabled ? "Yes" : "No");
                            }
                            else
                            {
                                globalFlagInfo += "(Unknown variable) " + globalFlagIndex + ": " + (enabled ? "Yes" : "No");
                            }

                            globalFlagInfo += Environment.NewLine;
                        }
                    }
                    else
                    {
                        globalFlagInfo = "None";
                    }

                    lblMissionNameValue.Text     = mission.GUIName;
                    lblDifficultyLevelValue.Text = difficultyName;
                    lblGlobalFlagsValue.Text     = globalFlagInfo;
                }

                lblSessionTypeValue.Text = "Singleplayer";

                break;
            }
        }