aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/roomedit
diff options
context:
space:
mode:
authorsyeyoung <42869671+cyoung06@users.noreply.github.com>2020-12-15 01:23:36 +0900
committersyeyoung <42869671+cyoung06@users.noreply.github.com>2020-12-15 01:23:36 +0900
commitc4448fea149d2638f126813deba6406a7a15d67d (patch)
tree7701c48f47dc95644acfae4756596b6b9a089dff /src/main/java/kr/syeyoung/dungeonsguide/roomedit
parent496efb764360cd26fa40982532048aa18ae4c6be (diff)
downloadSkyblock-Dungeons-Guide-c4448fea149d2638f126813deba6406a7a15d67d.tar.gz
Skyblock-Dungeons-Guide-c4448fea149d2638f126813deba6406a7a15d67d.tar.bz2
Skyblock-Dungeons-Guide-c4448fea149d2638f126813deba6406a7a15d67d.zip
predicate equals and more edits
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomedit')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditDoor.java28
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditLever.java2
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditOnewayLever.java2
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditPressurePlate.java2
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java54
5 files changed, 63 insertions, 25 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditDoor.java
index d916f15f..9f641a63 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditDoor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditDoor.java
@@ -29,7 +29,9 @@ public class ValueEditDoor extends MPanel implements ValueEdit<DungeonDoor> {
private MLabel label;
private MValue<OffsetPointSet> value;
private MTextField preRequisite;
- private MLabelAndElement preRequisite2;
+ private MLabelAndElement preRequisite_par;
+ private MTextField preRequisite2;
+ private MLabelAndElement preRequisite2_par;
private MButton updateOnlyAir;
public ValueEditDoor(final Parameter parameter2) {
@@ -67,13 +69,24 @@ public class ValueEditDoor extends MPanel implements ValueEdit<DungeonDoor> {
preRequisite = new MTextField() {
@Override
public void edit(String str) {
- dungeonDoor.setPreRequisite(Arrays.asList(str.split(",")));
+ dungeonDoor.setOpenPreRequisite(Arrays.asList(str.split(",")));
}
};
- preRequisite.setText(TextUtils.join(dungeonDoor.getPreRequisite(), ","));
- preRequisite2 = new MLabelAndElement("Req.",preRequisite);
- preRequisite2.setBounds(new Rectangle(0,60,bounds.width,20));
- add(preRequisite2);
+ preRequisite.setText(TextUtils.join(dungeonDoor.getOpenPreRequisite(), ","));
+ preRequisite_par = new MLabelAndElement("Open Req.",preRequisite);
+ preRequisite_par.setBounds(new Rectangle(0,60,bounds.width,20));
+ add(preRequisite_par);
+
+ preRequisite2 = new MTextField() {
+ @Override
+ public void edit(String str) {
+ dungeonDoor.setClosePreRequisite(Arrays.asList(str.split(",")));
+ }
+ };
+ preRequisite2.setText(TextUtils.join(dungeonDoor.getClosePreRequisite(), ","));
+ preRequisite2_par = new MLabelAndElement("Close Req.",preRequisite2);
+ preRequisite2_par.setBounds(new Rectangle(0,80,bounds.width,20));
+ add(preRequisite2_par);
}
@Override
@@ -81,7 +94,8 @@ public class ValueEditDoor extends MPanel implements ValueEdit<DungeonDoor> {
label.setBounds(new Rectangle(0,0,bounds.width, 20));
value.setBounds(new Rectangle(0,20,bounds.width, 20));
updateOnlyAir.setBounds(new Rectangle(0,40,bounds.width, 20));
- preRequisite2.setBounds(new Rectangle(0,60,bounds.width,20));
+ preRequisite_par.setBounds(new Rectangle(0,60,bounds.width,20));
+ preRequisite2_par.setBounds(new Rectangle(0,80,bounds.width,20));
}
@Override
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditLever.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditLever.java
index 7bc41e1f..1d18fcb2 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditLever.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditLever.java
@@ -62,7 +62,7 @@ public class ValueEditLever extends MPanel implements ValueEdit<DungeonLever> {
}
};
target.setText(dungeonLever.getTriggering());
- target2 = new MLabelAndElement("Req.",target);
+ target2 = new MLabelAndElement("Target",target);
target2.setBounds(new Rectangle(0,60,bounds.width,20));
add(target2);
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditOnewayLever.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditOnewayLever.java
index 90edcb63..be88158e 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditOnewayLever.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditOnewayLever.java
@@ -65,7 +65,7 @@ public class ValueEditOnewayLever extends MPanel implements ValueEdit<DungeonOne
}
};
target.setText(dungeonLever.getTriggering());
- target2 = new MLabelAndElement("Req.",target);
+ target2 = new MLabelAndElement("Target",target);
target2.setBounds(new Rectangle(0,60,bounds.width,20));
add(target2);
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditPressurePlate.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditPressurePlate.java
index 80e05b05..56d09c7a 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditPressurePlate.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditPressurePlate.java
@@ -65,7 +65,7 @@ public class ValueEditPressurePlate extends MPanel implements ValueEdit<DungeonP
}
};
target.setText(dungeonPressureplate.getTriggering());
- target2 = new MLabelAndElement("Req.",target);
+ target2 = new MLabelAndElement("Target",target);
target2.setBounds(new Rectangle(0,60,bounds.width,20));
add(target2);
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java
index 20c5242d..e19af8d8 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java
@@ -41,7 +41,8 @@ public class ActionTreeDisplayPane extends MPanel {
FontRenderer fr = Minecraft.getMinecraft().fontRendererObj;
GL11.glPushMatrix();
- GL11.glTranslated(-offsetX, -offsetY, 0);
+ GL11.glTranslated(offsetX, offsetY, 0);
+ GL11.glScaled(0.5,0.5,1);
renderTree(tree, 5, 5, Minecraft.getMinecraft().fontRendererObj, null, new HashMap<ActionTree, Point>());
GL11.glPopMatrix();
}
@@ -53,12 +54,23 @@ public class ActionTreeDisplayPane extends MPanel {
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
- WorldRenderer renderer = Tessellator.getInstance().getWorldRenderer();
- GlStateManager.color(255,0,0, 255);
- renderer.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
- renderer.pos(pt.x, pt.y, 0).endVertex();
- renderer.pos(drawLineFrom.x, drawLineFrom.y, 0).endVertex();
- Tessellator.getInstance().draw();
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_LINE_SMOOTH);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ GL11.glBlendFunc(770, 771);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glLineWidth(1);
+ GL11.glColor4f(1, 0, 0, 1);
+ GL11.glBegin(2);
+ GL11.glVertex2d(drawLineFrom.x, drawLineFrom.y);
+ GL11.glVertex2d(pt.x, pt.y);
+ GL11.glEnd();
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ GL11.glDisable(GL11.GL_LINE_SMOOTH);
+ GL11.glDisable(GL11.GL_BLEND);
GlStateManager.popMatrix();
GlStateManager.popAttrib();
return 0;
@@ -68,12 +80,24 @@ public class ActionTreeDisplayPane extends MPanel {
if (drawLineFrom != null) {
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
- WorldRenderer renderer = Tessellator.getInstance().getWorldRenderer();
- GlStateManager.color(255,255,255, 255);
- renderer.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
- renderer.pos(x + dim.width, y, 0).endVertex();
- renderer.pos(drawLineFrom.x, drawLineFrom.y, 0).endVertex();
- Tessellator.getInstance().draw();
+
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_LINE_SMOOTH);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ GL11.glBlendFunc(770, 771);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glLineWidth(1);
+ GL11.glColor4f(1, 1, 1, 1);
+ GL11.glBegin(2);
+ GL11.glVertex2d(drawLineFrom.x, drawLineFrom.y);
+ GL11.glVertex2d(x + dim.width / 2, y);
+ GL11.glEnd();
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ GL11.glDisable(GL11.GL_LINE_SMOOTH);
+ GL11.glDisable(GL11.GL_BLEND);
GlStateManager.popMatrix();
GlStateManager.popAttrib();
}
@@ -84,7 +108,7 @@ public class ActionTreeDisplayPane extends MPanel {
for (ActionTree tree:actionTree.getChildren()) {
xOff += renderTree(tree, x + xOff, y + dim.height + 10, fr, pt, drawmPoints) + 10;
}
- return xOff;
+ return Math.max(xOff, dim.width);
}
public Dimension renderAction(Action action, int x, int y, FontRenderer fr) {
@@ -99,7 +123,7 @@ public class ActionTreeDisplayPane extends MPanel {
Gui.drawRect(x,y,x + maxWidth +10, y + height + 10, 0xff000000);
Gui.drawRect(x+1,y+1,x + maxWidth +8, y + height + 8, 0xff4d4d4d);
for (int i = 0; i < lines.length; i++) {
- fr.drawString(lines[i], 5, 5 + i*(fr.FONT_HEIGHT + offset), 0xffffffff);
+ fr.drawString(lines[i], x + 5, y + 5 + i*(fr.FONT_HEIGHT + offset), 0xffffffff);
}
return new Dimension(maxWidth + 10, height + 10);