예제 #1
0
        public ScreenshotManager(SaveWatcher saveWatcher)
        {
            _loadedScreenshots = new Dictionary <string, Texture2D>();
            try
            {
                saveWatcher.OnSave += OnSave;
                // Migrate old full screenshots to thumbnails
                foreach (var file in Directory.GetFiles(Util.SaveDir, "*.*"))
                {
                    var fullPath = Path.Combine(Util.SaveDir, file);
                    if (IsFullScreenshot(fullPath))
                    {
                        EnqueueAction(() => ResizeScreenshot(fullPath));
                    }
                }

                //_placeholder = GameDatabase.Instance.GetTexture("BetterLoadSaveGame/placeholder", false);
                _placeholder = new Texture2D(2, 2);
                ToolbarControl.LoadImageFromFile(ref _placeholder, "GameData/BetterLoadSaveGame/PluginData/placeholder");
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }
        public LoadGameDialog(SaveWatcher saveWatcher, SaveGameCollection saveGameCollection, ScreenshotManager screenshotManager, int instanceID)
        {
            _saveWatcher        = saveWatcher;
            _saveGameCollection = saveGameCollection;
            _screenshotManager  = screenshotManager;
            _instanceID         = instanceID;

            _windowRect = new Rect((Screen.width - WIDTH) / 2, (Screen.height - HEIGHT) / 2, WIDTH, HEIGHT);
        }
예제 #3
0
 public SaveGameCollection(SaveWatcher saveWatcher)
 {
     if (saveWatcher != null)
     {
         saveWatcher.OnSave += OnSave;
     }
     ArchiveDir = "";
     LoadAllGames();
 }
예제 #4
0
        public SaveGameCollection(SaveWatcher saveWatcher)
        {
            saveWatcher.OnSave += OnSave;

            foreach (var file in Directory.GetFiles(Util.SaveDir))
            {
                if (file.EndsWith(".sfs"))
                {
                    var fullPath = Path.Combine(Util.SaveDir, file);
                    _saves.Add(new SaveGameInfo(file));
                }
            }

            UpdateSort();
        }
예제 #5
0
        public void Start()
        {
            try
            {
                _saveWatcher = new SaveWatcher();

                _screenshotManager  = new ScreenshotManager(_saveWatcher);
                _saveGameCollection = new SaveGameCollection(_saveWatcher);

                _loadGameDialog = new LoadGameDialog(_saveWatcher, _saveGameCollection, _screenshotManager, GetInstanceID());
            }
            catch (Exception ex)
            {
                Log.Error(ex.ToString());
            }
        }
예제 #6
0
        public void Start()
        {
            try
            {
                fetch        = this;
                _saveWatcher = new SaveWatcher();

                _screenshotManager  = new ScreenshotManager(_saveWatcher);
                _saveGameCollection = new SaveGameCollection(_saveWatcher);

                _loadGameDialog = new LoadGameDialog(_saveWatcher, _saveGameCollection, _screenshotManager, GetInstanceID());
            }
            catch (Exception ex)
            {
                Log.Error(ex.ToString());
            }
            if (!ToolbarControl.LoadImageFromFile(ref clearBtn, "GameData/" + InstallChecker.FOLDERNAME + "/PluginData/clear-30"))
            {
                Log.Error("Error loading clear-30 image");
            }
        }
        public ScreenshotManager(SaveWatcher saveWatcher)
        {
            try
            {
                saveWatcher.OnSave += OnSave;

                // Migrate old full screenshots to thumbnails
                foreach (var file in Directory.GetFiles(Util.SaveDir, "*.*"))
                {
                    var fullPath = Path.Combine(Util.SaveDir, file);
                    if (IsFullScreenshot(fullPath))
                    {
                        EnqueueAction(() => ResizeScreenshot(fullPath));
                    }
                }

                _placeholder = GameDatabase.Instance.GetTexture("BetterLoadSaveGame/placeholder", false);
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }