@@ -234,10 +234,10 @@ public boolean isWestFloor() {
234
234
235
235
float camX = 7.5f ;
236
236
float camY = 8 ;
237
- float camZ = 4 .5f ;
237
+ float camZ = 6 .5f ;
238
238
239
- float rotX = 0 ;
240
- float rotY = 20f ;
239
+ float rotX = 3.14159f ;
240
+ float rotY = 1.4f ;
241
241
double rota = 0 ;
242
242
double rotya = 0 ;
243
243
float rotYClamp = 1.571f ;
@@ -668,6 +668,11 @@ public void draw() {
668
668
shouldDrawBox = true ;
669
669
}
670
670
671
+ // don't draw the box when freelooking
672
+ if (shouldDrawBox && !selected && Gdx .input .isCursorCatched ()) {
673
+ shouldDrawBox = false ;
674
+ }
675
+
671
676
if (pickedEntity == null && hoveredEntity == null || tileDragging ) {
672
677
if (!selected || (!(pickedControlPoint != null || movingControlPoint ) &&
673
678
editorInput .isButtonPressed (Input .Buttons .LEFT ) && Gdx .input .justTouched ())) {
@@ -2020,10 +2025,10 @@ else if(pickedEntity != null && pickedEntity == hoveredEntity || additionalSelec
2020
2025
}
2021
2026
if (pickedEntity == null ) movingEntity = false ;
2022
2027
2023
- boolean turnLeft = editorInput .isKeyPressed (Keys .LEFT ) || (Gdx .input .getDeltaX () < 0 && Gdx .input .isButtonPressed (Buttons .MIDDLE ));
2024
- boolean turnRight = editorInput .isKeyPressed (Keys .RIGHT ) || (Gdx .input .getDeltaX () > 0 && Gdx .input .isButtonPressed (Buttons .MIDDLE ));
2025
- boolean turnUp = editorInput . isKeyPressed ( Keys . UP ) || (Gdx .input .getDeltaY () > 0 && Gdx .input .isButtonPressed (Buttons .MIDDLE ));
2026
- boolean turnDown = editorInput . isKeyPressed ( Keys . DOWN ) || (Gdx .input .getDeltaY () < 0 && Gdx .input .isButtonPressed (Buttons .MIDDLE ));
2028
+ boolean turnLeft = editorInput .isKeyPressed (Keys .Q ) || (Gdx .input .getDeltaX () < 0 && Gdx .input .isButtonPressed (Buttons .MIDDLE ));
2029
+ boolean turnRight = editorInput .isKeyPressed (Keys .E ) || (Gdx .input .getDeltaX () > 0 && Gdx .input .isButtonPressed (Buttons .MIDDLE ));
2030
+ boolean turnUp = (Gdx .input .getDeltaY () > 0 && Gdx .input .isButtonPressed (Buttons .MIDDLE ));
2031
+ boolean turnDown = (Gdx .input .getDeltaY () < 0 && Gdx .input .isButtonPressed (Buttons .MIDDLE ));
2027
2032
2028
2033
if (turnLeft ) {
2029
2034
rota += rotSpeed ;
@@ -4044,6 +4049,75 @@ public Decal getDecal() {
4044
4049
return sd ;
4045
4050
}
4046
4051
4052
+ public void moveTiles (int moveX , int moveY ) {
4053
+ int selX = selectionX ;
4054
+ int selY = selectionY ;
4055
+ int selWidth = selectionWidth ;
4056
+ int selHeight = selectionHeight ;
4057
+
4058
+ // Move Tiles
4059
+ if (selected ) {
4060
+ Tile [] moving = new Tile [selWidth * selHeight ];
4061
+
4062
+ for (int x = 0 ; x < selWidth ; x ++) {
4063
+ for (int y = 0 ; y < selHeight ; y ++) {
4064
+ int tileX = selX + x ;
4065
+ int tileY = selY + y ;
4066
+
4067
+ Tile t = level .getTileOrNull (tileX , tileY );
4068
+ moving [x + y * selectionWidth ] = t ;
4069
+
4070
+ level .setTile (tileX , tileY , null );
4071
+ markWorldAsDirty (tileX , tileY , 1 );
4072
+ }
4073
+ }
4074
+
4075
+ for (int x = 0 ; x < selWidth ; x ++) {
4076
+ for (int y = 0 ; y < selHeight ; y ++) {
4077
+ int tileX = selX + x + moveX ;
4078
+ int tileY = selY + y + moveY ;
4079
+
4080
+ level .setTile (tileX , tileY , moving [x + y * selectionWidth ]);
4081
+ markWorldAsDirty (tileX , tileY , 1 );
4082
+ }
4083
+ }
4084
+
4085
+ // Move Markers
4086
+ for (int x = selX ; x < selX + selWidth ; x ++) {
4087
+ for (int y = selY ; y < selY + selHeight ; y ++) {
4088
+ if (level .editorMarkers != null && level .editorMarkers .size > 0 ) {
4089
+ for (int i = 0 ; i < level .editorMarkers .size ; i ++) {
4090
+ EditorMarker m = level .editorMarkers .get (i );
4091
+ if (m .x == x && m .y == y ) {
4092
+ m .x += moveX ;
4093
+ m .y += moveY ;
4094
+ }
4095
+ }
4096
+ }
4097
+ }
4098
+ }
4099
+
4100
+ selectionX += moveX ;
4101
+ selectionY += moveY ;
4102
+ controlPoints .clear ();
4103
+ }
4104
+
4105
+ // Move Entities
4106
+ Array <Entity > allSelected = new Array <Entity >();
4107
+ if (pickedEntity != null ) {
4108
+ allSelected .add (pickedEntity );
4109
+ }
4110
+ allSelected .addAll (additionalSelected );
4111
+
4112
+ for (Entity e : allSelected ) {
4113
+ e .x += moveX ;
4114
+ e .y += moveY ;
4115
+ markWorldAsDirty ((int )e .x , (int )e .y , 1 );
4116
+ }
4117
+
4118
+ history .saveState (level );
4119
+ }
4120
+
4047
4121
private void vizualizePicking () {
4048
4122
if (pickViz == null )
4049
4123
pickViz = new SpriteBatch ();
0 commit comments