mirror of
https://github.com/GTNewHorizons/MouseTweaks.git
synced 2026-11-22 12:59:57 +00:00
Co-authored-by: GitHub GTNH Actions <>
This commit is contained in:
1 parent
4f4c849c9e
commit
5e7807e775
6 files changed
+21
-19
No files matched your search
@@ -1,13 +1,13 @@
|
||||
package yalter.mousetweaks;
|
||||
|
||||
import yalter.mousetweaks.config.MTConfig;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import java.util.Properties;
|
||||
|
||||
import yalter.mousetweaks.config.MTConfig;
|
||||
|
||||
public class Config {
|
||||
|
||||
private File file;
|
||||
@@ -27,7 +27,7 @@ public class Config {
|
||||
}
|
||||
}
|
||||
|
||||
public void importOldConfig(){
|
||||
public void importOldConfig() {
|
||||
try {
|
||||
FileReader reader = new FileReader(this.file);
|
||||
Properties tempProps = new Properties();
|
||||
@@ -54,7 +54,6 @@ public class Config {
|
||||
if (tempProps.containsKey("ScrollItemScaling"))
|
||||
MTConfig.ScrollItemScaling = Integer.parseInt(tempProps.get("ScrollItemScaling").toString());
|
||||
|
||||
|
||||
file.renameTo(new File(file.getPath() + ".bak"));
|
||||
} catch (IOException ignored) {}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import yalter.mousetweaks.config.MTConfig;
|
||||
|
||||
public class Main extends DeobfuscationLayer {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package yalter.mousetweaks.config;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.config.Config;
|
||||
|
||||
import yalter.mousetweaks.Constants;
|
||||
|
||||
@Config(modid = Constants.MOD_ID)
|
||||
@@ -18,24 +19,19 @@ public class MTConfig {
|
||||
@Config.Comment("Scroll to quickly move items between inventories")
|
||||
public static boolean WheelTweak = true;
|
||||
|
||||
@Config.Comment("Wheel Inventory Slot Search Order\n" +
|
||||
"0 - First to Last\n" +
|
||||
"1 - Last To First")
|
||||
@Config.Comment("Wheel Inventory Slot Search Order\n" + "0 - First to Last\n" + "1 - Last To First")
|
||||
@Config.RangeInt(min = 0, max = 1)
|
||||
public static int WheelSearchOrder = 1;
|
||||
|
||||
@Config.Comment("Wheel Scroll Direction\n" +
|
||||
"0 - Down to Push, Up to Pull\n" +
|
||||
"1 - Up to Push, Down to Pull\n" +
|
||||
"2 - Inventory Position Aware\n" +
|
||||
"3 - Inventory Position Aware, Inverted\n"
|
||||
)
|
||||
@Config.Comment("Wheel Scroll Direction\n" + "0 - Down to Push, Up to Pull\n"
|
||||
+ "1 - Up to Push, Down to Pull\n"
|
||||
+ "2 - Inventory Position Aware\n"
|
||||
+ "3 - Inventory Position Aware, Inverted\n")
|
||||
@Config.RangeInt(min = 0, max = 3)
|
||||
public static int WheelScrollDirection = 0;
|
||||
|
||||
@Config.Comment("Scroll Scaling\n" +
|
||||
"0 - Multiple Wheel Clicks Move Multiple Items\n" +
|
||||
"1 - Always Move One Item (macOS Compatibility)")
|
||||
@Config.Comment("Scroll Scaling\n" + "0 - Multiple Wheel Clicks Move Multiple Items\n"
|
||||
+ "1 - Always Move One Item (macOS Compatibility)")
|
||||
@Config.RangeInt(min = 0, max = 1)
|
||||
public static int ScrollItemScaling = 0;
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package yalter.mousetweaks.config;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.config.ConfigException;
|
||||
import com.gtnewhorizon.gtnhlib.config.SimpleGuiConfig;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
import yalter.mousetweaks.Constants;
|
||||
|
||||
public class MTGuiConfig extends SimpleGuiConfig {
|
||||
|
||||
public MTGuiConfig(GuiScreen parent) throws ConfigException {
|
||||
super(parent, MTConfig.class, Constants.MOD_ID, Constants.MOD_NAME);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package yalter.mousetweaks.config;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.config.SimpleGuiFactory;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.config.SimpleGuiFactory;
|
||||
|
||||
public class MTGuiConfigFactory implements SimpleGuiFactory {
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiScreen> mainConfigGuiClass() {
|
||||
return MTGuiConfig.class;
|
||||
|
||||
@@ -2,6 +2,7 @@ package yalter.mousetweaks.loaders;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.config.ConfigException;
|
||||
import com.gtnewhorizon.gtnhlib.config.ConfigurationManager;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
@@ -27,7 +28,7 @@ public class MouseTweaksForge {
|
||||
if (event.getSide().isClient()) {
|
||||
try {
|
||||
Config oldConfig = new Config(event.getSuggestedConfigurationFile());
|
||||
if (oldConfig.hasOldConfig()){
|
||||
if (oldConfig.hasOldConfig()) {
|
||||
oldConfig.importOldConfig();
|
||||
}
|
||||
ConfigurationManager.registerConfig(MTConfig.class);
|
||||
|
||||
Reference in new issue
Block a user