Moved the new classes into the entity system.

This commit is contained in:
Relintai 2019-07-05 21:03:05 +02:00
parent 9a2869f289
commit 8c7537c3cb
8 changed files with 0 additions and 202 deletions

3
SCsub
View File

@ -3,6 +3,3 @@ Import('env')
env.add_source_files(env.modules_sources,"register_types.cpp")
env.add_source_files(env.modules_sources,"touch_button.cpp")
env.add_source_files(env.modules_sources,"mesh_data_resource.cpp")
env.add_source_files(env.modules_sources,"editor_import_collada_mdr.cpp")
env.add_source_files(env.modules_sources,"editor_plugin_collada_mdr.cpp")

View File

@ -1,54 +0,0 @@
#include "editor_import_collada_mdr.h"
String EditorImportColladaMdr::get_importer_name() const {
return "collada_mdr";
}
String EditorImportColladaMdr::get_visible_name() const {
return "Collada MDR";
}
void EditorImportColladaMdr::get_recognized_extensions(List<String> *p_extensions) const {
//p_extensions->push_back("daeas");
}
String EditorImportColladaMdr::get_save_extension() const {
return "cmdr";
}
String EditorImportColladaMdr::get_resource_type() const {
return "MeshDataResource";
}
float EditorImportColladaMdr::get_priority() const {
return 1.0;
}
int EditorImportColladaMdr::get_preset_count() const {
return 0;
}
String EditorImportColladaMdr::get_preset_name(int p_idx) const {
return "";
}
void EditorImportColladaMdr::get_import_options(List<ImportOption> *r_options, int p_preset) const {
}
bool EditorImportColladaMdr::get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const {
return true;
}
Error EditorImportColladaMdr::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
return Error::ERR_PARSE_ERROR;
}
EditorImportColladaMdr::EditorImportColladaMdr() {
//_importer.instance();
}
EditorImportColladaMdr::~EditorImportColladaMdr() {
//_importer.unref();
}

View File

@ -1,37 +0,0 @@
#ifndef EDITOR_IMPORT_COLLADA_MDR
#define EDITOR_IMPORT_COLLADA_MDR
#include "core/io/resource_importer.h"
#include "core/ustring.h"
//#include "editor/import/editor_import_collada.h"
class EditorImportColladaMdr : public ResourceImporter {
GDCLASS(EditorImportColladaMdr, ResourceImporter);
public:
String get_importer_name() const override;
String get_visible_name() const override;
void get_recognized_extensions(List<String> *p_extensions) const override;
String get_save_extension() const override;
String get_resource_type() const override;
float get_priority() const override;
int get_preset_count() const override;
String get_preset_name(int p_idx) const override;
void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const override;
bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const override;
Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL) override;
EditorImportColladaMdr();
~EditorImportColladaMdr();
private:
//Ref<EditorSceneImporterCollada> _importer;
};
#endif

View File

@ -1,23 +0,0 @@
#include "editor_plugin_collada_mdr.h"
void EditorPluginColladaMdr::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE:
if (!_importer.is_valid())
_importer.instance();
add_import_plugin(_importer);
break;
case NOTIFICATION_EXIT_TREE:
remove_import_plugin(_importer);
_importer.unref();
break;
}
}
EditorPluginColladaMdr::EditorPluginColladaMdr(EditorNode *node) {
_node = node;
}

View File

@ -1,25 +0,0 @@
#ifndef EDITOR_PLUGIN_COLLADA_MDR
#define EDITOR_PLUGIN_COLLADA_MDR
#include "editor/editor_plugin.h"
#include "core/ustring.h"
#include "editor_import_collada_mdr.h"
class EditorPluginColladaMdr : public EditorPlugin {
GDCLASS(EditorPluginColladaMdr, EditorPlugin);
public:
EditorPluginColladaMdr(EditorNode *node);
protected:
void _notification(int p_what);
private:
EditorNode *_node;
Ref<EditorImportColladaMdr> _importer;
};
#endif

View File

@ -1,20 +0,0 @@
#include "mesh_data_resource.h"
Array MeshDataResource::get_array() {
return _arrays;
}
void MeshDataResource::set_array(const Array &p_arrays) {
_arrays.clear();
_arrays = p_arrays.duplicate(true);
}
MeshDataResource::MeshDataResource() {
}
void MeshDataResource::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_array"), &MeshDataResource::get_array);
ClassDB::bind_method(D_METHOD("set_array", "array"), &MeshDataResource::set_array);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "array"), "set_array", "get_array");
}

View File

@ -1,26 +0,0 @@
#ifndef MESH_DATA_REOURCE_H
#define MESH_DATA_REOURCE_H
#include "core/resource.h"
#include "core/array.h"
#include "scene/resources/mesh.h"
class MeshDataResource : public Resource {
GDCLASS(MeshDataResource, Resource);
RES_BASE_EXTENSION("mdres");
public:
Array get_array();
void set_array(const Array &p_arrays);
MeshDataResource();
protected:
static void _bind_methods();
private:
Array _arrays;
};
#endif

View File

@ -1,23 +1,9 @@
#include "register_types.h"
#include "touch_button.h"
#include "mesh_data_resource.h"
#ifdef TOOLS_ENABLED
#include "editor/editor_plugin.h"
#include "editor_plugin_collada_mdr.h"
#endif
void register_ui_extensions_types() {
ClassDB::register_class<TouchButton>();
ClassDB::register_class<MeshDataResource>();
#ifdef TOOLS_ENABLED
//ClassDB::register_class<EditorPluginColladaMdr>();
//EditorPlugins::add_by_type<EditorPluginColladaMdr>();
#endif
}
void unregister_ui_extensions_types() {