Breaking logic change: Coordinates are now tile-based
This commit is contained in:
@@ -16,6 +16,7 @@ import arc.util.*;
|
||||
import mindustry.ai.formations.patterns.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.core.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.game.EventType.*;
|
||||
@@ -568,8 +569,8 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
wx = wy;
|
||||
wy = -x;
|
||||
}
|
||||
req.x = world.toTile(wx - req.block.offset) + ox;
|
||||
req.y = world.toTile(wy - req.block.offset) + oy;
|
||||
req.x = World.toTile(wx - req.block.offset) + ox;
|
||||
req.y = World.toTile(wy - req.block.offset) + oy;
|
||||
req.rotation = Mathf.mod(req.rotation + direction, 4);
|
||||
});
|
||||
}
|
||||
@@ -934,11 +935,11 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
}
|
||||
|
||||
int rawTileX(){
|
||||
return world.toTile(Core.input.mouseWorld().x);
|
||||
return World.toTile(Core.input.mouseWorld().x);
|
||||
}
|
||||
|
||||
int rawTileY(){
|
||||
return world.toTile(Core.input.mouseWorld().y);
|
||||
return World.toTile(Core.input.mouseWorld().y);
|
||||
}
|
||||
|
||||
int tileX(float cursorX){
|
||||
@@ -946,7 +947,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
if(selectedBlock()){
|
||||
vec.sub(block.offset, block.offset);
|
||||
}
|
||||
return world.toTile(vec.x);
|
||||
return World.toTile(vec.x);
|
||||
}
|
||||
|
||||
int tileY(float cursorY){
|
||||
@@ -954,7 +955,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
if(selectedBlock()){
|
||||
vec.sub(block.offset, block.offset);
|
||||
}
|
||||
return world.toTile(vec.y);
|
||||
return World.toTile(vec.y);
|
||||
}
|
||||
|
||||
public boolean selectedBlock(){
|
||||
|
||||
Reference in New Issue
Block a user