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 | |
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')
8 files changed, 25 insertions, 6 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java index 9aeac9e8..37acd018 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java @@ -3,12 +3,14 @@ package kr.syeyoung.dungeonsguide.dungeon.actions; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonMechanic; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import lombok.Data; +import lombok.EqualsAndHashCode; import java.util.HashSet; import java.util.Set; @Data public class ActionChangeState implements Action{ + @EqualsAndHashCode.Exclude private Set<Action> preRequisite2 = new HashSet<Action>(); private String mechanicName; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionClick.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionClick.java index b3a4cc92..8c745385 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionClick.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionClick.java @@ -5,6 +5,7 @@ import com.google.common.base.Predicates; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraft.item.ItemStack; import java.util.HashSet; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionClickSet.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionClickSet.java index 595e66c7..0aea2d97 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionClickSet.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionClickSet.java @@ -5,6 +5,7 @@ import com.google.common.base.Predicates; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraft.item.ItemStack; import java.util.HashSet; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionDropItem.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionDropItem.java index 151fe96c..80a39564 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionDropItem.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionDropItem.java @@ -5,6 +5,7 @@ import com.google.common.base.Predicates; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraft.item.ItemStack; import java.util.HashSet; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionKill.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionKill.java index e1eba8b7..ff26fe20 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionKill.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionKill.java @@ -1,9 +1,11 @@ package kr.syeyoung.dungeonsguide.dungeon.actions; import com.google.common.base.Predicate; +import com.google.common.base.Predicates; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import lombok.Data; +import lombok.EqualsAndHashCode; import net.minecraft.entity.Entity; import java.util.HashSet; @@ -13,7 +15,7 @@ import java.util.Set; public class ActionKill implements Action { private Set<Action> preRequisite = new HashSet<Action>(); private OffsetPoint target; - private Predicate<Entity> predicate; + private Predicate<Entity> predicate = Predicates.alwaysFalse(); private int radius; public ActionKill(OffsetPoint target) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionTree.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionTree.java index 334f7c2b..009924cf 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionTree.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionTree.java @@ -35,6 +35,10 @@ public class ActionTree { tree.setChildren(set); return tree; } + public static ActionTree buildActionTree(Action actions, DungeonRoom dungeonRoom) { + return buildActionTree(null, actions, dungeonRoom, new HashMap<Action, ActionTree>()); + } + private static ActionTree buildActionTree(ActionTree parent, Action action, DungeonRoom dungeonRoom, Map<Action, ActionTree> alreadyBuilt) { 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; + } } |