aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-02-06 14:43:37 +0900
committersyeyoung <cyong06@naver.com>2021-02-06 14:43:37 +0900
commite7d6517b2e1fb4aa7a5993e53739006a3fca39c8 (patch)
treeab097980bcd8809c2bcfa55b832367fd44f38036 /src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig
parent5f51b33a4f19454072c92638e040647d4a3f6f38 (diff)
downloadSkyblock-Dungeons-Guide-e7d6517b2e1fb4aa7a5993e53739006a3fca39c8.tar.gz
Skyblock-Dungeons-Guide-e7d6517b2e1fb4aa7a5993e53739006a3fca39c8.tar.bz2
Skyblock-Dungeons-Guide-e7d6517b2e1fb4aa7a5993e53739006a3fca39c8.zip
THE period to gui overhaul
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MParameter.java68
1 files changed, 49 insertions, 19 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MParameter.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MParameter.java
index 72cbf4b9..6906f615 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MParameter.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MParameter.java
@@ -1,8 +1,11 @@
package kr.syeyoung.dungeonsguide.config.guiconfig;
+import kr.syeyoung.dungeonsguide.config.types.AColor;
import kr.syeyoung.dungeonsguide.features.AbstractFeature;
import kr.syeyoung.dungeonsguide.features.FeatureParameter;
import kr.syeyoung.dungeonsguide.gui.MPanel;
+import kr.syeyoung.dungeonsguide.gui.elements.MEditableAColor;
+import kr.syeyoung.dungeonsguide.gui.elements.MToggleButton;
import kr.syeyoung.dungeonsguide.roomedit.Parameter;
import kr.syeyoung.dungeonsguide.gui.elements.MButton;
import kr.syeyoung.dungeonsguide.gui.elements.MLabel;
@@ -40,25 +43,52 @@ public class MParameter extends MPanel {
this.label.setText(parameter.getName());
{
- MButton button = new MButton();
- button.setText("Edit");
- button.setOnActionPerformed(new Runnable() {
- @Override
- public void run() {
- final GuiParameterValueEdit guiParameterValueEdit = new GuiParameterValueEdit(parameter.getValue(), config2);
- guiParameterValueEdit.setOnUpdate(new Runnable() {
- @Override
- public void run() {
- Parameter parameter1 = guiParameterValueEdit.getParameter();
- parameter.setValue(parameter1.getNewData());
- label2.setText(parameter.getValue().toString());
- }
- });
- Minecraft.getMinecraft().displayGuiScreen(guiParameterValueEdit);
- }
- });
- addons.add(button);
- add(button);
+ if (parameter.getValue_type().equalsIgnoreCase("boolean")) {
+ final MToggleButton button = new MToggleButton();
+ button.setOnToggle(new Runnable() {
+ @Override
+ public void run() {
+ parameter.setValue(button.isEnabled());
+ label2.setText(parameter.getValue().toString());
+ }
+ });
+ button.setEnabled((Boolean) parameter.getValue());
+ addons.add(button);
+ add(button);
+ } else if (parameter.getValue_type().equalsIgnoreCase("acolor")) {
+ final MEditableAColor button = new MEditableAColor();
+ button.setEnableEdit(true);
+ button.setOnUpdate(new Runnable() {
+ @Override
+ public void run() {
+ parameter.setValue(button.getColor());
+ label2.setText(parameter.getValue().toString());
+ }
+ });
+ button.setColor((AColor) parameter.getValue());
+ addons.add(button);
+ add(button);
+ } else {
+ MButton button = new MButton();
+ button.setText("Edit");
+ button.setOnActionPerformed(new Runnable() {
+ @Override
+ public void run() {
+ final GuiParameterValueEdit guiParameterValueEdit = new GuiParameterValueEdit(parameter.getValue(), config2);
+ guiParameterValueEdit.setOnUpdate(new Runnable() {
+ @Override
+ public void run() {
+ Parameter parameter1 = guiParameterValueEdit.getParameter();
+ parameter.setValue(parameter1.getNewData());
+ label2.setText(parameter.getValue().toString());
+ }
+ });
+ Minecraft.getMinecraft().displayGuiScreen(guiParameterValueEdit);
+ }
+ });
+ addons.add(button);
+ add(button);
+ }
}
{
MLabel button = new MLabel();