コード例 #1
0
        public bool VerifySettings(out List <string> errors)
        {
            errors = new List <string>();

            if (ScreenshotsPath.IsEmpty())
            {
                errors.Add("Screenshots Folder Path must not be empty!");
            }

            var hotkeys = new HashSet <Hotkey>(new HotkeyComparer());

            if (!hotkeys.Add(CaptureFullscreenHotkey))
            {
                errors.Add("Duplicate hotkeys are not allowed!");
            }

            if (!hotkeys.Add(CaptureActiveMonitorHotkey))
            {
                errors.Add("Duplicate hotkeys are not allowed!");
            }

            if (!hotkeys.Add(CaptureActiveWindowHotkey))
            {
                errors.Add("Duplicate hotkeys are not allowed!");
            }

            return(errors.Count <= 0);
        }
コード例 #2
0
        public ScreenshotPluginSettings(ScreenshotExtensionPlugin plugin)
        {
            _plugin = plugin;

            var savedSettings = plugin.LoadPluginSettings <ScreenshotPluginSettings>();

            if (savedSettings != null)
            {
                //SaveToGame = savedSettings.SaveToGame;
                //SaveToFolder = savedSettings.SaveToFolder;
                OnlyGameScreenshots        = savedSettings.OnlyGameScreenshots;
                ScreenshotsPath            = savedSettings.ScreenshotsPath;
                CaptureActiveMonitorHotkey = savedSettings.CaptureActiveMonitorHotkey;
                CaptureActiveWindowHotkey  = savedSettings.CaptureActiveWindowHotkey;
                CaptureFullscreenHotkey    = savedSettings.CaptureFullscreenHotkey;
            }

            if (ScreenshotsPath.IsEmpty())
            {
                ScreenshotsPath = Path.Combine(_plugin.PlayniteApi.Paths.ExtensionsDataPath, _plugin.Id.ToString());
            }
        }