diff --git a/binaries/data/config/default.cfg b/binaries/data/config/default.cfg
index e01335c2e1..7249308c9b 100644
--- a/binaries/data/config/default.cfg
+++ b/binaries/data/config/default.cfg
@@ -151,6 +151,9 @@ view.fov = 45.0 ; Field of view (degrees), lower is
view.height.smoothness = 0.5
view.height.min = 16
+; How close do we have to be to the actual location in order to jump back to the previous one?
+camerajump.threshold = 40
+
; HOTKEY MAPPINGS:
; Each one of the specified keys will trigger the action on the left
@@ -194,6 +197,26 @@ hotkey.camera.rotate.speed.increase = "Ctrl+Shift+R" ; Increase rotation
hotkey.camera.rotate.speed.decrease = "Ctrl+Alt+R" ; Decrease rotation speed
hotkey.camera.zoom.speed.increase = "Ctrl+Shift+Z" ; Increase zoom speed
hotkey.camera.zoom.speed.decrease = "Ctrl+Alt+Z" ; Decrease zoom speed
+hotkey.camera.jump.1 = F5 ; Jump to position N
+hotkey.camera.jump.2 = F6
+hotkey.camera.jump.3 = F7
+hotkey.camera.jump.4 = F8
+;hotkey.camera.jump.5 =
+;hotkey.camera.jump.6 =
+;hotkey.camera.jump.7 =
+;hotkey.camera.jump.8 =
+;hotkey.camera.jump.9 =
+;hotkey.camera.jump.10 =
+hotkey.camera.jump.set.1 = "Ctrl+F5" ; Set jump position N
+hotkey.camera.jump.set.2 = "Ctrl+F6"
+hotkey.camera.jump.set.3 = "Ctrl+F7"
+hotkey.camera.jump.set.4 = "Ctrl+F8"
+;hotkey.camera.jump.set.5 =
+;hotkey.camera.jump.set.6 =
+;hotkey.camera.jump.set.7 =
+;hotkey.camera.jump.set.8 =
+;hotkey.camera.jump.set.9 =
+;hotkey.camera.jump.set.10 =
; > CONSOLE SETTINGS
hotkey.console.toggle = BackQuote, F9 ; Open/close console
diff --git a/binaries/data/mods/public/gui/manual/intro.txt b/binaries/data/mods/public/gui/manual/intro.txt
index b7e3f79a70..2a31b9a5b2 100644
--- a/binaries/data/mods/public/gui/manual/intro.txt
+++ b/binaries/data/mods/public/gui/manual/intro.txt
@@ -66,6 +66,8 @@ H: Stop (halt) the currently selected units.
Ctrl + 1 (and so on up to Ctrl + 0): Create control group 1 (to 0) from the selected units/buildings
1 (and so on up to 0): Select the units/buildings in control group 1 (to 0)
Shift + 1 (to 0): Add selected units/buildings to control group 1 (to 0)
+Ctrl + F5 (and so on up to F8): Mark the current camera position, for jumping back to later.
+F5, F6, F7, and F8: Move the camera to a marked position. Jump back to the last location if the camera is already over the marked position.
Z, X, C, V, B, N, M: With training buildings selected. Add the 1st, 2nd, ... unit shown to the training queue for all the selected buildings.
[font="serif-bold-14"]Modify mouse action
diff --git a/binaries/data/mods/public/gui/session/input.js b/binaries/data/mods/public/gui/session/input.js
index 6b4518f48d..6f0c173f7f 100644
--- a/binaries/data/mods/public/gui/session/input.js
+++ b/binaries/data/mods/public/gui/session/input.js
@@ -1508,6 +1508,33 @@ function exchangeResources(command)
Engine.PostNetworkCommand({"type": "barter", "sell": command.sell, "buy": command.buy, "amount": command.amount});
}
+// Camera jumping: when the user presses a hotkey the current camera location is marked.
+// When they press another hotkey the camera jumps back to that position. If the camera is already roughly at that location,
+// jump back to where it was previously.
+var jumpCameraPositions = [], jumpCameraLast;
+
+function jumpCamera(index)
+{
+ var position = jumpCameraPositions[index], distanceThreshold = g_ConfigDB.system["camerajump.threshold"];
+ if (position)
+ {
+ if (jumpCameraLast &&
+ Math.abs(Engine.CameraGetX() - position.x) < distanceThreshold &&
+ Math.abs(Engine.CameraGetZ() - position.z) < distanceThreshold)
+ Engine.CameraMoveTo(jumpCameraLast.x, jumpCameraLast.z);
+ else
+ {
+ jumpCameraLast = {x: Engine.CameraGetX(), z: Engine.CameraGetZ()};
+ Engine.CameraMoveTo(position.x, position.z);
+ }
+ }
+}
+
+function setJumpCamera(index)
+{
+ jumpCameraPositions[index] = {x: Engine.CameraGetX(), z: Engine.CameraGetZ()};
+}
+
// Batch training:
// When the user shift-clicks, we set these variables and switch to INPUT_BATCHTRAINING
// When the user releases shift, or clicks on a different training button, we create the batched units
diff --git a/binaries/data/mods/public/gui/session/session.xml b/binaries/data/mods/public/gui/session/session.xml
index be259646de..e2a17068c7 100644
--- a/binaries/data/mods/public/gui/session/session.xml
+++ b/binaries/data/mods/public/gui/session/session.xml
@@ -96,6 +96,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+