Example #1
0
        private static void CreateSettingsUI()
        {
            var subMenu = SettingsUI.CreateSubMenu("Platforms");

            var feetMenu = subMenu.AddBool("Always Show Feet");

            feetMenu.GetValue += delegate
            {
                return(PlatformManager.Instance.envHider.showFeetOverride);
            };
            feetMenu.SetValue += delegate(bool value)
            {
                PlatformManager.Instance.envHider.showFeetOverride = value;
                ModPrefs.SetBool(CustomFloorPlugin.PluginName, "AlwaysShowFeet", PlatformManager.Instance.envHider.showFeetOverride);
            };

            var environment = subMenu.AddList("Environment Override", EnvironmentSceneOverrider.OverrideModes());

            environment.GetValue += delegate
            {
                return((float)EnvironmentSceneOverrider.overrideMode);
            };
            environment.SetValue += delegate(float value)
            {
                EnvironmentSceneOverrider.overrideMode = (EnvironmentSceneOverrider.EnvOverrideMode)value;
                EnvironmentSceneOverrider.OverrideEnvironmentScene();
                ModPrefs.SetInt(CustomFloorPlugin.PluginName, "EnvironmentOverrideMode", (int)EnvironmentSceneOverrider.overrideMode);
            };
            environment.FormatValue += delegate(float value) { return(EnvironmentSceneOverrider.Name((EnvironmentSceneOverrider.EnvOverrideMode)value)); };
        }
Example #2
0
        private static void CreateSettingsUI()
        {
            var subMenu = SettingsUI.CreateSubMenu("Platforms");

            var feetMenu = subMenu.AddBool("Always Show Feet");

            feetMenu.GetValue += delegate
            {
                return(EnvironmentHider.showFeetOverride);
            };
            feetMenu.SetValue += delegate(bool value)
            {
                EnvironmentHider.showFeetOverride = value;
                Plugin.config.SetBool("Settings", "AlwaysShowFeet", EnvironmentHider.showFeetOverride);
            };

            var environment = subMenu.AddList("Environment Override", EnvironmentSceneOverrider.OverrideModes());

            environment.GetValue += delegate
            {
                return((float)EnvironmentSceneOverrider.overrideMode);
            };
            environment.SetValue += delegate(float value)
            {
                EnvironmentSceneOverrider.overrideMode = (EnvironmentSceneOverrider.EnvOverrideMode)value;
                EnvironmentSceneOverrider.OverrideEnvironmentScene();
                Plugin.config.SetInt("Settings", "EnvironmentOverrideMode", (int)EnvironmentSceneOverrider.overrideMode);
            };
            environment.FormatValue += delegate(float value) { return(EnvironmentSceneOverrider.Name((EnvironmentSceneOverrider.EnvOverrideMode)value)); };

            var arrangement = subMenu.AddList("Environment Arrangement", EnvironmentArranger.RepositionModes());

            arrangement.GetValue += delegate
            {
                return((float)EnvironmentArranger.arrangement);
            };
            arrangement.SetValue += delegate(float value)
            {
                EnvironmentArranger.arrangement = (EnvironmentArranger.Arrangement)value;
                Plugin.config.SetInt("Settings", "EnvironmentArrangement", (int)EnvironmentArranger.arrangement);
            };
            arrangement.FormatValue += delegate(float value) { return(EnvironmentArranger.Name((EnvironmentArranger.Arrangement)value)); };
        }