improved camera in dialog
This commit is contained in:
parent
6df16a9a68
commit
1fc63bd1d9
@ -65,6 +65,8 @@ public class InteractionCell extends Cell {
|
|||||||
window.getCamera().setCameraEnd(Integer.parseInt(cameraInfo[1]), Integer.parseInt(cameraInfo[2]));
|
window.getCamera().setCameraEnd(Integer.parseInt(cameraInfo[1]), Integer.parseInt(cameraInfo[2]));
|
||||||
window.getCamera().setCameraTime(Double.parseDouble(cameraInfo[3]));
|
window.getCamera().setCameraTime(Double.parseDouble(cameraInfo[3]));
|
||||||
window.getCamera().setCameraStopped(false);
|
window.getCamera().setCameraStopped(false);
|
||||||
|
if (!window.getCamera().getIsFirstMove())
|
||||||
|
window.getCamera().setCameraFirstMove(true);
|
||||||
readNextLine();
|
readNextLine();
|
||||||
}
|
}
|
||||||
else if (data.contains("<wait>")) {
|
else if (data.contains("<wait>")) {
|
||||||
|
|||||||
@ -14,6 +14,7 @@ public class Camera {
|
|||||||
private boolean isReturning;
|
private boolean isReturning;
|
||||||
private boolean isStopped;
|
private boolean isStopped;
|
||||||
private int count;
|
private int count;
|
||||||
|
private boolean isFirstMove;
|
||||||
|
|
||||||
public Camera(WindowOfFreeMove window, WindowOfFreeMove.Canvas canvas) {
|
public Camera(WindowOfFreeMove window, WindowOfFreeMove.Canvas canvas) {
|
||||||
this.window = window;
|
this.window = window;
|
||||||
@ -132,6 +133,18 @@ public class Camera {
|
|||||||
canvas.setLocation(coordX + stepX, coordY + stepY);
|
canvas.setLocation(coordX + stepX, coordY + stepY);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
else if (isFirstMove) {
|
||||||
|
int x = window.getMapManager().getActualMap().getPerson().getX();
|
||||||
|
int y = window.getMapManager().getActualMap().getPerson().getY();
|
||||||
|
int dir = window.getMapManager().getActualMap().getPerson().getDirectionSight();
|
||||||
|
if (window.getMapManager().getActualMap().findTriggerByXY(x, y) != null) {
|
||||||
|
window.getMapManager().getActualMap().findTriggerByXY(x, y).readNextLine();
|
||||||
|
}
|
||||||
|
else if (window.getMapManager().getActualMap().findInteractionByXY(x, y, dir) != null) {
|
||||||
|
window.getMapManager().getActualMap().findInteractionByXY(x, y, dir).readNextLine();
|
||||||
|
}
|
||||||
|
isFirstMove = false;
|
||||||
|
}
|
||||||
if (Math.abs(coordX - endX) <= stepX && Math.abs(coordY - endY) <= stepY && isReturning) boundCamera();
|
if (Math.abs(coordX - endX) <= stepX && Math.abs(coordY - endY) <= stepY && isReturning) boundCamera();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,4 +194,8 @@ public class Camera {
|
|||||||
public boolean getCameraBound() { return isBound; }
|
public boolean getCameraBound() { return isBound; }
|
||||||
|
|
||||||
public void setCameraStopped(boolean stopped) { isStopped = stopped; }
|
public void setCameraStopped(boolean stopped) { isStopped = stopped; }
|
||||||
|
|
||||||
|
public void setCameraFirstMove(boolean move) { isFirstMove = move; }
|
||||||
|
|
||||||
|
public boolean getIsFirstMove() { return isFirstMove; }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<location>
|
<location>
|
||||||
<map>openspace</map>
|
<map>boss</map>
|
||||||
<x>8</x>
|
<x>4</x>
|
||||||
<y>16</y>
|
<y>18</y>
|
||||||
<direction>3</direction>
|
<direction>2</direction>
|
||||||
</location>
|
</location>
|
||||||
Loading…
x
Reference in New Issue
Block a user