diff --git a/src/main/java/electroblob/wizardry/Settings.java b/src/main/java/electroblob/wizardry/Settings.java index 3994f11b..f6c9bb54 100644 --- a/src/main/java/electroblob/wizardry/Settings.java +++ b/src/main/java/electroblob/wizardry/Settings.java @@ -158,6 +158,8 @@ public final class Settings { * while sneaking. */ public boolean enableShiftScrolling = true; + /** [Client-only] Whether to reverse the spell switching scroll direction.*/ + public boolean reverseScrollDirection = false; // Display /** [Client-only] Whether to show summoned creatures' names and owners above their heads. */ @@ -459,6 +461,12 @@ public final class Settings { property.setRequiresWorldRestart(false); enableShiftScrolling = property.getBoolean(); propOrder.add(property.getName()); + + property = config.get(CLIENT_CATEGORY, "reverseScrollDirection", true, "Whether to reverse the scroll direction used to switch between spells on a wand while sneaking."); + property.setLanguageKey("config." + Wizardry.MODID + ".reverse_scroll_direction"); + property.setRequiresWorldRestart(false); + reverseScrollDirection = property.getBoolean(); + propOrder.add(property.getName()); property = config.get(CLIENT_CATEGORY, "spellHUDPosition", GuiPosition.BOTTOM_LEFT.name, "The position of the spell HUD.", GuiPosition.names); property.setLanguageKey("config." + Wizardry.MODID + ".spell_hud_position"); diff --git a/src/main/java/electroblob/wizardry/client/WizardryControlHandler.java b/src/main/java/electroblob/wizardry/client/WizardryControlHandler.java index 8e4fea67..ce212de8 100644 --- a/src/main/java/electroblob/wizardry/client/WizardryControlHandler.java +++ b/src/main/java/electroblob/wizardry/client/WizardryControlHandler.java @@ -101,10 +101,12 @@ public class WizardryControlHandler { && Wizardry.settings.enableShiftScrolling){ event.setCanceled(true); + + int d = Wizardry.settings.reverseScrollDirection ? -event.getDwheel() : event.getDwheel(); - if(event.getDwheel() > 0){ + if(d > 0){ selectNextSpell(wand); - }else if(event.getDwheel() < 0){ + }else if(d < 0){ selectPreviousSpell(wand); } } diff --git a/src/main/resources/assets/ebwizardry/lang/en_gb.lang b/src/main/resources/assets/ebwizardry/lang/en_gb.lang index 79eb401e..79604949 100644 --- a/src/main/resources/assets/ebwizardry/lang/en_gb.lang +++ b/src/main/resources/assets/ebwizardry/lang/en_gb.lang @@ -703,6 +703,7 @@ config.ebwizardry.friendly_fire=Friendly Fire config.ebwizardry.telekinetic_disarmament=Telekinetic Disarmament config.ebwizardry.discovery_mode=Discovery Mode config.ebwizardry.enable_shift_scrolling=Enable Shift-scrolling +config.ebwizardry.reverse_scroll_direction=Reverse Scroll Direction config.ebwizardry.minion_revenge_targeting=Minion Revenge Targeting config.ebwizardry.player_damage_scaling=Player Damage Scaling Factor config.ebwizardry.npc_damage_scaling=NPC Damage Scaling Factor @@ -740,6 +741,7 @@ config.ebwizardry.friendly_fire.tooltip=Whether to allow players to damage their config.ebwizardry.telekinetic_disarmament.tooltip=Whether to allow players to disarm other players using the telekinesis spell. Set to false to prevent stealing of items. config.ebwizardry.discovery_mode.tooltip=For those who like a sense of mystery! When set to true, spells you haven't cast yet will be unreadable until you cast them (on a per-world basis). Has no effect when in creative mode. Spells of identification will be unobtainable in survival mode if this is false. config.ebwizardry.enable_shift_scrolling.tooltip=Whether you can switch between spells on a wand by scrolling with the mouse wheel while sneaking. Note that this will only affect you; other players connected to the same server obey their own settings. +config.ebwizardry.reverse_scroll_direction.tooltip=Whether to reverse the scroll direction used to switch between spells on a wand while sneaking. config.ebwizardry.minion_revenge_targeting.tooltip=Whether summoned creatures can revenge attack their owner if their owner attacks them. config.ebwizardry.player_damage_scaling.tooltip=Global damage scaling factor for the damage dealt by players casting spells, relative to 1. config.ebwizardry.npc_damage_scaling.tooltip=Global damage scaling factor for the damage dealt by NPCs casting spells, relative to 1. diff --git a/src/main/resources/assets/ebwizardry/lang/en_us.lang b/src/main/resources/assets/ebwizardry/lang/en_us.lang index 449313b5..f8d7de57 100644 --- a/src/main/resources/assets/ebwizardry/lang/en_us.lang +++ b/src/main/resources/assets/ebwizardry/lang/en_us.lang @@ -703,6 +703,7 @@ config.ebwizardry.friendly_fire=Friendly Fire config.ebwizardry.telekinetic_disarmament=Telekinetic Disarmament config.ebwizardry.discovery_mode=Discovery Mode config.ebwizardry.enable_shift_scrolling=Enable Shift-scrolling +config.ebwizardry.reverse_scroll_direction=Reverse Scroll Direction config.ebwizardry.minion_revenge_targeting=Minion Revenge Targeting config.ebwizardry.player_damage_scaling=Player Damage Scaling Factor config.ebwizardry.npc_damage_scaling=NPC Damage Scaling Factor @@ -739,7 +740,7 @@ config.ebwizardry.show_summoned_creature_names.tooltip=Whether to show summoned config.ebwizardry.friendly_fire.tooltip=Whether to allow players to damage their designated allies using magic. config.ebwizardry.telekinetic_disarmament.tooltip=Whether to allow players to disarm other players using the telekinesis spell. Set to false to prevent stealing of items. config.ebwizardry.discovery_mode.tooltip=For those who like a sense of mystery! When set to true, spells you haven't cast yet will be unreadable until you cast them (on a per-world basis). Has no effect when in creative mode. Spells of identification will be unobtainable in survival mode if this is false. -config.ebwizardry.enable_shift_scrolling.tooltip=Whether you can switch between spells on a wand by scrolling with the mouse wheel while sneaking. Note that this will only affect you; other players connected to the same server obey their own settings. +config.ebwizardry.enable_shift_scrolling.tooltip=Whether you can switch between spells on a wand by scrolling with the mouse wheel while sneaking. Note that this will only affect you; other players connected to the same server obey their own settings.config.ebwizardry.reverse_scroll_direction.tooltip=Whether to reverse the scroll direction used to switch between spells on a wand while sneaking. config.ebwizardry.minion_revenge_targeting.tooltip=Whether summoned creatures can revenge attack their owner if their owner attacks them. config.ebwizardry.player_damage_scaling.tooltip=Global damage scaling factor for the damage dealt by players casting spells, relative to 1. config.ebwizardry.npc_damage_scaling.tooltip=Global damage scaling factor for the damage dealt by NPCs casting spells, relative to 1.