aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/config/MFeature.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/config/MFeature.java')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/config/MFeature.java34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/MFeature.java b/src/main/java/kr/syeyoung/dungeonsguide/config/MFeature.java
index f151b77f..25436572 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/config/MFeature.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/config/MFeature.java
@@ -34,17 +34,17 @@ public class MFeature extends MPanel {
this.add(this.label = new MLabel());
this.label.setText(abstractFeature.getName());
- if (abstractFeature instanceof GuiFeature) {
- MButton button = new MButton();
- button.setText("GUI");
- button.setOnActionPerformed(new Runnable() {
+ {
+ final MStringSelectionButton mStringSelectionButton = new MStringSelectionButton(new ArrayList<String>(Arrays.asList(new String[] {"on", "off"})), abstractFeature.isEnabled() ? "on" : "off");
+ mStringSelectionButton.setOnUpdate(new Runnable() {
@Override
public void run() {
- Minecraft.getMinecraft().displayGuiScreen(new GuiGuiLocationConfig());
+ String selected = mStringSelectionButton.getSelected();
+ feature.setEnabled("on".equals(selected));
}
});
- addons.add(button);
- add(button);
+ addons.add(mStringSelectionButton);
+ add(mStringSelectionButton);
}
if (!abstractFeature.getParameters().isEmpty()) {
MButton button = new MButton();
@@ -52,17 +52,17 @@ public class MFeature extends MPanel {
addons.add(button);
add(button);
}
- {
- final MStringSelectionButton mStringSelectionButton = new MStringSelectionButton(new ArrayList<String>(Arrays.asList(new String[] {"on", "off"})), abstractFeature.isEnabled() ? "on" : "off");
- mStringSelectionButton.setOnUpdate(new Runnable() {
+ if (abstractFeature instanceof GuiFeature) {
+ MButton button = new MButton();
+ button.setText("GUI");
+ button.setOnActionPerformed(new Runnable() {
@Override
public void run() {
- String selected = mStringSelectionButton.getSelected();
- feature.setEnabled("on".equals(selected));
+ Minecraft.getMinecraft().displayGuiScreen(new GuiGuiLocationConfig());
}
});
- addons.add(mStringSelectionButton);
- add(mStringSelectionButton);
+ addons.add(button);
+ add(button);
}
}
@@ -80,10 +80,10 @@ public class MFeature extends MPanel {
@Override
public void onBoundsUpdate() {
- int x = getBounds().width - 70;
+ int x = getBounds().width - 50;
for (MPanel panel : addons) {
- panel.setBounds(new Rectangle(x, 0, 70, getBounds().height));
- x -= 70;
+ panel.setBounds(new Rectangle(x, 3, 50, getBounds().height - 6));
+ x -= 50;
}
label.setBounds(new Rectangle(0,0,x, getBounds().height));
}