Exemple #1
0
        // called when Gamecraft starts up
        public override void OnApplicationStart()
        {
            // Initialize the Gamecraft modding API first
            GamecraftModdingAPI.Main.Init();
            // check out the modding API docs here: https://mod.exmods.org/

            // Initialize Pixi mod
            CommandRoot root = new CommandRoot();

            // 2D Image Functionality
            root.Inject(new ImageCanvasImporter());
            root.Inject(new ImageTextBlockImporter());
            root.Inject(new ImageCommandImporter());
            // Robot functionality
            var robot = new RobotInternetImporter();

            root.Inject(robot);
            //RobotCommands.CreateRobotCRFCommand();
            //RobotCommands.CreateRobotFileCommand();
#if DEBUG
            // Development functionality
            RobotCommands.CreatePartDumpCommand();
            ((RobotBlueprintProvider)robot.BlueprintProvider).AddDebugCommands();
            root.Inject(new TestImporter());
#endif
            // Audio functionality
            root.Inject(new MidiImporter());
            root.Inject(new AudioFakeImporter());
        }
Exemple #2
0
        public static void Load()
        {
            try
            {
                commandRoot = new CommandRoot("zhelperBase");

                commandRoot.AddCommand <ZHelperCommand>();
            }
            catch (Exception ex)
            {
                Debug.LogException(ex);
            }
        }
        public static void Load()
        {
            SNLogger.Debug("Method call: Main.Load()");

            try
            {
                SEConfig.Config_Load();
                SlotHelper.InitSlotIDs();
                SlotHelper.ExpandSlotMapping();

                hInstance = new Harmony("Subnautica.SlotExtender.mod");

                SNLogger.Debug($"Main.Load(): Harmony Instance created, Name = [{hInstance.Id}]");

                hInstance.PatchAll(Assembly.GetExecutingAssembly());

                SceneManager.sceneLoaded += new UnityAction <Scene, LoadSceneMode>(OnSceneLoaded);

                SNLogger.Debug("Main.Load(): Added OnSceneLoaded method to SceneManager.sceneLoaded event.");

                //add console commad for configuration window
                commandRoot = new CommandRoot("SEConfigGO");
                commandRoot.AddCommand <SECommand>();

                IngameMenuHandler.Main.RegisterOnQuitEvent(OnQuitEvent);
            }
            catch (Exception ex)
            {
                Debug.LogException(ex);
            }

            // check MoreQuickSlots namespace is exists
            if (ReflectionHelper.IsNamespaceExists("MoreQuickSlots"))
            {
                SNLogger.Log("MoreQuickSlots namespace is exist! Trying to install a Cross-MOD patch...");

                // if yes construct a Harmony patch
                if (MQS_Patches.InitPatch(hInstance))
                {
                    SNLogger.Log("MoreQuickSlots Cross-MOD patch installed!");
                }
                else
                {
                    SNLogger.Error("MoreQuickSlots Cross-MOD patch install failed!");
                }
            }
        }
        public static void Load()
        {
            try
            {
                RuntimeHelper_Config.LoadConfig();
                RuntimeHelper_Config.InitConfig();
                DevConsole.disableConsole = false;

                //add console commad
                commandRoot = new CommandRoot("RHCommandGO", true);
                commandRoot.AddCommand <RuntimeHelperCommand>();

                SceneManager.sceneLoaded += new UnityAction <Scene, LoadSceneMode>(OnSceneLoaded);
            }
            catch (Exception ex)
            {
                Debug.LogException(ex);
            }
        }