コード例 #1
0
        public OverrideHook()
        {
            var fxCore = new Fox_Core("NimbusFox", "OverrideAPI", "0.1");

            fxCore.PatchController.Override(typeof(TileDatabase), "LoadDefinitions", typeof(TileDatabasePatches),
                                            nameof(TileDatabasePatches.LoadDefinitionsInit), TileDatabasePatches.LoadDefinitionsTranspiler);
        }
コード例 #2
0
 internal static void Init()
 {
     FoxCore       = new Fox_Core("NimbusFox", "World Edit", "V0.2");
     _positions    = new Dictionary <Entity, UserData>();
     _undoData     = new Dictionary <string, RedoUndo>();
     RegionManager = new RegionManager();
 }
コード例 #3
0
        public void GameContextInitializeAfter()
        {
            if (Process.GetCurrentProcess().ProcessName.Contains("ContentBuilder") && !Process.GetCurrentProcess().StartInfo.Arguments.Contains("--stopVariantCheck"))
            {
                var variantLoader = new VariantLoader();

                Application.Run(variantLoader);

                variantLoader.Dispose();
            }

            if (FxCore == null)
            {
                FxCore = new Fox_Core("NimbusFox", "FoxCore", "V2.1");

                //FxCore.PatchController.Add(typeof(PlayerEntityLogic), "PersistOtherPlayerData", typeof(CoreHook), nameof(BeforeSave), typeof(CoreHook), nameof(AfterSave));
                //FxCore.PatchController.Add(typeof(PlayerEntityLogic), "Construct", null, null, typeof(CoreHook), nameof(AfterLoad));
                FxCore.PatchController.Add(typeof(PlayerPersistence), "SaveAllPlayerDataOnConnect", null, null, typeof(CoreHook), nameof(OnConnect));
                FxCore.PatchController.Add(typeof(PlayerPersistence), "SaveDisconnectingPlayer", null, null, typeof(CoreHook), nameof(OnDisconnect));
                FxCore.PatchController.Add(typeof(ChatController), "ReceiveConsoleResponse",
                                           typeof(ChatControllerPatches), nameof(ChatControllerPatches.ReceiveConsoleResponse));

                UserManager = new UserManager();
            }
        }
コード例 #4
0
ファイル: TestHook.cs プロジェクト: NimbusFox/Staxel-FoxCore
        public TestHook()
        {
            var fxCore = new Fox_Core("NimbusFox", "TestMod", "DEV");

            DirectoryTest(fxCore.SaveDirectory);
            DirectoryTest(fxCore.ConfigDirectory);

            fxCore.ExceptionManager.HandleException(new Exception("Test"));
        }
コード例 #5
0
 public static void CreateItem(Dictionary <Color, Color> replaceColorsWith, string kind,
                               string newVariantTileCode, string source, Fox_Core modFoxCore, Blob overrides)
 {
     CreateItem(replaceColorsWith, kind, newVariantTileCode, source, modFoxCore.ModDirectory, overrides);
 }
コード例 #6
0
 public static void CreateTile(Tile baseTile, Dictionary <Color, Color> replaceColorsWith,
                               string newVariantTileCode, Fox_Core modFoxCore, Blob overrides)
 {
     CreateTile(baseTile, replaceColorsWith, newVariantTileCode, modFoxCore.ModDirectory, overrides);
 }