Rename mod: nav → rp_nav

This commit is contained in:
Wuzzy 2022-04-23 02:17:31 +02:00
parent d8c13d7e60
commit ffc9f991f6
32 changed files with 46 additions and 39 deletions

View File

@ -1,12 +0,0 @@
--
-- Nav mod
-- By Kaadmy, for Pixture
--
nav = {}
dofile(minetest.get_modpath("nav").."/waypoints.lua") -- TODO: Waypoint implenentation is a stub
dofile(minetest.get_modpath("nav").."/map.lua")
dofile(minetest.get_modpath("nav").."/compass.lua")
default.log("mod:nav", "loaded")

View File

@ -5,7 +5,7 @@
-- Tweaked by Kaadmy, for Pixture
--
local nav_mod = minetest.get_modpath("nav") ~= nil
local nav_mod = minetest.get_modpath("rp_nav") ~= nil
item_drop = {}
@ -107,7 +107,7 @@ minetest.register_globalstep(
}, true)
end
-- Notify nav mod of inventory change
if nav_mod and lua.itemstring == "nav:map" then
if nav_mod and lua.itemstring == "rp_nav:map" then
nav.map.update_hud_flags(player)
end

View File

@ -2,7 +2,7 @@
--
-- Compass handling
--
local S = minetest.get_translator("nav")
local S = minetest.get_translator("rp_nav")
local wield_image_0 = "nav_compass_inventory_0.png"
local wield_image_1 = "nav_compass_inventory_1.png"
@ -28,7 +28,7 @@ local function on_globalstep(dtime)
if item ~= nil then
if item.groups.nav_compass then
inv:set_stack("main", i, ItemStack("nav:compass_"..dir))
inv:set_stack("main", i, ItemStack("rp_nav:compass_"..dir))
end
end
end
@ -43,7 +43,7 @@ local d = S("Compass")
local t = S("It points to the North")
minetest.register_craftitem(
"nav:compass_0",
"rp_nav:compass_0",
{
description = d,
_tt_help = t,
@ -56,7 +56,7 @@ minetest.register_craftitem(
})
minetest.register_craftitem(
"nav:compass_1",
"rp_nav:compass_1",
{
description = d,
_tt_help = t,
@ -69,7 +69,7 @@ minetest.register_craftitem(
})
minetest.register_craftitem(
"nav:compass_2",
"rp_nav:compass_2",
{
description = d,
_tt_help = t,
@ -82,7 +82,7 @@ minetest.register_craftitem(
})
minetest.register_craftitem(
"nav:compass_3",
"rp_nav:compass_3",
{
description = d,
_tt_help = t,
@ -96,7 +96,7 @@ minetest.register_craftitem(
minetest.register_craftitem(
"nav:compass_4",
"rp_nav:compass_4",
{
description = d,
_tt_help = t,
@ -109,7 +109,7 @@ minetest.register_craftitem(
})
minetest.register_craftitem(
"nav:compass_5",
"rp_nav:compass_5",
{
description = d,
_tt_help = t,
@ -122,7 +122,7 @@ minetest.register_craftitem(
})
minetest.register_craftitem(
"nav:compass_6",
"rp_nav:compass_6",
{
description = d,
_tt_help = t,
@ -135,7 +135,7 @@ minetest.register_craftitem(
})
minetest.register_craftitem(
"nav:compass_7",
"rp_nav:compass_7",
{
description = d,
_tt_help = t,
@ -147,13 +147,13 @@ minetest.register_craftitem(
stack_max = 1,
})
minetest.register_alias("nav:compass", "nav:compass_0")
minetest.register_alias("rp_nav:compass", "rp_nav:compass_0")
-- Crafting
crafting.register_craft(
{
output = "nav:compass",
output = "rp_nav:compass",
items = {
"rp_default:ingot_steel 4",
"rp_default:stick",
@ -168,7 +168,12 @@ achievements.register_achievement(
title = S("True Navigator"),
description = S("Craft a compass."),
times = 1,
craftitem = "nav:compass_0",
craftitem = "rp_nav:compass_0",
})
minetest.register_alias("nav:compass", "rp_nav:compass_0")
for i=0, 7 do
minetest.register_alias("nav:compass_"..i, "rp_nav:compass_"..i)
end
default.log("compass", "loaded")

12
mods/rp_nav/init.lua Normal file
View File

@ -0,0 +1,12 @@
--
-- Nav mod
-- By Kaadmy, for Pixture
--
nav = {}
dofile(minetest.get_modpath("rp_nav").."/waypoints.lua") -- TODO: Waypoint implenentation is a stub
dofile(minetest.get_modpath("rp_nav").."/map.lua")
dofile(minetest.get_modpath("rp_nav").."/compass.lua")
default.log("mod:rp_nav", "loaded")

View File

@ -1,4 +1,4 @@
# textdomain: nav
# textdomain: rp_nav
Compass=Kompass
Map=Karte
Navigator=Navigator

View File

@ -1,4 +1,4 @@
# textdomain: nav
# textdomain: rp_nav
Compass=Boussole
Map=Carte
Navigator=Navigateur

View File

@ -1,4 +1,4 @@
# textdomain: nav
# textdomain: rp_nav
Compass=
Map=
Navigator=

View File

@ -3,7 +3,7 @@
-- Map handling
--
local S = minetest.get_translator("nav")
local S = minetest.get_translator("rp_nav")
-- Based on Minetest Game's map mod, licensed under MIT License.
@ -23,7 +23,7 @@ function nav.map.update_hud_flags(player)
creative_mode_cache
local minimap_enabled = creative_enabled or
player:get_inventory():contains_item("main", "nav:map")
player:get_inventory():contains_item("main", "rp_nav:map")
local radar_enabled = creative_enabled
player:hud_set_flags({
@ -46,11 +46,11 @@ minetest.register_on_player_inventory_action(function(player, action, inventory,
if action == "move" then
local stack_from = inventory:get_stack(inventory_info.from_list, inventory_info.from_index)
local stack_to = inventory:get_stack(inventory_info.to_list, inventory_info.to_index)
if stack_from:get_name() == "nav:map" or stack_to:get_name() == "nav:map" then
if stack_from:get_name() == "rp_nav:map" or stack_to:get_name() == "rp_nav:map" then
nav.map.update_hud_flags(player)
end
elseif action == "put" or action == "take" then
if inventory_info.stack:get_name() == "nav:map" then
if inventory_info.stack:get_name() == "rp_nav:map" then
nav.map.update_hud_flags(player)
end
end
@ -72,7 +72,7 @@ minetest.after(5.3, cyclic_update)
-- Items
minetest.register_craftitem(
"nav:map",
"rp_nav:map",
{
description = S("Map"),
_tt_help = S("Keep this in your inventory and view the map with the 'minimap' key"),
@ -89,7 +89,7 @@ minetest.register_craftitem(
crafting.register_craft(
{
output = "nav:map",
output = "rp_nav:map",
items = {
"rp_default:stick 6",
"rp_default:paper 3",
@ -105,7 +105,9 @@ achievements.register_achievement(
title = S("Navigator"),
description = S("Craft a map."),
times = 1,
craftitem = "nav:map",
craftitem = "rp_nav:map",
})
minetest.register_alias("nav:map", "rp_nav:map")
default.log("map", "loaded")

View File

@ -1,2 +1,2 @@
name = nav
name = rp_nav
depends = rp_default, rp_util, rp_achievements

View File

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 202 B

View File

Before

Width:  |  Height:  |  Size: 141 B

After

Width:  |  Height:  |  Size: 141 B

View File

Before

Width:  |  Height:  |  Size: 153 B

After

Width:  |  Height:  |  Size: 153 B

View File

Before

Width:  |  Height:  |  Size: 172 B

After

Width:  |  Height:  |  Size: 172 B

View File

Before

Width:  |  Height:  |  Size: 176 B

After

Width:  |  Height:  |  Size: 176 B

View File

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 213 B

View File

Before

Width:  |  Height:  |  Size: 156 B

After

Width:  |  Height:  |  Size: 156 B

View File

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 178 B

View File

Before

Width:  |  Height:  |  Size: 153 B

After

Width:  |  Height:  |  Size: 153 B

View File

Before

Width:  |  Height:  |  Size: 209 B

After

Width:  |  Height:  |  Size: 209 B

View File

@ -1,3 +1,3 @@
name = village
depends = rp_default, rp_util, mobs, rp_goodies, nav, rp_privs
depends = rp_default, rp_util, mobs, rp_goodies, rp_nav, rp_privs
optional_depends = rp_locks