LoadGameFromDisk() публичный Метод

public LoadGameFromDisk ( string gameToLoad, bool interactive ) : bool
gameToLoad string
interactive bool
Результат bool
Пример #1
0
        public bool LoadGameFromDisk(string gameToLoad)
        {
            try
            {
                bool success = _tasks.LoadGameFromDisk(gameToLoad, true);

                AGS.Types.Game game = Factory.AGSEditor.CurrentGame;
                if (((game.SavedXmlVersion != null) &&
                     (game.SavedXmlVersion != AGSEditor.LATEST_XML_VERSION))
                    ||
                    ((game.SavedXmlVersionIndex != null) &&
                     (game.SavedXmlVersionIndex != AGSEditor.LATEST_XML_VERSION_INDEX)))
                {
                    Factory.GUIController.ShowMessage("This game was last saved with " +
                                                      ((game.SavedXmlEditorVersion == null) ? "an older version" : ("version " + game.SavedXmlEditorVersion))
                                                      + " of AGS. If you save it now, the game will be upgraded and previous versions of AGS will be unable to open it.", MessageBoxIcon.Information);
                    game.WorkspaceState.RequiresRebuild = true;
                }

                return(success);
            }
            catch (Exception ex)
            {
                ReportTaskException("An error occurred whilst trying to load your game.", ex);
                return(false);
            }
        }
Пример #2
0
        public bool LoadGameFromDisk(string gameToLoad)
        {
            try
            {
                bool success = _tasks.LoadGameFromDisk(gameToLoad, true);

                AGS.Types.Game game = Factory.AGSEditor.CurrentGame;
                if (((game.SavedXmlVersion != null) &&
                     (game.SavedXmlVersion != AGSEditor.LATEST_XML_VERSION))
                    ||
                    ((game.SavedXmlVersionIndex != null) &&
                     (game.SavedXmlVersionIndex != AGSEditor.LATEST_XML_VERSION_INDEX)))
                {
                    Factory.GUIController.ShowMessage("This game was last saved with " +
                                                      ((game.SavedXmlEditorVersion == null) ? "an older version" : ("version " + game.SavedXmlEditorVersion))
                                                      + " of AGS. If you save it now, the game will be upgraded and previous versions of AGS will be unable to open it.", MessageBoxIcon.Information);
                }

                return(success);
            }
            catch (Exception ex)
            {
                string messageDetails = string.Empty;
                if ((!(ex is AGS.Types.InvalidDataException)) &&
                    (!(ex is AGS.Types.AGSEditorException)))
                {
                    messageDetails = "\r\n\r\nError details: " + ex.ToString();
                }
                Factory.GUIController.ShowMessage("An error occurred whilst trying to load your game. The error was: " + Environment.NewLine + Environment.NewLine + ex.Message + "\r\n\r\nIf you cannot resolve the error, please post on the AGS Technical Forum for assistance." + messageDetails, MessageBoxIcon.Warning);
                return(false);
            }
        }