Merge remote-tracking branch 'origin/development' into development
This commit is contained in:
@@ -53,6 +53,7 @@ public class BoardHandler {
|
|||||||
// Flags and lists for handling piece selection and movement
|
// Flags and lists for handling piece selection and movement
|
||||||
private List<PieceControl> selectableOwnPieces;
|
private List<PieceControl> selectableOwnPieces;
|
||||||
private List<PieceControl> selectableEnemyPieces;
|
private List<PieceControl> selectableEnemyPieces;
|
||||||
|
private Map<PieceControl, NodeControl> selectedPieceNodeMap;
|
||||||
private List<NodeControl> outlineNodes;
|
private List<NodeControl> outlineNodes;
|
||||||
private PieceControl selectedOwnPiece;
|
private PieceControl selectedOwnPiece;
|
||||||
private PieceControl selectedEnemyPiece;
|
private PieceControl selectedEnemyPiece;
|
||||||
@@ -87,6 +88,7 @@ public void init() {
|
|||||||
isInitialised = true;
|
isInitialised = true;
|
||||||
selectableOwnPieces = new ArrayList<>();
|
selectableOwnPieces = new ArrayList<>();
|
||||||
selectableEnemyPieces = new ArrayList<>();
|
selectableEnemyPieces = new ArrayList<>();
|
||||||
|
selectedPieceNodeMap = new HashMap<>();
|
||||||
outlineNodes = new ArrayList<>();
|
outlineNodes = new ArrayList<>();
|
||||||
selectedOwnPiece = null;
|
selectedOwnPiece = null;
|
||||||
selectedEnemyPiece = null;
|
selectedEnemyPiece = null;
|
||||||
@@ -603,6 +605,7 @@ public void outlineMove(List<UUID> pieces, List<Integer> moveIndexe, List<Boolea
|
|||||||
pieceControl.setSelectable(true);
|
pieceControl.setSelectable(true);
|
||||||
outlineNodes.add(nodeControl);
|
outlineNodes.add(nodeControl);
|
||||||
selectableOwnPieces.add(pieceControl);
|
selectableOwnPieces.add(pieceControl);
|
||||||
|
selectedPieceNodeMap.put(pieceControl, nodeControl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -668,6 +671,7 @@ public void pieceSelect(PieceControl pieceSelected) {
|
|||||||
}
|
}
|
||||||
if (!isSelected) {
|
if (!isSelected) {
|
||||||
pieceSelected.select();
|
pieceSelected.select();
|
||||||
|
selectedPieceNodeMap.get(pieceSelected).select();
|
||||||
selectedOwnPiece = pieceSelected;
|
selectedOwnPiece = pieceSelected;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ public class NodeControl extends OutlineControl {
|
|||||||
|
|
||||||
private static final ColorRGBA OUTLINE_HIGHLIGHT_COLOR = ColorRGBA.White;
|
private static final ColorRGBA OUTLINE_HIGHLIGHT_COLOR = ColorRGBA.White;
|
||||||
private static final int OUTLINE_HIGHLIGHT_WIDTH = 6;
|
private static final int OUTLINE_HIGHLIGHT_WIDTH = 6;
|
||||||
|
private static final ColorRGBA OUTLINE_SELECT_COLOR = ColorRGBA.Cyan;
|
||||||
|
private static final int OUTLINE_SELECT_WIDTH = 6;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a {@link NodeControl} with the specified application and post processor.
|
* Constructs a {@link NodeControl} with the specified application and post processor.
|
||||||
@@ -45,4 +47,8 @@ public Vector3f getLocation(){
|
|||||||
public void highlight() {
|
public void highlight() {
|
||||||
super.outline(OUTLINE_HIGHLIGHT_COLOR, OUTLINE_HIGHLIGHT_WIDTH);
|
super.outline(OUTLINE_HIGHLIGHT_COLOR, OUTLINE_HIGHLIGHT_WIDTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void select() {
|
||||||
|
super.outline(OUTLINE_SELECT_COLOR, OUTLINE_SELECT_WIDTH);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user