Пример #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)); };
        }
Пример #2
0
        private void Start()
        {
            platforms = new PlatformLoader().CreateAllPlatforms(transform);

            // Retrieve saved path from player prefs if it exists
            if (ModPrefs.HasKey(CustomFloorPlugin.PluginName, "CustomPlatformPath"))
            {
                string savedPath = ModPrefs.GetString(CustomFloorPlugin.PluginName, "CustomPlatformPath");
                // Check if this path was loaded and update our platform index
                for (int i = 0; i < platforms.Length; i++)
                {
                    if (savedPath == platforms[i].platName + platforms[i].platAuthor)
                    {
                        platformIndex = i;
                        break;
                    }
                }
            }

            EnvironmentArranger.arrangement        = (EnvironmentArranger.Arrangement)ModPrefs.GetInt(CustomFloorPlugin.PluginName, "EnvironmentArrangement", 0, true);
            EnvironmentSceneOverrider.overrideMode = (EnvironmentSceneOverrider.EnvOverrideMode)ModPrefs.GetInt(CustomFloorPlugin.PluginName, "EnvironmentOverrideMode", 0, true);
            EnvironmentSceneOverrider.GetSceneInfos();
            EnvironmentSceneOverrider.OverrideEnvironmentScene();

            envHider = new EnvironmentHider();
            envHider.showFeetOverride = ModPrefs.GetBool(CustomFloorPlugin.PluginName, "AlwaysShowFeet", false, true);
            envHider.FindEnvironment();
            envHider.HideObjectsForPlatform(currentPlatform);

            currentPlatform.gameObject.SetActive(true);

            BSSceneManager.activeSceneChanged += SceneManagerOnActiveSceneChanged;

            PlatformUI.OnLoad();
        }
Пример #3
0
        private void Start()
        {
            EnvironmentSceneOverrider.GetSceneInfos();
            EnvironmentSceneOverrider.OverrideEnvironmentScene();

            EnvHider       = new EnvironmentHider();
            platformLoader = new PlatformLoader();

            RefreshPlatforms();
            PlatformUI.OnLoad();
        }
Пример #4
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)); };
        }
Пример #5
0
        private void Start()
        {
            EnvironmentArranger.arrangement        = (EnvironmentArranger.Arrangement)Plugin.config.GetInt("Settings", "EnvironmentArrangement", 0, true);
            EnvironmentSceneOverrider.overrideMode = (EnvironmentSceneOverrider.EnvOverrideMode)Plugin.config.GetInt("Settings", "EnvironmentOverrideMode", 0, true);
            EnvironmentSceneOverrider.GetSceneInfos();
            EnvironmentSceneOverrider.OverrideEnvironmentScene();

            menuEnvHider   = new EnvironmentHider();
            gameEnvHider   = new EnvironmentHider();
            platformLoader = new PlatformLoader();

            BSEvents.gameSceneLoaded      += HandleGameSceneLoaded;
            BSEvents.menuSceneLoadedFresh += HandleMenuSceneLoadedFresh;
            BSEvents.menuSceneLoaded      += HandleMenuSceneLoaded;

            RefreshPlatforms();

            HandleMenuSceneLoadedFresh();

            PlatformUI.OnLoad();
        }
Пример #6
0
        private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1)
        {
            // Load in the menu scene
            if (arg0.name == "Menu" && !init)
            {
                init = true;

                SettingsUI.OnLoad();
                BSSceneManager.OnLoad();
                PlatformLoader.OnLoad();

                // Load from modprefs
                EnvironmentHider.showFeetOverride = ModPrefs.GetBool(PluginName, "AlwaysShowFeet", false, true);

                EnvironmentSceneOverrider.overrideMode = (EnvironmentSceneOverrider.EnvOverrideMode)ModPrefs.GetInt(PluginName, "EnvironmentOverrideMode", 0, true);
                EnvironmentSceneOverrider.GetSceneInfos();
                EnvironmentSceneOverrider.OverrideEnvironmentScene();

                //Application.logMessageReceived += LogCallback;
            }
        }