示例#1
0
 public void OnApplicationStart()
 {
     //Instance = this;
     BSEvents.OnLoad();
     SettingsUI.CreateMenu();
     BSEvents.menuSceneLoadedFresh += OnMenuSceneLoadedFresh;
 }
示例#2
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)); };
        }
示例#3
0
 public void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         SceneManager.activeSceneChanged += SceneManagerOnActiveSceneChanged;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(this);
     }
 }
示例#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 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;
            }
        }