Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions editor/inspector/editor_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,10 @@ void EditorPropertyEnum::set_option_button_clip(bool p_enable) {
options->set_clip_text(p_enable);
}

OptionButton *EditorPropertyEnum::get_option_button() {
return options;
}

EditorPropertyEnum::EditorPropertyEnum() {
options = memnew(OptionButton);
options->set_clip_text(true);
Expand Down
1 change: 1 addition & 0 deletions editor/inspector/editor_properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ class EditorPropertyEnum : public EditorProperty {
void setup(const Vector<String> &p_options);
virtual void update_property() override;
void set_option_button_clip(bool p_enable);
OptionButton *get_option_button(); // Hack to allow setting icons.
EditorPropertyEnum();
};

Expand Down
2 changes: 1 addition & 1 deletion editor/scene/2d/tiles/tile_data_editors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1887,7 +1887,7 @@ void TileDataTerrainsEditor::_update_terrain_selector() {

// Kind of a hack to set icons.
// We could provide a way to modify that in the EditorProperty.
OptionButton *option_button = Object::cast_to<OptionButton>(terrain_property_editor->get_child(0));
OptionButton *option_button = terrain_property_editor->get_option_button();
for (int terrain = 0; terrain < tile_set->get_terrains_count(terrain_set); terrain++) {
option_button->set_item_icon(terrain + 1, icons[terrain_set][terrain]);
}
Expand Down