diff --git a/Config.cs b/Config.cs index 75e2cb7..d3af9b2 100644 --- a/Config.cs +++ b/Config.cs @@ -115,12 +115,12 @@ public static void Load() else GoldensMisc.Log("Old config folder still cotains some files/directories. They will not get deleted."); } + SetDefaults(); if(!ReadConfig()) { - SetDefaults(); - GoldensMisc.Log("Failed to read config file! Creating config..."); - SaveConfig(); + GoldensMisc.Log("Failed to read config file!"); } + SaveConfig(); } public static void SetDefaults() @@ -153,7 +153,7 @@ public static void SetDefaults() MechanicsRodOften = true; ChestVacuum = true; } - + public static bool ReadConfig() { if(Configuration.Load()) diff --git a/GoldensMisc.cs b/GoldensMisc.cs index 7f0a91a..7e09b0f 100644 --- a/GoldensMisc.cs +++ b/GoldensMisc.cs @@ -48,12 +48,12 @@ public override void Load() Instance = this; //apparently you get some problems with Mod Reloading if you put this in the constructor FKtModSettingsLoaded = ModLoader.GetMod("FKTModSettings") != null; VanillaTweaksLoaded = ModLoader.GetMod("VanillaTweaks") != null; - + if(!Main.dedServ) { if(FKtModSettingsLoaded) Config.LoadFKConfig(); - + MiscGlowMasks.Load(); if(Config.CellPhoneResprite) { @@ -62,34 +62,40 @@ public override void Load() } // SkyManager.Instance["GoldensMisc:Laputa"] = new LaputaSky(); - GameShaders.Armor.BindShader(ItemType(), new ArmorShaderData(Main.PixelShaderRef, "ArmorPhase")).UseImage("Images/Misc/noise").UseColor(0f, 1.0f, 0.2f); - GameShaders.Armor.BindShader(ItemType(), new ArmorShaderData(Main.PixelShaderRef, "ArmorPhase")).UseImage("Images/Misc/noise").UseColor(1f, 0.1f, 0.1f); - GameShaders.Armor.BindShader(ItemType(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.4f, 0.7f, 1.2f); - GameShaders.Armor.BindShader(ItemType(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(1.2f, 0.5f, 0.3f); - GameShaders.Armor.BindShader(ItemType(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.3f, 0.8f, 0.8f); - GameShaders.Armor.BindShader(ItemType(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(1.1f, 0.3f, 1.1f); - GameShaders.Armor.BindShader(ItemType(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(1.1f, 0.4f, 0.6f); - GameShaders.Armor.BindShader(ItemType(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.5f, 0.7f, 0.7f); - GameShaders.Armor.BindShader(ItemType(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.5f, 1.1f, 0.1f); - + if(Config.ExtraDyes) + { + GameShaders.Armor.BindShader(ItemType(), new ArmorShaderData(Main.PixelShaderRef, "ArmorPhase")).UseImage("Images/Misc/noise").UseColor(0f, 1.0f, 0.2f); + GameShaders.Armor.BindShader(ItemType(), new ArmorShaderData(Main.PixelShaderRef, "ArmorPhase")).UseImage("Images/Misc/noise").UseColor(1f, 0.1f, 0.1f); + GameShaders.Armor.BindShader(ItemType(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.4f, 0.7f, 1.2f); + GameShaders.Armor.BindShader(ItemType(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(1.2f, 0.5f, 0.3f); + GameShaders.Armor.BindShader(ItemType(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.3f, 0.8f, 0.8f); + GameShaders.Armor.BindShader(ItemType(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(1.1f, 0.3f, 1.1f); + GameShaders.Armor.BindShader(ItemType(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(1.1f, 0.4f, 0.6f); + GameShaders.Armor.BindShader(ItemType(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.5f, 0.7f, 0.7f); + GameShaders.Armor.BindShader(ItemType(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.5f, 1.1f, 0.1f); + } WormholeUI = new UIWormhole(); WormholeUI.Activate(); MiscUserInterface = new UserInterface(); MiscUserInterface.SetState(WormholeUI); } - AddProjectile("MagicSpearMiniAlt", new MagicSpearMini()); + if(Config.SpearofJustice) + { + AddProjectile("MagicSpearMiniAlt", new MagicSpearMini()); + } } public override void PostSetupContent() { var hotkeysMod = ModLoader.GetMod("HelpfulHotkeys"); - if(hotkeysMod != null) + if(hotkeysMod != null && Config.WormholeMirror) { hotkeysMod.Call("RegisterRecallItem", ItemType()); hotkeysMod.Call("RegisterRecallItem", ItemType()); hotkeysMod.Call("RegisterRecallItem", ItemType()); } - GetTile().SetDefaultsPostContent(); + if(Config.ChestVacuum) + GetTile().SetDefaultsPostContent(); } public override void Unload() @@ -124,7 +130,7 @@ public override void PreSaveAndQuit() { if(FKtModSettingsLoaded && !Main.dedServ) Config.SaveConfig(); - + UIWormhole.Close(); } diff --git a/Projectiles/AutofisherBobber.cs b/Projectiles/AutofisherBobber.cs index 9b6a837..9a53372 100644 --- a/Projectiles/AutofisherBobber.cs +++ b/Projectiles/AutofisherBobber.cs @@ -21,6 +21,11 @@ public override string Texture get { return "Terraria/Projectile_" + ProjectileID.BobberMechanics; } } + public override bool Autoload(ref string name) + { + return Config.Autofisher; + } + public override void SetDefaults() { projectile.width = 14; diff --git a/Projectiles/GasterBlaster.cs b/Projectiles/GasterBlaster.cs index 399d788..d40fb35 100644 --- a/Projectiles/GasterBlaster.cs +++ b/Projectiles/GasterBlaster.cs @@ -39,7 +39,12 @@ int SoundCounter set { projectile.localAI[0] = value; } } bool FirstSpawn = true; - + + public override bool Autoload(ref string name) + { + return Config.GasterBlaster; + } + public override void SetStaticDefaults() { Main.projFrames[projectile.type] = 2; diff --git a/Projectiles/GasterLaser.cs b/Projectiles/GasterLaser.cs index e2f30b0..f801a14 100644 --- a/Projectiles/GasterLaser.cs +++ b/Projectiles/GasterLaser.cs @@ -20,7 +20,12 @@ float BeamLength set { projectile.ai[0] = value; } } Vector2 endPoint; - + + public override bool Autoload(ref string name) + { + return Config.GasterBlaster; + } + public override void SetDefaults() { projectile.netImportant = true; diff --git a/Projectiles/MagicSpear.cs b/Projectiles/MagicSpear.cs index c959614..9bd6f6e 100644 --- a/Projectiles/MagicSpear.cs +++ b/Projectiles/MagicSpear.cs @@ -9,7 +9,12 @@ namespace GoldensMisc.Projectiles { public class MagicSpear : ModProjectile - { + { + public override bool Autoload(ref string name) + { + return Config.SpearofJustice; + } + public override void SetDefaults() { projectile.scale = 1.3f; diff --git a/Projectiles/MagicSpearMini.cs b/Projectiles/MagicSpearMini.cs index 632f0c4..72e3f9f 100644 --- a/Projectiles/MagicSpearMini.cs +++ b/Projectiles/MagicSpearMini.cs @@ -21,7 +21,12 @@ bool undying get { return projectile.ai[0] > 0; } set { projectile.ai[0] = value ? 1 : 0; } } - + + public override bool Autoload(ref string name) + { + return Config.SpearofJustice; + } + public override void SetDefaults() { projectile.width = 14; diff --git a/Projectiles/OrbofLight.cs b/Projectiles/OrbofLight.cs index 4840727..606c2ea 100644 --- a/Projectiles/OrbofLight.cs +++ b/Projectiles/OrbofLight.cs @@ -10,6 +10,11 @@ namespace GoldensMisc.Projectiles { public class OrbofLight : ModProjectile { + public override bool Autoload(ref string name) + { + return Config.AncientOrb; + } + public override void SetStaticDefaults() { Main.projFrames[projectile.type] = 1; diff --git a/Projectiles/RedBullet.cs b/Projectiles/RedBullet.cs index 9a46616..44068be 100644 --- a/Projectiles/RedBullet.cs +++ b/Projectiles/RedBullet.cs @@ -16,7 +16,12 @@ int DustDelay get { return (int)projectile.localAI[0]; } set { projectile.localAI[0] = value; } } - + + public override bool Autoload(ref string name) + { + return Config.DemonCrown; + } + public override string Texture { get diff --git a/Projectiles/RedCrystal.cs b/Projectiles/RedCrystal.cs index 1dfbd39..318f5c3 100644 --- a/Projectiles/RedCrystal.cs +++ b/Projectiles/RedCrystal.cs @@ -29,7 +29,12 @@ int DustDelay } const float TargetDist = 450f; - + + public override bool Autoload(ref string name) + { + return Config.DemonCrown; + } + public override void SetStaticDefaults() { Main.projFrames[projectile.type] = 2; diff --git a/Projectiles/UndyingSpear.cs b/Projectiles/UndyingSpear.cs index 51546cb..a30bc01 100644 --- a/Projectiles/UndyingSpear.cs +++ b/Projectiles/UndyingSpear.cs @@ -10,7 +10,12 @@ namespace GoldensMisc.Projectiles { public class UndyingSpear : ModProjectile - { + { + public override bool Autoload(ref string name) + { + return Config.SpearofJustice; + } + public override void SetDefaults() { projectile.scale = 1.3f; diff --git a/Tiles/AutofisherTE.cs b/Tiles/AutofisherTE.cs index 2dc75f0..5daea8b 100644 --- a/Tiles/AutofisherTE.cs +++ b/Tiles/AutofisherTE.cs @@ -16,6 +16,11 @@ public class AutofisherTE : ModTileEntity int bobberProj = -1; int FishingCooldown = 300; + public override bool Autoload(ref string name) + { + return Config.Autofisher; + } + public override bool ValidTile(int i, int j) { var tile = Main.tile[i, j]; diff --git a/Tiles/ChestVacuumTE.cs b/Tiles/ChestVacuumTE.cs index 8fa9119..fac7489 100644 --- a/Tiles/ChestVacuumTE.cs +++ b/Tiles/ChestVacuumTE.cs @@ -18,6 +18,11 @@ public class ChestVacuumTE : ModTileEntity public bool SmartStack = false; const float PickupRadiusSq = 160f * 160f; + public override bool Autoload(ref string name) + { + return Config.ChestVacuum; + } + public override bool ValidTile(int i, int j) { var tile = Main.tile[i, j];