Skip to content

Commit

Permalink
- Autodetail now defaults to off when UDMF is the selected map format.
Browse files Browse the repository at this point in the history
  • Loading branch information
GTD-Carthage committed Mar 22, 2021
1 parent e0437b1 commit 7aeef64
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/prefab_controller.lua
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ OB_MODULES["prefab_control"] =
name = "autodetail",
label=("Auto Detailing"),
choices=PREFAB_CONTROL.ON_OFF,
tooltip = "Reduces the amount of complex architecture in a map based on its size. Default is on.",
tooltip = "Reduces the amount of complex architecture in a map based on its size. " ..
"Default is on in binary map format, off in UDMF map format.",
default = "on",
priority = 102,
gap = 1
Expand All @@ -177,7 +178,11 @@ OB_MODULES["prefab_control"] =
name = "point_prob",
label=_("Point Decor"),
choices=PREFAB_CONTROL.POINT_CHOICES,
tooltip = "Decor prefabs are prefabs placed along the floors such as crates, pillars, and other decorative elements which aren't tied to walls. This directly modifies probabilities on a per-room basis, not the density for decor prefabs in any given room.\n\nNote: DEFAULT actually behaves like Mix-It-Up.",
tooltip = "Decor prefabs are prefabs placed along the floors such as " ..
"crates, pillars, and other decorative elements which aren't tied to walls. " ..
"This directly modifies probabilities on a per-room basis, " ..
"not the density for decor prefabs in any given room. " ..
"\n\nNote: DEFAULT actually behaves like Mix-It-Up.",
default = "fab_default",
priority = 101
},
Expand Down
9 changes: 9 additions & 0 deletions scripts/autodetail.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ function Autodetail_get_level_svolume()
LEVEL.autodetail_group_walls_factor = 1

if PARAM.autodetail == "off" then return end
if not PARAM.autodetail
and OB_CONFIG.map_format
and OB_CONFIG.map_format == "udmf" then return end

local total_walkable_area = 0

Expand All @@ -63,6 +66,9 @@ function Autodetail_plain_walls()
LEVEL.autodetail_plain_walls_factor = 0

if PARAM.autodetail == "off" then return end
if not PARAM.autodetail
and OB_CONFIG.map_format
and OB_CONFIG.map_format == "udmf" then return end

local total_perimeter = 0
for _,junc in pairs(LEVEL.junctions) do
Expand Down Expand Up @@ -100,6 +106,9 @@ end

function Autodetail_report()
if PARAM.autodetail == "off" then return end
if not PARAM.autodetail
and OB_CONFIG.map_format
and OB_CONFIG.map_format == "udmf" then return end

gui.printf("\n--==| Auto Detail Report |==--\n\n")
gui.printf("Total walkable volume: " .. LEVEL.total_svolume .. "\n")
Expand Down

0 comments on commit 7aeef64

Please sign in to comment.