Skip to content

Commit

Permalink
Apply random plants option.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwatkot committed Dec 22, 2024
1 parent c454c03 commit 825070b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions webui/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def add_left_widgets(self) -> None:
self.fields_padding = 0
self.farmland_margin = 3
self.forest_density = 10
self.randomize_plants = True

if not self.auto_process:
self.logger.info("Auto preset is disabled.")
Expand Down Expand Up @@ -347,6 +348,13 @@ def add_left_widgets(self) -> None:
label_visibility="collapsed",
)

st.write("Random plants:")
st.write(Messages.RANDOMIZE_PLANTS_INFO)

self.randomize_plants = st.checkbox(
"Random plants", value=True, key="randomize_plants"
)

# Add an empty container for status messages.
self.status_container = st.empty()

Expand Down Expand Up @@ -455,6 +463,7 @@ def generate_map(self) -> None:
fields_padding=self.fields_padding,
farmland_margin=self.farmland_margin,
forest_density=self.forest_density,
randomize_plants=self.randomize_plants,
)

if self.community:
Expand Down
4 changes: 4 additions & 0 deletions webui/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,7 @@ class Messages:
"and the map size, it may generate dozens of thousands of trees, which can cause "
"performance issues."
)
RANDOMIZE_PLANTS_INFO = (
"If checked, random species of plants will be generated. "
"If unchecked, only basic smallDenseMix will be applied."
)

0 comments on commit 825070b

Please sign in to comment.