示例#1
0
        public override void Init()
        {
            ExceptionText  = string.Empty;
            ExceptionText2 = string.Empty;

            ZipFilePath   = Metadata.Archive;
            FilePath      = Metadata.Directory;
            ResourcesPath = ETGMod.ResourcesDirectory;

            try { ExpandSettings.LoadSettings(); } catch (Exception ex) { ExceptionText2 = ex.ToString(); }

            itemList = new List <string>()
            {
                "Baby Good Hammer",
                "Corruption Bomb",
                "Table Tech Assassin",
                "ex:bloodied_scarf",
                "Cronenberg Bullets",
                "Mimiclay",
                "The Lead Key",
                "RockSlide",
                "Corrupted Master Round",
                "Wooden Crest",
                "Bootleg Pistol",
                "Bootleg Shotgun",
                "Bootleg Machine Pistol",
                "Bulletkin Gun",
                "Baby Sitter",
                "Pow Block",
                "Cursed Brick",
                "Black Revolver",
                "Golden Revolver",
                "Sonic Box"
            };

            ExpandAssets.InitCustomAssetBundles();

            if (ExpandSettings.EnableLogo)
            {
                ModLogo = ExpandAssets.LoadAsset <Texture2D>("EXLogo");
            }

            try {
                ExpandSharedHooks.InstallMidGameSaveHooks();
                if (ExpandSettings.EnableLogo)
                {
                    MainMenuFoyerUpdateHook = new Hook(
                        typeof(MainMenuFoyerController).GetMethod("Update", BindingFlags.NonPublic | BindingFlags.Instance),
                        typeof(ExpandTheGungeon).GetMethod(nameof(MainMenuUpdateHook), BindingFlags.NonPublic | BindingFlags.Instance),
                        typeof(MainMenuFoyerController)
                        );
                }
                GameManager.Instance.OnNewLevelFullyLoaded += ExpandObjectMods.InitSpecialMods;
            } catch (Exception ex) {
                // ETGModConsole can't be called by anything that occurs in Init(), so write message to static strinng and check it later.
                ExceptionText = "[ExpandTheGungeon] ERROR: Exception occured while installing hooks!";
                Debug.LogException(ex);
                return;
            }
        }
示例#2
0
 private void ExpandExportSettings(string[] consoleText)
 {
     ExpandSettings.SaveSettings();
     ETGModConsole.Log("[ExpandTheGungeon] Settings have been saved!");
     return;
 }