Skip to content

Commit

Permalink
Remove ItemList editor and replace it by a property array
Browse files Browse the repository at this point in the history
  • Loading branch information
groud committed Oct 28, 2021
1 parent 435d50b commit a51f922
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 723 deletions.
2 changes: 1 addition & 1 deletion core/object/class_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ class ClassDB {

static void add_property_group(const StringName &p_class, const String &p_name, const String &p_prefix = "");
static void add_property_subgroup(const StringName &p_class, const String &p_name, const String &p_prefix = "");
static void add_property_array_count(const StringName &p_class, const String &p_label, const StringName &p_count_property, const StringName &p_count_setter, const StringName &p_count_getter, const String &p_array_element_prefix, uint32_t p_count_usage = PROPERTY_USAGE_EDITOR);
static void add_property_array_count(const StringName &p_class, const String &p_label, const StringName &p_count_property, const StringName &p_count_setter, const StringName &p_count_getter, const String &p_array_element_prefix, uint32_t p_count_usage = PROPERTY_USAGE_DEFAULT);
static void add_property_array(const StringName &p_class, const StringName &p_path, const String &p_array_element_prefix);
static void add_property(const StringName &p_class, const PropertyInfo &p_pinfo, const StringName &p_setter, const StringName &p_getter, int p_index = -1);
static void set_property_default_value(const StringName &p_class, const StringName &p_name, const Variant &p_default);
Expand Down
9 changes: 3 additions & 6 deletions doc/classes/ItemList.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,6 @@
When there is no item at that point, -1 will be returned if [code]exact[/code] is [code]true[/code], and the closest item index will be returned otherwise.
</description>
</method>
<method name="get_item_count" qualifiers="const">
<return type="int" />
<description>
Returns the number of items currently in the list.
</description>
</method>
<method name="get_item_custom_bg_color" qualifiers="const">
<return type="Color" />
<argument index="0" name="idx" type="int" />
Expand Down Expand Up @@ -387,6 +381,9 @@
<member name="icon_scale" type="float" setter="set_icon_scale" getter="get_icon_scale" default="1.0">
The scale of icon applied after [member fixed_icon_size] and transposing takes effect.
</member>
<member name="items_count" type="int" setter="set_item_count" getter="get_item_count" default="0">
The number of items currently in the list.
</member>
<member name="max_columns" type="int" setter="set_max_columns" getter="get_max_columns" default="1">
Maximum columns the list will have.
If greater than zero, the content will be split among the specified columns.
Expand Down
2 changes: 0 additions & 2 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@
#include "editor/plugins/gpu_particles_collision_sdf_editor_plugin.h"
#include "editor/plugins/gradient_editor_plugin.h"
#include "editor/plugins/input_event_editor_plugin.h"
#include "editor/plugins/item_list_editor_plugin.h"
#include "editor/plugins/light_occluder_2d_editor_plugin.h"
#include "editor/plugins/lightmap_gi_editor_plugin.h"
#include "editor/plugins/line_2d_editor_plugin.h"
Expand Down Expand Up @@ -6960,7 +6959,6 @@ EditorNode::EditorNode() {
add_editor_plugin(memnew(CPUParticles2DEditorPlugin(this)));
add_editor_plugin(memnew(CPUParticles3DEditorPlugin(this)));
add_editor_plugin(memnew(ResourcePreloaderEditorPlugin(this)));
add_editor_plugin(memnew(ItemListEditorPlugin(this)));
add_editor_plugin(memnew(Polygon3DEditorPlugin(this)));
add_editor_plugin(memnew(CollisionPolygon2DEditorPlugin(this)));
add_editor_plugin(memnew(TilesEditorPlugin(this)));
Expand Down
Loading

0 comments on commit a51f922

Please sign in to comment.