diff --git a/src/main/java/electroblob/wizardry/Settings.java b/src/main/java/electroblob/wizardry/Settings.java index dd7efcec..bd36babc 100644 --- a/src/main/java/electroblob/wizardry/Settings.java +++ b/src/main/java/electroblob/wizardry/Settings.java @@ -300,6 +300,10 @@ public final class Settings { public boolean booksPauseGame = true; /** [Client-only] Whether to use custom shaders for certain spells. */ public boolean useShaders = true; + /** [Client-only] Whether to use the screen shake effect for certain spells. */ + public boolean screenShake = true; + /** [Client-only] Whether to use the screen blink effect for teleportation spells. */ + public boolean blinkEffect = true; /** [Client-only] The position of the spell HUD. */ public GuiPosition spellHUDPosition = GuiPosition.BOTTOM_LEFT; @@ -878,6 +882,18 @@ public final class Settings { useShaders = property.getBoolean(); propOrder.add(property.getName()); + property = config.get(CLIENT_CATEGORY, "screenShake", true, "Whether to use the screen shake effect for certain spells."); + property.setLanguageKey("config." + Wizardry.MODID + ".screen_shake"); + Wizardry.proxy.setToNamedBooleanEntry(property); + screenShake = property.getBoolean(); + propOrder.add(property.getName()); + + property = config.get(CLIENT_CATEGORY, "blinkEffect", true, "Whether to use the screen blink effect for teleportation spells."); + property.setLanguageKey("config." + Wizardry.MODID + ".blink_effect"); + Wizardry.proxy.setToNamedBooleanEntry(property); + blinkEffect = property.getBoolean(); + propOrder.add(property.getName()); + config.setCategoryPropertyOrder(CLIENT_CATEGORY, propOrder); } diff --git a/src/main/java/electroblob/wizardry/client/WizardryClientEventHandler.java b/src/main/java/electroblob/wizardry/client/WizardryClientEventHandler.java index 4a5586da..5084198a 100644 --- a/src/main/java/electroblob/wizardry/client/WizardryClientEventHandler.java +++ b/src/main/java/electroblob/wizardry/client/WizardryClientEventHandler.java @@ -75,13 +75,15 @@ public final class WizardryClientEventHandler { /** Starts the first-person blink overlay effect. */ public static void playBlinkEffect(){ - blinkEffectTimer = BLINK_EFFECT_DURATION; + if(Wizardry.settings.blinkEffect) blinkEffectTimer = BLINK_EFFECT_DURATION; } /** Starts the client-side screen shake effect. */ public static void shakeScreen(float intensity){ - screenShakeCounter = (int)(intensity / SHAKINESS); - Minecraft.getMinecraft().player.rotationPitch -= intensity * 0.5f; // Start halfway down + if(Wizardry.settings.screenShake){ + screenShakeCounter = (int)(intensity / SHAKINESS); + Minecraft.getMinecraft().player.rotationPitch -= intensity * 0.5f; // Start halfway down + } } @SubscribeEvent @@ -89,12 +91,20 @@ public final class WizardryClientEventHandler { if(event.player == Minecraft.getMinecraft().player && event.phase == TickEvent.Phase.END){ - if(blinkEffectTimer > 0) blinkEffectTimer--; + if(Wizardry.settings.blinkEffect){ + if(blinkEffectTimer > 0) blinkEffectTimer--; + }else{ + blinkEffectTimer = 0; + } - if(screenShakeCounter > 0){ - float magnitude = screenShakeCounter * SHAKINESS; - Minecraft.getMinecraft().player.rotationPitch += screenShakeCounter % 2 == 0 ? magnitude : -magnitude; - screenShakeCounter--; + if(Wizardry.settings.screenShake){ + if(screenShakeCounter > 0){ + float magnitude = screenShakeCounter * SHAKINESS; + Minecraft.getMinecraft().player.rotationPitch += screenShakeCounter % 2 == 0 ? magnitude : -magnitude; + screenShakeCounter--; + } + }else{ + screenShakeCounter = 0; } // Only seems to work here... diff --git a/src/main/resources/assets/ebwizardry/lang/en_gb.lang b/src/main/resources/assets/ebwizardry/lang/en_gb.lang index 06f02985..983a92aa 100644 --- a/src/main/resources/assets/ebwizardry/lang/en_gb.lang +++ b/src/main/resources/assets/ebwizardry/lang/en_gb.lang @@ -1234,6 +1234,10 @@ config.ebwizardry.use_shaders=Use Custom Shaders config.ebwizardry.use_shaders.tooltip=Whether to use custom shaders for certain spells. These use the vanilla shader system (like mob spectating shaders) and shouldn't have much of an effect on performance in most cases, but they may conflict with other shaders. config.ebwizardry.use_shaders.true=Yes - gimme those sweet shaders! config.ebwizardry.use_shaders.false=No - I'm running this on a potato +config.ebwizardry.screen_shake=Screen Shake +config.ebwizardry.screen_shake.tooltip=Whether to use the screen shake effect for certain spells. +config.ebwizardry.blink_effect=Blink Effect +config.ebwizardry.blink_effect.tooltip=Whether to use the screen blink effect for teleportation spells. config.ebwizardry.category.commands=Command Settings config.ebwizardry.category.commands.tooltip=Configure wizardry's commands diff --git a/src/main/resources/assets/ebwizardry/lang/en_us.lang b/src/main/resources/assets/ebwizardry/lang/en_us.lang index 906ed57e..5b0800f7 100644 --- a/src/main/resources/assets/ebwizardry/lang/en_us.lang +++ b/src/main/resources/assets/ebwizardry/lang/en_us.lang @@ -1234,6 +1234,10 @@ config.ebwizardry.use_shaders=Use Custom Shaders config.ebwizardry.use_shaders.tooltip=Whether to use custom shaders for certain spells. These use the vanilla shader system (like mob spectating shaders) and shouldn't have much of an effect on performance in most cases, but they may conflict with other shaders. config.ebwizardry.use_shaders.true=Yes - gimme those sweet shaders! config.ebwizardry.use_shaders.false=No - I'm running this on a potato +config.ebwizardry.screen_shake=Screen Shake +config.ebwizardry.screen_shake.tooltip=Whether to use the screen shake effect for certain spells. +config.ebwizardry.blink_effect=Blink Effect +config.ebwizardry.blink_effect.tooltip=Whether to use the screen blink effect for teleportation spells. config.ebwizardry.category.commands=Command Settings config.ebwizardry.category.commands.tooltip=Configure wizardry's commands