}
if (!this.guiAction) {
this.guiAction = PositionMarker.isAnyMarkerSelected();
}
if (!Dialog.isAnyDialogActive()) {
Vector mousePos = new Vector(input.getMouseX(), input.getMouseY());
Vector translatedMousePos = this.translateMousePos(mousePos);
if (!guiAction) {
if (input.isMouseButtonDown(Input.MOUSE_LEFT_BUTTON)
&& this.lastFunction instanceof GameObjects
&& !this.newObjectTimer.isRunning()) {
this.addNewObject((GameObjects) this.lastFunction,
translatedMousePos);
this.newObjectTimer.start(OBJECT_DELAY);
this.lastFunction = null;
}
}
if (this.selected == null) {
this.playerPosition.poll(input, secounds);
if (input.isMouseButtonDown(Input.MOUSE_LEFT_BUTTON)
&& !this.playerPosition.isMoving()) {
if (!this.guiAction) {
// Kamera verschieben
if (!this.cameraMove) {
this.oldClick = mousePos;
}
this.cameraMove = true;
if (this.oldClick == null) {
this.oldClick = mousePos;
}
Vector dif = mousePos.sub(oldClick);
dif = dif.modifyX(dif.x / this.getZoomX());
dif = dif.modifyY(dif.y / this.getZoomY());
this.setCameraPosition(this.oldCameraPos.sub(dif));
}
} else {
this.cameraMove = false;
this.oldCameraPos = this.getCameraPos();