Beispiel #1
0
            public override void HandleClick()
            {
                string path = Engine_Universal.CurrentPlayerDataDirectory + "Save/" + this.SaveName + Engine_Universal.SaveExtension;

                if (!File.Exists(path))
                {
                    return;
                }
                Engine_Universal.LoadGame(this.SaveName);
                Instance.Close();
            }
            public override MouseHandlingResult HandleClick()
            {
                bool   debug       = false;
                string SaveName    = this.SaveGame.ToString();
                string oldSaveName = this.SaveGame.saveName;
                string path        = Engine_Universal.CurrentPlayerDataDirectory + "Save/" + SaveName + Engine_Universal.SaveExtension;
                string oldPath     = Engine_Universal.CurrentPlayerDataDirectory + "Save/" + oldSaveName + Engine_Universal.SaveExtension;

                //if ( path.Contains( " " ) )
                //{
                //    path = "\"" + path + "\"";
                //}
                if (debug)
                {
                    ArcenDebugging.ArcenDebugLogSingleLine("Trying to load from " + path, Verbosity.DoNotShow);
                }
                if (File.Exists(path))
                {
                    SFXItemTable.TryPlayItemByName_GUIOnly("ButtonStartGame");
                    Window_SaveGameMenu.Instance.OverallCampaignName = this.SaveGame.campaignName;
                    Engine_Universal.LoadGame(SaveName);
                    Instance.Close();
                }
                else if (File.Exists(oldPath))
                {
                    SFXItemTable.TryPlayItemByName_GUIOnly("ButtonStartGame");
                    Window_SaveGameMenu.Instance.OverallCampaignName = this.SaveGame.campaignName;
                    Engine_Universal.LoadGame(oldSaveName);
                    Instance.Close();
                }
                else
                {
                    ArcenDebugging.ArcenDebugLogSingleLine("File does not exist" + Environment.NewLine + "path=" + path + Environment.NewLine + "oldPath=" + oldPath, Verbosity.DoNotShow);
                    return(MouseHandlingResult.PlayClickDeniedSound);
                }
                return(MouseHandlingResult.DoNotPlayClickSound);
            }