Skip to content

Commit

Permalink
make mapping kit requirement more flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
FaceDeer committed Jan 31, 2020
1 parent c612972 commit f6d9c04
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
9 changes: 6 additions & 3 deletions settlements/buildings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ local settlement_waypoint_def = {
default_color = 0xFFFFFF,
discovery_volume_radius = tonumber(minetest.settings:get("settlements_discovery_range")) or 30,
}
if minetest.settings:get_bool("settlements_hud_requires_mapping_kit", true)
and minetest.registered_items["map:mapping_kit"] then
settlement_waypoint_def.visibility_requires_item = "map:mapping_kit"
if minetest.settings:get_bool("settlements_hud_requires_item", true) then
local item_required = minetest.settings:get("settlements_hud_item_required")
if item_required == nil or item_required == "" then
item_required = "map:mapping_kit"
end
settlement_waypoint_def.visibility_requires_item = item_required
end
if minetest.settings:get_bool("settlements_show_in_hud", true) then
settlement_waypoint_def.visibility_volume_radius = tonumber(minetest.settings:get("settlements_visibility_range")) or 600
Expand Down
2 changes: 1 addition & 1 deletion settlements/mod.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = settlements
description = API for adding small settlements to map generation.
depends = named_waypoints
optional_depends = commoditymarket, map, intllib
optional_depends = commoditymarket, intllib
8 changes: 5 additions & 3 deletions settlements/settingtypes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ settlements_generate_books (Generate books to populate shelves in settlements) b
#existing discoveries will not be removed and will be visible again if
#this is reenabled)
settlements_show_in_hud (Show settlement names in HUD) bool true
#Players can still discover the locations of settlements without a map, but waypoints
#will only be visible in their hud if they have a mapping kit in their inventory
settlements_hud_requires_mapping_kit (Require mapping kit to view waypoints) bool true
settlements_hud_requires_item (Require an item to view waypoints) bool true
#Players can still discover the locations of settlements without this, but waypoints
#will only be visible in their hud if they have this item in their inventory. You can also
#specify "group:groupname" here. Leave it blank to default to map:mapping_kit.
settlements_hud_item_required (Specify the item or group required) string map:mapping_kit
settlements_discovery_range (Settlement discovery range) int 30
settlements_visibility_range (Settlement visibility range) int 600

0 comments on commit f6d9c04

Please sign in to comment.