예제 #1
0
        public override object Call(params object[] args)
        {
            //don't catch exceptions, just blatantly show an error
            //it's probably the other modder's fault

            if ((string)args[0] == "RegisterHookGetFishingLevel")
            {
                var methodInfo = ((Type)args[1]).GetMethod((string)args[2], BindingFlags.Static | BindingFlags.Public);
                if (methodInfo == null)
                {
                    throw new Exception("Method " + (string)args[2] + " not found. Make sure it's a public static method.");
                }
                AutofisherHooks.RegisterHook(AutofisherHooks.HookType.GetFishingLevel, methodInfo);
                Log("Added GetFishingLevel hook");
                return(true);
            }
            else if ((string)args[0] == "RegisterHookCatchFish")
            {
                var methodInfo = ((Type)args[1]).GetMethod((string)args[2], BindingFlags.Static | BindingFlags.Public);
                if (methodInfo == null)
                {
                    throw new Exception("Method " + (string)args[2] + " not found. Make sure it's a public static method.");
                }
                AutofisherHooks.RegisterHook(AutofisherHooks.HookType.CatchFish, methodInfo);
                Log("Added CatchFish hook");
                return(true);
            }
            throw new Exception("Invalid mod.Call() message. Could be caused by an outdated version of Miscellania, or by a typo in someone else's mod.");
        }
예제 #2
0
 public override void Unload()
 {
     MiscGlowMasks.Unload();
     if (CellPhoneTexture != null)
     {
         Main.itemTexture[ItemID.CellPhone] = CellPhoneTexture;
         CellPhoneTexture = null;
     }
     AutofisherHooks.Unload();
 }
예제 #3
0
        public override void Load()
        {
            Instance = this;             //apparently you get some problems with Mod Reloading if you put this in the constructor
            AutofisherHooks.Initialize();
            FKtModSettingsLoaded = ModLoader.GetMod("FKTModSettings") != null;
            VanillaTweaksLoaded  = ModLoader.GetMod("VanillaTweaks") != null;

            if (!Main.dedServ)
            {
                if (FKtModSettingsLoaded)
                {
                    Config.LoadFKConfig();
                }

                MiscGlowMasks.Load();
                if (Config.CellPhoneResprite)
                {
                    CellPhoneTexture = Main.itemTexture[ItemID.CellPhone];
                    Main.itemTexture[ItemID.CellPhone] = GetTexture("Items/Tools/CellPhone_Resprite");
                }
                //				SkyManager.Instance["GoldensMisc:Laputa"] = new LaputaSky();

                if (Config.ExtraDyes)
                {
                    GameShaders.Armor.BindShader(ItemType <MatrixDye>(), new ArmorShaderData(Main.PixelShaderRef, "ArmorPhase")).UseImage("Images/Misc/noise").UseColor(0f, 1.0f, 0.2f);
                    GameShaders.Armor.BindShader(ItemType <VirtualDye>(), new ArmorShaderData(Main.PixelShaderRef, "ArmorPhase")).UseImage("Images/Misc/noise").UseColor(1f, 0.1f, 0.1f);
                    GameShaders.Armor.BindShader(ItemType <CobaltDye>(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.4f, 0.7f, 1.2f);
                    GameShaders.Armor.BindShader(ItemType <PalladiumDye>(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(1.2f, 0.5f, 0.3f);
                    GameShaders.Armor.BindShader(ItemType <MythrilDye>(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.3f, 0.8f, 0.8f);
                    GameShaders.Armor.BindShader(ItemType <OrichalcumDye>(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(1.1f, 0.3f, 1.1f);
                    GameShaders.Armor.BindShader(ItemType <AdamantiteDye>(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(1.1f, 0.4f, 0.6f);
                    GameShaders.Armor.BindShader(ItemType <TitaniumDye>(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.5f, 0.7f, 0.7f);
                    GameShaders.Armor.BindShader(ItemType <ChlorophyteDye>(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.5f, 1.1f, 0.1f);
                }
                WormholeUI = new UIWormhole();
                WormholeUI.Activate();
                MiscUserInterface = new UserInterface();
                MiscUserInterface.SetState(WormholeUI);
            }
            if (Config.SpearofJustice)
            {
                AddProjectile("MagicSpearMiniAlt", new MagicSpearMini());
            }
        }
예제 #4
0
        public override void Load()
        {
            AutofisherHooks.Initialize();
            VanillaTweaksLoaded = ModLoader.GetMod("VanillaTweaks") != null;

            if (ModContent.GetInstance <ServerConfig>().WormholeMirror)
            {
                WormholeHacks.Load();
            }

            if (!Main.dedServ)
            {
                MiscGlowMasks.Load();
                if (ModContent.GetInstance <ClientConfig>().CellPhoneResprite)
                {
                    CellPhoneTexture = Main.itemTexture[ItemID.CellPhone];
                    Main.itemTexture[ItemID.CellPhone] = GetTexture("Items/Tools/CellPhone_Resprite");
                }
                //				SkyManager.Instance["GoldensMisc:Laputa"] = new LaputaSky();

                if (ModContent.GetInstance <ServerConfig>().ExtraDyes)
                {
                    GameShaders.Armor.BindShader(ModContent.ItemType <MatrixDye>(), new ArmorShaderData(Main.PixelShaderRef, "ArmorPhase")).UseImage("Images/Misc/noise").UseColor(0f, 1.0f, 0.2f);
                    GameShaders.Armor.BindShader(ModContent.ItemType <VirtualDye>(), new ArmorShaderData(Main.PixelShaderRef, "ArmorPhase")).UseImage("Images/Misc/noise").UseColor(1f, 0.1f, 0.1f);
                    GameShaders.Armor.BindShader(ModContent.ItemType <CobaltDye>(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.4f, 0.7f, 1.2f);
                    GameShaders.Armor.BindShader(ModContent.ItemType <PalladiumDye>(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(1.2f, 0.5f, 0.3f);
                    GameShaders.Armor.BindShader(ModContent.ItemType <MythrilDye>(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.3f, 0.8f, 0.8f);
                    GameShaders.Armor.BindShader(ModContent.ItemType <OrichalcumDye>(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(1.1f, 0.3f, 1.1f);
                    GameShaders.Armor.BindShader(ModContent.ItemType <AdamantiteDye>(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(1.1f, 0.4f, 0.6f);
                    GameShaders.Armor.BindShader(ModContent.ItemType <TitaniumDye>(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.5f, 0.7f, 0.7f);
                    GameShaders.Armor.BindShader(ModContent.ItemType <ChlorophyteDye>(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.5f, 1.1f, 0.1f);
                }
            }
            if (ModContent.GetInstance <ServerConfig>().SpearofJustice)
            {
                AddProjectile("MagicSpearMiniAlt", new MagicSpearMini());
            }
        }