aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/gui/widget/ConfigWidget.java
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-02-03 17:02:55 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-02-03 17:02:55 +0800
commit0b0c9163782337b91f70c4bbb529f76e760b073e (patch)
treec267eebdc56c97cb6b6b0198f984e37bbe5798e3 /src/main/java/me/shedaniel/rei/gui/widget/ConfigWidget.java
parente9c090e47a1cf0e65ecaf123f06cd1272d42bc72 (diff)
downloadRoughlyEnoughItems-2.2.0.48.tar.gz
RoughlyEnoughItems-2.2.0.48.tar.bz2
RoughlyEnoughItems-2.2.0.48.zip
Version Checker + Mirror REI + Fix Bugsv2.2.0.48
Fix #26 Close #21
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/widget/ConfigWidget.java')
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/ConfigWidget.java44
1 files changed, 43 insertions, 1 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/ConfigWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/ConfigWidget.java
index d1391d978..8637afd8a 100644
--- a/src/main/java/me/shedaniel/rei/gui/widget/ConfigWidget.java
+++ b/src/main/java/me/shedaniel/rei/gui/widget/ConfigWidget.java
@@ -54,7 +54,7 @@ public class ConfigWidget extends Screen {
@Override
public void draw(int mouseX, int mouseY, float partialTicks) {
text = getTrueFalseText(RoughlyEnoughItemsCore.getConfigHelper().sideSearchField());
- String t = I18n.translate("text.rei.centre_searchbox");
+ String t = I18n.translate("text.rei.side_searchbox");
int width = fontRenderer.getStringWidth(t);
fontRenderer.drawWithShadow(t, this.x - width - 10, this.y + (this.height - 8) / 2, -1);
super.draw(mouseX, mouseY, partialTicks);
@@ -106,6 +106,48 @@ public class ConfigWidget extends Screen {
super.draw(int_1, int_2, float_1);
}
});
+ widgets.add(new ButtonWidget(window.getScaledWidth() / 2 - 20, 120, 40, 20, "") {
+ @Override
+ public void onPressed(int button, double mouseX, double mouseY) {
+ if (button == 0)
+ RoughlyEnoughItemsCore.getConfigHelper().setMirrorItemPanel(!RoughlyEnoughItemsCore.getConfigHelper().isMirrorItemPanel());
+ try {
+ RoughlyEnoughItemsCore.getConfigHelper().saveConfig();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void draw(int mouseX, int mouseY, float partialTicks) {
+ text = getTrueFalseText(RoughlyEnoughItemsCore.getConfigHelper().isMirrorItemPanel());
+ String t = I18n.translate("text.rei.mirror_rei");
+ int width = fontRenderer.getStringWidth(t);
+ fontRenderer.drawWithShadow(t, this.x - width - 10, this.y + (this.height - 8) / 2, -1);
+ super.draw(mouseX, mouseY, partialTicks);
+ }
+ });
+ widgets.add(new ButtonWidget(window.getScaledWidth() / 2 - 20, 150, 40, 20, "") {
+ @Override
+ public void onPressed(int button, double mouseX, double mouseY) {
+ if (button == 0)
+ RoughlyEnoughItemsCore.getConfigHelper().setCheckUpdates(!RoughlyEnoughItemsCore.getConfigHelper().checkUpdates());
+ try {
+ RoughlyEnoughItemsCore.getConfigHelper().saveConfig();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void draw(int mouseX, int mouseY, float partialTicks) {
+ text = getTrueFalseText(RoughlyEnoughItemsCore.getConfigHelper().checkUpdates());
+ String t = I18n.translate("text.rei.check_updates");
+ int width = fontRenderer.getStringWidth(t);
+ fontRenderer.drawWithShadow(t, this.x - width - 10, this.y + (this.height - 8) / 2, -1);
+ super.draw(mouseX, mouseY, partialTicks);
+ }
+ });
}
private String getTrueFalseText(boolean showCraftableOnlyButton) {