From 917ca305d875924863cfcae7f1cb8d805a98122d Mon Sep 17 00:00:00 2001 From: syeyoung <42869671+cyoung06@users.noreply.github.com> Date: Tue, 15 Dec 2020 16:56:06 +0900 Subject: this works fantasticallyas --- .../dungeonsguide/roomedit/panes/ActionDisplayPane.java | 8 ++++---- .../dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java | 10 +++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomedit') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionDisplayPane.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionDisplayPane.java index 974e46b5..22b7fc2a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionDisplayPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionDisplayPane.java @@ -1,6 +1,7 @@ package kr.syeyoung.dungeonsguide.roomedit.panes; import kr.syeyoung.dungeonsguide.dungeon.actions.Action; +import kr.syeyoung.dungeonsguide.dungeon.actions.ActionChangeState; import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionTree; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonMechanic; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; @@ -12,6 +13,7 @@ import kr.syeyoung.dungeonsguide.roomprocessor.ProcessorFactory; import java.awt.*; import java.util.ArrayList; +import java.util.Collections; import java.util.Set; public class ActionDisplayPane extends MPanel { @@ -42,10 +44,8 @@ public class ActionDisplayPane extends MPanel { String text = textField.getText(); String target = text.split(":")[0]; String state = text.split(":")[1]; - - DungeonMechanic mechanic = dungeonRoom.getDungeonRoomInfo().getMechanics().get(target); - Set actionSet = mechanic.getAction(state, dungeonRoom); - ActionTree tree= ActionTree.buildActionTree(actionSet, dungeonRoom); + ActionChangeState actionChangeState = new ActionChangeState(target, state); + ActionTree tree= ActionTree.buildActionTree(actionChangeState, dungeonRoom); displayPane = new ActionTreeDisplayPane(dungeonRoom, tree); displayPane.setBounds(new Rectangle(0,25,bounds.width,bounds.height-25)); 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 e19af8d8..21d0fd9f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java @@ -27,6 +27,8 @@ public class ActionTreeDisplayPane extends MPanel { private int offsetX = 0; private int offsetY = 0; + private float scale; + private DungeonRoom dungeonRoom; private ActionTree tree; public ActionTreeDisplayPane(DungeonRoom dungeonRoom, ActionTree tree) { @@ -42,7 +44,7 @@ public class ActionTreeDisplayPane extends MPanel { GL11.glPushMatrix(); GL11.glTranslated(offsetX, offsetY, 0); - GL11.glScaled(0.5,0.5,1); + GL11.glScaled(scale,scale,1); renderTree(tree, 5, 5, Minecraft.getMinecraft().fontRendererObj, null, new HashMap()); GL11.glPopMatrix(); } @@ -152,4 +154,10 @@ public class ActionTreeDisplayPane extends MPanel { lastX = absMouseX; lastY = absMouseY; } + + @Override + public void mouseScrolled0(int absMouseX, int absMouseY, int relMouseX0, int relMouseY0, int scrollAmount) { + if (scrollAmount > 0) scale += 0.1; + if (scrollAmount < 0) scale -= 0.1; + } } -- cgit