mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-26 02:49:18 +01:00
Fix the mesh library editor plugin, and cleanups.
This commit is contained in:
parent
be5795add2
commit
d8f00dc1b4
@ -5,5 +5,10 @@ Import("env_modules")
|
|||||||
|
|
||||||
env_gridmap = env_modules.Clone()
|
env_gridmap = env_modules.Clone()
|
||||||
|
|
||||||
# Godot source files
|
env_gridmap.add_source_files(env.modules_sources, "grid_map.cpp")
|
||||||
env_gridmap.add_source_files(env.modules_sources, "*.cpp")
|
env_gridmap.add_source_files(env.modules_sources, "mesh_library.cpp")
|
||||||
|
env_gridmap.add_source_files(env.modules_sources, "register_types.cpp")
|
||||||
|
|
||||||
|
if env["tools"]:
|
||||||
|
env_gridmap.add_source_files(env.modules_sources, "grid_map_editor_plugin.cpp")
|
||||||
|
env_gridmap.add_source_files(env.modules_sources, "mesh_library_editor_plugin.cpp")
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
def can_build(env, platform):
|
def can_build(env, platform):
|
||||||
return False
|
return True
|
||||||
|
|
||||||
|
|
||||||
def configure(env):
|
def configure(env):
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#ifndef GRID_MAP_H
|
||||||
|
#define GRID_MAP_H
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* grid_map.h */
|
/* grid_map.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
@ -28,9 +31,6 @@
|
|||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef GRID_MAP_H
|
|
||||||
#define GRID_MAP_H
|
|
||||||
|
|
||||||
#include "scene/3d/navigation.h"
|
#include "scene/3d/navigation.h"
|
||||||
#include "scene/3d/spatial.h"
|
#include "scene/3d/spatial.h"
|
||||||
#include "mesh_library.h"
|
#include "mesh_library.h"
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#ifndef GRID_MAP_EDITOR_PLUGIN_H
|
||||||
|
#define GRID_MAP_EDITOR_PLUGIN_H
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* grid_map_editor_plugin.h */
|
/* grid_map_editor_plugin.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
@ -28,9 +31,6 @@
|
|||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef GRID_MAP_EDITOR_PLUGIN_H
|
|
||||||
#define GRID_MAP_EDITOR_PLUGIN_H
|
|
||||||
|
|
||||||
#include "editor/editor_node.h"
|
#include "editor/editor_node.h"
|
||||||
#include "editor/editor_plugin.h"
|
#include "editor/editor_plugin.h"
|
||||||
#include "scene/gui/box_container.h"
|
#include "scene/gui/box_container.h"
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#ifndef MESH_LIBRARY_H
|
||||||
|
#define MESH_LIBRARY_H
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* mesh_library.h */
|
/* mesh_library.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
@ -28,9 +31,6 @@
|
|||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef MESH_LIBRARY_H
|
|
||||||
#define MESH_LIBRARY_H
|
|
||||||
|
|
||||||
#include "core/containers/map.h"
|
#include "core/containers/map.h"
|
||||||
#include "core/object/resource.h"
|
#include "core/object/resource.h"
|
||||||
#include "scene/resources/mesh.h"
|
#include "scene/resources/mesh.h"
|
||||||
|
@ -38,7 +38,17 @@
|
|||||||
#include "scene/3d/physics_body.h"
|
#include "scene/3d/physics_body.h"
|
||||||
#include "scene/main/viewport.h"
|
#include "scene/main/viewport.h"
|
||||||
#include "scene/resources/packed_scene.h"
|
#include "scene/resources/packed_scene.h"
|
||||||
#include "spatial_editor_plugin.h"
|
#include "editor/plugins/spatial_editor_plugin.h"
|
||||||
|
|
||||||
|
#include "scene/gui/popup_menu.h"
|
||||||
|
#include "scene/gui/menu_button.h"
|
||||||
|
|
||||||
|
#include "editor/editor_inspector.h"
|
||||||
|
#include "editor/editor_file_dialog.h"
|
||||||
|
|
||||||
|
#include "mesh_library.h"
|
||||||
|
|
||||||
|
#include "scene/resources/navigation_mesh.h"
|
||||||
|
|
||||||
void MeshLibraryEditor::edit(const Ref<MeshLibrary> &p_mesh_library) {
|
void MeshLibraryEditor::edit(const Ref<MeshLibrary> &p_mesh_library) {
|
||||||
mesh_library = p_mesh_library;
|
mesh_library = p_mesh_library;
|
||||||
@ -275,7 +285,7 @@ MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) {
|
|||||||
SpatialEditor::get_singleton()->add_control_to_menu_panel(menu);
|
SpatialEditor::get_singleton()->add_control_to_menu_panel(menu);
|
||||||
menu->set_position(Point2(1, 1));
|
menu->set_position(Point2(1, 1));
|
||||||
menu->set_text(TTR("MeshLibrary"));
|
menu->set_text(TTR("MeshLibrary"));
|
||||||
menu->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("MeshLibrary", "EditorIcons"));
|
menu->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("MeshLibrary", "EditorIcons"));
|
||||||
menu->get_popup()->add_item(TTR("Add Item"), MENU_OPTION_ADD_ITEM);
|
menu->get_popup()->add_item(TTR("Add Item"), MENU_OPTION_ADD_ITEM);
|
||||||
menu->get_popup()->add_item(TTR("Remove Selected Item"), MENU_OPTION_REMOVE_ITEM);
|
menu->get_popup()->add_item(TTR("Remove Selected Item"), MENU_OPTION_REMOVE_ITEM);
|
||||||
menu->get_popup()->add_separator();
|
menu->get_popup()->add_separator();
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#ifndef MESH_LIBRARY_EDITOR_PLUGIN_H
|
||||||
|
#define MESH_LIBRARY_EDITOR_PLUGIN_H
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* mesh_library_editor_plugin.h */
|
/* mesh_library_editor_plugin.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
@ -28,11 +31,10 @@
|
|||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef MESH_LIBRARY_EDITOR_PLUGIN_H
|
|
||||||
#define MESH_LIBRARY_EDITOR_PLUGIN_H
|
|
||||||
|
|
||||||
#include "editor/editor_node.h"
|
#include "editor/editor_node.h"
|
||||||
#include "scene/resources/mesh_library.h"
|
#include "editor/editor_plugin.h"
|
||||||
|
|
||||||
|
class MeshLibrary;
|
||||||
|
|
||||||
class MeshLibraryEditor : public Control {
|
class MeshLibraryEditor : public Control {
|
||||||
GDCLASS(MeshLibraryEditor, Control);
|
GDCLASS(MeshLibraryEditor, Control);
|
||||||
|
@ -32,8 +32,12 @@
|
|||||||
#ifndef _3D_DISABLED
|
#ifndef _3D_DISABLED
|
||||||
#include "core/object/class_db.h"
|
#include "core/object/class_db.h"
|
||||||
#include "grid_map.h"
|
#include "grid_map.h"
|
||||||
#include "grid_map_editor_plugin.h"
|
|
||||||
#include "mesh_library.h"
|
#include "mesh_library.h"
|
||||||
|
|
||||||
|
#ifdef TOOLS_ENABLED
|
||||||
|
#include "mesh_library_editor_plugin.h"
|
||||||
|
#include "grid_map_editor_plugin.h"
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void register_gridmap_types() {
|
void register_gridmap_types() {
|
||||||
@ -42,6 +46,7 @@ void register_gridmap_types() {
|
|||||||
ClassDB::register_class<MeshLibrary>();
|
ClassDB::register_class<MeshLibrary>();
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
EditorPlugins::add_by_type<GridMapEditorPlugin>();
|
EditorPlugins::add_by_type<GridMapEditorPlugin>();
|
||||||
|
EditorPlugins::add_by_type<MeshLibraryEditorPlugin>();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#ifndef GRIDMAP_REGISTER_TYPES_H
|
||||||
|
#define GRIDMAP_REGISTER_TYPES_H
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* register_types.h */
|
/* register_types.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
@ -28,9 +31,6 @@
|
|||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef GRIDMAP_REGISTER_TYPES_H
|
|
||||||
#define GRIDMAP_REGISTER_TYPES_H
|
|
||||||
|
|
||||||
void register_gridmap_types();
|
void register_gridmap_types();
|
||||||
void unregister_gridmap_types();
|
void unregister_gridmap_types();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user