private static void OnSceneLoaded(Scene scene, LoadSceneMode mode)
        {
            if (scene.name == "Main")
            {
                Init();
                Instance.gameObject.AddIfNeedComponent <AlwaysDayConsoleCommand>();
                Instance.gameObject.AddIfNeedComponent <NoInfectConsoleCommand>();
                Instance.gameObject.AddIfNeedComponent <OverPowerConsoleCommand>();
            }
            else if (scene.name == "StartScreen")
            {
                //DisplayManager.OnDisplayChanged += Screen_OnDisplayChanged;

                if (isInfoBarEnabled)
                {
                    CmInfoBar = new CM_InfoBar();
                }

                if (isConsoleEnabled)
                {
                    CmLogger = new CM_Logger();
                }

                CmConfig.Load();
            }
        }
    public void ReLayout()
    {
        Vector3 tempTxtPos    = orgTextPos;
        Vector3 tempOptPos    = orgOptPos;
        Vector3 tempRewardPos = orgActionPos;

        for (int i = 0; i < allWindows.Count; i++)
        {
            CmConfig item = allWindows[i];
            if (item is TxtConfig)
            {
                TxtConfig txtConfig = item as TxtConfig;
                AddTextWind(ref orgTextPos, txtConfig);
            }
            else if (item is OptionConfig)
            {
                OptionConfig op = item as OptionConfig;
                AddOption(ref tempOptPos, op);
            }
            else if (item is ActionConfig)
            {
                ActionConfig action = item as ActionConfig;
                AddAction(ref tempRewardPos, action);
            }
            else if (item is SpaceConfig)
            {
                SpaceConfig space = item as SpaceConfig;
                orgTextPos.y -= space.LineCount * space.LineHeight;
            }
        }
    }
 public void OnDestroy()
 {
     CmConfig.WriteConfig();
     commands          = null;
     toggleCommands    = null;
     daynightTab       = null;
     categoriesTab     = null;
     vehicleSettings   = null;
     tMatrix           = null;
     initToggleButtons = false;
     warpSound         = null;
     isActive          = false;
     onConsoleCommandEntered.RemoveHandler(this, OnConsoleCommandEntered);
     onFilterFastChanged.RemoveHandler(this, OnFilterFastChanged);
 }
Beispiel #4
0
        public static void Load()
        {
            try
            {
                CmConfig.Config_Load();

                Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Subnautica.CheatManager.mod");
                DevConsole.disableConsole = false;
                SceneManager.sceneLoaded += new UnityAction <Scene, LoadSceneMode>(OnSceneLoaded);
            }
            catch (Exception ex)
            {
                Debug.LogException(ex);
            }
        }