File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -870,6 +870,10 @@ void EditorPropertyEnum::set_option_button_clip(bool p_enable) {
870870 options->set_clip_text (p_enable);
871871}
872872
873+ OptionButton *EditorPropertyEnum::get_option_button () {
874+ return options;
875+ }
876+
873877EditorPropertyEnum::EditorPropertyEnum () {
874878 options = memnew (OptionButton);
875879 options->set_clip_text (true );
Original file line number Diff line number Diff line change @@ -272,6 +272,7 @@ class EditorPropertyEnum : public EditorProperty {
272272 void setup (const Vector<String> &p_options);
273273 virtual void update_property () override ;
274274 void set_option_button_clip (bool p_enable);
275+ OptionButton *get_option_button (); // Hack to allow setting icons.
275276 EditorPropertyEnum ();
276277};
277278
Original file line number Diff line number Diff line change @@ -1887,7 +1887,7 @@ void TileDataTerrainsEditor::_update_terrain_selector() {
18871887
18881888 // Kind of a hack to set icons.
18891889 // We could provide a way to modify that in the EditorProperty.
1890- OptionButton *option_button = Object::cast_to<OptionButton>( terrain_property_editor->get_child ( 0 ) );
1890+ OptionButton *option_button = terrain_property_editor->get_option_button ( );
18911891 for (int terrain = 0 ; terrain < tile_set->get_terrains_count (terrain_set); terrain++) {
18921892 option_button->set_item_icon (terrain + 1 , icons[terrain_set][terrain]);
18931893 }
You can’t perform that action at this time.
0 commit comments