diff options
author | syeyoung <42869671+cyoung06@users.noreply.github.com> | 2020-12-15 16:56:06 +0900 |
---|---|---|
committer | syeyoung <42869671+cyoung06@users.noreply.github.com> | 2020-12-15 16:56:06 +0900 |
commit | 917ca305d875924863cfcae7f1cb8d805a98122d (patch) | |
tree | d58a14f0344b332e2a207e3a25b45847a018aae3 /src/main/java/kr/syeyoung/dungeonsguide/roomedit | |
parent | 5009cd40af60e0519609ef1656483ba14b60eef1 (diff) | |
download | Skyblock-Dungeons-Guide-917ca305d875924863cfcae7f1cb8d805a98122d.tar.gz Skyblock-Dungeons-Guide-917ca305d875924863cfcae7f1cb8d805a98122d.tar.bz2 Skyblock-Dungeons-Guide-917ca305d875924863cfcae7f1cb8d805a98122d.zip |
this works fantasticallyas
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomedit')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionDisplayPane.java | 8 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java | 10 |
2 files changed, 13 insertions, 5 deletions
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<Action> 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<ActionTree, Point>()); 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; + } } |