Skip to content

Commit

Permalink
Implement InspectorPropertyArray
Browse files Browse the repository at this point in the history
Closes #2
  • Loading branch information
4d49 committed Apr 23, 2024
1 parent 6425134 commit 98306b3
Show file tree
Hide file tree
Showing 5 changed files with 364 additions and 5 deletions.
1 change: 1 addition & 0 deletions icons/delete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 27 additions & 1 deletion inspector_theme.tres
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[gd_resource type="Theme" load_steps=13 format=3 uid="uid://dyf67c0ud50ts"]
[gd_resource type="Theme" load_steps=16 format=3 uid="uid://dyf67c0ud50ts"]

[ext_resource type="Texture2D" uid="uid://cr6jrnuywr8g4" path="res://addons/object-inspector/icons/maximize.svg" id="1_hfaeu"]
[ext_resource type="Texture2D" uid="uid://cfw5fv6chuy5o" path="res://addons/object-inspector/icons/collapsed.svg" id="1_hpca1"]
[ext_resource type="Texture2D" uid="uid://dec8bwwwl2po1" path="res://addons/object-inspector/icons/expanded.svg" id="2_0jwgf"]
[ext_resource type="Texture2D" uid="uid://bq3g4y2emis6p" path="res://addons/object-inspector/icons/search.svg" id="2_vebvf"]
[ext_resource type="Texture2D" uid="uid://ce8g2ipkdytv4" path="res://addons/object-inspector/icons/page_first.svg" id="5_e0bdv"]
[ext_resource type="Texture2D" uid="uid://xk56atdieu1t" path="res://addons/object-inspector/icons/edit.svg" id="5_x0g0o"]
[ext_resource type="Texture2D" uid="uid://ccs8xtkn7x5wd" path="res://addons/object-inspector/icons/page_last.svg" id="6_wdbtw"]
[ext_resource type="Texture2D" uid="uid://bd0mwwwcv347l" path="res://addons/object-inspector/icons/page_next.svg" id="7_hjbvh"]
[ext_resource type="Texture2D" uid="uid://cysi7j6pgq3m" path="res://addons/object-inspector/icons/page_prev.svg" id="8_ybigx"]
[ext_resource type="Texture2D" uid="uid://bblbrs0vcnuui" path="res://addons/object-inspector/icons/delete.svg" id="9_t1qfx"]

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_h08j0"]

Expand Down Expand Up @@ -65,6 +67,24 @@ corner_radius_bottom_left = 2
corner_detail = 2
anti_aliasing = false

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ruqut"]
content_margin_left = 2.0
content_margin_top = 2.0
content_margin_right = 2.0
content_margin_bottom = 2.0
bg_color = Color(0.25, 0.35, 0.5, 0.25)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.25, 0.25, 0.5, 0.5)
corner_radius_top_left = 2
corner_radius_top_right = 2
corner_radius_bottom_right = 2
corner_radius_bottom_left = 2
corner_detail = 2
anti_aliasing = false

[resource]
BoxContainer/constants/separation = 1
FlowContainer/constants/h_separation = 1
Expand All @@ -74,6 +94,10 @@ Inspector/icons/maximize = ExtResource("1_hfaeu")
Inspector/icons/search = ExtResource("2_vebvf")
InspectorProperty/base_type = &"PanelContainer"
InspectorProperty/styles/panel = SubResource("StyleBoxEmpty_h08j0")
InspectorPropertyArray/base_type = &"PanelContainer"
InspectorPropertyArray/icons/delete = ExtResource("9_t1qfx")
InspectorPropertyArray/icons/edit = ExtResource("5_x0g0o")
InspectorPropertyArray/styles/panel = SubResource("StyleBoxEmpty_h08j0")
InspectorPropertyCategory/base_type = &"PanelContainer"
InspectorPropertyCategory/styles/panel = SubResource("StyleBoxFlat_3ctcn")
InspectorPropertyGroup/base_type = &"PanelContainer"
Expand All @@ -87,3 +111,5 @@ InspectorPropertyPaginator/icons/page_next = ExtResource("7_hjbvh")
InspectorPropertyPaginator/icons/page_prev = ExtResource("8_ybigx")
InspectorPropertySubGroup/base_type = &"InspectorPropertyGroup"
InspectorPropertySubGroup/styles/panel = SubResource("StyleBoxFlat_cncyr")
InspectorSubProperty/base_type = &"InspectorProperty"
InspectorSubProperty/styles/panel = SubResource("StyleBoxFlat_ruqut")
4 changes: 0 additions & 4 deletions scripts/inspector.gd
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ extends VBoxContainer
## Emitted when object changed.
signal object_changed(object: Object)

# INFO: Required for static initialization.
const InspectorProperties = preload("res://addons/object-inspector/scripts/inspector_properties.gd")


@export
var _readonly := false:
Expand Down Expand Up @@ -55,7 +52,6 @@ func _init() -> void:

# INFO: Required for static initialization.
load("res://addons/object-inspector/scripts/inspector_property_array.gd")
load("res://addons/object-inspector/scripts/inspector_property_dictionary.gd")

_search = LineEdit.new()
_search.set_placeholder("Filter properties")
Expand Down
Loading

0 comments on commit 98306b3

Please sign in to comment.