|
@@ -5,9 +5,11 @@ import me.shedaniel.Core;
|
|
|
import me.shedaniel.gui.widget.KeyBindButton;
|
|
|
import net.minecraft.client.MinecraftClient;
|
|
|
import net.minecraft.client.gui.Gui;
|
|
|
+import net.minecraft.client.gui.widget.ButtonWidget;
|
|
|
import net.minecraft.client.resource.language.I18n;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
+import java.util.Arrays;
|
|
|
|
|
|
public class ConfigGui extends Gui {
|
|
|
|
|
@@ -28,7 +30,7 @@ public class ConfigGui extends Gui {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}));
|
|
|
- addButton(new KeyBindButton(997, parent.width / 2 - 20, 60, 80, 20, Core.config.usageKeyBind, key -> {
|
|
|
+ addButton(new KeyBindButton(998, parent.width / 2 - 20, 60, 80, 20, Core.config.usageKeyBind, key -> {
|
|
|
Core.config.usageKeyBind = key;
|
|
|
ClientListener.usageKeyBind.setKey(key);
|
|
|
try {
|
|
@@ -37,7 +39,7 @@ public class ConfigGui extends Gui {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}));
|
|
|
- addButton(new KeyBindButton(997, parent.width / 2 - 20, 90, 80, 20, Core.config.hideKeyBind, key -> {
|
|
|
+ addButton(new KeyBindButton(999, parent.width / 2 - 20, 90, 80, 20, Core.config.hideKeyBind, key -> {
|
|
|
Core.config.hideKeyBind = key;
|
|
|
ClientListener.hideKeyBind.setKey(key);
|
|
|
try {
|
|
@@ -46,6 +48,29 @@ public class ConfigGui extends Gui {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}));
|
|
|
+ addButton(new ButtonWidget(1000, parent.width / 2 - 90, 120, 150, 20, "") {
|
|
|
+ @Override
|
|
|
+ public void onPressed(double double_1, double double_2) {
|
|
|
+ Core.config.centreSearchBox = !Core.config.centreSearchBox;
|
|
|
+ try {
|
|
|
+ Core.saveConfig();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void draw(int int_1, int int_2, float float_1) {
|
|
|
+ this.text = I18n.translate("text.rei.centre_searchbox", Core.config.centreSearchBox ? "§a" : "§c", Core.config.centreSearchBox);
|
|
|
+ super.draw(int_1, int_2, float_1);
|
|
|
+ if (this.hovered)
|
|
|
+ drawSuggestion(int_1, int_2);
|
|
|
+ }
|
|
|
+
|
|
|
+ protected void drawSuggestion(int x, int y) {
|
|
|
+ drawTooltip(Arrays.asList(I18n.translate("text.rei.centre_searchbox.tooltip").split("\n")), x, y);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@Override
|