Repository: godotengine/godot
File: editor/plugins/sprite_frames_editor_plugin.cpp (C++)

Code before:
	SpriteFrames *frames = Object::cast_to<SpriteFrames>(p_object);
	if (frames && (frames_editor->get_sprite_frames().is_null() || frames_editor->get_sprite_frames() == frames)) {
		return true;
	}
	return false;
}

void SpriteFramesEditorPlugin::make_visible(bool p_visible) {
	if (p_visible) {
		button->show();
		EditorNode::get_bottom_panel()->make_item_visible(frames_editor);
	} else {
		button->hide();
		if (frames_editor->is_visible_in_tree()) {
			EditorNode::get_bottom_panel()->hide_bottom_panel();
		}
	}
}

SpriteFramesEditorPlugin::SpriteFramesEditorPlugin() {
	frames_editor = memnew(SpriteFramesEditor);
	frames_editor->set_custom_minimum_size(Size2(0, 300) * EDSCALE);
	button = EditorNode::get_bottom_panel()->add_item(TTR("SpriteFrames"), frames_editor, ED_SHORTCUT_AND_COMMAND("bottom_panels/toggle_sprite_frames_bottom_panel", TTR("Toggle SpriteFrames Bottom Panel")));
	button->hide();
}

SpriteFramesEditorPlugin::~SpriteFramesEditorPlugin() {
}


Review comment (suggestion):
Note that in the region editor it's without a dash, we should be consistent about it.
https://github.com/godotengine/godot/blob/e63c40e59c6650bdba02c2ceff3390ee9273ac46/editor/plugins/texture_region_editor_plugin.cpp#L1139
```suggestion
	auto_slice->set_text(TTR("Auto Slice"));
```

Code after:
	split_sheet_offset_hb->set_h_size_flags(SIZE_EXPAND_FILL);

	Label *split_sheet_offset_label = memnew(Label(TTR("Offset")));
	split_sheet_offset_label->set_h_size_flags(SIZE_EXPAND_FILL);
	split_sheet_offset_label->set_v_size_flags(SIZE_SHRINK_BEGIN);
	split_sheet_offset_hb->add_child(split_sheet_offset_label);

	VBoxContainer *split_sheet_offset_vb = memnew(VBoxContainer);
	split_sheet_offset_vb->set_h_size_flags(SIZE_EXPAND_FILL);
	split_sheet_offset_x = memnew(SpinBox);
	split_sheet_offset_x->set_min(0);
	split_sheet_offset_x->set_step(1);
	split_sheet_offset_x->set_suffix("px");
	split_sheet_offset_x->set_select_all_on_focus(true);
	split_sheet_offset_x->connect(SceneStringName(value_changed), callable_mp(this, &SpriteFramesEditor::_sheet_spin_changed).bind(PARAM_USE_CURRENT));
	split_sheet_offset_vb->add_child(split_sheet_offset_x);
	split_sheet_offset_y = memnew(SpinBox);
	split_sheet_offset_y->set_min(0);
	split_sheet_offset_y->set_step(1);
	split_sheet_offset_y->set_suffix("px");
	split_sheet_offset_y->set_select_all_on_focus(true);
	split_sheet_offset_y->connect(SceneStringName(value_changed), callable_mp(this, &SpriteFramesEditor::_sheet_spin_changed).bind(PARAM_USE_CURRENT));
	split_sheet_offset_vb->add_child(split_sheet_offset_y);
	split_sheet_offset_hb->add_child(split_sheet_offset_vb);
	split_sheet_settings_vb->add_child(split_sheet_offset_hb);

	Button *auto_slice = memnew(Button);
	auto_slice->set_text(TTR("Auto Slice"));
	auto_slice->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_auto_slice_sprite_sheet));
	split_sheet_settings_vb->add_child(auto_slice);

	split_sheet_hb->add_child(split_sheet_settings_vb);

	file_split_sheet = memnew(EditorFileDialog);
	file_split_sheet->set_title(TTR("Create Frames from Sprite Sheet"));
	file_split_sheet->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE);
	add_child(file_split_sheet);
	file_split_sheet->connect("file_selected", callable_mp(this, &SpriteFramesEditor::_prepare_sprite_sheet));

	// Config scale.
	scale_ratio = 1.2f;
	thumbnail_default_size = 96 * MAX(1, EDSCALE);
	thumbnail_zoom = MAX(1.0f, EDSCALE);
	max_thumbnail_zoom = 8.0f * MAX(1.0f, EDSCALE);
	min_thumbnail_zoom = 0.1f * MAX(1.0f, EDSCALE);
	// Default the zoom to match the editor scale, but don't dezoom on editor scales below 100% to prevent pixel art from looking bad.
	sheet_zoom = MAX(1.0f, EDSCALE);
	max_sheet_zoom = 128.0f * MAX(1.0f, EDSCALE);
	min_sheet_zoom = 0.01f * MAX(1.0f, EDSCALE);
	_zoom_reset();