Add Preview resize, fix GDScript fields not working

This commit is contained in:
don-tnowe 2022-09-26 22:12:09 +03:00
parent c1354071ed
commit 7e28c1d79f
2 changed files with 14 additions and 4 deletions

View File

@ -759,8 +759,18 @@ min_value = 32.0
max_value = 512.0
value = 128.0
[node name="Label4" type="Label" parent="Control/Settings/MarginContainer/RichTextLabel/GridContainer"]
[node name="Label6" type="Label" parent="Control/Settings/MarginContainer/RichTextLabel/GridContainer"]
layout_mode = 2
offset_top = 107.0
offset_right = 513.0
offset_bottom = 133.0
size_flags_horizontal = 3
text = "Resource preview size (Including Textures)"
autowrap_mode = 2
[node name="ResourcePreviewSize" type="SpinBox" parent="Control/Settings/MarginContainer/RichTextLabel/GridContainer"]
layout_mode = 2
offset_left = 517.0
offset_top = 105.0
offset_right = 513.0
offset_bottom = 157.0

View File

@ -32,10 +32,10 @@ func set_value(node : Control, value):
else:
node.get_node("Box/Tex").visible = false
previewer.queue_resource_preview(value.resource_path, self, &"_on_preview_loaded", node)
node.get_node("Box/Tex").custom_minimum_size = Vector2.ONE * ProjectSettings.get_setting(
SettingsGrid.SETTING_PREFIX + "resource_preview_size"
)
SettingsGrid.SETTING_PREFIX + "resource_preview_size"
)
func set_color(node : Control, color : Color):