Compare commits

...

5 Commits

Author SHA1 Message Date
Wuzzy 986b776c90 Version 1.6 2020-11-07 00:57:13 +01:00
Wuzzy 9d71a18d50 Remove two old TODOs 2020-11-07 00:56:38 +01:00
Wuzzy 57b60c50ef Add tt helptexts 2020-11-07 00:54:28 +01:00
Wuzzy 1e88160230 Use minetest.is_creative_enabled 2020-11-07 00:25:38 +01:00
Wuzzy 00ee213ecf Add z_index to HUD elements 2020-04-07 16:20:26 +02:00
4 changed files with 38 additions and 6 deletions

View File

@ -3,7 +3,7 @@ This mod adds several tools which mostly aid in orientation. When carrying them,
this will enhance the HUD by adding several interesting information such as the
coordinates or the viewing angles or enabling the use of the minimap.
Current version: 1.5
Current version: 1.6
## Mod support
All dependencies are optional.
@ -15,8 +15,8 @@ There is an optional dependency on Achievements [`awards`] by rubenwardy. If
both this mod and the default mod are enabled, the achievement “Master of
Orienteering” will be added.
This mod includes item help texts for `doc_items` of the Documentation System
modpack.
This mod includes item help texts for `tt` (Extended Tooltips mod)
and `doc_items` of the Documentation System modpack.
## Tools
The orienteering tools are used automatically. To use them, you only need to

View File

@ -48,6 +48,7 @@ local use_time = S("Put this tool in your hotbar to make use of its functionalit
-- Displays height (Y)
minetest.register_tool("orienteering:altimeter", {
description = S("Altimeter"),
_tt_help = S("Shows your elevation"),
_doc_items_longdesc = S("It shows you your current elevation (Y)."),
_doc_items_usagehelp = use,
wield_image = "orienteering_altimeter.png",
@ -58,6 +59,7 @@ minetest.register_tool("orienteering:altimeter", {
-- Displays X and Z coordinates
minetest.register_tool("orienteering:triangulator", {
description = S("Triangulator"),
_tt_help = S("Shows your horizontal coordinates"),
_doc_items_longdesc = S("It shows you the coordinates of your current position in the horizontal plane (X and Z)."),
_doc_items_usagehelp = use,
wield_image = "orienteering_triangulator.png",
@ -66,9 +68,9 @@ minetest.register_tool("orienteering:triangulator", {
})
-- Displays player yaw
-- TODO: calculate yaw difference between 2 points
minetest.register_tool("orienteering:compass", {
description = S("Compass"),
_tt_help = S("Shows your yaw"),
_doc_items_longdesc = S("It shows you your yaw (horizontal viewing angle) in degrees."),
_doc_items_usagehelp = use,
wield_image = "orienteering_compass_wield.png",
@ -77,9 +79,9 @@ minetest.register_tool("orienteering:compass", {
})
-- Displays player pitch
-- TODO: calculate pitch difference between 2 points
minetest.register_tool("orienteering:sextant", {
description = S("Sextant"),
_tt_help = S("Shows your pitch"),
_doc_items_longdesc = S("It shows you your pitch (vertical viewing angle) in degrees."),
_doc_items_usagehelp = use,
wield_image = "orienteering_sextant_wield.png",
@ -90,6 +92,7 @@ minetest.register_tool("orienteering:sextant", {
-- Ultimate orienteering tool: Displays X,Y,Z, yaw, pitch, time, speed and enables the minimap
minetest.register_tool("orienteering:quadcorder", {
description = S("Quadcorder"),
_tt_help = S("Shows your coordinates, yaw, pitch, time, speed and enables minimap"),
_doc_items_longdesc = 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."),
wield_image = "orienteering_quadcorder.png",
_doc_items_usagehelp = use_time,
@ -102,6 +105,7 @@ minetest.register_tool("orienteering:quadcorder", {
-- Displays game time
minetest.register_tool("orienteering:watch", {
description = S("Watch"),
_tt_help = S("Shows the time"),
_doc_items_longdesc = S("It shows you the current time."),
_doc_items_usagehelp = S("Put the watch in your hotbar to see the time. Punch to toggle between the 24-hour and 12-hour display."),
wield_image = "orienteering_watch.png",
@ -113,6 +117,7 @@ minetest.register_tool("orienteering:watch", {
-- Displays speed
minetest.register_tool("orienteering:speedometer", {
description = S("Speedometer"),
_tt_help = S("Shows your speed"),
_doc_items_longdesc = S("It shows you your current horizontal (“hor.”) and vertical (“ver.”) speed in meters per second, where one meter is the side length of a single cube."),
_doc_items_usagehelp = use,
wield_image = "orienteering_speedometer_wield.png",
@ -124,6 +129,7 @@ if not mod_map then
-- Enables minimap (surface)
minetest.register_tool("orienteering:map", {
description = S("Map"),
_tt_help = S("Allows using the minimap"),
_doc_items_longdesc = S("The map allows you to view a minimap of the area around you."),
_doc_items_usagehelp = S("If you put a map in your hotbar, you will be able to access the minimap (only surface mode). Press the “minimap” key to view the minimap."),
wield_image = "orienteering_map.png",
@ -136,6 +142,7 @@ end
-- Enables minimap (radar)
minetest.register_tool("orienteering:automapper", {
description = S("Radar Mapper"),
_tt_help = S("Allows using the minimap and radar"),
_doc_items_longdesc = S("The radar mapper is a device that combines a map with a radar. It unlocks both the surface mode and radar mode of the minimap."),
_doc_items_usagehelp = S("If you put a radar mapper in your hotbar, you will be able to access the minimap. Press the “minimap” key to view the minimap."),
wield_image = "orienteering_automapper_wield.png",
@ -147,6 +154,7 @@ minetest.register_tool("orienteering:automapper", {
-- Displays X,Y,Z coordinates, yaw and game time
minetest.register_tool("orienteering:gps", {
description = S("GPS device"),
_tt_help = S("Shows your coordinates, yaw and the time"),
_doc_items_longdesc = S("The GPS device shows you your coordinates (X, Y and Z), your yaw (horizontal viewing angle) and the time."),
_doc_items_usagehelp = use_time,
wield_image = "orienteering_gps_wield.png",
@ -243,7 +251,7 @@ if minetest.get_modpath("default") ~= nil then
end
function orienteering.update_automapper(player)
if orienteering.tool_active(player, "orienteering:automapper") or orienteering.tool_active(player, "orienteering:quadcorder") or minetest.settings:get_bool("creative_mode") then
if orienteering.tool_active(player, "orienteering:automapper") or orienteering.tool_active(player, "orienteering:quadcorder") or minetest.is_creative_enabled(player:get_player_name()) then
player:hud_set_flags({minimap = true, minimap_radar = true})
elseif ((not mod_map) and orienteering.tool_active(player, "orienteering:map")) or ((mod_map) and orienteering.tool_active(player, "map:mapping_kit")) then
player:hud_set_flags({minimap = true, minimap_radar = false})
@ -282,6 +290,7 @@ function orienteering.init_hud(player)
alignment = orienteering.settings.hud_alignment,
number = 0xFFFFFF,
scale= { x = 100, y = 20 },
z_index = 0,
})
end
end

View File

@ -33,6 +33,17 @@ Coordinates: X@=@1, Z@=@2=Koordinaten: X@=@1, Z@=@2
Master of Orienteering=Meister der Orientierung
Craft a quadcorder.=Fertigen Sie einen Vierkorder.
Shows your horizontal coordinates=Zeigt Ihre horizontalen Koordinaten
Shows your yaw=Zeigt Ihren Gierwinkel
Shows your pitch=Zeigt Ihren Nickwinkel
Shows your coordinates, yaw, pitch, time, speed and enables minimap=Zeigt Koordinaten, Blickwinkel, Zeit, Tempo und aktiviert Übersichtskarte
Shows the time=Zeigt die Zeit
Shows your speed=Zeigt Ihre Geschwindigkeit
Allows using the minimap=Erlaubt Benuzung der Übersichtskarte
Allows using the minimap and radar=Erlaubt Benutzung der Übersichtskarte und des Radars
Shows your coordinates, yaw and the time=Zeigt Ihre Koordinaten, Gierwinkel und die Zeit
Shows your elevation=Zeigt Ihre Höhe
It shows you your yaw (horizontal viewing angle) in degrees.=Er zeigt Ihnen Ihre Gierung (horizontaler Blickwinkel) in Grad.
It shows you your pitch (vertical viewing angle) in degrees.=Er zeigt Ihnen Ihren Nick (vertikaler Blickwinkel) in Grad.
It shows you your current elevation (Y).=Er zeigt Ihnen Ihre momentane Höhe (Y).

View File

@ -45,6 +45,18 @@ Speed: hor.: @1 @2, vert.: @3 @4=
Master of Orienteering=
Craft a quadcorder.=
# Tooltips / short helptexts
Shows your horizontal coordinates=
Shows your yaw=
Shows your pitch=
Shows your coordinates, yaw, pitch, time, speed and enables minimap=
Shows the time=
Shows your speed=
Allows using the minimap=
Allows using the minimap and radar=
Shows your coordinates, yaw and the time=
Shows your elevation=
# Help texts
It shows you your yaw (horizontal viewing angle) in degrees.=
It shows you your pitch (vertical viewing angle) in degrees.=