mirror of
https://repo.or.cz/minetest_orienteering.git
synced 2025-01-09 14:17:42 +01:00
Add (slightly) experimental binoculars
This commit is contained in:
parent
2d88b8ff07
commit
2026249d90
10
README.md
10
README.md
@ -29,8 +29,9 @@ The following tools are available:
|
|||||||
* Speedometer: Shows speed in m/s (1 m = side length of a single cube)
|
* Speedometer: Shows speed in m/s (1 m = side length of a single cube)
|
||||||
* Automapper: Enables the usage of the minimap and radar (F7 key by default)
|
* Automapper: Enables the usage of the minimap and radar (F7 key by default)
|
||||||
* GPS device: Shows X, Y, Z coordinates, yaw and time
|
* GPS device: Shows X, Y, Z coordinates, yaw and time
|
||||||
* Quadcorder: Ultimate tool: Shows X, Y, Z coordinates, pitch, yaw, time, speed
|
* Quadcorder: Combination of everything above: Shows X, Y, Z coordinates, pitch,
|
||||||
and enables minimap/radar
|
yaw, time, speed and enables minimap/radar
|
||||||
|
* Binoculars: Allows you to zoom (must wield to use)
|
||||||
|
|
||||||
To toggle between 12h and 24h mode for the displayed time, wield any device
|
To toggle between 12h and 24h mode for the displayed time, wield any device
|
||||||
which is capable of displaying the time and press the left mouse button.
|
which is capable of displaying the time and press the left mouse button.
|
||||||
@ -123,6 +124,11 @@ Symbols:
|
|||||||
6D7
|
6D7
|
||||||
4D8
|
4D8
|
||||||
|
|
||||||
|
### Binoculars
|
||||||
|
|
||||||
|
g g
|
||||||
|
S S
|
||||||
|
SSS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
33
init.lua
33
init.lua
@ -107,6 +107,13 @@ minetest.register_tool("orienteering:automapper", {
|
|||||||
inventory_image = "orienteering_automapper_inv.png",
|
inventory_image = "orienteering_automapper_inv.png",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Allows zooming
|
||||||
|
minetest.register_tool("orienteering:binoculars", {
|
||||||
|
description = S("Binoculars"),
|
||||||
|
wield_image = "orienteering_binoculars.png",
|
||||||
|
inventory_image = "orienteering_binoculars_inv.png",
|
||||||
|
})
|
||||||
|
|
||||||
-- Displays X,Y,Z coordinates, yaw and game time
|
-- Displays X,Y,Z coordinates, yaw and game time
|
||||||
minetest.register_tool("orienteering:gps", {
|
minetest.register_tool("orienteering:gps", {
|
||||||
description = S("GPS device"),
|
description = S("GPS device"),
|
||||||
@ -201,6 +208,27 @@ function orienteering.update_automapper(player)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function orienteering.update_binoculars(player)
|
||||||
|
local wielding = player:get_wielded_item()
|
||||||
|
local playername = player:get_player_name()
|
||||||
|
local privs = minetest.get_player_privs(playername)
|
||||||
|
if not wielding:is_empty() and wielding:get_name() == "orienteering:binoculars" then
|
||||||
|
-- Has binoculars
|
||||||
|
if privs.zoom ~= true then
|
||||||
|
privs.zoom = true
|
||||||
|
minetest.set_player_privs(playername, privs)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- Does not have binoculars
|
||||||
|
if privs.zoom == true then
|
||||||
|
privs.zoom = nil
|
||||||
|
minetest.set_player_privs(playername, privs)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Checks whether a certain orienteering tool is “active” and ready for use
|
-- Checks whether a certain orienteering tool is “active” and ready for use
|
||||||
function orienteering.tool_active(player, item)
|
function orienteering.tool_active(player, item)
|
||||||
-- Requirement: player carries the tool in the hotbar
|
-- Requirement: player carries the tool in the hotbar
|
||||||
@ -216,6 +244,7 @@ end
|
|||||||
|
|
||||||
function orienteering.init_hud(player)
|
function orienteering.init_hud(player)
|
||||||
orienteering.update_automapper(player)
|
orienteering.update_automapper(player)
|
||||||
|
orienteering.update_binoculars(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
orienteering.playerhuds[name] = {}
|
orienteering.playerhuds[name] = {}
|
||||||
for i=1, o_lines do
|
for i=1, o_lines do
|
||||||
@ -356,6 +385,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
local players = minetest.get_connected_players()
|
local players = minetest.get_connected_players()
|
||||||
for i=1, #players do
|
for i=1, #players do
|
||||||
orienteering.update_automapper(players[i])
|
orienteering.update_automapper(players[i])
|
||||||
|
orienteering.update_binoculars(players[i])
|
||||||
orienteering.update_hud_displays(players[i])
|
orienteering.update_hud_displays(players[i])
|
||||||
end
|
end
|
||||||
updatetimer = updatetimer - dtime
|
updatetimer = updatetimer - dtime
|
||||||
@ -386,12 +416,14 @@ if minetest.get_modpath("doc_items") ~= nil then
|
|||||||
["orienteering:watch"] = S("It shows you the current time."),
|
["orienteering:watch"] = S("It shows you the current time."),
|
||||||
["orienteering:quadcorder"] = S("This is the ultimate orientieering tool. It shows you your coordinates (X, Y and Z), shows your yaw and pitch (horizontal and vertical viewing angles), the current time, your current speed and it enables you to access the minimap."),
|
["orienteering:quadcorder"] = S("This is the ultimate orientieering tool. It shows you your coordinates (X, Y and Z), shows your yaw and pitch (horizontal and vertical viewing angles), the current time, your current speed and it enables you to access the minimap."),
|
||||||
["orienteering:automapper"] = S("The automapper automatically creates a map of the area around you and enables you to view a minimap of your surroundings. It also has a built-in radar."),
|
["orienteering:automapper"] = S("The automapper automatically creates a map of the area around you and enables you to view a minimap of your surroundings. It also has a built-in radar."),
|
||||||
|
["orienteering:binoculars"] = S("Binoculars allow you to zoom."),
|
||||||
})
|
})
|
||||||
|
|
||||||
local use = S("Put this tool in your hotbar to see the data it provides.")
|
local use = S("Put this tool in your hotbar to see the data it provides.")
|
||||||
local use_watch = S("Put the watch in your hotbar to see the time. Leftclick to toggle between the 24-hour and 12-hour display.")
|
local use_watch = S("Put the watch in your hotbar to see the time. Leftclick to toggle between the 24-hour and 12-hour display.")
|
||||||
local use_time = S("Put this tool in your hotbar to make use of its functionality. Leftclick to toggle between 24-hour and 12-hour display for the time feature.")
|
local use_time = S("Put this tool in your hotbar to make use of its functionality. Leftclick to toggle between 24-hour and 12-hour display for the time feature.")
|
||||||
local use_automapper = S("If you put an automapper in your hotbar, you will be able to access the minimap. By default the minimap can be opened with [F7].")
|
local use_automapper = S("If you put an automapper in your hotbar, you will be able to access the minimap. By default the minimap can be opened with [F7].")
|
||||||
|
local use_binoculars = S("Wield the binoculars to be able to zoom. Hold down the Zoom key (default: [Z]) to zoom.")
|
||||||
|
|
||||||
doc.sub.items.set_items_usagehelp({
|
doc.sub.items.set_items_usagehelp({
|
||||||
["orienteering:compass"] = use,
|
["orienteering:compass"] = use,
|
||||||
@ -403,5 +435,6 @@ if minetest.get_modpath("doc_items") ~= nil then
|
|||||||
["orienteering:watch"] = use_watch,
|
["orienteering:watch"] = use_watch,
|
||||||
["orienteering:quadcorder"] = use_time,
|
["orienteering:quadcorder"] = use_time,
|
||||||
["orienteering:automapper"] = use_automapper,
|
["orienteering:automapper"] = use_automapper,
|
||||||
|
["orienteering:binoculars"] = use_binoculars,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
@ -7,6 +7,7 @@ Watch = Uhr
|
|||||||
Speedometer = Tacho
|
Speedometer = Tacho
|
||||||
Automapper = Autokartierer
|
Automapper = Autokartierer
|
||||||
GPS device = GPS-Gerät
|
GPS device = GPS-Gerät
|
||||||
|
Binoculars = Fernglas
|
||||||
|
|
||||||
Yaw: %.1f°, pitch: %.1f° = Gier: %.1f°, Nick: %.1f°
|
Yaw: %.1f°, pitch: %.1f° = Gier: %.1f°, Nick: %.1f°
|
||||||
Yaw: %.1f° = Gier: %.1f°
|
Yaw: %.1f° = Gier: %.1f°
|
||||||
@ -40,9 +41,11 @@ It shows you your current horizontal (“hor.”) and vertical (“ver.”) spee
|
|||||||
It shows you the current time. = Es zeigt Ihnen die aktuelle Uhrzeit.
|
It shows you the current time. = Es zeigt Ihnen die aktuelle Uhrzeit.
|
||||||
This is the ultimate orientieering tool. It shows you your coordinates (X, Y and Z), shows your yaw and pitch (horizontal and vertical viewing angles), the current time, your current speed and it enables you to access the minimap. = Dies ist das ultimative Werkzeug für die Orientierung. Es zeigt Ihnen Ihre aktuellen Koordinaten (X, Y, und Z), zeigt Ihren Gier- und Nickwinkel (horizontaler und vertikaler Blickwinkel), die aktuelle Uhrzeit, Ihre aktuelle Geschwindigkeit und es ermöglicht es Ihnen, auf die Kleinkarte zuzugreifen.
|
This is the ultimate orientieering tool. It shows you your coordinates (X, Y and Z), shows your yaw and pitch (horizontal and vertical viewing angles), the current time, your current speed and it enables you to access the minimap. = Dies ist das ultimative Werkzeug für die Orientierung. Es zeigt Ihnen Ihre aktuellen Koordinaten (X, Y, und Z), zeigt Ihren Gier- und Nickwinkel (horizontaler und vertikaler Blickwinkel), die aktuelle Uhrzeit, Ihre aktuelle Geschwindigkeit und es ermöglicht es Ihnen, auf die Kleinkarte zuzugreifen.
|
||||||
The automapper automatically creates a map of the area around you and enables you to view a minimap of your surroundings. It also has a built-in radar. = Der Autokartierer erstellt automatisch eine Karte von Ihrer näheren Umgebung und ermöglicht es Ihnen, eine Kleinkarte davon zu betrachten. Er hat außerdem einen eingebauten Radar.
|
The automapper automatically creates a map of the area around you and enables you to view a minimap of your surroundings. It also has a built-in radar. = Der Autokartierer erstellt automatisch eine Karte von Ihrer näheren Umgebung und ermöglicht es Ihnen, eine Kleinkarte davon zu betrachten. Er hat außerdem einen eingebauten Radar.
|
||||||
|
Binoculars allow you to zoom. = Ein Ferglas ermöglicht es Ihnen, die Ansicht zu vergrößern.
|
||||||
|
|
||||||
Put this tool in your hotbar to see the data it provides. = Legen Sie dieses Werkzeug in Ihrer Schnellzugriffsleiste ab, um die dazugehörigen Daten zu sehen.
|
Put this tool in your hotbar to see the data it provides. = Legen Sie dieses Werkzeug in Ihrer Schnellzugriffsleiste ab, um die dazugehörigen Daten zu sehen.
|
||||||
Put the watch in your hotbar to see the time. Leftclick to toggle between the 24-hour and 12-hour display. = Legen Sie die Uhr in Ihrer Schnellzugriffsleiste ab, um die Uhrzeit zu sehen. Mit Linksklick können Sie zwischen der 24-Stunden- und der 2-mal-12-Stunden-Anzeige wechseln.
|
Put the watch in your hotbar to see the time. Leftclick to toggle between the 24-hour and 12-hour display. = Legen Sie die Uhr in Ihrer Schnellzugriffsleiste ab, um die Uhrzeit zu sehen. Mit Linksklick können Sie zwischen der 24-Stunden- und der 2-mal-12-Stunden-Anzeige wechseln.
|
||||||
Put this tool in your hotbar to make use of its functionality. Leftclick to toggle between 24-hour and 12-hour display for the time feature. = Legen Sie dieses Werkzeug irgendwo in Ihrem Spielerinventar ab, um davon Gebrauch zu machen. Mit Linksklick können Sie zwischen der 24-Stunden- und der 2-mal-12-Stunden-Anzeige der Uhrenfunktion wechseln.
|
Put this tool in your hotbar to make use of its functionality. Leftclick to toggle between 24-hour and 12-hour display for the time feature. = Legen Sie dieses Werkzeug irgendwo in Ihrem Spielerinventar ab, um davon Gebrauch zu machen. Mit Linksklick können Sie zwischen der 24-Stunden- und der 2-mal-12-Stunden-Anzeige der Uhrenfunktion wechseln.
|
||||||
If you put an automapper in your hotbar, you will be able to access the minimap. By default the minimap can be opened with [F7]. = Wenn Sie einen Autokartierer in Ihrer Schnellzugriffsleiste ablegen, können Sie auf die Kleinkarte zugreifen. Standardmäßig kann die Kleinkarte mit [F7] geöffnet werden.
|
If you put an automapper in your hotbar, you will be able to access the minimap. By default the minimap can be opened with [F7]. = Wenn Sie einen Autokartierer in Ihrer Schnellzugriffsleiste ablegen, können Sie auf die Kleinkarte zugreifen. Standardmäßig kann die Kleinkarte mit [F7] geöffnet werden.
|
||||||
|
Wield the binoculars to be able to zoom. Hold down the Zoom key (default: [Z]) to zoom. = Halten Sie das Fernglas, um in der Lage zu sein, die Ansicht zu vergrößern. Halten Sie die Zoomtaste (Standard: [Z]) gedrückt, um die Ansicht zu vergrößern.
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ Watch
|
|||||||
Speedometer
|
Speedometer
|
||||||
Automapper
|
Automapper
|
||||||
GPS device
|
GPS device
|
||||||
|
Binoculars
|
||||||
|
|
||||||
# Coordinates
|
# Coordinates
|
||||||
Coordinates: X\=%d, Y\=%d, Z\=%d
|
Coordinates: X\=%d, Y\=%d, Z\=%d
|
||||||
@ -53,8 +54,11 @@ It shows you your current horizontal (“hor.”) and vertical (“ver.”) spee
|
|||||||
It shows you the current time.
|
It shows you the current time.
|
||||||
This is the ultimate orientieering tool. It shows you your coordinates (X, Y and Z), shows your yaw and pitch (horizontal and vertical viewing angles), the current time, your current speed and it enables you to access the minimap.
|
This is the ultimate orientieering tool. It shows you your coordinates (X, Y and Z), shows your yaw and pitch (horizontal and vertical viewing angles), the current time, your current speed and it enables you to access the minimap.
|
||||||
The automapper automatically creates a map of the area around you and enables you to view a minimap of your surroundings. It also has a built-in radar.
|
The automapper automatically creates a map of the area around you and enables you to view a minimap of your surroundings. It also has a built-in radar.
|
||||||
|
Binoculars allow you to zoom.
|
||||||
|
|
||||||
Put this tool in your hotbar to see the data it provides.
|
Put this tool in your hotbar to see the data it provides.
|
||||||
Put the watch in your hotbar to see the time. Leftclick to toggle between the 24-hour and 12-hour display.
|
Put the watch in your hotbar to see the time. Leftclick to toggle between the 24-hour and 12-hour display.
|
||||||
Put this tool in your hotbar to make use of its functionality. Leftclick to toggle between 24-hour and 12-hour display for the time feature.
|
Put this tool in your hotbar to make use of its functionality. Leftclick to toggle between 24-hour and 12-hour display for the time feature.
|
||||||
If you put an automapper in your hotbar, you will be able to access the minimap. By default the minimap can be opened with [F7].
|
If you put an automapper in your hotbar, you will be able to access the minimap. By default the minimap can be opened with [F7].
|
||||||
|
Wield the binoculars to be able to zoom. Hold down the Zoom key (default: [Z]) to zoom.
|
||||||
|
|
||||||
|
BIN
textures/orienteering_binoculars.png
Normal file
BIN
textures/orienteering_binoculars.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 685 B |
BIN
textures/orienteering_binoculars_inv.png
Normal file
BIN
textures/orienteering_binoculars_inv.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 741 B |
Loading…
Reference in New Issue
Block a user