Beispiel #1
0
        private void AddOptionsChannels(UIHelperBase helper)
        {
            ModOptions options = ModOptions.Instance;

            {
                List <string> vanillastations = new List <string>();

                foreach (RadioContentInfo.ContentType type in Enum.GetValues(typeof(RadioContentInfo.ContentType)))
                {
                    // They are no real channels
                    if (type == RadioContentInfo.ContentType.Broadcast)
                    {
                        continue;
                    }

                    String path = Path.Combine(Path.Combine(DataLocation.gameContentPath, "Radio"), type.ToString());

                    foreach (String d in Directory.GetDirectories(path))
                    {
                        if (Directory.GetFiles(d).Length != 0)
                        {
                            String station = Path.GetFileNameWithoutExtension(d);

                            if (!vanillastations.Contains(station))
                            {
                                vanillastations.Add(station);
                            }
                        }
                    }
                }

                vanillastations.Sort();
                var subgroup = helper.AddGroup("Enabled vanilla channels");

                foreach (String station in vanillastations)
                {
                    subgroup.AddCheckbox(station,
                                         !options.DisabledRadioStations.Contains(station),
                                         new OnCheckChanged((bool isChecked) =>
                    {
                        if (isChecked)
                        {
                            options.DisabledRadioStations.Remove(station);
                        }
                        else
                        {
                            options.DisabledRadioStations.Add(station);
                        }

                        options.SaveSettings();
                    }));
                }
            }
            {
                var subgroup = helper.AddGroup("Music packs (Needs reload)");
                subgroup.AddCheckbox("Use music from music packs",
                                     options.EnableMusicPacks,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.EnableMusicPacks = isChecked;
                }));
                subgroup.AddCheckbox("Create channels from unused music files",
                                     options.CreateChannelsFromLegacyPacks,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.CreateChannelsFromLegacyPacks = isChecked;
                }));
            }
            {
                var subgroup = helper.AddGroup("Channel with all content (Needs reload)");

                subgroup.AddCheckbox("Create CSLMusic Mix channel",
                                     options.CreateMixChannels,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.CreateMixChannels = isChecked;
                }));
                subgroup.AddCheckbox("Include vanilla songs",
                                     options.AddVanillaSongsToMusicMix,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.AddVanillaSongsToMusicMix = isChecked;
                }));
                subgroup.AddCheckbox("Include music",
                                     options.MixContentMusic,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.MixContentMusic = isChecked;
                }));
                subgroup.AddCheckbox("Include blurbs",
                                     options.MixContentBlurb,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.MixContentBlurb = isChecked;
                }));
                subgroup.AddCheckbox("Include talks",
                                     options.MixContentTalk,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.MixContentTalk = isChecked;
                }));
                subgroup.AddCheckbox("Include commercials",
                                     options.MixContentCommercial,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.MixContentCommercial = isChecked;
                }));
                subgroup.AddCheckbox("Include broadcasts",
                                     options.MixContentBroadcast,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.MixContentBroadcast = isChecked;
                }));
            }
        }
Beispiel #2
0
        private void AddOptionsContent(UIHelperBase helper)
        {
            ModOptions options = ModOptions.Instance;

            {
                var subgroup = helper.AddGroup("Additional features");

                subgroup.AddCheckbox("Content can be disabled*",
                                     options.EnableDisabledContent,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.EnableDisabledContent = isChecked;
                }));
                subgroup.AddCheckbox("Context-sensitive content*",
                                     options.EnableContextSensitivity,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.EnableContextSensitivity = isChecked;
                }));
                subgroup.AddCheckbox("Smooth transitions* (needs reload)",
                                     options.EnableSmoothTransitions,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.EnableSmoothTransitions = isChecked;
                }));
                //subgroup.AddSlider("Context-sensitivity update interval (Needs reload)",
                //           1,
                //           60,
                //           1,
                //           options.ContentWatcherInterval,
                //           new OnValueChanged((float v) =>
                //{
                //    options.ContentWatcherInterval = v;
                //}));
                subgroup.AddCheckbox("Extend vanilla stations with custom content (Needs reload)",
                                     options.EnableAddingContentToVanillaStations,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.EnableAddingContentToVanillaStations = isChecked;
                }));
                subgroup.AddButton("Reset disabled entries", new OnButtonClicked(() =>
                {
                    options.DisabledContent.Clear();
                    options.SaveSettings();
                }));
            }
            {
                var subgroup = helper.AddGroup("Radio station content (Needs reload)");
                subgroup.AddCheckbox("Enable music",
                                     options.AllowContentMusic,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.AllowContentMusic = isChecked;
                }));
                subgroup.AddCheckbox("Enable blurbs",
                                     options.AllowContentBlurb,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.AllowContentBlurb = isChecked;
                }));
                subgroup.AddCheckbox("Enable talks",
                                     options.AllowContentTalk,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.AllowContentTalk = isChecked;
                }));
                subgroup.AddCheckbox("Enable commercials",
                                     options.AllowContentCommercial,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.AllowContentCommercial = isChecked;
                }));
                subgroup.AddCheckbox("Enable broadcasts",
                                     options.AllowContentBroadcast,
                                     new OnCheckChanged((bool isChecked) =>
                {
                    options.AllowContentBroadcast = isChecked;
                }));
            }
        }