forked from Upstream/mmocore
Renaming for skill tree GUI.
This commit is contained in:
parent
ad6b7fa0ff
commit
5fdfc36fcc
@ -338,10 +338,10 @@ public class SkillTreeViewer extends EditableInventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Icon getIcon(IntegerCoordinates coordinates) {
|
public Icon getIcon(IntegerCoordinates coordinates) {
|
||||||
boolean hasNorthPath = skillTree.isPath(new IntegerCoordinates(coordinates.getX(), coordinates.getY() - 1));
|
boolean hasUpPath = skillTree.isPath(new IntegerCoordinates(coordinates.getX(), coordinates.getY() - 1));
|
||||||
boolean hasSouthPath = skillTree.isPath(new IntegerCoordinates(coordinates.getX(), coordinates.getY() + 1));
|
boolean hasDownPath = skillTree.isPath(new IntegerCoordinates(coordinates.getX(), coordinates.getY() + 1));
|
||||||
boolean hasEastPath = skillTree.isPath(new IntegerCoordinates(coordinates.getX() + 1, coordinates.getY()));
|
boolean hasRightPath = skillTree.isPath(new IntegerCoordinates(coordinates.getX() + 1, coordinates.getY()));
|
||||||
boolean hasWestPath = skillTree.isPath(new IntegerCoordinates(coordinates.getX() - 1, coordinates.getY()));
|
boolean hasLeftPath = skillTree.isPath(new IntegerCoordinates(coordinates.getX() - 1, coordinates.getY()));
|
||||||
|
|
||||||
if (skillTree.isNode(coordinates)) {
|
if (skillTree.isNode(coordinates)) {
|
||||||
SkillTreeNode node = skillTree.getNode(coordinates);
|
SkillTreeNode node = skillTree.getNode(coordinates);
|
||||||
@ -349,10 +349,10 @@ public class SkillTreeViewer extends EditableInventory {
|
|||||||
if(node.getItem()!=null)
|
if(node.getItem()!=null)
|
||||||
return new Icon(node.getItem(),node.getCustomModelData());
|
return new Icon(node.getItem(),node.getCustomModelData());
|
||||||
|
|
||||||
NodeType nodeType = NodeType.getNodeType(hasNorthPath, hasEastPath, hasSouthPath, hasWestPath);
|
NodeType nodeType = NodeType.getNodeType(hasUpPath, hasRightPath, hasDownPath, hasLeftPath);
|
||||||
return icons.get(new NodeDisplayInfo(nodeType, playerData.getNodeState(node)));
|
return icons.get(new NodeDisplayInfo(nodeType, playerData.getNodeState(node)));
|
||||||
} else {
|
} else {
|
||||||
PathType pathType = PathType.getPathType(hasNorthPath, hasEastPath, hasSouthPath, hasWestPath);
|
PathType pathType = PathType.getPathType(hasUpPath, hasRightPath, hasDownPath, hasLeftPath);
|
||||||
SkillTreePath path = skillTree.getPath(coordinates);
|
SkillTreePath path = skillTree.getPath(coordinates);
|
||||||
return icons.get(new PathDisplayInfo(pathType, path.getStatus(playerData)));
|
return icons.get(new PathDisplayInfo(pathType, path.getStatus(playerData)));
|
||||||
}
|
}
|
||||||
|
@ -1,42 +1,42 @@
|
|||||||
package net.Indyuce.mmocore.gui.skilltree.display;
|
package net.Indyuce.mmocore.gui.skilltree.display;
|
||||||
|
|
||||||
public enum NodeType {
|
public enum NodeType {
|
||||||
NORTH_EAST_SOUTH_WEST,
|
UP_RIGHT_DOWN_LEFT,
|
||||||
NORTH_EAST_SOUTH,
|
UP_RIGHT_DOWN,
|
||||||
NORTH_EAST_WEST,
|
UP_RIGHT_LEFT,
|
||||||
NORTH_SOUTH_WEST,
|
UP_DOWN_LEFT,
|
||||||
SOUTH_EAST_WEST,
|
DOWN_RIGHT_LEFT,
|
||||||
NORTH_EAST,
|
UP_RIGHT,
|
||||||
NORTH_SOUTH,
|
UP_DOWN,
|
||||||
NORTH_WEST,
|
UP_LEFT,
|
||||||
SOUTH_EAST,
|
DOWN_RIGHT,
|
||||||
SOUTH_WEST,
|
DOWN_LEFT,
|
||||||
EAST_WEST,
|
RIGHT_LEFT,
|
||||||
NO_PATH;
|
NO_PATH;
|
||||||
|
|
||||||
public static NodeType getNodeType(boolean hasNorthPath, boolean hasEastPath, boolean hasSouthPath, boolean hasWestPath) {
|
public static NodeType getNodeType(boolean hasUpPath, boolean hasRightPath, boolean hasDownPath, boolean hasLeftPath) {
|
||||||
if (hasNorthPath && hasEastPath && hasSouthPath && hasWestPath) {
|
if (hasUpPath && hasRightPath && hasDownPath && hasLeftPath) {
|
||||||
return NORTH_EAST_SOUTH_WEST;
|
return UP_RIGHT_DOWN_LEFT;
|
||||||
} else if (hasNorthPath && hasEastPath && hasSouthPath) {
|
} else if (hasUpPath && hasRightPath && hasDownPath) {
|
||||||
return NORTH_EAST_SOUTH;
|
return UP_RIGHT_DOWN;
|
||||||
} else if (hasNorthPath && hasEastPath && hasWestPath) {
|
} else if (hasUpPath && hasRightPath && hasLeftPath) {
|
||||||
return NORTH_EAST_WEST;
|
return UP_RIGHT_LEFT;
|
||||||
} else if (hasNorthPath && hasSouthPath && hasWestPath) {
|
} else if (hasUpPath && hasDownPath && hasLeftPath) {
|
||||||
return NORTH_SOUTH_WEST;
|
return UP_DOWN_LEFT;
|
||||||
} else if (hasSouthPath && hasEastPath && hasWestPath) {
|
} else if (hasDownPath && hasRightPath && hasLeftPath) {
|
||||||
return SOUTH_EAST_WEST;
|
return DOWN_RIGHT_LEFT;
|
||||||
} else if (hasNorthPath && hasEastPath) {
|
} else if (hasUpPath && hasRightPath) {
|
||||||
return NORTH_EAST;
|
return UP_RIGHT;
|
||||||
} else if (hasNorthPath && hasSouthPath) {
|
} else if (hasUpPath && hasDownPath) {
|
||||||
return NORTH_SOUTH;
|
return UP_DOWN;
|
||||||
} else if (hasNorthPath && hasWestPath) {
|
} else if (hasUpPath && hasLeftPath) {
|
||||||
return NORTH_WEST;
|
return UP_LEFT;
|
||||||
} else if (hasSouthPath && hasEastPath) {
|
} else if (hasDownPath && hasRightPath) {
|
||||||
return SOUTH_EAST;
|
return DOWN_RIGHT;
|
||||||
} else if (hasSouthPath && hasWestPath) {
|
} else if (hasDownPath && hasLeftPath) {
|
||||||
return SOUTH_WEST;
|
return DOWN_LEFT;
|
||||||
} else if (hasEastPath && hasWestPath) {
|
} else if (hasRightPath && hasLeftPath) {
|
||||||
return EAST_WEST;
|
return RIGHT_LEFT;
|
||||||
}
|
}
|
||||||
return NO_PATH;
|
return NO_PATH;
|
||||||
}
|
}
|
||||||
|
@ -5,34 +5,34 @@ package net.Indyuce.mmocore.gui.skilltree.display;
|
|||||||
*/
|
*/
|
||||||
public enum PathType {
|
public enum PathType {
|
||||||
|
|
||||||
NORTH,
|
UP,
|
||||||
/**
|
/**
|
||||||
* Goes to north then east/ goes to west then south.
|
* Goes to up then east/ goes to left then down.
|
||||||
*/
|
*/
|
||||||
NORTH_EAST,
|
UP_RIGHT,
|
||||||
NORTH_WEST,
|
UP_LEFT,
|
||||||
SOUTH_EAST,
|
DOWN_RIGHT,
|
||||||
SOUTH_WEST,
|
DOWN_LEFT,
|
||||||
EAST,
|
RIGHT,
|
||||||
|
|
||||||
DEFAULT;
|
DEFAULT;
|
||||||
|
|
||||||
public static PathType getPathType(boolean hasNorth,boolean hasEast,boolean hasSouth,boolean hasWest) {
|
public static PathType getPathType(boolean hasUp,boolean hasRight,boolean hasDown,boolean hasLeft) {
|
||||||
if ((hasNorth || hasSouth) && !hasWest && hasEast) {
|
if ((hasUp || hasDown) && !hasLeft && hasRight) {
|
||||||
return NORTH;
|
return UP;
|
||||||
} else if ((hasEast || hasWest)&& !hasNorth && !hasSouth) {
|
} else if ((hasRight || hasLeft)&& !hasUp && !hasDown) {
|
||||||
return EAST;
|
return RIGHT;
|
||||||
} else if (hasNorth && hasEast) {
|
} else if (hasUp && hasRight) {
|
||||||
return NORTH_EAST;
|
return UP_RIGHT;
|
||||||
}
|
}
|
||||||
else if (hasNorth && hasWest) {
|
else if (hasUp && hasLeft) {
|
||||||
return NORTH_WEST;
|
return UP_LEFT;
|
||||||
}
|
}
|
||||||
else if (hasSouth && hasEast) {
|
else if (hasDown && hasRight) {
|
||||||
return SOUTH_EAST;
|
return DOWN_RIGHT;
|
||||||
}
|
}
|
||||||
else if (hasSouth && hasWest) {
|
else if (hasDown && hasLeft) {
|
||||||
return SOUTH_WEST;
|
return DOWN_LEFT;
|
||||||
}
|
}
|
||||||
return DEFAULT;
|
return DEFAULT;
|
||||||
}
|
}
|
||||||
|
@ -102,66 +102,66 @@ items:
|
|||||||
display:
|
display:
|
||||||
paths:
|
paths:
|
||||||
unlocked:
|
unlocked:
|
||||||
north:
|
up:
|
||||||
item: "WHITE_DYE"
|
item: "WHITE_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-east:
|
up-right:
|
||||||
item: "WHITE_DYE"
|
item: "WHITE_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-west:
|
up-left:
|
||||||
item: "WHITE_DYE"
|
item: "WHITE_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-east:
|
down-right:
|
||||||
item: "WHITE_DYE"
|
item: "WHITE_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-west:
|
down-left:
|
||||||
item: "WHITE_DYE"
|
item: "WHITE_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
east:
|
right:
|
||||||
item: "WHITE_DYE"
|
item: "WHITE_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
default:
|
default:
|
||||||
item: "WHITE_DYE"
|
item: "WHITE_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
locked:
|
locked:
|
||||||
north:
|
up:
|
||||||
item: "GRAY_DYE"
|
item: "GRAY_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-east:
|
up-right:
|
||||||
item: "GRAY_DYE"
|
item: "GRAY_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-west:
|
up-left:
|
||||||
item: "GRAY_DYE"
|
item: "GRAY_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-east:
|
down-right:
|
||||||
item: "GRAY_DYE"
|
item: "GRAY_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-west:
|
down-left:
|
||||||
item: "GRAY_DYE"
|
item: "GRAY_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
east:
|
right:
|
||||||
item: "GRAY_DYE"
|
item: "GRAY_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
default:
|
default:
|
||||||
item: "GRAY_DYE"
|
item: "GRAY_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
fully-locked:
|
fully-locked:
|
||||||
north:
|
up:
|
||||||
item: "BLACK_DYE"
|
item: "BLACK_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-east:
|
up-right:
|
||||||
item: "BLACK_DYE"
|
item: "BLACK_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-west:
|
up-left:
|
||||||
item: "BLACK_DYE"
|
item: "BLACK_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-east:
|
down-right:
|
||||||
item: "BLACK_DYE"
|
item: "BLACK_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-west:
|
down-left:
|
||||||
item: "BLACK_DYE"
|
item: "BLACK_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
east:
|
right:
|
||||||
item: "BLACK_DYE"
|
item: "BLACK_DYE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
default:
|
default:
|
||||||
@ -169,148 +169,148 @@ display:
|
|||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
nodes:
|
nodes:
|
||||||
unlocked:
|
unlocked:
|
||||||
north-east-south-west:
|
up-right-down-left:
|
||||||
item: "WHITE_CONCRETE"
|
item: "WHITE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-east-south:
|
up-right-down:
|
||||||
item: "WHITE_CONCRETE"
|
item: "WHITE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-east-west:
|
up-right-left:
|
||||||
item: "WHITE_CONCRETE"
|
item: "WHITE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-south-west:
|
up-down-left:
|
||||||
item: "WHITE_CONCRETE"
|
item: "WHITE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-east-west:
|
down-right-left:
|
||||||
item: "WHITE_CONCRETE"
|
item: "WHITE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-east:
|
up-right:
|
||||||
item: "WHITE_CONCRETE"
|
item: "WHITE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-south:
|
up-down:
|
||||||
item: "WHITE_CONCRETE"
|
item: "WHITE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-west:
|
up-left:
|
||||||
item: "WHITE_CONCRETE"
|
item: "WHITE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-east:
|
down-right:
|
||||||
item: "WHITE_CONCRETE"
|
item: "WHITE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-west:
|
down-left:
|
||||||
item: "WHITE_CONCRETE"
|
item: "WHITE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
east-west:
|
right-left:
|
||||||
item: "WHITE_CONCRETE"
|
item: "WHITE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
no-path:
|
no-path:
|
||||||
item: "WHITE_CONCRETE"
|
item: "WHITE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
locked:
|
locked:
|
||||||
north-east-south-west:
|
up-right-down-left:
|
||||||
item: "GRAY_CONCRETE"
|
item: "GRAY_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-east-south:
|
up-right-down:
|
||||||
item: "GRAY_CONCRETE"
|
item: "GRAY_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-east-west:
|
up-right-left:
|
||||||
item: "GRAY_CONCRETE"
|
item: "GRAY_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-south-west:
|
up-down-left:
|
||||||
item: "GRAY_CONCRETE"
|
item: "GRAY_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-east-west:
|
down-right-left:
|
||||||
item: "GRAY_CONCRETE"
|
item: "GRAY_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-east:
|
up-right:
|
||||||
item: "GRAY_CONCRETE"
|
item: "GRAY_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-south:
|
up-down:
|
||||||
item: "GRAY_CONCRETE"
|
item: "GRAY_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-west:
|
up-left:
|
||||||
item: "GRAY_CONCRETE"
|
item: "GRAY_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-east:
|
down-right:
|
||||||
item: "GRAY_CONCRETE"
|
item: "GRAY_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-west:
|
down-left:
|
||||||
item: "GRAY_CONCRETE"
|
item: "GRAY_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
east-west:
|
right-left:
|
||||||
item: "GRAY_CONCRETE"
|
item: "GRAY_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
no-path:
|
no-path:
|
||||||
item: "GRAY_CONCRETE"
|
item: "GRAY_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
unlockable:
|
unlockable:
|
||||||
north-east-south-west:
|
up-right-down-left:
|
||||||
item: "BLUE_CONCRETE"
|
item: "BLUE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-east-south:
|
up-right-down:
|
||||||
item: "BLUE_CONCRETE"
|
item: "BLUE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-east-west:
|
up-right-left:
|
||||||
item: "BLUE_CONCRETE"
|
item: "BLUE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-south-west:
|
up-down-left:
|
||||||
item: "BLUE_CONCRETE"
|
item: "BLUE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-east-west:
|
down-right-left:
|
||||||
item: "BLUE_CONCRETE"
|
item: "BLUE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-east:
|
up-right:
|
||||||
item: "BLUE_CONCRETE"
|
item: "BLUE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-south:
|
up-down:
|
||||||
item: "BLUE_CONCRETE"
|
item: "BLUE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-west:
|
up-left:
|
||||||
item: "BLUE_CONCRETE"
|
item: "BLUE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-east:
|
down-right:
|
||||||
item: "BLUE_CONCRETE"
|
item: "BLUE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-west:
|
down-left:
|
||||||
item: "BLUE_CONCRETE"
|
item: "BLUE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
east-west:
|
right-left:
|
||||||
item: "BLUE_CONCRETE"
|
item: "BLUE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
no-path:
|
no-path:
|
||||||
item: "BLUE_CONCRETE"
|
item: "BLUE_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
fully-locked:
|
fully-locked:
|
||||||
north-east-south-west:
|
up-right-down-left:
|
||||||
item: "BLACK_CONCRETE"
|
item: "BLACK_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-east-south:
|
up-right-down:
|
||||||
item: "BLACK_CONCRETE"
|
item: "BLACK_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-east-west:
|
up-right-left:
|
||||||
item: "BLACK_CONCRETE"
|
item: "BLACK_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-south-west:
|
up-down-left:
|
||||||
item: "BLACK_CONCRETE"
|
item: "BLACK_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-east-west:
|
down-right-left:
|
||||||
item: "BLACK_CONCRETE"
|
item: "BLACK_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-east:
|
up-right:
|
||||||
item: "BLACK_CONCRETE"
|
item: "BLACK_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-south:
|
up-down:
|
||||||
item: "BLACK_CONCRETE"
|
item: "BLACK_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
north-west:
|
up-left:
|
||||||
item: "BLACK_CONCRETE"
|
item: "BLACK_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-east:
|
down-right:
|
||||||
item: "BLACK_CONCRETE"
|
item: "BLACK_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
south-west:
|
down-left:
|
||||||
item: "BLACK_CONCRETE"
|
item: "BLACK_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
east-west:
|
right-left:
|
||||||
item: "BLACK_CONCRETE"
|
item: "BLACK_CONCRETE"
|
||||||
custom-model-data: 0
|
custom-model-data: 0
|
||||||
no-path:
|
no-path:
|
||||||
|
Loading…
Reference in New Issue
Block a user