@@ -302,7 +302,6 @@ protected Decal newObject () {
302
302
private boolean showLights = false ;
303
303
private boolean lightsDirty = true ;
304
304
305
- private Entity hoveredEntity = null ;
306
305
private boolean movingEntity = false ;
307
306
private DragMode dragMode = DragMode .NONE ;
308
307
private MoveMode moveMode = MoveMode .DRAG ;
@@ -491,11 +490,11 @@ public void render() {
491
490
renderer .clearLights ();
492
491
renderer .clearDecals ();
493
492
494
- if (!ui .isShowingMenuOrModal () && pickedControlPoint == null && hoveredEntity == null && Editor .selection .picked == null ) {
493
+ if (!ui .isShowingMenuOrModal () && pickedControlPoint == null && Editor . selection . hovered == null && Editor .selection .picked == null ) {
495
494
updatePickedSurface ();
496
495
}
497
496
498
- if ((!Gdx .input .isButtonPressed (Buttons .LEFT ) || ui .isShowingMenuOrModal ()) && pickedControlPoint == null && hoveredEntity == null && Editor .selection .picked == null ) {
497
+ if ((!Gdx .input .isButtonPressed (Buttons .LEFT ) || ui .isShowingMenuOrModal ()) && pickedControlPoint == null && Editor . selection . hovered == null && Editor .selection .picked == null ) {
499
498
renderPickedSurface ();
500
499
}
501
500
@@ -604,7 +603,7 @@ public void draw() {
604
603
else if (Editor .selection .isSelected (e )) {
605
604
e .editorState = EditorState .picked ;
606
605
}
607
- else if (e == hoveredEntity ) {
606
+ else if (e == Editor . selection . hovered ) {
608
607
e .editorState = EditorState .hovered ;
609
608
}
610
609
else {
@@ -621,7 +620,7 @@ else if(e == hoveredEntity) {
621
620
if (e == Editor .selection .picked ) {
622
621
e .editorState = EditorState .picked ;
623
622
}
624
- else if (e == hoveredEntity ) {
623
+ else if (e == Editor . selection . hovered ) {
625
624
e .editorState = EditorState .hovered ;
626
625
}
627
626
else {
@@ -708,7 +707,7 @@ else if(e == hoveredEntity) {
708
707
shouldDrawBox = false ;
709
708
}
710
709
711
- if (Editor .selection .picked == null && hoveredEntity == null || tileDragging ) {
710
+ if (Editor .selection .picked == null && Editor . selection . hovered == null || tileDragging ) {
712
711
if (!selected || (!(pickedControlPoint != null || movingControlPoint ) &&
713
712
editorInput .isButtonPressed (Input .Buttons .LEFT ) && Gdx .input .justTouched ())) {
714
713
@@ -1389,7 +1388,7 @@ else if(dragMode == DragMode.Y) {
1389
1388
}
1390
1389
}
1391
1390
1392
- if (Editor .selection .picked != null && ((hoveredEntity == null || Editor .selection .isSelected (hoveredEntity )) || hoveredEntity == Editor .selection .picked || movingEntity )) {
1391
+ if (Editor .selection .picked != null && ((Editor . selection . hovered == null || Editor .selection .isSelected (Editor . selection . hovered )) || Editor . selection . hovered == Editor .selection .picked || movingEntity )) {
1393
1392
Gdx .gl .glEnable (GL20 .GL_DEPTH_TEST );
1394
1393
Gdx .gl .glEnable (GL20 .GL_ALPHA );
1395
1394
Gdx .gl .glEnable (GL20 .GL_BLEND );
@@ -1527,7 +1526,7 @@ private void GlPickEntity() {
1527
1526
int b = (int )(pickedPixelBufferColor .b * 255 );
1528
1527
int index = (r & 0xff ) << 16 | (g & 0xff ) << 8 | (b & 0xff );
1529
1528
1530
- hoveredEntity = renderer .entitiesForPicking .get (index );
1529
+ Editor . selection . hovered = renderer .entitiesForPicking .get (index );
1531
1530
//Gdx.app.log("Picking", pickedPixelBufferColor.toString());
1532
1531
}
1533
1532
catch (Exception ex ) {
@@ -2090,7 +2089,7 @@ public void tick() {
2090
2089
2091
2090
if (Gdx .input .isKeyJustPressed (Keys .TAB )) {
2092
2091
Editor .selection .picked = null ;
2093
- hoveredEntity = null ;
2092
+ Editor . selection . hovered = null ;
2094
2093
}
2095
2094
2096
2095
// Try to pick an entity
@@ -2107,20 +2106,20 @@ public void tick() {
2107
2106
if (movingControlPoint || pickedControlPoint != null ) {
2108
2107
// don't select entities
2109
2108
}
2110
- else if (hoveredEntity == null && Editor .selection .picked == null ) {
2109
+ else if (Editor . selection . hovered == null && Editor .selection .picked == null ) {
2111
2110
selected = true ;
2112
2111
}
2113
2112
else {
2114
2113
if (!readLeftClick ) {
2115
- if (Editor .selection .picked != null && hoveredEntity != null && hoveredEntity != Editor .selection .picked && !Editor .selection .isSelected (hoveredEntity ) && (Gdx .input .isKeyPressed (Input .Keys .SHIFT_LEFT ) || Gdx .input .isKeyPressed (Input .Keys .SHIFT_RIGHT ))) {
2116
- pickAdditionalEntity (hoveredEntity );
2114
+ if (Editor .selection .picked != null && Editor . selection . hovered != null && Editor . selection . hovered != Editor .selection .picked && !Editor .selection .isSelected (Editor . selection . hovered ) && (Gdx .input .isKeyPressed (Input .Keys .SHIFT_LEFT ) || Gdx .input .isKeyPressed (Input .Keys .SHIFT_RIGHT ))) {
2115
+ pickAdditionalEntity (Editor . selection . hovered );
2117
2116
}
2118
- else if (Editor .selection .picked != null && Editor .selection .picked == hoveredEntity || Editor .selection .isSelected (hoveredEntity )) {
2117
+ else if (Editor .selection .picked != null && Editor .selection .picked == Editor . selection . hovered || Editor .selection .isSelected (Editor . selection . hovered )) {
2119
2118
movingEntity = true ;
2120
2119
}
2121
2120
else {
2122
2121
clearEntitySelection ();
2123
- pickEntity (hoveredEntity );
2122
+ pickEntity (Editor . selection . hovered );
2124
2123
}
2125
2124
}
2126
2125
}
@@ -4199,15 +4198,6 @@ public Vector3 getIntersection() {
4199
4198
return new Vector3 (getSelectionX (), floorPos , getSelectionY ());
4200
4199
}
4201
4200
4202
- public Entity getPickedOrHoveredEntity () {
4203
- if (Editor .selection .picked != null ) return Editor .selection .picked ;
4204
- return hoveredEntity ;
4205
- }
4206
-
4207
- public Entity getHoveredEntity () {
4208
- return hoveredEntity ;
4209
- }
4210
-
4211
4201
public MoveMode getMoveMode () {
4212
4202
return moveMode ;
4213
4203
}
0 commit comments