Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 2
0
    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;
            }
        }
    }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 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);
            }
        }