mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-25 02:42:25 +01:00
Show chat message if using minimap incorrectly
This commit is contained in:
parent
312b5aeb73
commit
7ee2340f5c
@ -28,6 +28,28 @@ minetest.register_craftitem("mcl_maps:empty_map", {
|
||||
stack_max = 64,
|
||||
})
|
||||
|
||||
-- Checks if player is still allowed to display the minimap
|
||||
local function update_minimap(player)
|
||||
local creative = minetest.settings:get_bool("creative_mode")
|
||||
if creative then
|
||||
player:hud_set_flags({minimap=true, minimap_radar = true})
|
||||
else
|
||||
if has_item_in_hotbar(player, "mcl_maps:filled_map") then
|
||||
player:hud_set_flags({minimap = true, minimap_radar = false})
|
||||
else
|
||||
player:hud_set_flags({minimap = false, minimap_radar = false})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Remind player how to use the minimap correctly
|
||||
local function use_minimap(itemstack, player, pointed_thing)
|
||||
if player and player:is_player() then
|
||||
update_minimap(player)
|
||||
minetest.chat_send_player(player:get_player_name(), S("Use the minimap key to show the map."))
|
||||
end
|
||||
end
|
||||
|
||||
-- Enables minimap if carried in hotbar.
|
||||
-- If this item is NOT in the hotbar, the minimap is unavailable
|
||||
-- Note: This is not at all like Minecraft right now. Minetest's minimap is pretty overpowered, it
|
||||
@ -41,6 +63,9 @@ minetest.register_craftitem("mcl_maps:filled_map", {
|
||||
groups = { tool = 1 },
|
||||
inventory_image = "mcl_maps_map_filled.png^(mcl_maps_map_filled_markings.png^[colorize:#000000)",
|
||||
stack_max = 1,
|
||||
|
||||
on_use = use_minimap,
|
||||
on_secondary_use = use_minimap,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
@ -64,20 +89,6 @@ local function has_item_in_hotbar(player, item)
|
||||
return false
|
||||
end
|
||||
|
||||
-- Checks if player is still allowed to display the minimap
|
||||
local function update_minimap(player)
|
||||
local creative = minetest.settings:get_bool("creative_mode")
|
||||
if creative then
|
||||
player:hud_set_flags({minimap=true, minimap_radar = true})
|
||||
else
|
||||
if has_item_in_hotbar(player, "mcl_maps:filled_map") then
|
||||
player:hud_set_flags({minimap = true, minimap_radar = false})
|
||||
else
|
||||
player:hud_set_flags({minimap = false, minimap_radar = false})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
update_minimap(player)
|
||||
end)
|
||||
|
@ -7,3 +7,4 @@ Maps show your surroundings as you explore the world.=Karten zeigen Ihre Umgebun
|
||||
Hold the map in any of the hotbar slots. This allows you to access the minimap by pressing the minimap key (see controls settings).=Halten Sie die Karte in einen beliebigen Platz in der Schnellleiste. Damit können Sie jetzt die Übersichtskarte aktivieren, indem Sie die Taste zum Umschalten der Karte drücken (siehe Tastenbelegung).
|
||||
In Creative Mode, you don't need this item; the minimap is always available.=Im Kreativmodus brauchen Sie diesen Gegenstand nicht; die Übersichtskarte ist immer verfügbar.
|
||||
Enables minimap=Aktiviert Übersichtskarte
|
||||
Use the minimap key to show the map.=Taste „Karte an/aus“ benutzen, um die Karte zu betrachten.
|
||||
|
@ -7,3 +7,4 @@ Maps show your surroundings as you explore the world.=
|
||||
Hold the map in any of the hotbar slots. This allows you to access the minimap by pressing the minimap key (see controls settings).=
|
||||
In Creative Mode, you don't need this item; the minimap is always available.=
|
||||
Enables minimap=
|
||||
Use the minimap key to show the map.=
|
||||
|
Loading…
Reference in New Issue
Block a user