Exemplo n.º 1
0
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            int num11 = (Environment.OSVersion.Platform != PlatformID.Unix ? 26 : 28);
            var path  = Environment.GetFolderPath((Environment.SpecialFolder)num11);

            DefaultSSdirectory = new DirectoryInfo(Path.Combine(path, "StardewValley", "Screenshots"));

            // get Generic Mod Config Menu's API (if it's installed)
            var configMenu = this.Helper.ModRegistry.GetApi <IGenericModConfigMenuApi>("spacechase0.GenericModConfigMenu");

            if (configMenu is null)
            {
                return;
            }

            // register mod
            configMenu.Register(
                mod: this.ModManifest,
                reset: () => this.Config = new ModConfig(),
                save: () => this.Helper.WriteConfig(this.Config)
                );
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "Debug",
                getValue: () => this.Config.Debug,
                setValue: value => this.Config.Debug = value
                );
            configMenu.AddKeybindList(
                mod: this.ModManifest,
                name: () => "Screenshot Hotkey",
                getValue: () => this.Config.HotKey,
                setValue: value => this.Config.HotKey = value
                );
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "Capture Notification",
                getValue: () => this.Config.NotifyCapture,
                setValue: value => this.Config.NotifyCapture = value
                );
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "Camera Flash",
                getValue: () => this.Config.CameraFlash,
                setValue: value => this.Config.CameraFlash = value
                );
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "Shutter Sound",
                getValue: () => this.Config.ShutterSound,
                setValue: value => this.Config.ShutterSound = value
                );
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "Farm",
                getValue: () => this.Config.Farm,
                setValue: value => this.Config.Farm = value
                );
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "FarmHouse",
                getValue: () => this.Config.FarmHouse,
                setValue: value => this.Config.FarmHouse = value
                );
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "Greenhouse",
                getValue: () => this.Config.Greenhouse,
                setValue: value => this.Config.Greenhouse = value
                );
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "Cellar",
                getValue: () => this.Config.Cellar,
                setValue: value => this.Config.Cellar = value
                );
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "Town",
                getValue: () => this.Config.Town,
                setValue: value => this.Config.Town = value
                );
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "Beach",
                getValue: () => this.Config.Beach,
                setValue: value => this.Config.Beach = value
                );
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "Sheds",
                getValue: () => this.Config.Shed,
                setValue: value => this.Config.Shed = value
                );
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "Coops",
                getValue: () => this.Config.Coop,
                setValue: value => this.Config.Coop = value
                );
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "Barns",
                getValue: () => this.Config.Barn,
                setValue: value => this.Config.Barn = value
                );
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "IslandFarm",
                getValue: () => this.Config.IslandFarm,
                setValue: value => this.Config.IslandFarm = value
                );
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "Desert",
                getValue: () => this.Config.Desert,
                setValue: value => this.Config.Desert = value
                );
            configMenu.AddBoolOption(
                mod: this.ModManifest,
                name: () => "Forest",
                getValue: () => this.Config.Forest,
                setValue: value => this.Config.Forest = value
                );
            configMenu.AddTextOption(
                mod: this.ModManifest,
                name: () => "Screenshot Locations",
                getValue: () => this.Config.ScreenShotLocations,
                setValue: value => this.Config.ScreenShotLocations = value
                );
        }
Exemplo n.º 2
0
        private void updateConfig()
        {
            string locs = "";

            this.Config = this.Helper.ReadConfig <ModConfig>();
            if (this.Config.Farm)
            {
                locs += "farm,";
            }
            if (this.Config.FarmHouse)
            {
                locs += "farmhouse,";
            }
            if (this.Config.Town)
            {
                locs += "town,";
            }
            if (this.Config.Cellar)
            {
                locs += "cellar,";
            }
            if (this.Config.Beach)
            {
                locs += "beach,";
            }
            if (this.Config.Greenhouse)
            {
                locs += "greenhouse,";
            }
            if (this.Config.Coop)
            {
                locs += "coop,big coop,deluxe coop,";
            }
            if (this.Config.Barn)
            {
                locs += "barn,big barn,deluxe barn,";
            }
            if (this.Config.Shed)
            {
                locs += "shed,big shed,";
            }
            if (this.Config.IslandFarm)
            {
                locs += "islandwest,";
            }
            if (this.Config.Desert)
            {
                locs += "desert,";
            }
            if (this.Config.Forest)
            {
                locs += "forest,";
            }

            if (locs.Length > 0)
            {
                locs = locs.Substring(0, locs.Length - 1);
            }

            this.locations = $"{locs}{(locs.Length > 0 ? "," : "")}{Config.ScreenShotLocations}".ToLower().Split(',').ToList <string>();
        }