Skip to content

Commit

Permalink
Disabled Animations, Started Connection rewrite, finished Flow Packets
Browse files Browse the repository at this point in the history
  • Loading branch information
hilburn committed May 25, 2015
1 parent 20a157e commit ea8a913
Show file tree
Hide file tree
Showing 13 changed files with 886 additions and 844 deletions.
1,058 changes: 529 additions & 529 deletions src/main/java/advancedsystemsmanager/animation/AnimationController.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public interface IGuiElement<Gui extends GuiScreen>
{
@SideOnly(Side.CLIENT)
public abstract void draw(Gui gui, int mouseX, int mouseY, int zLevel);
void draw(Gui gui, int mouseX, int mouseY, int zLevel);

@SideOnly(Side.CLIENT)
void drawMouseOver(Gui gui, int mouseX, int mouseY);
Expand Down
26 changes: 15 additions & 11 deletions src/main/java/advancedsystemsmanager/flow/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class Connection
{
Expand All @@ -22,7 +21,7 @@ public class Connection
public int componentId;
public int connectionId;
public List<Point> nodes;
public Point selectedNode;
public int selected = -1;

public Connection(int componentId, int connectionId)
{
Expand Down Expand Up @@ -63,20 +62,21 @@ public Connection copy()

public void addAndSelectNode(int mX, int mY, int id)
{
nodes.add(id, selectedNode = new Point(mX, mY));
nodes.add(selected = id, new Point(mX, mY));
}

@SideOnly(Side.CLIENT)
public void update(int mX, int mY)
{
if (selectedNode != null)
if (selected != -1)
{
selectedNode.setX(mX);
selectedNode.setY(mY);
Point selected = getSelectedNode();
selected.setX(mX);
selected.setY(mY);

if (GuiScreen.isShiftKeyDown())
{
selectedNode.adjustToGrid(10);
selected.adjustToGrid(10);
}
}
}
Expand All @@ -94,15 +94,19 @@ public List<Point> getNodes()
return nodes;
}


public Point getSelectedNode()
{
return selectedNode;
return selected == -1? null : nodes.get(selected);
}

public int getSelected()
{
return selected;
}

public void setSelectedNode(Point selectedNode)
public void setSelected(int selected)
{
this.selectedNode = selectedNode;
this.selected = selected;
}

public void writeToNBT(NBTTagCompound tagCompound, int index)
Expand Down
Loading

0 comments on commit ea8a913

Please sign in to comment.