Skip to content

Commit

Permalink
Fixed according to review results
Browse files Browse the repository at this point in the history
  • Loading branch information
dreadpon committed Jun 29, 2022
1 parent 500168d commit 64e6a0a
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 29 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ If you want to report a bug or request a feature, you should do so on GitHub usi

You're welcome to support me on:

- **[<img src="https://i.postimg.cc/QCfW2L37/Digital-Patreon-Logo-Fiery-Coral.png" width="16" style="margin-right:4px"/> Patreon](https://www.patreon.com/dreadpon?fan_landing=true)**
- **[<img src="https://i.postimg.cc/QCfW2L37/Digital-Patreon-Logo-Fiery-Coral.png" width="16" style="margin-right:4px"/> Patreon](https://www.patreon.com/dreadpon)**
- **[<img src="https://i.postimg.cc/Hkc7hPPJ/Color.png" width="16" style="margin-right:4px"/> Boosty](https://boosty.to/dreadpon)**

This will help make updates for this plugin and embark on any new projects I set my eyes on.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ func update_size():
func update_size_step2():
var thumb_rect = Vector2(thumb_size, thumb_size)
var button_rect = Vector2(button_size, button_size)
var toMargin = thumb_size - button_size - 4
var to_margin = thumb_size - button_size - 4
var scale = float(button_size) / 32.0

print("%s %s" % [str(thumb_rect), str(button_rect)])
root_button_nd.set_size(thumb_rect)
texture_rect_nd.set_size(thumb_rect)

Expand All @@ -141,20 +143,26 @@ func update_size_step2():
check_box_nd.get_icon("checked").set_size_override(button_rect)
check_box_nd.get_icon("unchecked").set_size_override(button_rect)
check_box_nd.set_size(button_rect)
check_box_nd.set_position(Vector2(4, toMargin))
check_box_nd.set_position(Vector2(4, to_margin))
if is_instance_valid(clear_button_nd):
clear_button_nd.set_size(button_rect)
clear_button_nd.set_position(Vector2(4, 4))
if is_instance_valid(delete_button_nd):
delete_button_nd.set_size(button_rect)
delete_button_nd.set_position(Vector2(toMargin, 4))
delete_button_nd.set_position(Vector2(to_margin, 4))
if is_instance_valid(counter_container_nd):
counter_container_nd.set_size(button_rect)
counter_container_nd.set_position(Vector2(toMargin, toMargin))
counter_container_nd.set_position(Vector2(to_margin, to_margin))

counter_label_nd.rect_pivot_offset = counter_label_nd.rect_size
var scale = float(button_size) / 32.0
counter_label_nd.rect_scale = Vector2(scale, scale)
var label = counter_container_nd.get_child(0)
var font = label.get_font("font", "").duplicate()
font.size *= scale
label.add_font_override("font", font)
if is_instance_valid(alt_text_margin_nd):
var label = alt_text_margin_nd.get_child(0)
var font = label.get_font("font", "").duplicate()
font.size *= scale
label.add_font_override("font", font)

rect_size = thumb_rect
rect_min_size = thumb_rect
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ func _init():

func update_size_step2():
var button_rect = Vector2(button_size, button_size)
var toMargin = float(thumb_size - button_size) * 0.5
var to_margin = float(thumb_size - button_size) * 0.5

.update_size_step2()

texture_rect_nd.set_size(button_rect)
texture_rect_nd.set_position(Vector2(toMargin, toMargin))
texture_rect_nd.set_position(Vector2(to_margin, to_margin))



Expand Down
3 changes: 2 additions & 1 deletion addons/dreadpon.spatial_gardener/controls/ui_side_panel.gd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ func _ready():

size_flags_horizontal = Control.SIZE_EXPAND_FILL
size_flags_stretch_ratio = 0.3
rect_min_size.x = 275.0
rect_min_size.x = 100.0
rect_size.x = 300.0

gardener_ui_tools.name = "gardener_ui_tools"
gardener_ui_tools.split_offset = 80
Expand Down
2 changes: 1 addition & 1 deletion addons/dreadpon.spatial_gardener/greenhouse/greenhouse.gd
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func _create_input_field(_base_control:Control, _resource_previewer, prop:String
"add_create_inst_button": true,
"_base_control": _base_control,
"accepted_classes": ["Greenhouse_PlantState"],
"element_display_size": 100,
"element_display_size": 100 * FunLib.get_setting_safe("dreadpons_spatial_gardener/input_and_ui/greenhouse_thumbnail_scale", 1.0),
"element_interaction_flags": UI_IF_ThumbnailArray.PRESET_PLANT_STATE,
"_resource_previewer": _resource_previewer,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func _create_input_field(_base_control:Control, _resource_previewer, prop:String
"_base_control": _base_control,
# Godot really needs a proper class check
"accepted_classes": Globals.MESH_CLASSES,
"element_display_size": 75,
"element_display_size": 75 * FunLib.get_setting_safe("dreadpons_spatial_gardener/input_and_ui/greenhouse_thumbnail_scale", 1.0),
"element_interaction_flags": UI_IF_ThumbnailArray.PRESET_RESOURCE,
"_resource_previewer": _resource_previewer,
}
Expand All @@ -47,7 +47,7 @@ func _create_input_field(_base_control:Control, _resource_previewer, prop:String
var settings := {
"_base_control": _base_control,
"accepted_classes": ["PackedScene"],
"element_display_size": 75,
"element_display_size": 75 * FunLib.get_setting_safe("dreadpons_spatial_gardener/input_and_ui/greenhouse_thumbnail_scale", 1.0),
"element_interaction_flags": UI_IF_ThumbnailArray.PRESET_RESOURCE,
"_resource_previewer": _resource_previewer,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var mesh_LOD_max_distance:float = 10.0
var mesh_LOD_kill_distance:float = -1.0

# How many members fit into an octree node before it's subdivided
var mesh_LOD_max_capacity:int = 50
var mesh_LOD_max_capacity:int = 75
# Minimum size of an octree node. Will not subdivide after this treshold
# Chunks of minimum size might contain members beyond the capacity limit
var mesh_LOD_min_size:float = 1.0
Expand Down Expand Up @@ -128,7 +128,7 @@ func _create_input_field(__base_control:Control, __resource_previewer, prop:Stri
"add_create_inst_button": true,
"_base_control": _base_control,
"accepted_classes": accepted_classes,
"element_display_size": 75,
"element_display_size": 75 * FunLib.get_setting_safe("dreadpons_spatial_gardener/input_and_ui/greenhouse_thumbnail_scale", 1.0),
"element_interaction_flags": UI_IF_ThumbnailArray.PRESET_LOD_VARIANT,
"_resource_previewer": _resource_previewer,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ static func add_plugin_project_settings():
"dreadpons_spatial_gardener/input_and_ui/greenhouse_ui_enable_undo_redo",
true,
TYPE_BOOL)
add_project_setting(
"dreadpons_spatial_gardener/input_and_ui/greenhouse_thumbnail_scale",
1.0,
TYPE_REAL)
add_project_setting_globals_enum(
"dreadpons_spatial_gardener/input_and_ui/brush_property_edit_modifier_key",
Globals.KeyList.KEY_SHIFT, Globals.KeyList)
Expand Down
4 changes: 4 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ config_version=4
config/name="Dreadpon's Spatial Gardener"
config/icon="res://icon.png"

[editor_plugins]

enabled=PoolStringArray( "res://addons/dreadpon.spatial_gardener/plugin.cfg" )

[physics]

common/enable_pause_aware_picking=true
Expand Down
8 changes: 4 additions & 4 deletions reference/TUTORIAL_QUICK_START.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
## Plugin Setup
You should have Godot engine installed; if not, you can download it from the [official website.](https://godotengine.org/download)

Recommended version is [3.4.2 and can be easily found on Godot's GitHub](https://github.com/godotengine/godot/releases), however, most 3.x versions should be supported. Godot 4 is not supported at the moment.
Minimum and most compatible version is [3.4.2 and can be easily found on Godot's GitHub](https://github.com/godotengine/godot/releases/tag/3.4.2-stable).

![t_pt1_001_godot_older_download](https://i.postimg.cc/sgjxVHJn/t-pt1-001-godot-older-download.jpg)

Grab a copy of the showcase project from [GitHub](https://github.com/dreadpon/godot_spatial_gardener). Open the page, go to `Releases`, find the latest version and download the `godot_spatial_gardener_demo.zip`.
Grab a copy of the demo project from [GitHub](https://github.com/dreadpon/godot_spatial_gardener). Open the page, go to `Releases`, find the latest version and download the `godot_spatial_gardener_demo.zip`.

![t_pt1_002_plugin_demo_download](https://i.postimg.cc/DwxZmQj7/t-pt1-002-plugin-demo-download.jpg)

Expand Down Expand Up @@ -149,7 +149,7 @@ Last thing: collision. If you click on `LOD Variants`, you'll see two properties

![t_pt1_025_inside_lod_variant](https://i.postimg.cc/bJCdMxn6/t-pt1-025-inside-lod-variant.jpg)

Find `body_plants_tree_pine.tscn` and drag it over `Spawned Spatial`.
Find `body_plants_tree_pine.tscn` and drag it over `Spawned Spatial` for each of the variants.

![t_pt1_026_assigning_collision](https://i.postimg.cc/kXtD1tgc/t-pt1-026-assigning-collision.jpg)

Expand Down Expand Up @@ -191,7 +191,7 @@ In terms of environment design, this means our bushes will mostly point upwards,

## Final steps

In Spatial Gardener you can paint with several plant types simultaneously. Deselect trees, select bushes with grass and paint them.
In Spatial Gardener you can paint with several plant types simultaneously. Deselect trees, select bushes with grass and paint them. If you can't see your grass, temporarily disable `LOD Kill Distance` by setting it to -1.

![t_pt1_034_select_bush_grass_painting](https://i.postimg.cc/sXNDKVFq/t-pt1-034-select-bush-grass-painting.jpg)

Expand Down

0 comments on commit 64e6a0a

Please sign in to comment.